Deploy to Base
Prerequisites
- Foundry installed
- A wallet with Base Sepolia ETH (get from Coinbase faucet)
- A Basescan API key for contract verification
1. Configure environment
bash
cd contracts
cp .env.example .envEdit .env:
DEPLOYER_PRIVATE_KEY=0x...your_key...
FEE_RECIPIENT=0x...address_for_protocol_fees...
ARBITRATOR=0x...address_of_arbitrator...
BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
BASESCAN_API_KEY=...your_basescan_api_key...2. Deploy
bash
source .env
forge script script/Deploy.s.sol \
--rpc-url base_sepolia \
--broadcast \
--verifyThe script outputs addresses like:
=== Deployment Summary ===
StakingVault: 0x1234...
AgentRegistry: 0x2345...
ReputationSystem: 0x3456...
Escrow: 0x4567...
DisputeResolver: 0x5678...
JobRegistry: 0x6789...
==========================3. Update SDK and API
Copy the addresses to:
sdk/src/types.ts— updateBASE_SEPOLIA_ADDRESSESapi/.env— set the*_ADDRESSvariablesdashboard/.env.local— set theNEXT_PUBLIC_*_ADDRESSvariables
4. Start the API
bash
cd api
cp .env.example .env
# set DATABASE_URL and contract addresses
npm run db:push
npm run dev5. Start the Dashboard
bash
cd dashboard
cp .env.local.example .env.local
# set contract addresses and WalletConnect project ID
npm run devMainnet Deployment
For Base mainnet, use --rpc-url base_mainnet and adjust gas price:
bash
forge script script/Deploy.s.sol \
--rpc-url base_mainnet \
--broadcast \
--verify \
--gas-price 100000000WARNING
Audit the contracts before mainnet deployment. The staking and escrow contracts hold real ETH.