Giter Site home page Giter Site logo

colors's Introduction

ERC-721 Token Tutorial - Color Tokens!

Set Up

First, make sure you have nodejs v8, git, and metamask installed

Next up, start installing some global dependencies. We'll need testrpc and truffle for this tutorial

  • npm install -g ethereumjs-testrpc
  • npm install -g truffle

Next is to clone/download this repository and install all the node dependencies

  1. git clone [email protected]:leanthebean/colors.git
  2. cd colors
  3. npm install

Using Truffle + OpenZeppelin to write out our ERC-721 contract to mint Colors

We're going to inherit the implemented ERC-721 contract from OpenZeppelin
https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC721/ERC721Token.sol

As well as their Ownable implementation
https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/ownership/Ownable.sol

We already have access to these when we did npm install as OpenZeppelin was already a dependency in package.json

In the colors directory, type
4. truffle init

Notice that truffle now added 3 directories: contracts, migrations, and test

Open up your favorite IDE (I use VisualStudio with a Solidity plugin) and go into the contracts directory. Let's begin!

  1. Create a new file called ColorsERC721.sol in the contracts directory

  2. Create a new file called ColorsERC721Test.js in the test directory

  3. Create a new file called 2_migrate_contract.js in the migrations directory

  4. Follow the vide/workshop steps to implement and test your contract, and once you do, the UI included in this tutorial should work with your contract :)

Workshop slides: https://docs.google.com/presentation/d/11ebTVQnl_0K9I2WWaUjtV5YPdH9yCOga5kqhZdSI308/edit?ts=5a83a50e#slide=id.g30fce2c670_0_0

Video of the workshop https://www.facebook.com/ETHDenver/videos/164729944178073/

Happy hacking!

colors's People

Contributors

leanthebean avatar

Watchers

James Cloos avatar Tammi Ha 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.