## 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> |
||
|---|---|---|
| .. | ||
| config | ||
| deployments | ||
| lib | ||
| resources | ||
| script | ||
| scripts | ||
| src | ||
| storage-snapshots | ||
| test | ||
| .gitignore | ||
| foundry.toml | ||
| README.md | ||
DataHaven AVS Smart Contracts
Implements the Actively Validated Service (AVS) logic for DataHaven, secured by EigenLayer. These contracts manage operator registration, handle cross-chain rewards via Snowbridge, and enforce slashing.
Project Structure
contracts/
├── src/
│ ├── DataHavenServiceManager.sol # Core AVS service manager
│ ├── middleware/ # RewardsRegistry, Snowbridge helpers
│ ├── interfaces/ # Contract interfaces
│ └── libraries/ # Utility libraries
├── script/ # Deployment & setup scripts
├── lib/ # External dependencies (EigenLayer, Snowbridge, OpenZeppelin)
└── test/ # Foundry test suites
Key Components
- DataHavenServiceManager (
src/DataHavenServiceManager.sol): Core contract for operator lifecycle; inheritsServiceManagerBase. - RewardsRegistry (
src/middleware/RewardsRegistry.sol): Tracks validator performance and distributes rewards via Snowbridge.
Development
Requires Foundry.
# Build and Test
forge build
forge test
# Regenerate TS bindings (after contract changes)
cd ../test && bun generate:wagmi
Configuration
Deployment parameters (EigenLayer addresses, initial validators, owners) are defined in contracts/config/<network>.json.
- Do not edit
Config.solorDeployParams.s.soldirectly; they only load the JSON. - Ensure
contracts/config/hoodi.jsonmatches your target environment before deploying.
Deployment
Two deployment paths exist: Local (Anvil) and Testnet (Hoodi). Both install the DataHaven AVS contracts (ServiceManager, RewardsRegistry) and Snowbridge (BeefyClient, Gateway, Agent). They differ in EigenLayer setup:
Local (Anvil)
DeployLocal.s.sol bootstraps a full EigenLayer core deployment (DelegationManager, StrategyManager, AVSDirectory, etc.) alongside DataHaven AVS and Snowbridge.
anvil
forge script script/deploy/DeployLocal.s.sol --rpc-url anvil --broadcast
Testnet (Hoodi)
DeployTestnet.s.sol references existing EigenLayer contracts (addresses from contracts/config/<network>.json) and only deploys DataHaven AVS + Snowbridge.
NETWORK=hoodi forge script script/deploy/DeployTestnet.s.sol \
--rpc-url hoodi \
--private-key $PRIVATE_KEY \
--broadcast
Supported networks: hoodi (no mainnet config yet). Artifacts → contracts/deployments/<network>.json.
How It Works
- Registration: Validators register with EigenLayer via
DataHavenServiceManager. - Performance Tracking: DataHaven computes reward points and sends a Merkle root to
RewardsRegistryon Ethereum via Snowbridge. - Rewards Claims: Validators claim rewards on Ethereum from
RewardsRegistryusing Merkle proofs. - Slashing: Misbehavior triggers slashing.
See test/README.md for full network integration tests.