solace-fi / solace-core

solace.fi smart contracts
GNU General Public License v3.0
6 stars 3 forks source link

Upgradable Registry #137

Closed leonardishere closed 3 years ago

leonardishere commented 3 years ago

As Solace grows and more contracts are created, we'll need to track the new contracts in the Registry. The naive method requires deploying a new registry and repointing all references in the current contracts to the new registry. Instead we should have one constant address for the registry and its implementation should be upgradable.

This can be handled with proxies, most likely the Transparent Proxy Pattern or the more efficient UUPS Proxy https://blog.openzeppelin.com/the-transparent-proxy-pattern/ https://docs.openzeppelin.com/contracts/4.x/api/proxy#TransparentUpgradeableProxy

It needs to be readable as proxy on etherscan https://medium.com/etherscan-blog/and-finally-proxy-contract-support-on-etherscan-693e3da0714b

Test that you can set a new implementation that has a RiskManager getter and setter #148