datahaven/test/cli/handlers/contracts
Ahmad Kaouk ffd01d8f1d
Fix: command cli deploy contracts (#319)
## Summary

This PR fixes several issues with the CLI deploy-contracts command to
properly support local Anvil deployments and improves the overall
contract deployment workflow.

  ### Key fixes:
  - Add support for anvil chain in the CLI deploy contracts command
- Rename PRIVATE_KEY to DEPLOYER_PRIVATE_KEY for consistency and clarity
across the deployment flow
- Fix EigenLayer contract status display for local/anvil chains by
reading addresses from the deployments file instead of config
- Fix runShellCommandWithLogger to properly throw errors on command
failure
  - Correct totalSteps in DeployTestnet.s.sol from 2 to 4

  ### Housekeeping:
- Update .gitignore to ignore the entire broadcast/ folder
(autogenerated Foundry artifacts)
- Streamline contracts/README.md with clearer structure and deployment
instructions
2025-11-27 15:06:04 +01:00
..
.env.example Fix: command cli deploy contracts (#319) 2025-11-27 15:06:04 +01:00
deploy.ts Fix: command cli deploy contracts (#319) 2025-11-27 15:06:04 +01:00
index.ts feat: support updating the AVS dashboard metadata (#136) 2025-09-02 15:54:47 +02:00
README.md Fix: command cli deploy contracts (#319) 2025-11-27 15:06:04 +01:00
status.ts Fix: command cli deploy contracts (#319) 2025-11-27 15:06:04 +01:00
update-metadata.ts feat: support updating the AVS dashboard metadata (#136) 2025-09-02 15:54:47 +02:00
verify.ts feat: Datahaven contracts deployment on public testnet (#123) 2025-08-21 10:02:31 +00:00

DataHaven Contracts Deployment

Deploy DataHaven AVS contracts to supported chains (Hoodi, Holesky, Mainnet).

What Gets Deployed

  • DataHaven: ServiceManager, VetoableSlasher, RewardsRegistry
  • Snowbridge: BeefyClient, AgentExecutor, Gateway, RewardsAgent
  • EigenLayer: References existing contracts (not deployed)

Prerequisites

  1. Account Setup: Create or import an account in Metamask (you'll need the private key)
  2. Funding: Get native tokens for deployment fees:
  3. API Key (optional): Generate API token from block explorer for contract verification:

Setup

cd test && cp cli/handlers/contracts/.env.example .env

Edit .env with your values:

# Required: Private key with deployment funds
DEPLOYER_PRIVATE_KEY=0x...

# Required: AVS owner private key (can be same as DEPLOYER_PRIVATE_KEY)
AVS_OWNER_PRIVATE_KEY=0x...

# Optional: For contract verification
ETHERSCAN_API_KEY=your_api_key_here

Deployment Commands

Deploy to Hoodi

bun cli contracts deploy --chain hoodi

Deploy to Holesky

bun cli contracts deploy --chain holesky

Deploy to Mainnet

bun cli contracts deploy --chain mainnet

Custom RPC URL

bun cli contracts deploy --chain hoodi --rpc-url https://your-rpc-url.com

Check Deployment Status

bun cli contracts status --chain hoodi

Deployment Files

Successful deployments create:

  • ../contracts/deployments/{chain}.json - Contract addresses
  • ../contracts/deployments/{chain}-rewards-info.json - Rewards configuration