1

I have Token on ropsten network (https://ropsten.etherscan.io/token/0x975FB1824F82E446DD3F5c4cb04474468ED7d878) which is Mintable with initial supply of 10B and Mintable Cap up to 50B.

My ether account (owner) has only 10B, I now want to start MINTING/GENERATING additional tokens, let's say add 20B more tokens.

How do I do that?

[1] some important codes of my contract:

   constructor() public {
           name = "PPT";
           symbol = "PPT";
           initialSupply = 10000000000;
           totalSupply_ = initialSupply * 10 ** uint(decimals);
           balances[owner] = totalSupply_;
           mintCap = 50000000000;
           emit Transfer(address(0), owner, totalSupply_);
       }

[2] some important codes of my contract:

    function mint(address _to, uint256 _amount) onlyOwner public returns (bool) {
           require(mintCap >= totalSupply_.add(_amount));

           totalSupply_ = totalSupply_.add(_amount);
           balances[_to] = balances[_to].add(_amount);
           emit Transfer(address(0), _to, _amount);
           return true;
       }
  • What tools are you using to interact with your contract? Should be as simple as calling mint() with the owner address and valid _to and _amount parameters – Shawn Tabrizi Jan 28 at 8:51
  • I am using a terminal/truffle, how can I call those functions? @ShawnTabrizi – Josephhh Jan 28 at 8:52
  • 2
    This should probably be the more general question "How do I interact with a deployed contract?". – Richard Horrocks Jan 28 at 9:18
  • Please specify which version of OZ you are using. Also, both your coding snippets suggest that you are trying to do yourself what's already implemented in OZ. For example, in the constructor, assuming you inherit from ERC20, you can simply call _mint(owner, 10000000000 * 10 ** uint(decimals)). – goodvibration Jan 28 at 9:24
  • As @RichardHorrocks suggested I better ask "How do I interact with a deployed contract?" – Josephhh Jan 28 at 10:16
1

I forgot to answer my own question, so if there are people still confused here is the answer:

1) open https://remix.ethereum.org 2) create a file token.sol 3) select compiler matching your token.sol (in my case 0.4.23) 4) paste original code to the window 5) press compile 6) Go To “RUN” 7) Select token.sol 8) list of Functions will appear, past values needed and click on the name of functions!

That's it!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.