A command-line tool to upgrade Biconomy Nexus smart accounts from v2.0.0 to v2.1.0.
- Verifies your Nexus account is currently on v2.0.0
- Upgrades the implementation to v2.1.0 with proper validator initialization
- Verifies the upgrade completed successfully
- Optionally tests the upgraded account with a transaction
- Bun runtime installed
- A Nexus smart account on Base chain running v2.0.0
- Private key for the account owner
- USDC on Base for transaction fees (small amount, typically < $0.01)
Install dependencies:
bun install- Copy the example environment file:
cp .env.example .env- Edit
.envand add your private key:
KEY=your_private_key_here
Run the upgrade script:
bun run upgrade.tsThe tool will:
- ✅ Check your Nexus account version (must be v2.0.0)
- ✅ Prepare upgrade data for v2.1.0 implementation
- ✅ Get a fee quote from MEE (in USDC)
- ✅ Execute the upgrade transaction
- ✅ Wait for confirmation
- ✅ Verify the upgrade succeeded
Output example:
============================================================
Upgrade: v2.0.0 → v2.1.0
============================================================
⏳ Checking current Nexus version...
✅ Current version: v2.0.0
⏳ Getting v2.1.0 configuration...
✅ v2.1.0 implementation: 0x...
⏳ Preparing initData for validator initialization...
✅ initData prepared
⏳ Building upgradeToAndCall instruction...
✅ Built 1 instruction(s)
⏳ Getting fusion quote from MEE node...
✅ Fee: 0.000123 USDC
⏳ Executing upgrade via SDK...
✅ Supertx sent: 0x...
MEE scan: https://meescan.biconomy.io/details/0x...
⏳ Waiting for upgrade to complete...
✅ Upgrade executed successfully
⏳ Verifying upgraded Nexus information...
✅ Nexus upgraded successfully
📋 Upgraded Nexus Information:
Address: 0x...
Deployed: true
Implementation: 0x...
Version: v2.1.0
Account ID: ...
Upgrade Needed: false
✅ Nexus account upgraded to v2.1.0!
To verify the upgraded account works correctly, you can execute a test transaction:
- Open
upgrade.ts - Uncomment lines 224-225 at the bottom:
const nexusAddressOverride = '<your_nexus_address>' as Hex;
await executeAfterUpgrade(nexusAddressOverride);- Replace
<your_nexus_address>with your Nexus address - Run
bun run upgrade.tsagain
This will send 1 wei of USDC to your owner address as a test.
- Chain: Base (chainId: 8453)
- Fee Token: USDC (0x833589fcd6edb6e08f4c7c32d4f71b54bda02913)
- From: MEE v2.0.0
- To: MEE v2.1.0
You can modify these in upgrade.ts if needed for different chains or versions.