Upgrading an existing DAO
Existing DAOs with a Compound or OpenZeppelin based Governor can upgrade to use a Governor with Flexible Voting.
Upgrading a DAO's governance contracts is a sensitive process that must be done with great care. An improperly configured upgrade can leave a DAO's treasury locked.
There is no one-size-fits-all process to upgrading a DAO's Governor. The exact steps of the upgrade will depend on the configuration of the DAO's preexisting contracts. That said, a common pattern can be applied to most conventional DAO Governor upgrades. Here is a rough idea of how an upgrade should take place:
Step 1: Create a new Governor
The new Governor must first be assembled and deployed onchain. We cover creating a new Governor in our New Governor tutorial.
When creating a new Governor for an existing DAO, it's critical to ensure the Governor is built in a way that ensures compatibility with the rest of the DAO's existing onchain infrastructure.
Be sure that:
- The new Governor is configured to pull voting weight from the DAO's existing ERC20Votes token, and has the correct interface for interacting with the token contract that is oncahin.
- The new Governor is configured to execute proposals through the DAO's existing Timelock contract, and has the correct interface for interacting with the exact timelock contract that is onchain.
- The new Governor is configured with values for Quorum and the Proposal Threshold that make sense given the governance token's circulating supply and historical governance participation rates.
Step 2: Create a proposal submission script to upgrade admin
Once, the above Governor
is deployed, we will need to change the admin of the existing Timelock
to the new Governor. We will create a script that submits a proposal that calls the setPendingAdmin
function on the timelock with the new Governor
address, and then calls the new Governor's __acceptAdmin()
function.
Step 3: Test and Simulate the Upgrade
It is critical that any Governor upgrade be extensively tested before actually going live onchain. We highly recommend running tests against the forked state of the network where the preexisting governance system is deployed.
For example, if the DAO is on mainnet Ethereum, you could use Foundry's forking (opens in a new tab) feature to run tests against the state of the DAO in a recent mainnet block.
In your tests, you should simulate executing your proposal script and performing the upgrade vote. Furthermore, the tests should simulate voting and executing proposals with the new Governor after the upgrade is complete, including proposals that transfer treasury funds, and proposals that manipulate any other onchain resources which the DAO's governance has provenance over.
Writing tests in this manner can be tedious, but it is critical to ensure a successful upgrade. Running your tests against the actual contracts that exist onchain today ensure the changes will be fully compatible, and avoid bugs that can sneak in due to differences between different DAOs.
Step 4: Submit, Pass, and Execute proposal
Once the upgrade proposal has been thoroughly tested, it's time to put it onchain for the DAO to vote on. This must be done by someone with sufficient voting power in the DAO to clear the proposal threshold. Ideally, a semi-technical member of the DAO will be able to execute the script you've prepare and tested on their behalf.
After the proposal is approved by voters and executed onchain, your DAO will be compatible with Flexible Voting. All future proposals and governance actions will now flow through the new Governor.
Examples
ScopeLift has helped multiple DAOs upgrade their Governance contracts to gain Flexible Voting compatibility. Some example Governor upgrades can be found at the repos below: