GithubHelp home page GithubHelp logo

token-sample-erc721's Introduction

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

token-sample-erc721's People

Contributors

jimthematrix avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.