/colors

erc721 token tutorial for the eth denver workshop

Primary LanguageJavaScript

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 git@github.com: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.sol 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 :)

Happy hacking!