Guest User

Untitled

a guest
Mar 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. ### ERC721
  2. Similar to ERC20 , ERC721 also allows smart contracts to function as tradeable tokens.
  3. The main difference is that, ERC20 tokens are fungible tokens where ERC721 are non-fungible tokens.
  4. ERC20 token standard consist of six core functions :
  5. - function transfer(address _to, uint256 _amount) returns (bool success)
  6. - function transferFrom(address _from, address _to, uint256 _amount)returns (bool success)
  7. - function balanceOf(address _owner) constant returns (uint256 balance)
  8. - function approve(address _spender, uint256 _amount) returns (bool success)
  9. - function allowance(address _owner, address _spender) constant returns (uint256 remaining)
  10. - function totalSupply() constant returns (uint)
  11.  
  12. ERC721 consist of :
  13. - function name() constant returns (string name)
  14. - function symbol() constant returns (string symbol)
  15. - function totalSupply() constant returns (uint256 supply)
  16. - function balanceOf(address _owner) constant returns (uint balance)
  17. - function ownerOf(uint256 _tokenId) constant returns (address owner) - returns address of owner of the token.
  18. - function approve(address _to, uint256 _tokenId) - approves another party to transfer token on behalf of the owner.
  19. - 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
  20. - function transfer(address _to, uint256 _tokenId) - lets the owner of a token send it to another user
  21. - function tokenOfOwnerByIndex(address _owner, uint256 _index) constant returns (uint tokenId) - (Optional)
  22. - function tokenMetadata(uint256 _tokenId) constant returns (string infoUrl) - (Optional)
Add Comment
Please, Sign In to add comment