jezer0x/barren-wuffet

Make the Contracts Upgradeable

Closed this issue · 5 comments

Psyf commented
Make the Contracts Upgradeable
Psyf commented

All the stuff above should be skipped and just read https://blog.openzeppelin.com/the-state-of-smart-contract-upgrades/

Psyf commented

We are using EIP1167 Minimal Proxies to deploy new funds/robocops because funds/robocops are too big for

  1. Spurious Dragon (both can't fit into BarrenWuffet) and,
  2. gas costs would be too high for createFund()

However, minimal proxies can't be used with either ERC173 (supported by default out of hardhat-deploy's Hot Contract Upgrade), UUPS (not supported by hardhat-deploy, current OZ recommendation) or, transparent proxies (also supported by hardhat-deploy). This is because of this simple reason (that I missed somehow): https://forum.openzeppelin.com/t/using-eip1167-with-upgradability/3217

However, as we need both ProxyDeployments of Fund/Robocop AND upgradability, the only other option is to use Beacon pattern as described here: https://blog.openzeppelin.com/the-state-of-smart-contract-upgrades/#beacons. This would mean:

  1. giving up hardhat-deploy's contract upgrade simplification tools,
  2. writing 2 more smart contracts and updating the deployment workflow
  3. and manually keeping track of upgrades (and writing upgrade scripts - which is slightly eased by hardhat-upgrades potentially, though whether hardhat-deploy plays well with it is yet to be seen).

Despite the 3 downsides given above, I don't think we have any other choice.
Onwards!

Psyf commented

Done in #41