Beanstalk
Beanstalk copied to clipboard
Fork System
Fork System
The Fork System enables an opt-in/out system of upgrading and migration of any Diamond Contract to another compatible Diamond Contract. Anyone, including Beanstalk Farms, can implement descendant forks that allow users to opt into the upgrade by migrating existing parent assets into the child.
RFC
https://github.com/BeanstalkFarms/Beanstalk/issues/1036
Design of Destination
A source fork has no knowledge of child forks, however each child fork must specifically whitelist and implement logic for the parent forks it will support. This implementation demonstrates one way that a child fork could be designed to accept migrated assets, however, it is not the only way it can be done. Each child fork is responsible for deciding how to mint assets for migrating users. The possible design space is infinite and is not fully captured by this PR, however destination logic modifications should fit inside of the standardized interfaces demonstrated in this PR.
Implementation notes
Although a decent amount of tech debt had to be addressed throughout the codebase while implementing this system, the core of the changes can be found in
TransmitOutFacet.solLibTransmitOut.solTransmitInFacet.solLibTransmitIn.solTransmitToFork.t.sol
Deploy Preview for basin ready!
| Name | Link |
|---|---|
| Latest commit | 304fdf6741ca18d99323d2cf21652f8fda5cb1b5 |
| Latest deploy log | https://app.netlify.com/sites/basin/deploys/671d51c2ff78840008e24186 |
| Deploy Preview | https://deploy-preview-1042--basin.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Deploy Preview for beanstalk-ui ready!
| Name | Link |
|---|---|
| Latest commit | 304fdf6741ca18d99323d2cf21652f8fda5cb1b5 |
| Latest deploy log | https://app.netlify.com/sites/beanstalk-ui/deploys/671d51c2b02ccb0008683c18 |
| Deploy Preview | https://deploy-preview-1042--beanstalk-ui.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.