Skip to content

Instantly share code, notes, and snippets.

@totiz
Created July 19, 2020 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save totiz/2ee32f5c9cfdec7b53517a24ea7a654f to your computer and use it in GitHub Desktop.
Save totiz/2ee32f5c9cfdec7b53517a24ea7a654f to your computer and use it in GitHub Desktop.
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