Abi from ropsten.etherscan.io site vs Truffle abi

I have initially deployed an openzeppelin upgradeable Smart Contract (SC) on my local Ganache blockchain using Truffle, referring in my Dapp to the abi that is generated to a local file (everything working perfectly). I have afterwards deployed the same SC to Ropsten. I had obtained the abi from the ropsten.etherscan.io site after deployment (on my contract page) and copied it to a local file of my Dapp, referring to it (using the address and abi of the TransparentUpgradeableProxy instead of the one from my actual implementation). However, my Dapp does not work when referring to this abi, and noticed that it was different than my local one. Am I using the wrong abi (TransparentUpgradeableProxy instead of the one from my implementation contract)?

I am thus instead now referring to the abi that was generated locally by Truffle while deploying to Ganache (although the SC address used is the one pointing to Ropsten), everything working using this tactic. Is this the proper way to do it? Could I eventually encounter issues doing as such?


:computer: Environment

1 Like

Generally there should be no problems, as long as the function signature matches (correct spelling, param types etc.), it will be fine.

Regarding why your dapp isn't working, you need to give it the right ABI i.e. you need to get an instance of the contract with the proxy's address but the implementation's ABI.

1 Like

Thank you @STYJ I will continue to use the abi generated by Truffle since it would always be the same. I am curious however, how would I obtain the abi from the Ropsten blockchain explorer. If I enter the hash for the TransparentUpgradeableProxy contract, I obtain the abi for this contract, while if I enter the hash corresponding to the implementation contract (which I can get during the Truffle deployment), I am not able to access its abi on the Ropsten blockchain explorer, but only its ByteCode.

1 Like

could it be because the implementation contract is not verified on ropsten?

I see. Possibly. I will go through the verification process. Thanks again.

1 Like