Optimism Multisig
Overview
This is an example where FPS is used to make proposals for the Optimism Multisig on mainnet. This example upgrades the L1 NFT Bridge contract. The Optimism Multisig calls upgrade
on the proxy contract to upgrade the implementation to a new MockUpgrade
.
The following contract is present in the mocks folder.
Let's go through each of the functions that are overridden:
name()
: Defines the name of your proposal.description()
: Provides a detailed description of your proposal.deploy()
: This example demonstrates the deployment of the new MockUpgrade, which will be used as the new implementation for the proxy.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 L1 NFT Bridge is upgraded to a new implementation. The actions should be written in solidity code and in the order they should be executed. Any calls (except to the Addresses object) will be recorded and stored as actions to execute in the run function. Thecaller
address is passed intobuildModifier
that will call actions inbuild
. The caller is the Optimism Multisig for this example. ThebuildModifier
is a necessary modifier for thebuild
function and will not work 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
, and callssuper.run()
to run the entire proposal. In this example,primaryForkId
is set tomainnet
and selecting the fork for running the proposal. Next, theaddresses
object is set by reading from the JSON file. For further reading, see the run function.simulate()
: Executes the proposal actions outlined in thebuild()
step. This function performs a call to_simulateActions()
from the inheritedMultisigProposal
contract. Internally,_simulateActions()
simulates a call to the Multicall3 contract with the calldata generated from the actions set up in the build step.validate()
: Validates that the implementation is upgraded correctly.
Running the Proposal
All required addresses should be in the 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