How stader-labs/ethx works
Project type and purpose
• This is a blockchain smart-contract system built with Solidity, managed by Hardhat and Foundry.
• Purpose: ETHx provides a multi-pool architecture (permissioned and permissionless pools) for Ethereum node operations, handling deposits, rewards, penalties, and withdrawals in a decentralized, upgradable manner.
File structure
• Top-level directories
• contracts: Solidity code organized into factory, interfaces, libraries
• scripts: TypeScript deployment, upgrade, verification, multisig helper scripts
• test: Foundry tests and mocks
• lib: external submodules (forge-std, OpenZeppelin upgrades)
• Config files
• hardhat.config.ts, foundry.toml for compilation and test frameworks
• .openzeppelin for proxy deployment data
• Dockerfile, .devcontainer for development environment
• CI/CD pipelines under .github/workflows for linting, testing, coverage, security
Key components from the README and code
• Core smart contracts (deployed on multiple networks):
• VaultFactory, Auction, ETHx (main token), OperatorRewardsCollector, Penalty
• PermissionedNodeRegistry & PermissionlessNodeRegistry
• PermissionedPool & PermissionlessPool
• PoolSelector, PoolUtils
• SD_Collateral, SD_UtilityPool, SD_IncentiveController, SD_RewardManager (for staked derivatives)
• Socializing pools, InsuranceFund, StaderOracle, StakePoolManager, UserWithdrawalManager, RewardVaults
• External integrations:
• Chainlink ETHx/ETH feed oracle
• Multisig Safe for upgrades (via safe-scripts)
• OpenZeppelin upgradeable proxy pattern