blockchain-carbon-accounting icon indicating copy to clipboard operation
blockchain-carbon-accounting copied to clipboard

Remove upgradability from CarbonTracker

Open jamesondh opened this issue 2 years ago • 2 comments

After a discussion with @sichen1234 we deemed that upgradability adds too much operational complexity and security risks than what it's worth (see https://github.com/hyperledger-labs/blockchain-carbon-accounting/pull/597 for removal from NetEmissionsTokenNetwork). Instead, we deemed to make the token contracts non-upgradable and in the event that a token contract must be replaced, we index all of the balances to migrate over to a new contract (passing the previous balances in the constructor to re-mint the existing balances, then coordinate with all necessary parties to deprecate the old contract in favor of the new one).

To remove OpenZeppelin Upgrades from the CarbonTracker contract, the following is necessary:

  • Replace all OpenZeppelin libraries with non-upgradable version in the contract
  • Replace initialize() function with constructor()
  • Update the deploy script to remove the proxy
  • Update the old CarbonTracker default Hardhat address with the new one throughout the repo, since it will change
  • Remove the upgradable libraries from hardhat/package.json

jamesondh avatar Aug 09 '22 21:08 jamesondh

@brioux Please take a look at this. We've removed the upgrade feature from the net emissions tokens contract already.

sichen1234 avatar Aug 11 '22 01:08 sichen1234

Ok, Will look at this next week.

brioux avatar Aug 11 '22 03:08 brioux

@sichen1234 - should be resolved in PR 614

brioux avatar Aug 31 '22 07:08 brioux

Yes thanks!

sichen1234 avatar Aug 31 '22 21:08 sichen1234