Caution
This is a patch version and is only necessary for custom fee token chains with an ERC20Bridge
contract below version < v2.0.0
.
If your chain uses the parent chain's native asset for fees, or your ERC20Bridge
is already at v2.0.0
or above, do not perform this upgrade.
The rest of this document assumes the chain satisfies the above.
These scripts deploy and execute the NitroContracts2Point1Point2UpgradeAction
contract which allows Orbit chains to upgrade to 2.1.2 release. Predeployed instances of the upgrade action exist on the chains listed in the following section.
Upgrading to v2.1.2
is REQUIRED before upgrading to v3.0.0
. Upgrading to v2.1.0
is REQUIRED before upgrading to v2.1.2
.
NitroContracts2Point1Point2UpgradeAction
will perform the following action:
- Upgrade the
ERC20Bridge
contract tov2.1.2
- Force
nativeTokenDecimals
to 18
It is assumed that the native token has 18 decimals, since this was a requirement for deploying a custom fee token chain prior to v2.0.0
.
This upgrade only support upgrading from the following nitro-contract release:
- Inbox: v1.1.0 - v1.3.0 inclusive
- Outbox: v1.1.0 - v1.3.0 inclusive
- SequencerInbox: v1.2.1 - v2.1.0 inclusive
- Bridge: v1.1.0 - v1.3.0 inclusive
- RollupProxy: v1.1.0 - v2.1.0 inclusive
- RollupAdminLogic: v2.1.0
- RollupUserLogic: v2.1.0
- ChallengeManager: v2.1.0
Please refer to the top README Check Version and Upgrade Path
on how to determine your current nitro contracts version.
- L1 Mainnet: 0x78Ee30C74B3Ce1aeB38163Db3E7d769d9735542F
- L2 Arb1: 0x7D42F098e79DE006CFAB475cFD50BdF2310d7ae8
- L2 Nova: 0xEb35A5E1B0FdBa925880A539Eac661907d43Ee07
- L2 Base: 0x9d924ffE6D66ca0727657734a615CC9730925c49
- L1 Sepolia: 0xA8a3869A55Baf88f20B81bdbf54eDaC532b98369
- L1 Holesky: 0x619a0B831d61b90a8585CE9B25077021f1fFa925
- L2 ArbSepolia: 0x76A35A0c721A6bf53982f5a00ccb3AaDb184aD8E
- L2 BaseSepolia: 0xA5b663B60502ef6bFFe3e003A43d3E79AFB1aC1c
- Setup .env according to the example files, make sure you have everything correctly defined. The .env file must be in project root for recent foundry versions.
Caution
The .env file must be in project root.
- (Skip this step if you can use the deployed instances of action contract)
DeployNitroContracts2Point1Point2UpgradeActionScript.s.sol
script deploys templates, and upgrade action itself. It can be executed in this directory like this:
forge script --sender $DEPLOYER --rpc-url $PARENT_CHAIN_RPC --broadcast --slow DeployNitroContracts2Point1Point2UpgradeActionScript -vvv --verify --skip-simulation
# use --account XXX / --private-key XXX / --interactive / --ledger to set the account to send the transaction from
As a result, all templates and upgrade action are deployed. Note the last deployed address - that's the upgrade action.
ExecuteNitroContracts2Point1Point2Upgrade.s.sol
script uses previously deployed upgrade action to execute the upgrade. It makes following assumptions - L1UpgradeExecutor is the rollup owner, and there is an EOA which has executor rights on the L1UpgradeExecutor. Proceed with upgrade using the owner account (the one with executor rights on L1UpgradeExecutor):
forge script --sender $EXECUTOR --rpc-url $PARENT_CHAIN_RPC --broadcast ExecuteNitroContracts2Point1Point2UpgradeScript -vvv
# use --account XXX / --private-key XXX / --interactive / --ledger to set the account to send the transaction from
If you have a multisig as executor, you can still run the above command without broadcasting to get the payload for the multisig transaction.
- That's it, upgrade has been performed. You can make sure it has successfully executed by checking the native token decimals.
# should return 18
cast call --rpc-url $PARENT_CHAIN_RPC $BRIDGE "nativeTokenDecimals()(uint8)"
A: try to add -g 1000 to the command