0

If a custom ERC-20 token is initially issued, can its solidity code be modified for all existing holders and circulating supply to include a new function?

For example, you issue ERC-20 token in January purely as a currency, but in August you decide to add both a staking and farming functions to the original contract? How to go about handling this sort of amendment to an already issued token?

1

1 Answer 1

1

Just if uses a proxy pattern (upgradable contract).

The majority of ERC-20 tokens aren't upgradable, but I've seen stable coins contracts and game tokens contracts using upgradable ERC-20.

For instance, USDC uses proxy pattern: https://etherscan.io/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48#readContract

a good explanation about upgradable smart-contracts: https://ethereum.stackexchange.com/a/80206/86156

Openzeppelin documentation about upgradable smart-contracts: https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable.

4
  • Heard of upgradable ERC-20s. How to tell in Etherscan Contracts if a contract token is an upgradable ERC-20?
    – user610620
    Dec 18, 2021 at 23:42
  • 1
    Etherscan recently added "Read as Proxy" and "Write as Proxy" buttons when is n upgradable contract. Also, you can see in the contract code, they will have a initialize function instead of a constructor Dec 19, 2021 at 0:20
  • could you link a popular example of a proxy token
    – user610620
    Dec 19, 2021 at 1:23
  • 1
    USDC - that I linked in the answer, it's a good example. I also recently saw the CryptoPlanes ERC-20 token uses proxy. Is in Binance Smart Chain but it's a good example too. The upgradable proxy contract, i.e, the one that does not change and that users interact: bscscan.com/address/… The current implementation contract: bscscan.com/address/… Dec 19, 2021 at 2:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.