Governor Bravo example with IDLE Finance
Audited by Halborn, Debt DAO’s auditors on retainer, IDLE Finance is the first DAO to ever execute an onchain governance vote by token holders to transfer ownership of their revenue stream to a Spigot. Luckily IDLE Finance uses Compound’s GovernorBravo so all the code and mainnet fork tests related to governance should be reusable by any DAO.
The code related to the FeeCollector, IDLE’s revenue generating contract that is. transferred to their Spigot, is custom logic that will have to be adapted to your specific use case. Most of this custom code simply handles changing settings on FeeCollector to send revenue to Spigot and reduce everyone else’s share of revenue but its messy Solidity arrays so not very pretty or concise.
It is important to note that because the IDLE has their own payment collector/splitter contract that is hardcoded into their other contracts, they can receive a cut of revenue pre-Spigot. This does not compromise any trust assumptions because the Spigot owns the FeeCollector so revenue splits cant be changed without the Spigots approval, guaranteeing that we continue receiving the right % of revenue that we expect.
spigot-migrations/migrations/idle-finance at main · debtdao/spigot-migrations
The files contained in this directory enable the deployment of a Secured Line of Credit for Idle Finance's Fee Collector. All relevant contract addresses and parameters for the migration are located in the settings.yaml file. Detailed documentation of the migration process can be found in the Idle Migration Guide.