1

I have been working on ERC20 token development. My code is written using solidity and zeppelin frameworks.

So far I have used the test networks like Rinkeby, Ropsten to deploy and test all the ERC20 methods. Last night, I have to deploy the smart contract in the mainnet where 10000000 tokens had to be deployed but I deployed only 1000000 (missed a zero).

As it is deployed in the mainnet, mint is the only way to top up the initial amount instead of redeploying. Mint is achievable using remix by removing the internal keyword in the mint method. But it requires to redeploy the smart contract in order to use mint method, which customer would not agree to redo the same.

The only way I think is to use web3js API to achieve the same. But there are no content given in the web3js document to how to pragmatically mint (to top up the initial amount).

If any of you have faced a similar situation, please let me know how you tackled it.

Thanks, Sriram

Sriram B
  • 651
  • 2
  • 8
  • 20

1 Answers1

1

The mint using web3 would be just a call to the contract function just like from remix, nothing special. All you would have to do would be to call the function. But since this function internal you cannot call it directly not from remix, not from web3, not from any other library. To put it simply if you cannot call the function from remix you cannot do it from web3 either. Web3 offers nothing more than remix in terms access rights to the contract.

nikos fotiadis
  • 1,040
  • 2
  • 8
  • 16
  • I removed the keyword internal in _mint() function. In Remix Run tab, underneath the Deploy button "At Address", it will allow me to directly run the ERC20 methods against the contract address that created the contract for the base address used to deploy. With this way, I could top up / mint my initial amount with the new amount for the base token address. All these work in Ropsten; but when I connect to mainnet and call the mint method, in MetaMask, it is not going thru due to the low gas price. I am using Remix editor in Firefox and has the MetaMask extension installed in the same browser. – Sriram B Dec 13 '18 at 14:07