「🏗️」 wip: work in progress, not done yet.
This commit is contained in:
@ -8,7 +8,6 @@ contract Kanel42_token {
|
||||
uint8 public decimals = 6;
|
||||
uint256 public totalSupply = 8000000000; // 8000
|
||||
uint256 public totalMinted;
|
||||
uint256 public mintCost = 0.01 ether;
|
||||
mapping(address => uint256) public balanceOf;
|
||||
mapping(address => mapping(address => uint256)) public allowance;
|
||||
|
||||
@ -42,27 +41,18 @@ contract Kanel42_token {
|
||||
success = true;
|
||||
}
|
||||
|
||||
function mint() public payable {
|
||||
uint256 minted = msg.value / mintCost * (10 ** decimals);
|
||||
function mint(uint256 _value) public {
|
||||
if ((totalSupply / 16) <= _value) {
|
||||
revert("can't mint more than 1/16 of the supply at a time");
|
||||
}
|
||||
|
||||
balanceOf[msg.sender] += minted;
|
||||
totalMinted += minted;
|
||||
balanceOf[msg.sender] += _value;
|
||||
totalMinted += _value;
|
||||
|
||||
emit Transfer(address(0), msg.sender, minted);
|
||||
emit Transfer(address(0), msg.sender, _value);
|
||||
}
|
||||
|
||||
function burn(uint256 _value) public {
|
||||
uint256 sendBack = _value / (10 ** decimals) * mintCost * 1 ether;
|
||||
|
||||
balanceOf[msg.sender] -= _value;
|
||||
totalMinted -= _value;
|
||||
|
||||
msg.sender.call{ value: sendBack };
|
||||
|
||||
emit Transfer(msg.sender, address(0), _value);
|
||||
}
|
||||
|
||||
event Transfer(address indexed _from, address indexed _to, uint256 _value);
|
||||
event Transfer(address indexed _from, address indexed _to, uint256 _value);
|
||||
event Approval(
|
||||
address indexed _owner, address indexed _spender, uint256 _value
|
||||
);
|
||||
|
Reference in New Issue
Block a user