udacity / blockchain-nanodegree-issues

Issues for Udacity's Blockchain Nanodegree program
2 stars 2 forks source link

L02S22 - Supply amount is not in Ether #166

Open albertsundjaja opened 5 years ago

albertsundjaja commented 5 years ago

There is an issue with the code for deploying to rinkeby network using OpenZeppelin.

The amount that is set as supply is not in Ether, so metamask doesn't recognize this small amount. Need to use web3-utils.toWei function so that it is correctly passed as 1000 Ether

2_initial_migration.js

var utils = require('web3-utils');

var SampleToken = artifacts.require("SampleToken");

var number = utils.toWei("1000", "ether");

module.exports = function(deployer) {
    deployer.deploy(SampleToken, "UdacityToken", "UET", 18, number);
};