mirror of
https://github.com/datahaven-xyz/datahaven
synced 2026-05-24 01:38:32 +00:00
## Summary - Add stagenet-hoodi deployment artifacts (contract addresses, rewards info) and update Snowbridge config with latest validator set - Fix the `bun cli contracts verify` command to correctly verify all deployed contracts, including proxy contracts and Snowbridge dependencies - Fix the `bun cli contracts update-metadata` command to use the correct config file when `--environment` is specified ## Contract verification fixes The verification CLI hardcoded all contract source paths as `src/<Name>.sol`, which failed for: - **Snowbridge contracts** (Gateway, BeefyClient, AgentExecutor) — these live in `lib/snowbridge/contracts/src/` - **Gateway proxy** — the `Gateway` deployment address is actually a `GatewayProxy`, not the Gateway implementation. The implementation address needs to be resolved from the ERC1967 storage slot - **ServiceManager proxy** — was not being verified at all Changes: - Added `contractPath` field to `ContractToVerify` so each contract specifies its source location relative to the contracts directory - Added `guessConstructorArgs` option for proxy contracts with complex encoded init data (uses forge's `--guess-constructor-args`) - Gateway is now verified as two separate contracts: Gateway Implementation (address resolved from ERC1967 proxy slot) and GatewayProxy - ServiceManager proxy is now verified as `TransparentUpgradeableProxy` ## Update-metadata fix The `update-metadata` command was ignoring the `--environment` flag when selecting the deployments file: 1. The handler received a pre-built networkId (`"stagenet-hoodi"`) as the chain parameter, which `getChainDeploymentParams` couldn't resolve (falling back to anvil). Now chain and environment are passed separately. 2. Commander.js routed `--environment` to the parent contracts command, leaving `options.environment` undefined on the subcommand. Added the same parent-fallback logic already used for `--chain`. ## Test plan - [x] `bun typecheck` passes - [x] Ran `bun cli contracts verify --chain hoodi --environment stagenet` — all contracts verified successfully on Etherscan - [x] `bun cli contracts update-metadata --chain hoodi --environment stagenet` now reads the correct `stagenet-hoodi.json` deployments file --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .env.example | ||
| beefy-checkpoint.ts | ||
| deploy.ts | ||
| index.ts | ||
| README.md | ||
| rewards-origin.ts | ||
| status.ts | ||
| update-metadata.ts | ||
| verify.ts | ||
DataHaven Contracts Deployment
Deploy DataHaven AVS contracts to supported chains (Hoodi, Mainnet).
What Gets Deployed
- DataHaven: ServiceManager, RewardsRegistry
- Snowbridge: BeefyClient, AgentExecutor, Gateway, RewardsAgent
- EigenLayer: References existing contracts (not deployed)
Prerequisites
- Account Setup: Create or import an account in Metamask (you'll need the private key)
- Funding: Get native tokens for deployment fees:
- Hoodi: Use PoW Faucet at https://hoodi-faucet.pk910.de/#/mine/cc7df92c-9629-4ad8-aaa4-53b1e1c294e8
- Mainnet: Purchase ETH
- API Key (optional): Generate API token from block explorer for contract verification:
- Hoodi: Etherscan-compatible endpoint
- Mainnet: https://etherscan.io/apis
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 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