ERC20 Token contract deployed via Remix and verified on mainnet does not show expected mint function

I have recently created a new ERC20 contract based on exactly the same internal function _mint which gets called by the public function mintFVP(). Originally these two functions were fully tested and eventually deployed on Mainnet and have worked as expected for almost two years. See the following two contracts:

1.- https://etherscan.io/address/0x349c9a0afbe8c8e08a6bd8a2e925f9ec5ae7d2c9#code
2.- https://etherscan.io/address/0x29fb4CEe43155bAAB885897f0e96B1F0572a1E86#code

The new ERC20 contract in concern was successfully deployed and fully tested on Ropsten. See the following address:

On December 29th, 2020, I was able to deployed the new ERC20 contract in concern on Mainnet via Remix. See https://etherscan.io/address/0xa2e7a0d1cfeda4d3977277265e205f6092d02e3b

Such contract was successfully verified and signed. See Ownership

However, I have not been able to see the function mintFVP() when I try to interact with it via Etherscan while connecting with Metamask using the Wallet Creator. See

I have posted a question on https://ethereum.stackexchange.com/questions/91981/token-contract-verified-and-signed-on-mainnet-does-not-show-mint-function but so far I have only gotten bullied by some idiot.

Is there anyone here who could shed some light on how to resolve this issue? The most embarrasing thing is that I have not been able to Update the Token Information via Etherscan Helpdesk. The tickets #120001 and #120314 have been opened and I have interacted with Mr./Ms. Raja C, but he/she has not been able to update the Token Information because since I have not been able to mint any tokens yet, they believe that the Contract is NOT a Token contract. :roll_eyes:

1 Like

Hi @jaureguino,

Unfortunately when you deployed via Remix instead of deploying the FVP_Token contract it looks like you deployed ERC20 contract. When you deployed to Ropsten you deployed FVP_Token (you can see the contract name in verified Etherscan source code).

Whilst the verified code includes FVP_Token, this isn’t what you deployed.

In Remix you need to select FVP_Token rather than ERC20 when deploying.

Unfortunately you will need to redeploy to mainnet, this time deploying FVP_Token.

Dear @abcoathup,

Thanks so much for clarifying the issue :man_facepalming:t2:. I just have two additional questions:

a) if I interact (run) the deployed contract via Remix using the same contract address, and I mean, only running the mintFVP() function, would it work?

Note: Murch earlier I was trying to do so, by fetching the contract via Remix, but it would not retreieve it, so I was not able to see if the API interface, so I decided to switch to the old version of Remix and voilá :point_down:t2:

b) If so, then I would not mind always interating with the contract via Remix. I just would have to be more careful when deploying the next contract. Or does the Contract Name (ERC20) have to match with something within the Contract?

Looking forward to your kind and prompt response.

Cheers!

1 Like

I tend to believe that because the token has not been minted yet, the only Contract Name available is ERC20; however, once I run mintFVP(), the constructor variables will be put in place and then the Contract will be renamed FVP_Token…
:point_down:t2:

Your thoughts?

1 Like

Hi @jaureguino,

Unfortunately not. The function mintFVP doesn’t exist on the ERC20 contract you deployed.
If you look at Etherscan, you only have the ERC20 functions that you can interact with: https://etherscan.io/address/0xa2e7a0d1cfeda4d3977277265e205f6092d02e3b#writeContract

Unfortunately you have only deployed the ERC20 contract using Remix. There is no way to set the name, symbol or call the internal _mint function. See the API: https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#ERC20

To deploy your token you need to deploy your FVP_Token.

To put it another way, only part of your contract has been deployed. Only the OpenZeppelin Contracts ERC20 has been deployed and not ERC20Pausable or your FVP_Token.


As an aside, I also noticed that you are not using ERC20Detailed to set your token metadata.
https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#ERC20Detailed

:man_facepalming:t2:

Thanks so much @abcoathup !

Now it all makes sense…

When I deployed FVP_Tokel.sol on Ropsten via Truffle/Infura it migrated and worked just fine; but when I started experiencing issues while deploying on Mainnet (the prompt would just sit there for hours after compiling) I decided to try Remix (granted, the new fancy version) which in fact I do not recall there was an area where one would specifically select FVP_Token.sol.

It is very possible however since it has been a while I messed with Remix to begin with, that I totally forgot about ensuring that the master contract (FVP_Token.sol) was selected before it was deployed, or I simply did not see the area where to select the contract once it has been loaded.

I will do as you advice, with the OLD VERSION of Remix. Once the contract has been successfully deployed, verified, signed, updated, and I successfully run mintFVP, I will note this update this Topic as Solved.

Will keep you posted.

Cheers and all the best.

1 Like

Dear @abcoathup ,

On the second subject you brought up, would you please be so kind to advice me on how and where I ought to add/apply the ERC20Detailed on the FVP_Token.sol Contract? :pray:t2: :bowing_man:t2:

1 Like

Hi @jaureguino,

Instead of declaring your own name, symbol and decimals, you could do this using ERC20Detailed (if using OpenZeppelin Contracts 2.x)

See the example in the documentation: https://docs.openzeppelin.com/contracts/2.x/erc20#constructing-an-erc20-token-contract

If using OpenZeppelin Contracts 3.x then this is part of ERC20
See the example in the documentation: https://docs.openzeppelin.com/contracts/3.x/erc20#constructing-an-erc20-token-contract

1 Like