harvest-finance / harvest

Bread for the people!
217 stars 94 forks source link

timelocked proxy contract #6

Closed Byron-McKeeby closed 4 years ago

Byron-McKeeby commented 4 years ago

implements a timelocked proxy with EIP 1967 storage. The admin or governance may register a new implementation address

Design notes:

Limitations/questions:

Byron-McKeeby commented 4 years ago

the new architecture uses inheritence to encapsulate access to shared state. storage addresses for shared state are hardcoded to eip1967 standard there are 2 of these encapsulation contracts. One stores a Storage references and mediates access to it. It is used by the GovernableProxy and exposed to all its descendents

The other (ProxyVaultStore) stores Vault state that affects initialization. This includes ERC20Detailed info, numerator, denominator, etc.

because storage access must be done via assembly, the ProxyVaultStore has somewhat hacky handling of name and symbol strings, and I would appreciate review to ensure that they are handled correctly

breadforthepeople commented 4 years ago

Thank you. The proxied vaults were implemented and this code was taken into account as an inspiration.