Deploying a token that uses 'contracts-ethereum-package' to Ethereum Classic

Hi @husainfazel,

Glad that you are up and running.

Would be great if you could share what you are building on Ethereum Classic.
Either in What are you working on? or in the #general:showcase category.


As an aside, in the sample token code you provided, you import SafeMath but don’t use it (I assume you provided cut down code). Also in the initialize function you could call _mint rather than mint and use decimals() rather than hardcoding the decimal value.

An example upgradeable SimpleToken (not mintable) is as follows:

SimpleToken

pragma solidity ^0.5.0;

import "@openzeppelin/upgrades/contracts/Initializable.sol";

import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Detailed.sol";

/**
 * @title SimpleToken
 * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the sender.
 * Note they can later distribute these tokens as they wish using `transfer` and other
 * `ERC20` functions.
 */
contract SimpleToken is Initializable, ERC20, ERC20Detailed {

    /**
     * @dev initialize that gives msg.sender all of existing tokens.
     */
    function initialize(address sender) public initializer {
        ERC20Detailed.initialize("Token", "TKN", 18);
        _mint(sender, 1000000 * (10 ** uint256(decimals())));
    }
}