-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathSalt.sol
40 lines (28 loc) · 910 Bytes
/
Salt.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// SPDX-License-Identifier: BUSL 1.1
pragma solidity =0.8.22;
import "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
import "./interfaces/ISalt.sol";
contract Salt is ISalt, ERC20
{
event SALTBurned(uint256 amount);
uint256 public constant MILLION_ETHER = 1000000 ether;
uint256 public constant INITIAL_SUPPLY = 100 * MILLION_ETHER ;
constructor()
ERC20( "Salt", "SALT" )
{
_mint( msg.sender, INITIAL_SUPPLY );
}
// SALT tokens will need to be sent here before they are burned.
// There should otherwise be no SALT balance in this contract.
function burnTokensInContract() external
{
uint256 balance = balanceOf( address(this) );
_burn( address(this), balance );
emit SALTBurned(balance);
}
// === VIEWS ===
function totalBurned() external view returns (uint256)
{
return INITIAL_SUPPLY - totalSupply();
}
}