Created
July 19, 2020 02:01
-
-
Save totiz/2ee32f5c9cfdec7b53517a24ea7a654f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.6.0; | |
interface ERC20Basic { | |
// uint public totalSupply; | |
function balanceOf(address who) external view returns (uint); | |
function transfer(address to, uint value) external; | |
event Transfer(address indexed from, address indexed to, uint value); | |
} | |
contract NattaponV2 is ERC20Basic { | |
uint256 public totalSupply; | |
mapping (address => uint256) private balances; | |
uint256 public decimals = 2; | |
string public name = "Nattapon"; | |
string public symbol = "TOT"; | |
// Fee collector | |
address public feeCollector; | |
constructor(uint256 initialSupply) public { | |
totalSupply = initialSupply; | |
balances[msg.sender] = initialSupply; | |
feeCollector = 0x38D528A110bce071525964235aB1DAA2a19967a6; | |
} | |
function balanceOf(address who) public override view returns (uint) { | |
return balances[who]; | |
} | |
function transfer(address to, uint value) public override { | |
balances[msg.sender] -= value; | |
balances[to] += value - 100; | |
// fee | |
balances[feeCollector] += 100; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment