blockchain-carbon-accounting
blockchain-carbon-accounting copied to clipboard
Remove upgradability from CarbonTracker
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 withconstructor()
- 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
@brioux Please take a look at this. We've removed the upgrade feature from the net emissions tokens contract already.
Ok, Will look at this next week.
@sichen1234 - should be resolved in PR 614
Yes thanks!