tutorialtoken-box icon indicating copy to clipboard operation
tutorialtoken-box copied to clipboard

Does not work with latest open Zeppelin for Solidity ^0.5.0

Open nickjuntilla opened this issue 6 years ago • 0 comments

To make it work with new libraries the token code has to look more like this:

  
import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; 
import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol";  

contract TestToken is ERC20Detailed, ERC20 {
  constructor(
    string memory _name,
    string memory _symbol,
    uint8 _decimals,
    uint256 _amount
  )
    ERC20Detailed(_name, _symbol, _decimals)
    public
  {
    _mint(msg.sender, _amount);
  }
}

and the deploy code like this:


module.exports = function(deployer) {

  deployer.deploy(TestToken, "Test Token", "TEST", 18, 100000000000000000000000);
}

Hope this helps someone else!

nickjuntilla avatar Jun 28 '19 02:06 nickjuntilla