Upgrade ERC20 contract using remix IDE

Hello team,

I implemented a contract on the ethereum main network using online remix IDE.
I have developed that Contract using “@openzeppelin/contract-ethereum-package”: “^ 2.5.0”.

Now I want to upgrade this contract but couldn’t find any way.

I don’t have an implementation JSON file or anything that can help me get out of it.

I only have the address of the contract and its source code available on my system.

Could someone please suggest the way so that I can update it?

1 Like

Hi @Nikunj,

If you deployed just an ERC20 from @openzeppelin/contract-ethereum-package without a proxy contract, then unfortunately your contract is not upgradeable.

Did you deploy a proxy contract as well?

To create an upgradeable contract, we need a proxy contract and an implementation contract (with an optional ProxyAdmin contract). When we perform an upgrade, we deploy a new implementation contract and point the proxy contract to the new implementation. See: https://docs.openzeppelin.com/learn/upgrading-smart-contracts

I recommend deploying upgradeable contracts using the OpenZeppelin Upgrades Plugins (for Truffle and Hardhat): https://docs.openzeppelin.com/upgrades-plugins/1.x/

2 Likes

Hello @abcoathup,

The problem we are facing is we have deployed a upgradable smart contract which was created using "@openzeppelin/contracts-ethereum-package": "^2.5.0".

When we deployed it on the rinkeby test network using oz deploy commands we were able to upgrade our contract using oz upgrade commands because their was a rinkeby.json file created inside the .openzeppelin folder.

But unfortunately we deployed our contract using remix ide on mainnet so we want to upgrade it now but we don't have the rinkeby.json file with us as the contract was deployed using remix ide.

So just wanted to know is their any way we can reproduce that rinkeby.json using the already deployed contract address.

1 Like

Hi @Kartik_Rajendran,

Welcome to the community :wave:.

If you only deployed the ERC20 implementation without a proxy using Remix then unfortunately it isn’t upgradeable. Did you deploy a proxy contract as well as the implementation contract using Remix?

Can you share your contract address on mainnet?

Hi @abcoathup,

I will share you the same contract which we have deloyed on the rinkeby test network.
Contract address - 0xDb3f0F4430Bf0FD935eACCb352a05D71b39488F3

1 Like

Hi @Kartik_Rajendran,

It looks like you deployed the contract without a proxy pointing to it.

It looks like you also deployed a proxy contract: https://rinkeby.etherscan.io/address/0x81d193cb00719a22c143199bc1a8dc6f52dee18e#readProxyContract

What was your intention?