Agent Multiverse
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

  1. Arbitrum Sepolia RPC — Get one from Alchemy or Infura
  2. Testnet ETH — Claim from the Arbitrum Sepolia Faucet
  3. Private Key — An account with testnet ETH
  4. FoundryInstall 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_here

Compile Contracts

cd contracts
forge build

Deployment Options

Deploys all three contracts and links them automatically:

forge script script/Deploy.s.sol:DeployMultiverse \
  --rpc-url $RPC_URL \
  --broadcast \
  --verify \
  -vvvv

Option B: Individual Deployment

Use this to update a specific contract.

Deploy Passport:

forge script script/DeployPassport.s.sol:DeployPassport \
  --rpc-url $RPC_URL \
  --broadcast \
  --verify

Deploy Registry:

forge script script/DeployRegistry.s.sol:DeployRegistry \
  --rpc-url $RPC_URL \
  --broadcast \
  --verify

Deploy Bounty (requires REGISTRY_ADDRESS in .env):

forge script script/DeployBounty.s.sol:DeployBounty \
  --rpc-url $RPC_URL \
  --broadcast \
  --verify

Post-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

IssueSolution
Insufficient fundsEnsure your account has at least 0.1 Sepolia ETH
Remappings errorRun forge remappings > remappings.txt
Verification failedVerify manually: forge verify-contract <address> <ContractName>