Last active
April 25, 2018 19:31
-
-
Save zastrin/3e62ccc989abcabdd26165385bfdde3f to your computer and use it in GitHub Desktop.
Boston Blockchain training project phases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Project Phases | |
Phase 1 | |
Implement the ERC20 smart contract in Remix browser IDE https://remix.ethereum.org | |
Test the contract functions | |
Phase 2 | |
- Clone the starter project | |
git clone https://github.com/zastrin/boston_token | |
npm install | |
- Copy the token contract code in to the starter project contracts/ERC20Token.sol | |
- Compile by running "truffle compile" - If it just hangs, ctrl+c to kill it. | |
- Get some Ropsten test Ether from faucet: faucet.metamask.io | |
- Deploy to ropsten test network | |
In truffle.js, update the mnemonic to use your metamask seed | |
truffle migrate --network ropsten | |
Phase 3 | |
- Check your token balance from command line | |
In your starter project, run truffle console --network ropsten, it gives you a Javascript environment injected with other tools required to interact with blockchain | |
> ERC20Token.deployed().then(function(f) {f.balanceOf.call('your address').then(function(f) {console.log(f)})}) | |
- Run: "npm run dev", it will start the frontend server at localhost:8080 | |
- Update the frontend to display token name, symbol, price and balance | |
You have to make changes in app/javascript/app.js | |
Phase 4 | |
- Register your token with the TokenMaster Contract. If successfully registered, your token address will be visible on the projector | |
You can get your token address in truffle console by running this: ERC20Token.deployed().then(function(f) {console.log(f.address)}) | |
We have already deployed the TokenMaster Contract. You just have to trigger a call. Hint: TokenMaster.deployed().then(....). You can refer to the TokenMaster contract register function here: https://github.com/levelkdev/training-contracts/blob/master/contracts/TokenMaster.sol | |
Phase 5 | |
- TAs will purchase your token and in return send Class Tokens. | |
- Check your class token balance in truffle console | |
Hint: ERC20Token.at('0x5ac140c32dd3c32dc78c57f75262c2210bfb6d58') gives you an instance of class token | |
Phase 6 | |
- Tip the TAs using class token. Again refer to TokenMaster contract file for tip function details. To tip, you have to first approve say 100 tokens to transfer to address '0x1efeca31b7a122fc5a3a822885f5d00c39b6cd01'. Then call the tip function | |
- Display in your frontend your Class Tokens balance | |
Phase 7 | |
- Bonus 1: Implement a function in your token contract for anyone to purchase your tokens | |
- Bonus 2: Implement the frontend to send your tokens to any address | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment