- 1. Overview
- 2. Step Summary & Token Requirements
- 3. Prerequisites
- 4. Upgrade Process (Four Steps)
- 5. Post-Upgrade
Use this workflow to send admin transactions via ADMIN_PRIVATE_KEY. See environment defaults for when this applies.
App chain upgrades are four steps because they span two chains. The migrator address must be set on the settlement chain and bridged to the app chain. In Wallet mode, steps 2-3 are combined into a single command.
| Step | Chain | Address | baseETH | xUSD (settlement) | xUSD (app) | Note |
|---|---|---|---|---|---|---|
| 1. Prepare | App | DEPLOYER | - | - | Yes | Deploy new implementation and migrator contracts |
| 2. SetMigrator | Settlement | ADMIN | Yes | - | - | Set migrator address in settlement chain parameter registry (admin-only tx) |
| 3. BridgeParameter | Settlement | DEPLOYER | Yes | Yes | - | Bridge the migrator parameter to app chain |
| 4. Upgrade | App | DEPLOYER | - | - | Yes | Execute migration on app chain using bridged migrator |
ADMIN_PRIVATE_KEY=... # Admin private key (for setting migrator in Step 2)
BASE_SEPOLIA_RPC_URL=... # Settlement chain RPC endpoint
DEPLOYER_PRIVATE_KEY=... # Deployer private key (for all steps)
XMTP_ROPSTEN_RPC_URL=... # App chain RPC endpointEnsure the following fields are defined correctly in the config/<environment>.json file for your chosen environment:
{
"factory": "0x...", // Factory contract for creating new contracts
"parameterRegistryProxy": "0x...", // Parameter registry for setting migrator address
"<contract>Proxy": "0x..." // The proxy being upgraded (e.g., identityUpdateBroadcasterProxy)
}The following example upgrades IdentityUpdateBroadcaster on testnet-dev.
Note: In Wallet mode, steps 2-3 (SetMigrator and BridgeParameter) are combined into a single Bridge() command for convenience.
Before running any commands, set these environment variables:
export ENVIRONMENT=testnet-dev # or: testnet-staging, testnet, mainnet
export ADMIN_ADDRESS_TYPE=WALLET # use wallet private key signingDeploy the new implementation and migrator on the app chain:
forge script IdentityUpdateBroadcasterUpgrader --rpc-url xmtp_ropsten --slow --sig "Prepare()" --broadcastImportant: Note the MIGRATOR_ADDRESS_FOR_STEP_2 from the output.
Set the migrator in the settlement chain parameter registry and bridge it to the app chain:
forge script IdentityUpdateBroadcasterUpgrader --rpc-url base_sepolia --slow \
--sig "Bridge(address)" <MIGRATOR_ADDRESS> --broadcastThis single command performs both:
- Step 2 (SetMigrator): Sets migrator in settlement chain parameter registry (ADMIN)
- Step 3 (BridgeParameter): Bridges the parameter to app chain (DEPLOYER)
Wait for the bridge transaction to finalize. You can verify the migrator arrived on the app chain by checking the app chain parameter registry:
forge script BridgeParameter --rpc-url xmtp_ropsten --sig "get(string)" "xmtp.identityUpdateBroadcaster.migrator"The Value (address) in the output should match the MIGRATOR_ADDRESS from Step 1.
Execute the migration on the app chain:
forge script IdentityUpdateBroadcasterUpgrader --rpc-url xmtp_ropsten --slow \
--sig "Upgrade()" --broadcastThe script will verify that contract state is preserved after the upgrade.
After a successful upgrade:
- Copy the new implementation address to
config/<environment>.json - Verify the implementation contract:
./dev/verify-base xmtp_ropsten alchemy