Skip to content

isabella232/token-sample-erc721

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

token-sample-erc721

The purpose of this sample project is demonstrating ERC721 token contracts based on the awesome openzeppelin contract library, and features of the ERC721 token specification with truffel test scenarios.

Token Contracts Demonstrated

The contracts with the features and tested scenarios are listed below.

Basic ERC721 with metadata and minting

contracts/ERC721Basic.sol

constructor
  ✓ initialized with the correct metadata and designates the deployer as a minter (89ms)
  ✓ check the contract deployer balance is 0 (63ms)
minting tokens
  ✓ current owner can mint new tokens for themselves (161ms)
  ✓ current owner can mint new tokens for user1 (142ms)
designating token operators
  ✓ curent owner can designate an operator to manage their tokens (38ms)
  ✓ checking the approved operator on token 1
  ✓ blanket approval for operator to manager user1 assets (174ms)
  ✓ checking the approved operator on token 2 and 3
  ✓ operator now can transfer on behalf of currentOwner from specific approval (98ms)
  ✓ operator now can transfer on behalf of user1 from blanket approval (73ms)

Basic ERC721 with burning

contracts/ERC721BasicBurnable.sol

constructor
  ✓ initialized with the correct metadata and designates the deployer as a minter (104ms)
  ✓ check the contract deployer balance is 0
minting tokens
  ✓ current owner can mint new tokens for themselves (219ms)
  ✓ current owner can mint new tokens for user1 (268ms)
designating token operators to burn stuff up!
  ✓ curent owner can designate an operator to manage their tokens (85ms)
  ✓ checking the approved operator on token 1
  ✓ blanket approval for operator to manager user1 assets (64ms)
  ✓ checking the approved operator
  ✓ user1 can burn his own token (68ms)
  ✓ operator now can burn on behalf of currentOwner from specific approval (110ms)
  ✓ operator now can burn on behalf of user1 from blanket approval (57ms)

Getting Started

Instal truffle

Install Ganache and start it

npm i
truffle test

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%