ENS OZ Governor
Overview
This example on mainnet demonstrates FPS being utilized to simulate proposals for the ENS Governor on mainnet. The proposal involves setting up a new DNSSEC on the ENS root. It entails deploying a new DNSSEC contract named UPGRADE_DNSSEC_SUPPORT
. Subsequently, the timelock sets the newly deployed DNSSEC contract as the controller for the ENS Root.
The contract for this proposal is located in the mocks folder.
Let's review each of the overridden functions:
name()
: Specifies the name of the proposal.description()
: Provides a detailed description of the proposal.deploy()
: Deploys any necessary contracts. This example demonstrates the deployment of a newdnsSec
contract (only a mock for this proposal). Once the contracts are deployed, they are added to theAddresses
contract by callingaddAddress()
.Since these changes do not persist from runs themselves, after the contracts are deployed, the user must update the Addresses.json file with the newly deployed contract addresses.
build()
: Add actions to the proposal contract. In this example, the newly deployeddnsSec
contract is set as the controller for the root contract. Any calls (except to the Addresses object) will be recorded and stored as actions to execute in the run function. Thecaller
address that will call actions is passed intobuildModifier
. In this example, it is the OZ Governor's timelock. ThebuildModifier
is a necessary modifier for thebuild
function and will not function without it. For further reading, see the build function.run()
: Sets up the environment for running the proposal, and executes all proposal actions. This setsaddresses
,primaryForkId
, andgovernor
, and then callssuper.run()
to run the entire proposal. In this example,primaryForkId
is set tomainnet
, selecting the fork for running the proposal. Next, theaddresses
object is set by reading theaddresses.json
file. The OZ Governor contract to test is set usingsetGovernor
. This will be used to check onchain calldata and simulate the proposal. For further reading, see the run function.validate()
: This final step validates the system in its post-execution state. It ensures that the dnsSec contract is set as the controller for the root contract.
Running the Proposal
All required addresses should be in the Addresses.json file, including the DEPLOYER_EOA
address, which will deploy the new contracts. If these do not align, the script execution will fail.
The script will output the following:
Last updated