Testnet Deployment
Deploy Cron Protocol to Base Sepolia or Arbitrum Sepolia.
Prerequisites
- Foundry installed (
forge,cast) - Deployer wallet with testnet ETH
- Alchemy or Infura RPC URL for the target chain
- Etherscan/Basescan API key for contract verification (optional)
[*] Get testnet ETH
Base Sepolia faucet: QuickNode faucet. Arbitrum Sepolia: Triangle faucet.
1. Configure environment
bash
cd codebase/contracts
cp .env.example .envEdit contracts/.env:
bash
DEPLOYER_PRIVATE_KEY=0x... # Wallet with testnet ETH
# Protocol governance (can be your own wallet for testnet)
PROTOCOL_TREASURY=0x...
GOVERNANCE_MULTISIG=0x...
# RPC URLs
BASE_SEPOLIA_RPC=https://sepolia.base.org
ARBITRUM_SEPOLIA_RPC=https://sepolia-rollup.arbitrum.io/rpc
# Verifier API keys (optional)
BASESCAN_API_KEY=
ARBISCAN_API_KEY=2. Deploy to Base Sepolia
bash
forge script script/Deploy.s.sol \
--rpc-url base_sepolia \
--broadcast \
--verify \
-vvvvThe deploy script outputs all contract addresses. Save these — you'll need them in the next step.
3. Propagate addresses
Run the configure script from the codebase root to update the keeper, x402-api, and subgraph configs with your new registry address:
bash
cd codebase
./scripts/configure-addresses.sh \
--registry 0xYOUR_REGISTRY_ADDRESS \
--chain baseSepolia \
--start-block YOUR_DEPLOY_BLOCKThis updates:
packages/keeper/.env— CRON_REGISTRY_ADDRESS, CHAIN, RPC_URLpackages/x402-api/.env— samesubgraph/subgraph.yaml— address, startBlock, network
4. Deploy to Arbitrum Sepolia (optional)
bash
forge script script/Deploy.s.sol \
--rpc-url arbitrum_sepolia \
--broadcast \
--verify \
-vvvvThanks to CREATE2, the registry address will be identical to Base Sepolia (if deployed with the same salt and deployer).
5. Verify deployment
bash
# Check the registry is deployed
cast call YOUR_REGISTRY_ADDRESS "planCount()(uint256)" --rpc-url https://sepolia.base.org
# Create a test plan
cast send YOUR_REGISTRY_ADDRESS \
"createPlan(address,uint256,uint256,uint256,bool,string)" \
0x036CbD53842c5426634e7929541eC2318f3dCF7e \ # USDC Base Sepolia
"1000000" "86400" "3600" false '{"name":"Test"}' \
--private-key $DEPLOYER_PRIVATE_KEY \
--rpc-url https://sepolia.base.orgNext steps
- Deploy the subgraph
- Start the keeper against your testnet deployment
- Test the full flow: create plan → subscribe → wait for charge