Optimism Multisig
Last updated
Last updated
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 .
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. The caller
address is passed into buildModifier
that will call actions in build
. The caller is the Optimism Multisig for this example. The buildModifier
is a necessary modifier for the build
function and will not work without it. For further reading, see the .
run()
: Sets up the environment for running the proposal, and executes all proposal actions. This sets addresses
, primaryForkId
, and calls super.run()
to run the entire proposal. In this example, primaryForkId
is set to mainnet
and selecting the fork for running the proposal. Next, the addresses
object is set by reading from the JSON file. For further reading, see the .
simulate()
: Executes the proposal actions outlined in the build()
step. This function performs a call to _simulateActions()
from the inherited MultisigProposal
contract. Internally, _simulateActions()
simulates a call to the contract with the calldata generated from the actions set up in the build step.
validate()
: Validates that the implementation is upgraded correctly.
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: