[Ethereum] How tossue /Mint / Generate additional tokens? Contract is mintable

erc-20openzeppelin-contractssolidity

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;
       }

Best Answer

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!

Related Topic