Deployment
Prerequisites
- Node.js (v18+)
- Hardhat (via
npx hardhat) - Base Sepolia ETH for gas (obtain from Base Sepolia Faucet)
Environment Variables
Create a.env file in packages/contracts:
Commands
1
Compile
2
Deploy
3
Authorize initial agents
If
AGENT_PRIVATE_KEY is set, the deploy script automatically calls setAgent(agentAddress, true). Otherwise, call setAgent on the contract via Hardhat console or a custom script.Post-Deploy
- Set contract address — Add
CONTRACT_ADDRESS=<deployed-address>to your CLI and scanner.env. - Verify on BaseScan — Run
npx hardhat verify —network baseSepolia <CONTRACT_ADDRESS>to publish source code for verification.
The deploy script outputs the contract address. The default OPM contract is
0x16684391fc9bf48246B08Afe16d1a57BFa181d48 on Base Sepolia.