Skip to content

Demonstrates the use of ECR20 Standard for creating a Token Contract

Notifications You must be signed in to change notification settings

thanhnguyennguyen/ERC20-token

Repository files navigation

Build Status

Why do we need ERC20 ?

ERC20-token

Name: NguyenNguyen Token

Symbol: NGUYEN

Decimal: 0

Docker: nguyennguyen/erc20

Testing: truffle test

Please never write code without tests

ERC-20 withdrawal from smartcontract pattern

contract TokenInterface {
    function transferFrom(address from, address to, uint tokens) public returns (bool success);
    function approve(address spender, uint tokens) public returns (bool success);
    function balanceOf(address _owner) public view returns (uint balance);
}
function claimTokens (address token) public onlyOwner returns (bool){
                TokenInterface _instance = TokenInterface(address);    
                uint amount = _instance.balanceOf(contractAddress)
                _instance.transfer(contractAddress, msg.sender, amount));
                return true;
            }