Deployment
Deploying Meridian contracts and infrastructure to Base and 0G.
Contract Deployment
Base Sepolia (Development)
cd packages/contracts
# Deploy factory and registry
forge script script/DeployBaseSepolia.s.sol \
--rpc-url base_sepolia \
--broadcast
# Deploy hook (requires address mining)
forge script script/DeployHook.s.sol \
--rpc-url base_sepolia \
--broadcastHook Address Mining
Uniswap V4 hook permissions are encoded in the contract address bits. Deployment uses HookMiner.find() with CREATE2 to mine an address matching the required permission flags:
uint160 flags = uint160(
Hooks.BEFORE_INITIALIZE_FLAG
| Hooks.BEFORE_ADD_LIQUIDITY_FLAG
| Hooks.AFTER_ADD_LIQUIDITY_FLAG
| Hooks.BEFORE_REMOVE_LIQUIDITY_FLAG
| Hooks.BEFORE_SWAP_FLAG
| Hooks.AFTER_SWAP_FLAG
| Hooks.BEFORE_SWAP_RETURNS_DELTA_FLAG
);On testnet, you can use deployCodeTo to bypass mining. On mainnet, start mining early as it may take time to find a valid salt.
0G Chain (Agent Identity)
# Deploy iNFT contract to 0G Galileo testnet
forge script script/Deploy0G.s.sol \
--rpc-url og_galileo \
--broadcastDeployed Addresses
Uniswap V4 (Pre-deployed)
| Contract | Base Mainnet | Base Sepolia |
|---|---|---|
| PoolManager | 0x498581ff... | 0x05E73354... |
| PositionManager | 0x7c5f5a4b... | 0x4b2c77d2... |
| UniversalRouter | 0x6ff5693b... | 0x492e6456... |
| Quoter | 0x0d5e0f97... | 0x4a6513c8... |
0G Chain
| Property | Galileo Testnet |
|---|---|
| RPC | https://evmrpc-testnet.0g.ai |
| Chain ID | 16602 |
| EVM Version | cancun |
Frontend Deployment
The web frontend deploys to Vercel. Connect the repository and set the root directory to packages/web. Required environment variables:
NEXT_PUBLIC_FACTORY_ADDRESSNEXT_PUBLIC_HOOK_ADDRESSNEXT_PUBLIC_REGISTRY_ADDRESSNEXT_PUBLIC_AGENT_URLNEXT_PUBLIC_WALLETCONNECT_PROJECT_ID
Agent Server Deployment
The agent server can be deployed to any Node.js hosting provider. It runs as a standard Express application on port 4021. Ensure all environment variables are configured and the server has access to Base RPC endpoints.
Verification
Post-deployment verification steps:
- Verify contracts on Basescan/Blockscout with
forge verify-contract - Check ERC-8021 builder codes are visible in Basescan transaction input data
- Test market creation, proposal submission, and trading through the UI
- Verify agent registration flow: mint iNFT on 0G, attest, register on Base
- Confirm x402 payment flow: 402 response, payment header, resource delivery