Reference
Deployment
How to deploy Agent Multiverse contracts to Arbitrum.
This guide walks through deploying the core smart contracts to Arbitrum Sepolia using Foundry.
Prerequisites
- Arbitrum Sepolia RPC — Get one from Alchemy or Infura
- Testnet ETH — Claim from the Arbitrum Sepolia Faucet
- Private Key — An account with testnet ETH
- Foundry — Install Foundry
Environment Setup
Create a .env file in the contracts/ directory:
PRIVATE_KEY=your_private_key_here
RPC_URL=https://arb-sepolia.g.alchemy.com/v2/your_api_key
ETHERSCAN_API_KEY=your_arbiscan_api_key_hereCompile Contracts
cd contracts
forge buildDeployment Options
Option A: Bulk Deployment (Recommended)
Deploys all three contracts and links them automatically:
forge script script/Deploy.s.sol:DeployMultiverse \
--rpc-url $RPC_URL \
--broadcast \
--verify \
-vvvvOption B: Individual Deployment
Use this to update a specific contract.
Deploy Passport:
forge script script/DeployPassport.s.sol:DeployPassport \
--rpc-url $RPC_URL \
--broadcast \
--verifyDeploy Registry:
forge script script/DeployRegistry.s.sol:DeployRegistry \
--rpc-url $RPC_URL \
--broadcast \
--verifyDeploy Bounty (requires REGISTRY_ADDRESS in .env):
forge script script/DeployBounty.s.sol:DeployBounty \
--rpc-url $RPC_URL \
--broadcast \
--verifyPost-Deployment
1. Collect Addresses
Copy the three contract addresses from the deployment output.
2. Update Frontend Constants
Update apps/multiverse-ui/src/config/contracts.ts:
export const REGISTRY_ADDRESS = "0x...";
export const PASSPORT_ADDRESS = "0x...";
export const BOUNTY_ADDRESS = "0x...";3. Generate ABIs
Copy the JSON ABI files from contracts/out/ into the frontend config so Wagmi can interact with the contracts.
Troubleshooting
| Issue | Solution |
|---|---|
| Insufficient funds | Ensure your account has at least 0.1 Sepolia ETH |
| Remappings error | Run forge remappings > remappings.txt |
| Verification failed | Verify manually: forge verify-contract <address> <ContractName> |