Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### ERC721
- Similar to ERC20 , ERC721 also allows smart contracts to function as tradeable tokens.
- The main difference is that, ERC20 tokens are fungible tokens where ERC721 are non-fungible tokens.
- ERC20 token standard consist of six core functions :
- - function transfer(address _to, uint256 _amount) returns (bool success)
- - function transferFrom(address _from, address _to, uint256 _amount)returns (bool success)
- - function balanceOf(address _owner) constant returns (uint256 balance)
- - function approve(address _spender, uint256 _amount) returns (bool success)
- - function allowance(address _owner, address _spender) constant returns (uint256 remaining)
- - function totalSupply() constant returns (uint)
- ERC721 consist of :
- - function name() constant returns (string name)
- - function symbol() constant returns (string symbol)
- - function totalSupply() constant returns (uint256 supply)
- - function balanceOf(address _owner) constant returns (uint balance)
- - function ownerOf(uint256 _tokenId) constant returns (address owner) - returns address of owner of the token.
- - function approve(address _to, uint256 _tokenId) - approves another party to transfer token on behalf of the owner.
- - function takeOwnership(uint256 _tokenId) - used when a user has been _approved to own a certain amount of tokens and wishes to withdraw tokens from another userβs balance
- - function transfer(address _to, uint256 _tokenId) - lets the owner of a token send it to another user
- - function tokenOfOwnerByIndex(address _owner, uint256 _index) constant returns (uint tokenId) - (Optional)
- - function tokenMetadata(uint256 _tokenId) constant returns (string infoUrl) - (Optional)
Add Comment
Please, Sign In to add comment