diff --git a/.github/workflows/run-deploy-scripts.yml b/.github/workflows/run-deploy-scripts.yml new file mode 100644 index 000000000..c43dc1b73 --- /dev/null +++ b/.github/workflows/run-deploy-scripts.yml @@ -0,0 +1,38 @@ +name: Run Deploy Scripts +# We run the deploy scripts just to make sure they work + +on: + push: + pull_request: + types: [opened, reopened] + +jobs: + prepare: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: true + + # install foundry to run forge script. Should we run forge script in a container instead? + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - name: Start Anvil chain + # need to start Anvil chain with -d to let the container run in the background + # if we start with 'anvil &' instead, the process stops when the step ends + run: docker run -d --rm -p 8545:8545 --entrypoint anvil ghcr.io/foundry-rs/foundry:nightly-5b7e4cb3c882b28f3c32ba580de27ce7381f415a --host 0.0.0.0 + + - name: Wait for Anvil chain to start + run: sleep 3 + + # Run Forge script against the Anvil chain + - name: Run M2_Deploy_From_Scratch + run: | + forge script script/deploy/devnet/M2_Deploy_From_Scratch.s.sol --rpc-url http://localhost:8545 \ + --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast \ + --sig "run(string memory configFileName)" -- M2_deploy_from_scratch.anvil.config.json diff --git a/.github/workflows/testinparallel.yml b/.github/workflows/testinparallel.yml index a0bd90fe3..8ae97b9a4 100644 --- a/.github/workflows/testinparallel.yml +++ b/.github/workflows/testinparallel.yml @@ -25,9 +25,8 @@ jobs: needs: prepare runs-on: ubuntu-latest strategy: - matrix: - file: ${{fromJson(needs.prepare.outputs.matrix)}} fail-fast: false + steps: - name: Checkout code uses: actions/checkout@v2 @@ -43,9 +42,24 @@ jobs: forge build --sizes id: build - - name: Run forge test for the file - run: forge test --match-path src/test/${{ matrix.file }} --no-match-contract FFI + - name: Run unit tests + run: forge test --no-match-contract Integration + env: + RPC_MAINNET: ${{ secrets.RPC_MAINNET }} + RPC_HOLESKY: ${{ secrets.RPC_HOLESKY }} + CHAIN_ID: ${{ secrets.CHAIN_ID }} + + - name: Run integration tests + run: forge test --match-contract Integration env: RPC_MAINNET: ${{ secrets.RPC_MAINNET }} RPC_HOLESKY: ${{ secrets.RPC_HOLESKY }} CHAIN_ID: ${{ secrets.CHAIN_ID }} + + - name: Run integration mainnet fork tests + run: forge test --match-contract Integration + env: + FOUNDRY_PROFILE: "forktest" + RPC_MAINNET: ${{ secrets.RPC_MAINNET }} + RPC_HOLESKY: ${{ secrets.RPC_HOLESKY }} + CHAIN_ID: ${{ secrets.CHAIN_ID }} \ No newline at end of file diff --git a/README.md b/README.md index 03348f435..5e9a83574 100644 --- a/README.md +++ b/README.md @@ -87,54 +87,101 @@ surya mdreport surya_report.md ./src/contracts/**/*.sol ### Current Mainnet Deployment -The current mainnet deployment is our M1 release, and is from a much older version of this repo. You can view the deployed contract addresses below, or check out the code itself on the [`mainnet`](https://github.com/Layr-Labs/eigenlayer-contracts/tree/mainnet) branch. - -| Name | Solidity | Proxy | Implementation | Notes | -| -------- | -------- | -------- | -------- | -------- | -| StrategyManager | [`StrategyManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/core/StrategyManager.sol) | [`0x8586...075A`](https://etherscan.io/address/0x858646372CC42E1A627fcE94aa7A7033e7CF075A) | [`0x5d25...42Fb`](https://etherscan.io/address/0x5d25EEf8CfEdaA47d31fE2346726dE1c21e342Fb) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: cbETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x5494...56bc`](https://etherscan.io/address/0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: stETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x93c4...564D`](https://etherscan.io/address/0x93c4b944D05dfe6df7645A86cd2206016c51564D) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: rETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x1BeE...dCD2`](https://etherscan.io/address/0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: ETHx | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x9d7e...011d`](https://etherscan.io/address/0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: ankrETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x1376...58ff`](https://etherscan.io/address/0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: OETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0xa4C6...d059`](https://etherscan.io/address/0xa4C637e0F704745D182e4D38cAb7E7485321d059) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: osETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x57ba...4c02`](https://etherscan.io/address/0x57ba429517c3473B6d34CA9aCd56c0e735b94c02) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: swETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x0Fe4...96d6`](https://etherscan.io/address/0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: wBETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x7CA9...2184`](https://etherscan.io/address/0x7CA911E83dabf90C90dD3De5411a10F1A6112184) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: sfrxETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x8CA7...28b6`](https://etherscan.io/address/0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: lsETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0xAe60...4473`](https://etherscan.io/address/0xAe60d8180437b5C34bB956822ac2710972584473) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: mETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x298a...6dd2`](https://etherscan.io/address/0x298aFB19A105D59E74658C4C334Ff360BadE6dd2) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| EigenPodManager | [`EigenPodManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/pods/EigenPodManager.sol) | [`0x91E6...A338`](https://etherscan.io/address/0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338) | [`0xEB86...e111`](https://etherscan.io/address/0xEB86a5c40FdE917E6feC440aBbCDc80E3862e111) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| EigenPod (beacon) | [`EigenPod`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/pods/EigenPod.sol) | [`0x5a2a...9073`](https://etherscan.io/address/0x5a2a4F2F3C18f09179B6703e63D9eDD165909073) | [`0x5c86...9dA7`](https://etherscan.io/address/0x5c86e9609fbBc1B754D0FD5a4963Fdf0F5b99dA7) | - Beacon: [OpenZeppelin BeaconProxy@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/BeaconProxy.sol)
- Deployed pods use [UpgradableBeacon@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/UpgradeableBeacon.sol) | -| DelayedWithdrawalRouter | [`DelayedWithdrawalRouter`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/pods/DelayedWithdrawalRouter.sol) | [`0x7Fe7...23D8`](https://etherscan.io/address/0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D8) | [`0x44Bc...E2AF`](https://etherscan.io/address/0x44Bcb0E01CD0C5060D4Bb1A07b42580EF983E2AF) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| DelegationManager | [`DelegationManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/core/DelegationManager.sol) | [`0x3905...f37A`](https://etherscan.io/address/0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A) | [`0xf97E...75e4`](https://etherscan.io/address/0xf97E97649Da958d290e84E6D571c32F4b7F475e4) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Slasher | [`Slasher`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/core/Slasher.sol) | [`0xD921...c3Cd`](https://etherscan.io/address/0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd) | [`0xef31...d6d8`](https://etherscan.io/address/0xef31c292801f24f16479DD83197F1E6AeBb8d6d8) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| PauserRegistry | [`PauserRegistry`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/permissions/PauserRegistry.sol) | - | [`0x0c43...7060`](https://etherscan.io/address/0x0c431C66F4dE941d089625E5B423D00707977060) | | -| Pauser Multisig | [`GnosisSafe@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/GnosisSafe.sol) | [`0x5050...2390`](https://etherscan.io/address/0x5050389572f2d220ad927CcbeA0D406831012390) | [`0xd9db...9552`](https://etherscan.io/address/0xd9db270c1b5e3bd161e8c8503c55ceabee709552) | Proxy: [`GnosisSafeProxy@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/proxies/GnosisSafeProxy.sol) | -| Community Multisig | [`GnosisSafe@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/GnosisSafe.sol) | [`0xFEA4...c598`](https://etherscan.io/address/0xFEA47018D632A77bA579846c840d5706705Dc598) | [`0xd9db...9552`](https://etherscan.io/address/0xd9db270c1b5e3bd161e8c8503c55ceabee709552) | Proxy: [`GnosisSafeProxy@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/proxies/GnosisSafeProxy.sol) | -| Executor Multisig | [`GnosisSafe@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/GnosisSafe.sol) | [`0x369e...9111`](https://etherscan.io/address/0x369e6F597e22EaB55fFb173C6d9cD234BD699111) | [`0xd9db...9552`](https://etherscan.io/address/0xd9db270c1b5e3bd161e8c8503c55ceabee709552) | Proxy: [`GnosisSafeProxy@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/proxies/GnosisSafeProxy.sol) | -| Operations Multisig | [`GnosisSafe@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/GnosisSafe.sol) | [`0xBE16...3e90`](https://etherscan.io/address/0xBE1685C81aA44FF9FB319dD389addd9374383e90) | [`0xd9db...9552`](https://etherscan.io/address/0xd9db270c1b5e3bd161e8c8503c55ceabee709552) | Proxy: [`GnosisSafeProxy@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/proxies/GnosisSafeProxy.sol) | -| Timelock | [Compound: `Timelock.sol`](https://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/Timelock.sol) | - | [`0xA6Db...0EAF`](https://etherscan.io/address/0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF) | | -| Proxy Admin | [OpenZeppelin ProxyAdmin@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/ProxyAdmin.sol) | - | [`0x8b95...2444`](https://etherscan.io/address/0x8b9566AdA63B64d1E1dcF1418b43fd1433b72444) | | +The current mainnet deployment is our M2 release. You can view the deployed contract addresses below, or check out the code itself on the [`mainnet`](https://github.com/Layr-Labs/eigenlayer-contracts/tree/mainnet) branch. + +###### Core + +| Name | Proxy | Implementation | Notes | +| -------- | -------- | -------- | -------- | +| [`DelegationManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/4b15d68b7e16b5965bad398496bfce57f5a47e1b/src/contracts/core/DelegationManager.sol) | [`0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A`](https://etherscan.io/address/0x39053D51B77DC0d36036Fc1fCc8Cb819df8Ef37A) | [`0x1784...9dda`](https://etherscan.io/address/0x1784be6401339fc0fedf7e9379409f5c1bfe9dda) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/4b15d68b7e16b5965bad398496bfce57f5a47e1b/src/contracts/core/StrategyManager.sol) | [`0x858646372CC42E1A627fcE94aa7A7033e7CF075A`](https://etherscan.io/address/0x858646372CC42E1A627fcE94aa7A7033e7CF075A) | [`0x70f4...619b`](https://etherscan.io/address/0x70f44c13944d49a236e3cd7a94f48f5dab6c619b) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`EigenPodManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/4b15d68b7e16b5965bad398496bfce57f5a47e1b/src/contracts/pods/EigenPodManager.sol) | [`0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338`](https://etherscan.io/address/0x91E677b07F7AF907ec9a428aafA9fc14a0d3A338) | [`0xe429...5762`](https://etherscan.io/address/0xe4297e3dadbc7d99e26a2954820f514cb50c5762) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`AVSDirectory`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/4b15d68b7e16b5965bad398496bfce57f5a47e1b/src/contracts/core/AVSDirectory.sol) | [`0x135dda560e946695d6f155dacafc6f1f25c1f5af`](https://etherscan.io/address/0x135dda560e946695d6f155dacafc6f1f25c1f5af) | [`0xdabd...a5b7`](https://etherscan.io/address/0xdabdb3cd346b7d5f5779b0b614ede1cc9dcba5b7) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`Slasher`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/4b15d68b7e16b5965bad398496bfce57f5a47e1b/src/contracts/core/Slasher.sol) | [`0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd`](https://etherscan.io/address/0xD92145c07f8Ed1D392c1B88017934E301CC1c3Cd) | [`0xf323...6614`](https://etherscan.io/address/0xf3234220163a757edf1e11a8a085638d9b236614) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | + +###### Strategies + +| Name | Proxy | Implementation | Notes | +| -------- | -------- | -------- | -------- | +| [`StrategyBase (cbETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc`](https://etherscan.io/address/0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (stETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x93c4b944D05dfe6df7645A86cd2206016c51564D`](https://etherscan.io/address/0x93c4b944D05dfe6df7645A86cd2206016c51564D) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (rETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2`](https://etherscan.io/address/0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (ETHx)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d`](https://etherscan.io/address/0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (ankrETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff`](https://etherscan.io/address/0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (OETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0xa4C637e0F704745D182e4D38cAb7E7485321d059`](https://etherscan.io/address/0xa4C637e0F704745D182e4D38cAb7E7485321d059) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (osETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x57ba429517c3473B6d34CA9aCd56c0e735b94c02`](https://etherscan.io/address/0x57ba429517c3473B6d34CA9aCd56c0e735b94c02) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (swETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6`](https://etherscan.io/address/0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (wBETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x7CA911E83dabf90C90dD3De5411a10F1A6112184`](https://etherscan.io/address/0x7CA911E83dabf90C90dD3De5411a10F1A6112184) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (sfrxETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6`](https://etherscan.io/address/0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (lsETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0xAe60d8180437b5C34bB956822ac2710972584473`](https://etherscan.io/address/0xAe60d8180437b5C34bB956822ac2710972584473) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (mETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/mainnet/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x298aFB19A105D59E74658C4C334Ff360BadE6dd2`](https://etherscan.io/address/0x298aFB19A105D59E74658C4C334Ff360BadE6dd2) | [`0xdfdA...46d3`](https://etherscan.io/address/0xdfdA04f980bE6A64E3607c95Ca26012Ab9aA46d3) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| `Beacon Chain ETH` | `0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0` | - | - Used for Beacon Chain ETH shares
- Not a real contract! | + +###### EigenPods + +| Name | Proxy | Implementation | Notes | +| -------- | -------- | -------- | -------- | +| [`EigenPod (beacon)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/4b15d68b7e16b5965bad398496bfce57f5a47e1b/src/contracts/pods/EigenPod.sol) | [`0x5a2a4F2F3C18f09179B6703e63D9eDD165909073`](https://etherscan.io/address/0x5a2a4F2F3C18f09179B6703e63D9eDD165909073) | [`0x8ba4...a255`](https://etherscan.io/address/0x8ba40da60f0827d027f029acee62609f0527a255) | - Beacon: [`BeaconProxy`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/BeaconProxy.sol)
- Pods: [`UpgradeableBeacon`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/UpgradeableBeacon.sol) | +| [`DelayedWithdrawalRouter`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/4b15d68b7e16b5965bad398496bfce57f5a47e1b/src/contracts/pods/DelayedWithdrawalRouter.sol) | [`0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D8`](https://etherscan.io/address/0x7Fe7E9CC0F274d2435AD5d56D5fa73E47F6A23D8) | [`0x4bb6...4226`](https://etherscan.io/address/0x4bb6731b02314d40abbffbc4540f508874014226) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`EigenLayerBeaconOracle`](https://github.com/succinctlabs/eigenlayer-beacon-oracle/blob/main/contracts/src/EigenLayerBeaconOracle.sol) | - | [`0x3439...5442`](https://etherscan.io/address/0x343907185b71adf0eba9567538314396aa985442) | Provided by [Succinct](https://succinct.xyz/) | + +###### Multisigs + +| Name | Proxy | Implementation | Notes | +| -------- | -------- | -------- | -------- | +| [`PauserRegistry`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/0139d6213927c0a7812578899ddd3dda58051928/src/contracts/permissions/PauserRegistry.sol) | - | [`0x0c43...7060`](https://etherscan.io/address/0x0c431C66F4dE941d089625E5B423D00707977060) | | +| [`Pauser Multisig`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/GnosisSafe.sol) | [`0x5050389572f2d220ad927CcbeA0D406831012390`](https://etherscan.io/address/0x5050389572f2d220ad927CcbeA0D406831012390) | [`0xd9db...9552`](https://etherscan.io/address/0xd9db270c1b5e3bd161e8c8503c55ceabee709552) | Proxy: [`Gnosis@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/proxies/GnosisSafeProxy.sol) | +| [`Community Multisig`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/GnosisSafe.sol) | [`0xFEA47018D632A77bA579846c840d5706705Dc598`](https://etherscan.io/address/0xFEA47018D632A77bA579846c840d5706705Dc598) | [`0xd9db...9552`](https://etherscan.io/address/0xd9db270c1b5e3bd161e8c8503c55ceabee709552) | Proxy: [`Gnosis@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/proxies/GnosisSafeProxy.sol) | +| [`Executor Multisig`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/GnosisSafe.sol) | [`0x369e6F597e22EaB55fFb173C6d9cD234BD699111`](https://etherscan.io/address/0x369e6F597e22EaB55fFb173C6d9cD234BD699111) | [`0xd9db...9552`](https://etherscan.io/address/0xd9db270c1b5e3bd161e8c8503c55ceabee709552) | Proxy: [`Gnosis@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/proxies/GnosisSafeProxy.sol) | +| [`Operations Multisig`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/GnosisSafe.sol) | [`0xBE1685C81aA44FF9FB319dD389addd9374383e90`](https://etherscan.io/address/0xBE1685C81aA44FF9FB319dD389addd9374383e90) | [`0xd9db...9552`](https://etherscan.io/address/0xd9db270c1b5e3bd161e8c8503c55ceabee709552) | Proxy: [`Gnosis@1.3.0`](https://github.com/safe-global/safe-contracts/blob/v1.3.0/contracts/proxies/GnosisSafeProxy.sol) | +| [`Compound: Timelock`](https://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/Timelock.sol) | - | [`0xA6Db...0EAF`](https://etherscan.io/address/0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF) | | +| [`OZ: Proxy Admin`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/ProxyAdmin.sol) | - | [`0x8b95...2444`](https://etherscan.io/address/0x8b9566AdA63B64d1E1dcF1418b43fd1433b72444) | | + +--- ### Current Testnet Deployment The current testnet deployment is on holesky, and is from our M2 beta release. You can view the deployed contract addresses below, or check out the code itself on the [`testnet-holesky`](https://github.com/Layr-Labs/eigenlayer-contracts/tree/testnet-holesky) branch. -| Name | Solidity | Proxy | Implementation | Notes | -| -------- | -------- | -------- | -------- | -------- | -| StrategyManager | [`StrategyManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/StrategyManager.sol) | [`0xdfB5...D5b6`](https://holesky.etherscan.io/address/0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6) | [`0x59f7...3a18`](https://holesky.etherscan.io/address/0x59f766A603C53f3AC8Be43bBe158c1519b193a18) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: stETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x7D70...63d3`](https://holesky.etherscan.io/address/0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: rETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x3A8f...c4E0`](https://holesky.etherscan.io/address/0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Strategy: WETH | [`StrategyBaseTVLLimits`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x8052...FaF9`](https://holesky.etherscan.io/address/0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| EigenPodManager | [`EigenPodManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/EigenPodManager.sol) | [`0x3077...e315`](https://holesky.etherscan.io/address/0x30770d7E3e71112d7A6b7259542D1f680a70e315) | [`0x5265...4a7B`](https://holesky.etherscan.io/address/0x5265C162f7d5F3fE3175a78828ab16bf5E324a7B) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| EigenLayerBeaconOracle | [`succinctlabs/EigenLayerBeaconOracle.sol`](https://github.com/succinctlabs/eigenlayer-beacon-oracle/blob/main/contracts/src/EigenLayerBeaconOracle.sol) | - | [`0x4C11...8f25`](https://holesky.etherscan.io/address/0x4C116BB629bff7A8373c2378bBd919f8349B8f25) | | -| EigenPod (beacon) | [`EigenPod`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/EigenPod.sol) | [`0x7261...832D`](https://holesky.etherscan.io/address/0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D) | [`0xa6AF...bE18`](https://holesky.etherscan.io/address/0xa6AF55234A9A2B4d4A78d6952cf1Bb216857bE18) | - Beacon: [OpenZeppelin BeaconProxy@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/BeaconProxy.sol)
- Deployed pods use [UpgradableBeacon@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/UpgradeableBeacon.sol) | -| DelayedWithdrawalRouter | [`DelayedWithdrawalRouter`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/DelayedWithdrawalRouter.sol) | [`0x642c...FA32`](https://holesky.etherscan.io/address/0x642c646053eaf2254f088e9019ACD73d9AE0FA32) | [`0xcE8b...3407`](https://holesky.etherscan.io/address/0xcE8b8D99773a718423F8040a6e52c06a4ce63407) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| DelegationManager | [`DelegationManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/DelegationManager.sol) | [`0xA441...48e7`](https://holesky.etherscan.io/address/0xA44151489861Fe9e3055d95adC98FbD462B948e7) | [`0x83f8...0D76`](https://holesky.etherscan.io/address/0x83f8F8f0BB125F7870F6bfCf76853f874C330D76) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| AVSDirectory | [`AVSDirectory`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/AVSDirectory.sol) | [`0x0557...FeBf`](https://holesky.etherscan.io/address/0x055733000064333CaDDbC92763c58BF0192fFeBf) | [`0xEF5B...3e3a`](https://holesky.etherscan.io/address/0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| Slasher | [`Slasher`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/Slasher.sol) | [`0xcAe7...6e7C`](https://holesky.etherscan.io/address/0xcAe751b75833ef09627549868A04E32679386e7C) | [`0x9971...345A`](https://holesky.etherscan.io/address/0x99715D255E34a39bE9943b82F281CA734bcF345A) | Proxy: [OpenZeppelin TUP@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | -| PauserRegistry | [`PauserRegistry`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/permissions/PauserRegistry.sol) | - | [`0x85Ef...2F06`](https://holesky.etherscan.io/address/0x85Ef7299F8311B25642679edBF02B62FA2212F06) | | -| Timelock | [Compound: `Timelock.sol`](https://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/Timelock.sol) | - | [`0xcF19...0A7D`](https://holesky.etherscan.io/address/0xcF19CE0561052a7A7Ff21156730285997B350A7D) | | -| Proxy Admin | [OpenZeppelin ProxyAdmin@4.7.1](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/ProxyAdmin.sol) | - | [`0xDB02...A6cf`](https://holesky.etherscan.io/address/0xDB023566064246399b4AE851197a97729C93A6cf) | | +###### Core + +| Name | Proxy | Implementation | Notes | +| -------- | -------- | -------- | -------- | +| [`DelegationManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/DelegationManager.sol) | [`0xA44151489861Fe9e3055d95adC98FbD462B948e7`](https://holesky.etherscan.io/address/0xA44151489861Fe9e3055d95adC98FbD462B948e7) | [`0x83f8...0D76`](https://holesky.etherscan.io/address/0x83f8F8f0BB125F7870F6bfCf76853f874C330D76) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/StrategyManager.sol) | [`0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6`](https://holesky.etherscan.io/address/0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6) | [`0x59f7...3a18`](https://holesky.etherscan.io/address/0x59f766A603C53f3AC8Be43bBe158c1519b193a18) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`EigenPodManager`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/EigenPodManager.sol) | [`0x30770d7E3e71112d7A6b7259542D1f680a70e315`](https://holesky.etherscan.io/address/0x30770d7E3e71112d7A6b7259542D1f680a70e315) | [`0x5265...4a7B`](https://holesky.etherscan.io/address/0x5265C162f7d5F3fE3175a78828ab16bf5E324a7B) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`AVSDirectory`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/AVSDirectory.sol) | [`0x055733000064333CaDDbC92763c58BF0192fFeBf`](https://holesky.etherscan.io/address/0x055733000064333CaDDbC92763c58BF0192fFeBf) | [`0xEF5B...3e3a`](https://holesky.etherscan.io/address/0xEF5BA995Bc7722fd1e163edF8Dc09375de3d3e3a) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`Slasher`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/core/Slasher.sol) | [`0xcAe751b75833ef09627549868A04E32679386e7C`](https://holesky.etherscan.io/address/0xcAe751b75833ef09627549868A04E32679386e7C) | [`0x9971...345A`](https://holesky.etherscan.io/address/0x99715D255E34a39bE9943b82F281CA734bcF345A) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | + +###### Strategies + +| Name | Proxy | Implementation | Notes | +| -------- | -------- | -------- | -------- | +| [`StrategyBase (stETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3`](https://holesky.etherscan.io/address/0x7D704507b76571a51d9caE8AdDAbBFd0ba0e63d3) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (rETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0`](https://holesky.etherscan.io/address/0x3A8fBdf9e77DFc25d09741f51d3E181b25d0c4E0) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (WETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9`](https://holesky.etherscan.io/address/0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (lsETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x05037A81BD7B4C9E0F7B430f1F2A22c31a2FD943`](https://holesky.etherscan.io/address/0x05037A81BD7B4C9E0F7B430f1F2A22c31a2FD943) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (sfrxETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x9281ff96637710Cd9A5CAcce9c6FAD8C9F54631c`](https://holesky.etherscan.io/address/0x9281ff96637710Cd9A5CAcce9c6FAD8C9F54631c) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (ETHx)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x31B6F59e1627cEfC9fA174aD03859fC337666af7`](https://holesky.etherscan.io/address/0x31B6F59e1627cEfC9fA174aD03859fC337666af7) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (osETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x46281E3B7fDcACdBa44CADf069a94a588Fd4C6Ef`](https://holesky.etherscan.io/address/0x46281E3B7fDcACdBa44CADf069a94a588Fd4C6Ef) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (cbETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB6`](https://holesky.etherscan.io/address/0x70EB4D3c164a6B4A5f908D4FBb5a9cAfFb66bAB6) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (mETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0xaccc5A86732BE85b5012e8614AF237801636F8e5`](https://holesky.etherscan.io/address/0xaccc5A86732BE85b5012e8614AF237801636F8e5) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`StrategyBase (ankrETH)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/strategies/StrategyBaseTVLLimits.sol) | [`0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac`](https://holesky.etherscan.io/address/0x7673a47463F80c6a3553Db9E54c8cDcd5313d0ac) | [`0xFb83...3305`](https://holesky.etherscan.io/address/0xFb83e1D133D0157775eC4F19Ff81478Df1103305) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| `Beacon Chain ETH` | `0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0` | - | - Used for Beacon Chain ETH shares
- Not a real contract! | + +###### EigenPods + +| Name | Proxy | Implementation | Notes | +| -------- | -------- | -------- | -------- | +| [`EigenPod (beacon)`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/EigenPod.sol) | [`0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D`](https://holesky.etherscan.io/address/0x7261C2bd75a7ACE1762f6d7FAe8F63215581832D) | [`0xe98f...641c`](https://holesky.etherscan.io/address/0xe98f9298344527608A1BCC23907B8145F9Cb641c) | - Beacon: [`BeaconProxy`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/BeaconProxy.sol)
- Pods: [`UpgradeableBeacon`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/beacon/UpgradeableBeacon.sol) | +| [`DelayedWithdrawalRouter`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/pods/DelayedWithdrawalRouter.sol) | [`0x642c646053eaf2254f088e9019ACD73d9AE0FA32`](https://holesky.etherscan.io/address/0x642c646053eaf2254f088e9019ACD73d9AE0FA32) | [`0xcE8b...3407`](https://holesky.etherscan.io/address/0xcE8b8D99773a718423F8040a6e52c06a4ce63407) | Proxy: [`TUP@4.7.1`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/TransparentUpgradeableProxy.sol) | +| [`EigenLayerBeaconOracle`](https://github.com/succinctlabs/eigenlayer-beacon-oracle/blob/main/contracts/src/EigenLayerBeaconOracle.sol) | - | [`0x4C11...8f25`](https://holesky.etherscan.io/address/0x4C116BB629bff7A8373c2378bBd919f8349B8f25) | Provided by [Succinct](https://succinct.xyz/) | + +###### Multisigs + +| Name | Proxy | Implementation | Notes | +| -------- | -------- | -------- | -------- | +| [`PauserRegistry`](https://github.com/Layr-Labs/eigenlayer-contracts/blob/testnet-holesky/src/contracts/permissions/PauserRegistry.sol) | - | [`0x85Ef...2F06`](https://holesky.etherscan.io/address/0x85Ef7299F8311B25642679edBF02B62FA2212F06) | | +| [`Compound: Timelock`](https://github.com/compound-finance/compound-protocol/blob/a3214f67b73310d547e00fc578e8355911c9d376/contracts/Timelock.sol) | - | [`0xcF19...0A7D`](https://holesky.etherscan.io/address/0xcF19CE0561052a7A7Ff21156730285997B350A7D) | | +| [`OZ: Proxy Admin`](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.7.1/contracts/proxy/transparent/ProxyAdmin.sol) | - | [`0xDB02...A6cf`](https://holesky.etherscan.io/address/0xDB023566064246399b4AE851197a97729C93A6cf) | | diff --git a/certora/harnesses/DelegationManagerHarness.sol b/certora/harnesses/DelegationManagerHarness.sol index 9f01df08c..9f2366ee6 100644 --- a/certora/harnesses/DelegationManagerHarness.sol +++ b/certora/harnesses/DelegationManagerHarness.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../src/contracts/core/DelegationManager.sol"; @@ -25,4 +25,4 @@ contract DelegationManagerHarness is DelegationManager { return strategyManager.stakerStrategyShares(staker, strategy); } } -} \ No newline at end of file +} diff --git a/certora/harnesses/EigenPodHarness.sol b/certora/harnesses/EigenPodHarness.sol index 720a8b4aa..0462b9e1a 100644 --- a/certora/harnesses/EigenPodHarness.sol +++ b/certora/harnesses/EigenPodHarness.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../src/contracts/pods/EigenPod.sol"; @@ -37,4 +37,4 @@ contract EigenPodHarness is EigenPod { function get_ETH_Balance() public view returns (uint256) { return address(this).balance; } -} \ No newline at end of file +} diff --git a/certora/harnesses/EigenPodManagerHarness.sol b/certora/harnesses/EigenPodManagerHarness.sol index a09ae9b92..84576ec9f 100644 --- a/certora/harnesses/EigenPodManagerHarness.sol +++ b/certora/harnesses/EigenPodManagerHarness.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../src/contracts/pods/EigenPodManager.sol"; @@ -21,4 +21,4 @@ contract EigenPodManagerHarness is EigenPodManager { function get_podByOwner(address podOwner) public view returns (IEigenPod) { return ownerToPod[podOwner]; } -} \ No newline at end of file +} diff --git a/certora/harnesses/PausableHarness.sol b/certora/harnesses/PausableHarness.sol index a631315ec..fc0095ebe 100644 --- a/certora/harnesses/PausableHarness.sol +++ b/certora/harnesses/PausableHarness.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../src/contracts/permissions/Pausable.sol"; @@ -21,4 +21,4 @@ contract PausableHarness is Pausable { function bitwise_and(uint256 input_1, uint256 input_2) external pure returns (uint256) { return (input_1 & input_2); } -} \ No newline at end of file +} diff --git a/certora/harnesses/SlasherHarness.sol b/certora/harnesses/SlasherHarness.sol index a7c1a461e..519895780 100644 --- a/certora/harnesses/SlasherHarness.sol +++ b/certora/harnesses/SlasherHarness.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../src/contracts/core/Slasher.sol"; @@ -82,4 +82,4 @@ contract SlasherHarness is Slasher { // get_linked_list_entry(operator, get_previous_node(operator, node), true) == node && get_linked_list_entry(operator, get_next_node(operator, node), false) == node // ); // } -} \ No newline at end of file +} diff --git a/certora/harnesses/StrategyManagerHarness.sol b/certora/harnesses/StrategyManagerHarness.sol index 50274b47d..441037032 100644 --- a/certora/harnesses/StrategyManagerHarness.sol +++ b/certora/harnesses/StrategyManagerHarness.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../src/contracts/core/StrategyManager.sol"; @@ -55,4 +55,4 @@ contract StrategyManagerHarness is StrategyManager { function get_stakerStrategyShares(address staker, IStrategy strategy) public view returns (uint256) { return stakerStrategyShares[staker][strategy]; } -} \ No newline at end of file +} diff --git a/docs/README.md b/docs/README.md index 5854dbcf9..d6791a119 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,8 +2,6 @@ ## EigenLayer M2 Docs -**EigenLayer M2** extends the functionality of EigenLayer M1 (which is live on mainnet). M2 is currently on the Goerli testnet, and will eventually be released on mainnet. - This repo contains the EigenLayer core contracts, which enable restaking of liquid staking tokens (LSTs) and beacon chain ETH to secure new services, called AVSs (actively validated services). For more info on AVSs, check out the EigenLayer middleware contracts [here][middleware-repo]. This document provides an overview of system components, contracts, and user roles. Further documentation on the major system contracts can be found in [/core](./core/). diff --git a/docs/core/AVSDirectory.md b/docs/core/AVSDirectory.md index e025345b5..c135d2653 100644 --- a/docs/core/AVSDirectory.md +++ b/docs/core/AVSDirectory.md @@ -4,7 +4,7 @@ | File | Type | Proxy | | -------- | -------- | -------- | -| [`AVSDirectory.sol`](../src/contracts/core/AVSDirectory.sol) | Singleton | Transparent proxy | +| [`AVSDirectory.sol`](../../src/contracts/core/AVSDirectory.sol) | Singleton | Transparent proxy | The `AVSDirectory` handles interactions between AVSs and the EigenLayer core contracts. Once registered as an Operator in EigenLayer core (via the `DelegationManager`), Operators can register with one or more AVSs (via the AVS's contracts) to begin providing services to them offchain. As a part of registering with an AVS, the AVS will record this registration in the core contracts by calling into the `AVSDirectory`. diff --git a/docs/core/DelegationManager.md b/docs/core/DelegationManager.md index 28c18547f..54c4d312b 100644 --- a/docs/core/DelegationManager.md +++ b/docs/core/DelegationManager.md @@ -73,7 +73,7 @@ Registers the caller as an Operator in EigenLayer. The new Operator provides the * Sets `OperatorDetails` for the Operator in question * Delegates the Operator to itself * If the Operator has shares in the `EigenPodManager`, the `DelegationManager` adds these shares to the Operator's shares for the beacon chain ETH strategy. -* For each of the three strategies in the `StrategyManager`, if the Operator holds shares in that strategy they are added to the Operator's shares under the corresponding strategy. +* For each of the strategies in the `StrategyManager`, if the Operator holds shares in that strategy they are added to the Operator's shares under the corresponding strategy. *Requirements*: * Caller MUST NOT already be an Operator @@ -132,7 +132,7 @@ Allows the caller (a Staker) to delegate their shares to an Operator. Delegation *Effects*: * Records the Staker as being delegated to the Operator * If the Staker has shares in the `EigenPodManager`, the `DelegationManager` adds these shares to the Operator's shares for the beacon chain ETH strategy. -* For each of the three strategies in the `StrategyManager`, if the Staker holds shares in that strategy they are added to the Operator's shares under the corresponding strategy. +* For each of the strategies in the `StrategyManager`, if the Staker holds shares in that strategy they are added to the Operator's shares under the corresponding strategy. *Requirements*: * Pause status MUST NOT be set: `PAUSED_NEW_DELEGATION` diff --git a/docs/core/StrategyManager.md b/docs/core/StrategyManager.md index a6fdb4cbd..2b9f8aee1 100644 --- a/docs/core/StrategyManager.md +++ b/docs/core/StrategyManager.md @@ -7,7 +7,7 @@ The primary function of the `StrategyManager` is to handle accounting for individual Stakers as they deposit and withdraw LSTs from their corresponding strategies. It is responsible for (i) allowing Stakers to deposit LSTs into the corresponding strategy, (ii) allowing the `DelegationManager` to remove shares when a Staker queues a withdrawal, and (iii) allowing the `DelegationManager` to complete a withdrawal by either adding shares back to the Staker or withdrawing the shares as tokens via the corresponding strategy. -As of M2, three LSTs are supported and each has its own instance of `StrategyBaseTVLLimits`: cbETH, rETH, and stETH. Each `StrategyBaseTVLLimits` has two main functions (`deposit` and `withdraw`), both of which can only be called by the `StrategyManager`. These `StrategyBaseTVLLimits` contracts are fairly simple deposit/withdraw contracts that hold tokens deposited by Stakers. Because these strategies are essentially extensions of the `StrategyManager`, their functions are documented in this file (see below). +As of M2, several LSTs are supported and each has its own instance of `StrategyBaseTVLLimits`. Each `StrategyBaseTVLLimits` has two main functions (`deposit` and `withdraw`), both of which can only be called by the `StrategyManager`. These `StrategyBaseTVLLimits` contracts are fairly simple deposit/withdraw contracts that hold tokens deposited by Stakers. Because these strategies are essentially extensions of the `StrategyManager`, their functions are documented in this file (see below). #### High-level Concepts @@ -59,7 +59,7 @@ function depositIntoStrategy( returns (uint256 shares) ``` -Allows a Staker to deposit some `amount` of `token` into the specified `strategy` in exchange for shares of that strategy. The underlying `strategy` must be one of the three whitelisted `StrategyBaseTVLLimits` instances, and the `token` being deposited must correspond to that `strategy's` underlying token (cbETH, rETH, or stETH). +Allows a Staker to deposit some `amount` of `token` into the specified `strategy` in exchange for shares of that strategy. The underlying `strategy` must be one of the whitelisted `StrategyBaseTVLLimits` instances, and the `token` being deposited must correspond to that `strategy's` underlying token (cbETH, rETH, or stETH). The number of shares received is calculated by the `strategy` using an internal exchange rate that depends on the previous number of tokens deposited. diff --git a/foundry.toml b/foundry.toml index 918e190dd..8a79acefa 100644 --- a/foundry.toml +++ b/foundry.toml @@ -31,4 +31,7 @@ number_underscore = "thousands" quote_style = "double" tab_width = 4 -# See more config options https://github.com/gakonst/foundry/tree/master/config \ No newline at end of file +# See more config options https://github.com/gakonst/foundry/tree/master/config + +[profile.forktest.fuzz] +runs=20 \ No newline at end of file diff --git a/script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol b/script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol new file mode 100644 index 000000000..8384613db --- /dev/null +++ b/script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.12; + +import "../../utils/ExistingDeploymentParser.sol"; +import "../../utils/TimelockEncoding.sol"; + +// forge script script/admin/mainnet/Mainnet_Unpause_Deposits.s.sol:Mainnet_Unpause_Deposits --fork-url $RPC_MAINNET -vvvv +contract Mainnet_Unpause_Deposits is ExistingDeploymentParser, TimelockEncoding { + Vm cheats = Vm(HEVM_ADDRESS); + + // Tues Apr 16 2024 12:00:00 GMT-0700 (Pacific Daylight Time) + uint256 timelockEta = 1713250800; + + function run() external virtual { + _parseDeployedContracts("script/output/mainnet/M1_deployment_mainnet_2023_6_9.json"); + + bytes memory final_calldata_to_executor_multisig = encodeForExecutor({ + // call to executor will be from the timelock + from: timelock, + // performing single pause operation + to: address(strategyManager), + // value to send in tx + value: 0, + // calldata for the operation + data: abi.encodeWithSelector(Pausable.unpause.selector, 0), + // operation type (for performing single operation) + operation: ISafe.Operation.Call + }); + + (bytes memory calldata_to_timelock_queuing_action, bytes memory calldata_to_timelock_executing_action) = encodeForTimelock({ + // address to be called from the timelock + to: executorMultisig, + // value to send in tx + value: 0, + // calldata for the operation + data: final_calldata_to_executor_multisig, + // time at which the tx will become executable + timelockEta: timelockEta + }); + + bytes32 expectedTxHash = getTxHash({ + target: executorMultisig, + _value: 0, + _data: final_calldata_to_executor_multisig, + eta: timelockEta + }); + emit log_named_bytes32("expectedTxHash", expectedTxHash); + + cheats.prank(operationsMultisig); + (bool success, ) = timelock.call(calldata_to_timelock_queuing_action); + require(success, "call to timelock queuing action failed"); + + require(ITimelock(timelock).queuedTransactions(expectedTxHash), "expectedTxHash not queued"); + + // test performing the upgrade + cheats.warp(timelockEta); + cheats.prank(operationsMultisig); + (success, ) = timelock.call(calldata_to_timelock_executing_action); + require(success, "call to timelock executing action failed"); + + // Check correctness after upgrade + require(strategyManager.paused() == 0, "unpausing was not completed correctly"); + } + + function getTxHash(address target, uint256 _value, bytes memory _data, uint256 eta) public pure returns (bytes32) { + // empty bytes + bytes memory signature; + bytes32 txHash = keccak256(abi.encode(target, _value, signature, _data, eta)); + return txHash; + } +} \ No newline at end of file diff --git a/script/configs/devnet/M2_deploy_from_scratch.anvil.config.json b/script/configs/devnet/M2_deploy_from_scratch.anvil.config.json index 2b2b7adbd..0c7961427 100644 --- a/script/configs/devnet/M2_deploy_from_scratch.anvil.config.json +++ b/script/configs/devnet/M2_deploy_from_scratch.anvil.config.json @@ -15,7 +15,6 @@ "MAX_RESTAKED_BALANCE_GWEI_PER_VALIDATOR": "32000000000" }, "eigenPodManager": { - "max_pods": 0, "init_paused_status": 30 }, "delayedWithdrawalRouter": { diff --git a/script/deploy/M2_Deploy_From_Scratch.s.sol b/script/deploy/devnet/M2_Deploy_From_Scratch.s.sol similarity index 95% rename from script/deploy/M2_Deploy_From_Scratch.s.sol rename to script/deploy/devnet/M2_Deploy_From_Scratch.s.sol index 1eea0af3d..7d20193e0 100644 --- a/script/deploy/M2_Deploy_From_Scratch.s.sol +++ b/script/deploy/devnet/M2_Deploy_From_Scratch.s.sol @@ -1,29 +1,29 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; -import "../../src/contracts/interfaces/IETHPOSDeposit.sol"; -import "../../src/contracts/interfaces/IBeaconChainOracle.sol"; +import "../../../src/contracts/interfaces/IETHPOSDeposit.sol"; +import "../../../src/contracts/interfaces/IBeaconChainOracle.sol"; -import "../../src/contracts/core/StrategyManager.sol"; -import "../../src/contracts/core/Slasher.sol"; -import "../../src/contracts/core/DelegationManager.sol"; -import "../../src/contracts/core/AVSDirectory.sol"; +import "../../../src/contracts/core/StrategyManager.sol"; +import "../../../src/contracts/core/Slasher.sol"; +import "../../../src/contracts/core/DelegationManager.sol"; +import "../../../src/contracts/core/AVSDirectory.sol"; -import "../../src/contracts/strategies/StrategyBaseTVLLimits.sol"; +import "../../../src/contracts/strategies/StrategyBaseTVLLimits.sol"; -import "../../src/contracts/pods/EigenPod.sol"; -import "../../src/contracts/pods/EigenPodManager.sol"; -import "../../src/contracts/pods/DelayedWithdrawalRouter.sol"; +import "../../../src/contracts/pods/EigenPod.sol"; +import "../../../src/contracts/pods/EigenPodManager.sol"; +import "../../../src/contracts/pods/DelayedWithdrawalRouter.sol"; -import "../../src/contracts/permissions/PauserRegistry.sol"; +import "../../../src/contracts/permissions/PauserRegistry.sol"; -import "../../src/test/mocks/EmptyContract.sol"; -import "../../src/test/mocks/ETHDepositMock.sol"; +import "../../../src/test/mocks/EmptyContract.sol"; +import "../../../src/test/mocks/ETHDepositMock.sol"; import "forge-std/Script.sol"; import "forge-std/Test.sol"; @@ -87,20 +87,19 @@ contract Deployer_M2 is Script, Test { uint256 DELEGATION_INIT_PAUSED_STATUS; uint256 DELEGATION_WITHDRAWAL_DELAY_BLOCKS; uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS; - uint256 EIGENPOD_MANAGER_MAX_PODS; uint256 DELAYED_WITHDRAWAL_ROUTER_INIT_PAUSED_STATUS; // one week in blocks -- 50400 uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS; uint32 DELAYED_WITHDRAWAL_ROUTER_INIT_WITHDRAWAL_DELAY_BLOCKS; - function run(string memory configFile) external { + function run(string memory configFileName) external { // read and log the chainID uint256 chainId = block.chainid; emit log_named_uint("You are deploying on ChainID", chainId); // READ JSON CONFIG DATA - deployConfigPath = string(bytes(string.concat("script/testing/", configFile))); + deployConfigPath = string(bytes(string.concat("script/configs/devnet/", configFileName))); string memory config_data = vm.readFile(deployConfigPath); // bytes memory parsedData = vm.parseJson(config_data); @@ -108,7 +107,6 @@ contract Deployer_M2 is Script, Test { SLASHER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".slasher.init_paused_status"); DELEGATION_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".delegation.init_paused_status"); DELEGATION_WITHDRAWAL_DELAY_BLOCKS = stdJson.readUint(config_data, ".delegation.init_withdrawal_delay_blocks"); - EIGENPOD_MANAGER_MAX_PODS = stdJson.readUint(config_data, ".eigenPodManager.max_pods"); EIGENPOD_MANAGER_INIT_PAUSED_STATUS = stdJson.readUint(config_data, ".eigenPodManager.init_paused_status"); DELAYED_WITHDRAWAL_ROUTER_INIT_PAUSED_STATUS = stdJson.readUint( config_data, @@ -258,7 +256,6 @@ contract Deployer_M2 is Script, Test { address(eigenPodManagerImplementation), abi.encodeWithSelector( EigenPodManager.initialize.selector, - EIGENPOD_MANAGER_MAX_PODS, IBeaconChainOracle(address(0)), executorMultisig, eigenLayerPauserReg, @@ -392,7 +389,7 @@ contract Deployer_M2 is Script, Test { string memory finalJson = vm.serializeString(parent_object, parameters, parameters_output); // TODO: should output to different file depending on configFile passed to run() // so that we don't override mainnet output by deploying to goerli for eg. - vm.writeJson(finalJson, "script/output/M2_from_scratch_deployment_data.json"); + vm.writeJson(finalJson, "script/output/devnet/M2_from_scratch_deployment_data.json"); } function _verifyContractsPointAtOneAnother( @@ -495,7 +492,7 @@ contract Deployer_M2 is Script, Test { require(delegation.owner() == executorMultisig, "delegation: owner not set correctly"); // removing slasher requirements because there is no slasher as part of m2-mainnet release // require(slasher.owner() == executorMultisig, "slasher: owner not set correctly"); - require(eigenPodManager.owner() == executorMultisig, "delegation: owner not set correctly"); + require(eigenPodManager.owner() == executorMultisig, "eigenPodManager: owner not set correctly"); require(eigenLayerProxyAdmin.owner() == executorMultisig, "eigenLayerProxyAdmin: owner not set correctly"); require(eigenPodBeacon.owner() == executorMultisig, "eigenPodBeacon: owner not set correctly"); diff --git a/script/deploy/goerli/GoerliUpgrade1.s.sol b/script/deploy/goerli/GoerliUpgrade1.s.sol index d5d351c69..45e1258b5 100644 --- a/script/deploy/goerli/GoerliUpgrade1.s.sol +++ b/script/deploy/goerli/GoerliUpgrade1.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; @@ -87,4 +87,4 @@ contract GoerliUpgrade1 is Script, Test { // SlasherImplementation: 0x2f82092969d156da92f0b787525042735fc4774a // EigenPodImplementation: 0x4dd49853a27e3d4a0557876fe225ffce9b6b5d7a } -} \ No newline at end of file +} diff --git a/script/deploy/goerli/GoerliUpgrade2.s.sol b/script/deploy/goerli/GoerliUpgrade2.s.sol index edd98d05b..d643634f1 100644 --- a/script/deploy/goerli/GoerliUpgrade2.s.sol +++ b/script/deploy/goerli/GoerliUpgrade2.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../../src/contracts/interfaces/IETHPOSDeposit.sol"; @@ -126,4 +126,4 @@ contract GoerliUpgrade2 is Script, Test { EigenPodManagerImplementation: 0xDA9B60D3dC7adD40C0e35c628561Ff71C13a189f */ } -} \ No newline at end of file +} diff --git a/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol b/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol index 0105406fc..7d66ec162 100644 --- a/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol +++ b/script/deploy/holesky/M2_Deploy_From_Scratch.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../utils/ExistingDeploymentParser.sol"; diff --git a/script/deploy/holesky/M2_Deploy_Preprod.s.sol b/script/deploy/holesky/M2_Deploy_Preprod.s.sol index be27f3809..d58059955 100644 --- a/script/deploy/holesky/M2_Deploy_Preprod.s.sol +++ b/script/deploy/holesky/M2_Deploy_Preprod.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "./M2_Deploy_From_Scratch.s.sol"; diff --git a/script/deploy/mainnet/M1_Deploy.s.sol b/script/deploy/mainnet/M1_Deploy.s.sol index 09548c3d7..48a7db712 100644 --- a/script/deploy/mainnet/M1_Deploy.s.sol +++ b/script/deploy/mainnet/M1_Deploy.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; diff --git a/script/deploy/mainnet/M2Deploy.s.sol b/script/deploy/mainnet/M2Deploy.s.sol index a39eeb544..68f45520b 100644 --- a/script/deploy/mainnet/M2Deploy.s.sol +++ b/script/deploy/mainnet/M2Deploy.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; diff --git a/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol b/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol index 227e37125..daa042db5 100644 --- a/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol +++ b/script/deploy/mainnet/M2_Mainnet_Upgrade.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../utils/ExistingDeploymentParser.sol"; import "../../utils/TimelockEncoding.sol"; diff --git a/script/output/mainnet/M1_deployment_mainnet_2023_6_9.json b/script/output/mainnet/M1_deployment_mainnet_2023_6_9.json index 9482010cb..85916bdb1 100644 --- a/script/output/mainnet/M1_deployment_mainnet_2023_6_9.json +++ b/script/output/mainnet/M1_deployment_mainnet_2023_6_9.json @@ -35,5 +35,6 @@ "operationsMultisig": "0xBE1685C81aA44FF9FB319dD389addd9374383e90", "pauserMultisig": "0x5050389572f2d220ad927CcbeA0D406831012390", "timelock": "0xA6Db1A8C5a981d1536266D2a393c5F8dDb210EAF" - } + }, + "numStrategies": 0 } \ No newline at end of file diff --git a/script/utils/ExistingDeploymentParser.sol b/script/utils/ExistingDeploymentParser.sol index f8fbd5c50..48ff563f3 100644 --- a/script/utils/ExistingDeploymentParser.sol +++ b/script/utils/ExistingDeploymentParser.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; diff --git a/script/utils/TimelockEncoding.sol b/script/utils/TimelockEncoding.sol index f2a6c12e5..cbb0c8da3 100644 --- a/script/utils/TimelockEncoding.sol +++ b/script/utils/TimelockEncoding.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Script.sol"; import "forge-std/Test.sol"; diff --git a/script/whitelist/Staker.sol b/script/whitelist/Staker.sol index 026f9a891..f353610ce 100644 --- a/script/whitelist/Staker.sol +++ b/script/whitelist/Staker.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../src/contracts/interfaces/IStrategyManager.sol"; import "../../src/contracts/interfaces/IStrategy.sol"; @@ -48,4 +48,4 @@ contract Staker is Ownable { } -} \ No newline at end of file +} diff --git a/script/whitelist/delegationFaucet/DelegationFaucet.sol b/script/whitelist/delegationFaucet/DelegationFaucet.sol index fa51c65b9..327e8e678 100644 --- a/script/whitelist/delegationFaucet/DelegationFaucet.sol +++ b/script/whitelist/delegationFaucet/DelegationFaucet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/contracts/interfaces/IStrategyManager.sol"; import "src/contracts/interfaces/IStrategy.sol"; diff --git a/script/whitelist/delegationFaucet/DelegationFaucetStaker.sol b/script/whitelist/delegationFaucet/DelegationFaucetStaker.sol index e5e36e600..fac0e543c 100644 --- a/script/whitelist/delegationFaucet/DelegationFaucetStaker.sol +++ b/script/whitelist/delegationFaucet/DelegationFaucetStaker.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/contracts/interfaces/IStrategyManager.sol"; diff --git a/script/whitelist/delegationFaucet/DeployDelegationFaucet.sol b/script/whitelist/delegationFaucet/DeployDelegationFaucet.sol index ace53fa21..db458e99d 100644 --- a/script/whitelist/delegationFaucet/DeployDelegationFaucet.sol +++ b/script/whitelist/delegationFaucet/DeployDelegationFaucet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/contracts/interfaces/IDelegationManager.sol"; import "src/contracts/interfaces/IStrategyManager.sol"; diff --git a/src/contracts/core/AVSDirectory.sol b/src/contracts/core/AVSDirectory.sol index 0391aac6b..57844689f 100644 --- a/src/contracts/core/AVSDirectory.sol +++ b/src/contracts/core/AVSDirectory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; @@ -180,4 +180,4 @@ contract AVSDirectory is function _calculateDomainSeparator() internal view returns (bytes32) { return keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes("EigenLayer")), block.chainid, address(this))); } -} \ No newline at end of file +} diff --git a/src/contracts/core/AVSDirectoryStorage.sol b/src/contracts/core/AVSDirectoryStorage.sol index ec536f76b..993025c15 100644 --- a/src/contracts/core/AVSDirectoryStorage.sol +++ b/src/contracts/core/AVSDirectoryStorage.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../interfaces/IAVSDirectory.sol"; import "../interfaces/IStrategyManager.sol"; diff --git a/src/contracts/core/DelegationManager.sol b/src/contracts/core/DelegationManager.sol index 6a54bb3d2..ac14e6879 100644 --- a/src/contracts/core/DelegationManager.sol +++ b/src/contracts/core/DelegationManager.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; diff --git a/src/contracts/core/DelegationManagerStorage.sol b/src/contracts/core/DelegationManagerStorage.sol index cea995b3d..8a86af6d3 100644 --- a/src/contracts/core/DelegationManagerStorage.sol +++ b/src/contracts/core/DelegationManagerStorage.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../interfaces/IStrategyManager.sol"; import "../interfaces/IDelegationManager.sol"; diff --git a/src/contracts/core/Slasher.sol b/src/contracts/core/Slasher.sol index b4ad83dd7..359383e84 100644 --- a/src/contracts/core/Slasher.sol +++ b/src/contracts/core/Slasher.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../interfaces/ISlasher.sol"; import "../interfaces/IDelegationManager.sol"; @@ -99,4 +99,4 @@ contract Slasher is Initializable, OwnableUpgradeable, ISlasher, Pausable { address ) external view returns (MiddlewareDetails memory) {} -} \ No newline at end of file +} diff --git a/src/contracts/core/StrategyManager.sol b/src/contracts/core/StrategyManager.sol index b0ec52d25..05db17560 100644 --- a/src/contracts/core/StrategyManager.sol +++ b/src/contracts/core/StrategyManager.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; diff --git a/src/contracts/core/StrategyManagerStorage.sol b/src/contracts/core/StrategyManagerStorage.sol index 568e6770b..b6c92a557 100644 --- a/src/contracts/core/StrategyManagerStorage.sol +++ b/src/contracts/core/StrategyManagerStorage.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../interfaces/IStrategyManager.sol"; import "../interfaces/IStrategy.sol"; diff --git a/src/contracts/interfaces/IPaymentCoordinator.sol b/src/contracts/interfaces/IPaymentCoordinator.sol index d1bdd1ac8..395b39b36 100644 --- a/src/contracts/interfaces/IPaymentCoordinator.sol +++ b/src/contracts/interfaces/IPaymentCoordinator.sol @@ -82,6 +82,7 @@ interface IPaymentCoordinator { * @param earnerTokenRoot The merkle root of the earner's token subtree * Each leaf in the earner's token subtree is a TokenTreeMerkleLeaf */ + struct EarnerTreeMerkleLeaf { address earner; bytes32 earnerTokenRoot; diff --git a/src/contracts/interfaces/ISocketUpdater.sol b/src/contracts/interfaces/ISocketUpdater.sol index 7c3de7a21..8f28465e1 100644 --- a/src/contracts/interfaces/ISocketUpdater.sol +++ b/src/contracts/interfaces/ISocketUpdater.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; /** * @title Interface for an `ISocketUpdater` where operators can update their sockets. diff --git a/src/contracts/libraries/EIP1271SignatureUtils.sol b/src/contracts/libraries/EIP1271SignatureUtils.sol index 173827b20..a4452f91e 100644 --- a/src/contracts/libraries/EIP1271SignatureUtils.sol +++ b/src/contracts/libraries/EIP1271SignatureUtils.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/interfaces/IERC1271.sol"; import "@openzeppelin/contracts/utils/Address.sol"; diff --git a/src/contracts/libraries/StructuredLinkedList.sol b/src/contracts/libraries/StructuredLinkedList.sol index 744e2d6c5..29410656f 100644 --- a/src/contracts/libraries/StructuredLinkedList.sol +++ b/src/contracts/libraries/StructuredLinkedList.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.12; +pragma solidity ^0.8.12; /** * @title StructuredLinkedList diff --git a/src/contracts/permissions/Pausable.sol b/src/contracts/permissions/Pausable.sol index 3c5b9b9b3..76996420b 100644 --- a/src/contracts/permissions/Pausable.sol +++ b/src/contracts/permissions/Pausable.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../interfaces/IPausable.sol"; diff --git a/src/contracts/permissions/PauserRegistry.sol b/src/contracts/permissions/PauserRegistry.sol index 57376f23c..1058784ec 100644 --- a/src/contracts/permissions/PauserRegistry.sol +++ b/src/contracts/permissions/PauserRegistry.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../interfaces/IPauserRegistry.sol"; diff --git a/src/contracts/pods/DelayedWithdrawalRouter.sol b/src/contracts/pods/DelayedWithdrawalRouter.sol index 9de2eb093..9e57cfa45 100644 --- a/src/contracts/pods/DelayedWithdrawalRouter.sol +++ b/src/contracts/pods/DelayedWithdrawalRouter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; diff --git a/src/contracts/pods/EigenPod.sol b/src/contracts/pods/EigenPod.sol index 780bce5c6..2532b9381 100644 --- a/src/contracts/pods/EigenPod.sol +++ b/src/contracts/pods/EigenPod.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; diff --git a/src/contracts/pods/EigenPodManager.sol b/src/contracts/pods/EigenPodManager.sol index ce42de544..f28f9fc7b 100644 --- a/src/contracts/pods/EigenPodManager.sol +++ b/src/contracts/pods/EigenPodManager.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/utils/Create2.sol"; import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; @@ -336,4 +336,4 @@ contract EigenPodManager is return timestamp; } } -} \ No newline at end of file +} diff --git a/src/contracts/pods/EigenPodManagerStorage.sol b/src/contracts/pods/EigenPodManagerStorage.sol index f637f060e..39c98f2c2 100644 --- a/src/contracts/pods/EigenPodManagerStorage.sol +++ b/src/contracts/pods/EigenPodManagerStorage.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/proxy/beacon/IBeacon.sol"; diff --git a/src/contracts/pods/EigenPodPausingConstants.sol b/src/contracts/pods/EigenPodPausingConstants.sol index 60a8a71e1..f7eca3ece 100644 --- a/src/contracts/pods/EigenPodPausingConstants.sol +++ b/src/contracts/pods/EigenPodPausingConstants.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; /** * @title Constants shared between 'EigenPod' and 'EigenPodManager' contracts. diff --git a/src/contracts/strategies/StrategyBase.sol b/src/contracts/strategies/StrategyBase.sol index cf31a30f8..1e159ab7d 100644 --- a/src/contracts/strategies/StrategyBase.sol +++ b/src/contracts/strategies/StrategyBase.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../interfaces/IStrategyManager.sol"; import "../permissions/Pausable.sol"; diff --git a/src/contracts/strategies/StrategyBaseTVLLimits.sol b/src/contracts/strategies/StrategyBaseTVLLimits.sol index a395bf081..63b76ff45 100644 --- a/src/contracts/strategies/StrategyBaseTVLLimits.sol +++ b/src/contracts/strategies/StrategyBaseTVLLimits.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "./StrategyBase.sol"; diff --git a/src/contracts/utils/UpgradeableSignatureCheckingUtils.sol b/src/contracts/utils/UpgradeableSignatureCheckingUtils.sol index 761ffe282..b9b899e53 100644 --- a/src/contracts/utils/UpgradeableSignatureCheckingUtils.sol +++ b/src/contracts/utils/UpgradeableSignatureCheckingUtils.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; import "../libraries/EIP1271SignatureUtils.sol"; diff --git a/src/test/Delegation.t.sol b/src/test/Delegation.t.sol index cb3f51960..b92343100 100644 --- a/src/test/Delegation.t.sol +++ b/src/test/Delegation.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/mocks/ERC1271WalletMock.sol"; import "src/contracts/interfaces/ISignatureUtils.sol"; diff --git a/src/test/DelegationFaucet.t.sol b/src/test/DelegationFaucet.t.sol index 3bd26ef80..e3f04fa75 100644 --- a/src/test/DelegationFaucet.t.sol +++ b/src/test/DelegationFaucet.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "script/whitelist/delegationFaucet/DelegationFaucet.sol"; import "script/whitelist/ERC20PresetMinterPauser.sol"; diff --git a/src/test/DepositWithdraw.t.sol b/src/test/DepositWithdraw.t.sol index dea978d8d..50fb7b8d3 100644 --- a/src/test/DepositWithdraw.t.sol +++ b/src/test/DepositWithdraw.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "./EigenLayerTestHelper.t.sol"; import "../contracts/core/StrategyManagerStorage.sol"; diff --git a/src/test/EigenLayerDeployer.t.sol b/src/test/EigenLayerDeployer.t.sol index 8b5ada2a8..5912edb24 100644 --- a/src/test/EigenLayerDeployer.t.sol +++ b/src/test/EigenLayerDeployer.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; diff --git a/src/test/EigenLayerTestHelper.t.sol b/src/test/EigenLayerTestHelper.t.sol index 6f99dc6bb..5bc429611 100644 --- a/src/test/EigenLayerTestHelper.t.sol +++ b/src/test/EigenLayerTestHelper.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../test/EigenLayerDeployer.t.sol"; import "../contracts/interfaces/ISignatureUtils.sol"; diff --git a/src/test/EigenPod.t.sol b/src/test/EigenPod.t.sol index 5e5f78bcb..eb703d088 100644 --- a/src/test/EigenPod.t.sol +++ b/src/test/EigenPod.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../contracts/interfaces/IEigenPod.sol"; import "../contracts/pods/DelayedWithdrawalRouter.sol"; @@ -1873,4 +1873,4 @@ contract Relayer is Test { // cheats.expectRevert(bytes("EigenPod.verifyAndProcessWithdrawals: inputs must be same length")); // pod.verifyAndProcessWithdrawals(0, stateRootProofStruct, withdrawalProofsArray, validatorFieldsProofArray, validatorFieldsArray, withdrawalFieldsArray); - // } \ No newline at end of file + // } diff --git a/src/test/Pausable.t.sol b/src/test/Pausable.t.sol index 8ab03ada5..2aea7a996 100644 --- a/src/test/Pausable.t.sol +++ b/src/test/Pausable.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "./EigenLayerTestHelper.t.sol"; diff --git a/src/test/Strategy.t.sol b/src/test/Strategy.t.sol index 2a776cdea..3139e92a2 100644 --- a/src/test/Strategy.t.sol +++ b/src/test/Strategy.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "./EigenLayerTestHelper.t.sol"; import "../contracts/core/StrategyManagerStorage.sol"; diff --git a/src/test/WithdrawalMigration.t.sol b/src/test/WithdrawalMigration.t.sol index beac35874..500031031 100644 --- a/src/test/WithdrawalMigration.t.sol +++ b/src/test/WithdrawalMigration.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../test/EigenLayerTestHelper.t.sol"; import "src/test/utils/Utils.sol"; diff --git a/src/test/Withdrawals.t.sol b/src/test/Withdrawals.t.sol index 567822f70..f8f780e7a 100644 --- a/src/test/Withdrawals.t.sol +++ b/src/test/Withdrawals.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../test/EigenLayerTestHelper.t.sol"; diff --git a/src/test/events/IAVSDirectoryEvents.sol b/src/test/events/IAVSDirectoryEvents.sol index ff344d994..a4f0a2962 100644 --- a/src/test/events/IAVSDirectoryEvents.sol +++ b/src/test/events/IAVSDirectoryEvents.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/contracts/interfaces/IAVSDirectory.sol"; @@ -12,4 +12,4 @@ interface IAVSDirectoryEvents { /// @notice Emitted when an operator's registration status for an AVS is updated event OperatorAVSRegistrationStatusUpdated(address indexed operator, address indexed avs, IAVSDirectory.OperatorAVSRegistrationStatus status); -} \ No newline at end of file +} diff --git a/src/test/events/IDelegationManagerEvents.sol b/src/test/events/IDelegationManagerEvents.sol index 4654d722f..53eae90b6 100644 --- a/src/test/events/IDelegationManagerEvents.sol +++ b/src/test/events/IDelegationManagerEvents.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/contracts/interfaces/IDelegationManager.sol"; @@ -61,4 +61,4 @@ interface IDelegationManagerEvents { /// @notice Emitted when the `strategyWithdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`. event StrategyWithdrawalDelayBlocksSet(IStrategy strategy, uint256 previousValue, uint256 newValue); -} \ No newline at end of file +} diff --git a/src/test/events/IEigenPodEvents.sol b/src/test/events/IEigenPodEvents.sol index c4016691b..20d37557f 100644 --- a/src/test/events/IEigenPodEvents.sol +++ b/src/test/events/IEigenPodEvents.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; interface IEigenPodEvents { /// @notice Emitted when an ETH validator stakes via this eigenPod @@ -39,4 +39,4 @@ interface IEigenPodEvents { /// @notice Emitted when ETH that was previously received via the `receive` fallback is withdrawn event NonBeaconChainETHWithdrawn(address indexed recipient, uint256 amountWithdrawn); -} \ No newline at end of file +} diff --git a/src/test/events/IEigenPodManagerEvents.sol b/src/test/events/IEigenPodManagerEvents.sol index d974ce2c9..50caf34bf 100644 --- a/src/test/events/IEigenPodManagerEvents.sol +++ b/src/test/events/IEigenPodManagerEvents.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; interface IEigenPodManagerEvents { /// @notice Emitted to notify the update of the beaconChainOracle address @@ -13,4 +13,4 @@ interface IEigenPodManagerEvents { /// @notice Emitted when the balance of an EigenPod is updated event PodSharesUpdated(address indexed podOwner, int256 sharesDelta); -} \ No newline at end of file +} diff --git a/src/test/events/IStrategyManagerEvents.sol b/src/test/events/IStrategyManagerEvents.sol index e5a83effb..e0727d069 100644 --- a/src/test/events/IStrategyManagerEvents.sol +++ b/src/test/events/IStrategyManagerEvents.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/contracts/interfaces/IStrategyManager.sol"; @@ -60,4 +60,4 @@ interface IStrategyManagerEvents { /// @notice Emitted when the `withdrawalDelayBlocks` variable is modified from `previousValue` to `newValue`. event WithdrawalDelayBlocksSet(uint256 previousValue, uint256 newValue); -} \ No newline at end of file +} diff --git a/src/test/harnesses/EigenPodHarness.sol b/src/test/harnesses/EigenPodHarness.sol index 2e84fad79..50582dfe7 100644 --- a/src/test/harnesses/EigenPodHarness.sol +++ b/src/test/harnesses/EigenPodHarness.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../contracts/pods/EigenPod.sol"; import "forge-std/Test.sol"; @@ -124,4 +124,4 @@ contract EPInternalFunctions is EigenPod, Test { function setMostRecentWithdrawalTimestamp(uint64 _mostRecentWithdrawalTimestamp) public { mostRecentWithdrawalTimestamp = _mostRecentWithdrawalTimestamp; } - } \ No newline at end of file + } diff --git a/src/test/harnesses/EigenPodManagerWrapper.sol b/src/test/harnesses/EigenPodManagerWrapper.sol index 7377f3b7b..15eec05fd 100644 --- a/src/test/harnesses/EigenPodManagerWrapper.sol +++ b/src/test/harnesses/EigenPodManagerWrapper.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../contracts/pods/EigenPodManager.sol"; @@ -21,4 +21,4 @@ contract EigenPodManagerWrapper is EigenPodManager { function setPodAddress(address owner, IEigenPod pod) external { ownerToPod[owner] = pod; } -} \ No newline at end of file +} diff --git a/src/test/harnesses/PausableHarness.sol b/src/test/harnesses/PausableHarness.sol index 53ebc2ef7..7a0e37fdb 100644 --- a/src/test/harnesses/PausableHarness.sol +++ b/src/test/harnesses/PausableHarness.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../contracts/permissions/Pausable.sol"; @@ -8,4 +8,4 @@ contract PausableHarness is Pausable { function initializePauser(IPauserRegistry _pauserRegistry, uint256 initPausedStatus) external { _initializePauser(_pauserRegistry, initPausedStatus); } -} \ No newline at end of file +} diff --git a/src/test/integration/IntegrationBase.t.sol b/src/test/integration/IntegrationBase.t.sol index 0ae15ade4..96e0e478d 100644 --- a/src/test/integration/IntegrationBase.t.sol +++ b/src/test/integration/IntegrationBase.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; diff --git a/src/test/integration/IntegrationChecks.t.sol b/src/test/integration/IntegrationChecks.t.sol index 54bb59952..9ca5e3fd6 100644 --- a/src/test/integration/IntegrationChecks.t.sol +++ b/src/test/integration/IntegrationChecks.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/test/integration/IntegrationBase.t.sol"; import "src/test/integration/users/User.t.sol"; diff --git a/src/test/integration/IntegrationDeployer.t.sol b/src/test/integration/IntegrationDeployer.t.sol index f19c92b4d..3849e92f6 100644 --- a/src/test/integration/IntegrationDeployer.t.sol +++ b/src/test/integration/IntegrationDeployer.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; // Imports import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; @@ -72,8 +72,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { // be returned from `_randUser`. bytes assetTypes; bytes userTypes; - bytes forkTypes; - // Set only once in configRand + // Set only once in setUp, if FORK_MAINNET env is set uint forkType; // Constants @@ -183,10 +182,31 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { */ function setUp() public virtual { isUpgraded = false; - // create mainnet fork that can be used later - mainnetForkId = cheats.createFork(cheats.rpcUrl("mainnet"), mainnetForkBlock); - // create holesky fork that can be used later - holeskyForkId = cheats.createFork(cheats.rpcUrl("holesky"), holeskyForkBLock); + + /** + * env FOUNDRY_PROFILE=forktest forge t --mc Integration + * + * Running foundry like this will trigger the fork test profile, + * lowering fuzz runs and using a remote RPC to test against mainnet state + */ + bool forkMainnet = + _hash("forktest") == + _hash(cheats.envOr(string("FOUNDRY_PROFILE"), string("default"))); + + if (forkMainnet) { + emit log("setUp: running tests against mainnet fork"); + emit log_named_string("- using RPC url", cheats.rpcUrl("mainnet")); + emit log_named_uint("- forking at block", mainnetForkBlock); + + cheats.createSelectFork(cheats.rpcUrl("mainnet"), mainnetForkBlock); + forkType = MAINNET; + } else { + emit log("setUp: running tests locally"); + + forkType = LOCAL; + } + + _deployOrFetchContracts(); } function _setUpLocal() public virtual { @@ -608,8 +628,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { function _configRand( uint24 _randomSeed, uint _assetTypes, - uint _userTypes, - uint _forkTypes + uint _userTypes ) internal { // Using uint24 for the seed type so that if a test fails, it's easier // to manually use the seed to replay the same test. @@ -619,7 +638,6 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { // Convert flag bitmaps to bytes of set bits for easy use with _randUint assetTypes = _bitmapToBytes(_assetTypes); userTypes = _bitmapToBytes(_userTypes); - forkTypes = _bitmapToBytes(_forkTypes); emit log("_configRand: Users will be initialized with these asset types:"); for (uint i = 0; i < assetTypes.length; i++) { @@ -631,17 +649,8 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { emit log(userTypeToStr[uint(uint8(userTypes[i]))]); } - emit log("_configRand: Tests will be shadow forked based on these fork types"); - for (uint i = 0; i < forkTypes.length; i++) { - emit log(forkTypeToStr[uint(uint8(forkTypes[i]))]); - } - assertTrue(assetTypes.length != 0, "_configRand: no asset types selected"); assertTrue(userTypes.length != 0, "_configRand: no user types selected"); - assertTrue(forkTypes.length != 0, "_configRand: no fork types selected"); - - // Use forkType to deploy contracts locally or fetch from mainnet - _deployOrFetchContracts(); } /** @@ -651,16 +660,14 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { * Note: for non-LOCAL forktypes, upgrade of contracts will be peformed after user initialization. */ function _deployOrFetchContracts() internal { - forkType = _randForkType(); - - emit log_named_string("_deployOrFetchContracts selected fork for test", forkTypeToStr[forkType]); + emit log_named_string("_deployOrFetchContracts using fork for test", forkTypeToStr[forkType]); if (forkType == LOCAL) { _setUpLocal(); // Set Upgraded as local setup deploys most up to date contracts isUpgraded = true; } else if (forkType == MAINNET) { - cheats.selectFork(mainnetForkId); + // cheats.selectFork(mainnetForkId); string memory deploymentInfoPath = "script/configs/mainnet/Mainnet_current_deployment.config.json"; _parseDeployedContracts(deploymentInfoPath); @@ -688,7 +695,8 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { // Create mock beacon chain / proof gen interface beaconChain = new BeaconChainMock(timeMachine, beaconChainOracle, eigenPodManager); } else if (forkType == HOLESKY) { - cheats.selectFork(holeskyForkId); + revert("_deployOrFetchContracts - holesky tests currently broken sorry"); + // cheats.selectFork(holeskyForkId); string memory deploymentInfoPath = "script/configs/holesky/Holesky_current_deployment.config.json"; _parseDeployedContracts(deploymentInfoPath); @@ -727,7 +735,7 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { cheats.stopPrank(); } else { - revert("_configEigenlayerContracts: unimplemented forkType"); + revert("_deployOrFetchContracts: unimplemented forkType"); } } @@ -970,13 +978,6 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { return userType; } - function _randForkType() internal returns (uint) { - uint idx = _randUint({ min: 0, max: forkTypes.length - 1 }); - uint randForkType = uint(uint8(forkTypes[idx])); - - return randForkType; - } - /** * @dev Converts a bitmap into an array of bytes * @dev Each byte in the input is processed as indicating a single bit to flip in the bitmap @@ -1028,4 +1029,9 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser { emit log("=================="); } -} \ No newline at end of file + + /// @dev Helper because solidity syntax is exhausting + function _hash(string memory s) internal pure returns (bytes32) { + return keccak256(abi.encodePacked(s)); + } +} diff --git a/src/test/integration/README.md b/src/test/integration/README.md index e1c2b75af..992d2a326 100644 --- a/src/test/integration/README.md +++ b/src/test/integration/README.md @@ -6,6 +6,13 @@ Good question. This folder contains the integration framework and tests for Eigenlayer core, which orchestrates the deployment of all EigenLayer core contracts to fuzz high-level user flows across multiple user and asset types, and supports time-travelling state lookups to quickly compare past and present states (please try to avoid preventing your own birth). +**If you want to know how to run the tests**: + +* Local: `forge t --mc Integration` +* Mainnet fork tests: `env FOUNDRY_PROFILE=forktest forge t --mc Integration` + +Note that for mainnet fork tests, you'll need to set the `RPC_MAINNET` environment variable to your RPC provider of choice! + **If you want to know where the tests are**, take a look at `/tests`. We're doing one test contract per top-level flow, and defining multiple test functions for variants on that flow. e.g. if you're testing the flow "deposit into strategies -> delegate to operator -> queue withdrawal -> complete withdrawal", that's it's own test contract. For variants where withdrawals are completed "as tokens" vs "as shares," those are their own functions inside that contract. @@ -93,4 +100,16 @@ function testFuzz_deposit_delegate_EXAMPLE(uint24 _random) public { ### What needs to be done? * Suggest or PR cleanup if you have ideas. Currently, the `IntegrationDeployer` contract is pretty messy. -* Coordinate in Slack to pick out some user flows to write tests for! \ No newline at end of file +* Coordinate in Slack to pick out some user flows to write tests for! + +#### Reduce RPC spam for fork tests + +Currently our mainnet fork tests spam whatever RPC we use. We can improve this in the future - apparently the meta is: + +> Use an anvil node to fork the network, you can write a script to make some changes to the forked network for setup etc, then fork your local node in your test. +> Effectively you just setup an anvil node with the command +`anvil -f RPC_URL ` +You can use `anvil -h` for more info on what it can do. + +> Then in your test you use the vm.createSelectFork command in your setup with the argument to point to your local anvil node which is basically a copy of the rpc you set it up as. +> If you want to do some setup before running your tests you can write a script file and broadcast the setup transactions to your local anvil node (make sure to use one of the private keys anvil gives you) \ No newline at end of file diff --git a/src/test/integration/TimeMachine.t.sol b/src/test/integration/TimeMachine.t.sol index 86a7c8930..7158f9db8 100644 --- a/src/test/integration/TimeMachine.t.sol +++ b/src/test/integration/TimeMachine.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; @@ -42,4 +42,4 @@ contract TimeMachine is Test { proofGenStartTime = uint64(block.timestamp); cheats.warp(block.timestamp + secondsAgo); } -} \ No newline at end of file +} diff --git a/src/test/integration/deprecatedInterfaces/mainnet/BeaconChainProofs.sol b/src/test/integration/deprecatedInterfaces/mainnet/BeaconChainProofs.sol index c41d75a45..89af42013 100644 --- a/src/test/integration/deprecatedInterfaces/mainnet/BeaconChainProofs.sol +++ b/src/test/integration/deprecatedInterfaces/mainnet/BeaconChainProofs.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/contracts/libraries/Merkle.sol"; import "src/contracts/libraries/Endian.sol"; diff --git a/src/test/integration/deprecatedInterfaces/mainnet/IBeaconChainOracle.sol b/src/test/integration/deprecatedInterfaces/mainnet/IBeaconChainOracle.sol index 4a9a5ac36..2bb2c818e 100644 --- a/src/test/integration/deprecatedInterfaces/mainnet/IBeaconChainOracle.sol +++ b/src/test/integration/deprecatedInterfaces/mainnet/IBeaconChainOracle.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; /** * @notice DEPRECATED INTERFACE at commit hash https://github.com/Layr-Labs/eigenlayer-contracts/tree/0139d6213927c0a7812578899ddd3dda58051928 diff --git a/src/test/integration/deprecatedInterfaces/mainnet/IDelayedWithdrawalRouter.sol b/src/test/integration/deprecatedInterfaces/mainnet/IDelayedWithdrawalRouter.sol index 2ee0914d4..8abb54a86 100644 --- a/src/test/integration/deprecatedInterfaces/mainnet/IDelayedWithdrawalRouter.sol +++ b/src/test/integration/deprecatedInterfaces/mainnet/IDelayedWithdrawalRouter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; /// @notice DEPRECATED INTERFACE at commit hash https://github.com/Layr-Labs/eigenlayer-contracts/tree/0139d6213927c0a7812578899ddd3dda58051928 interface IDelayedWithdrawalRouter_DeprecatedM1 { diff --git a/src/test/integration/deprecatedInterfaces/mainnet/IEigenPod.sol b/src/test/integration/deprecatedInterfaces/mainnet/IEigenPod.sol index 8efe93ccd..72a698e84 100644 --- a/src/test/integration/deprecatedInterfaces/mainnet/IEigenPod.sol +++ b/src/test/integration/deprecatedInterfaces/mainnet/IEigenPod.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "./BeaconChainProofs.sol"; import "./IEigenPodManager.sol"; diff --git a/src/test/integration/deprecatedInterfaces/mainnet/IEigenPodManager.sol b/src/test/integration/deprecatedInterfaces/mainnet/IEigenPodManager.sol index 5c791c232..d5795bf5d 100644 --- a/src/test/integration/deprecatedInterfaces/mainnet/IEigenPodManager.sol +++ b/src/test/integration/deprecatedInterfaces/mainnet/IEigenPodManager.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "./IStrategyManager.sol"; import "./IEigenPod.sol"; diff --git a/src/test/integration/deprecatedInterfaces/mainnet/IStrategyManager.sol b/src/test/integration/deprecatedInterfaces/mainnet/IStrategyManager.sol index c0a45f82a..be5745683 100644 --- a/src/test/integration/deprecatedInterfaces/mainnet/IStrategyManager.sol +++ b/src/test/integration/deprecatedInterfaces/mainnet/IStrategyManager.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/contracts/interfaces/IStrategy.sol"; import "src/contracts/interfaces/ISlasher.sol"; diff --git a/src/test/integration/mocks/BeaconChainMock.t.sol b/src/test/integration/mocks/BeaconChainMock.t.sol index 2429859ce..ec5619850 100644 --- a/src/test/integration/mocks/BeaconChainMock.t.sol +++ b/src/test/integration/mocks/BeaconChainMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; diff --git a/src/test/integration/mocks/BeaconChainOracleMock.t.sol b/src/test/integration/mocks/BeaconChainOracleMock.t.sol index 74390123e..b5a401c1f 100644 --- a/src/test/integration/mocks/BeaconChainOracleMock.t.sol +++ b/src/test/integration/mocks/BeaconChainOracleMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/contracts/interfaces/IBeaconChainOracle.sol"; @@ -14,4 +14,4 @@ contract BeaconChainOracleMock is IBeaconChainOracle { function setBlockRoot(uint64 timestamp, bytes32 blockRoot) public { blockRoots[timestamp] = blockRoot; } -} \ No newline at end of file +} diff --git a/src/test/integration/tests/Delegate_Deposit_Queue_Complete.t.sol b/src/test/integration/tests/Delegate_Deposit_Queue_Complete.t.sol index e9f3dd450..1c20e1807 100644 --- a/src/test/integration/tests/Delegate_Deposit_Queue_Complete.t.sol +++ b/src/test/integration/tests/Delegate_Deposit_Queue_Complete.t.sol @@ -5,14 +5,13 @@ import "src/test/integration/IntegrationChecks.t.sol"; import "src/test/integration/users/User.t.sol"; contract Integration_Delegate_Deposit_Queue_Complete is IntegrationCheckUtils { - + function testFuzz_delegate_deposit_queue_completeAsShares(uint24 _random) public { // Configure the random parameters for the test _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); // Create a staker and an operator with a nonzero balance and corresponding strategies (User staker, IStrategy[] memory strategies, uint[] memory tokenBalances) = _newRandomStaker(); @@ -50,8 +49,7 @@ contract Integration_Delegate_Deposit_Queue_Complete is IntegrationCheckUtils { _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); // Create a staker and an operator with a nonzero balance and corresponding strategies diff --git a/src/test/integration/tests/Deposit_Delegate_Queue_Complete.t.sol b/src/test/integration/tests/Deposit_Delegate_Queue_Complete.t.sol index 5d90763f8..5129d0710 100644 --- a/src/test/integration/tests/Deposit_Delegate_Queue_Complete.t.sol +++ b/src/test/integration/tests/Deposit_Delegate_Queue_Complete.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/test/integration/IntegrationChecks.t.sol"; import "src/test/integration/users/User.t.sol"; @@ -20,8 +20,7 @@ contract Integration_Deposit_Delegate_Queue_Complete is IntegrationCheckUtils { _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -83,8 +82,7 @@ contract Integration_Deposit_Delegate_Queue_Complete is IntegrationCheckUtils { _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -149,8 +147,7 @@ contract Integration_Deposit_Delegate_Queue_Complete is IntegrationCheckUtils { _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -215,8 +212,7 @@ contract Integration_Deposit_Delegate_Queue_Complete is IntegrationCheckUtils { _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -287,8 +283,7 @@ contract Integration_Deposit_Delegate_Queue_Complete is IntegrationCheckUtils { _configRand({ _randomSeed: _random, _assetTypes: NO_ASSETS | HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create a staker and operator diff --git a/src/test/integration/tests/Deposit_Delegate_Redelegate_Complete.t.sol b/src/test/integration/tests/Deposit_Delegate_Redelegate_Complete.t.sol index a0e0f155e..e5bc6b91d 100644 --- a/src/test/integration/tests/Deposit_Delegate_Redelegate_Complete.t.sol +++ b/src/test/integration/tests/Deposit_Delegate_Redelegate_Complete.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/test/integration/users/User.t.sol"; import "src/test/integration/IntegrationChecks.t.sol"; @@ -18,8 +18,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -91,8 +90,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -177,8 +175,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST, // not holding ETH since we can only deposit 32 ETH multiples - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -270,8 +267,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST, // not holding ETH since we can only deposit 32 ETH multiples - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -363,8 +359,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create operators and a staker @@ -438,8 +433,7 @@ contract Integration_Deposit_Delegate_Redelegate_Complete is IntegrationCheckUti _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create operators and a staker diff --git a/src/test/integration/tests/Deposit_Delegate_Undelegate_Complete.t.sol b/src/test/integration/tests/Deposit_Delegate_Undelegate_Complete.t.sol index 32afc81cd..9307eb358 100644 --- a/src/test/integration/tests/Deposit_Delegate_Undelegate_Complete.t.sol +++ b/src/test/integration/tests/Deposit_Delegate_Undelegate_Complete.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/test/integration/users/User.t.sol"; import "src/test/integration/IntegrationChecks.t.sol"; @@ -16,8 +16,7 @@ contract Integration_Deposit_Delegate_Undelegate_Complete is IntegrationCheckUti _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -80,8 +79,7 @@ contract Integration_Deposit_Delegate_Undelegate_Complete is IntegrationCheckUti _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -137,8 +135,7 @@ contract Integration_Deposit_Delegate_Undelegate_Complete is IntegrationCheckUti _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: @@ -195,8 +192,7 @@ contract Integration_Deposit_Delegate_Undelegate_Complete is IntegrationCheckUti _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and a staker with: diff --git a/src/test/integration/tests/Deposit_Delegate_UpdateBalance.t.sol b/src/test/integration/tests/Deposit_Delegate_UpdateBalance.t.sol index a782363db..53b42ff4a 100644 --- a/src/test/integration/tests/Deposit_Delegate_UpdateBalance.t.sol +++ b/src/test/integration/tests/Deposit_Delegate_UpdateBalance.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/test/integration/IntegrationChecks.t.sol"; import "src/test/integration/users/User.t.sol"; @@ -16,8 +16,7 @@ contract Integration_Deposit_Delegate_UpdateBalance is IntegrationCheckUtils { _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); /// 0. Create an operator and staker with some underlying assets diff --git a/src/test/integration/tests/Deposit_Queue_Complete.t.sol b/src/test/integration/tests/Deposit_Queue_Complete.t.sol index 4d84b8bea..3260cf32c 100644 --- a/src/test/integration/tests/Deposit_Queue_Complete.t.sol +++ b/src/test/integration/tests/Deposit_Queue_Complete.t.sol @@ -15,8 +15,7 @@ contract Integration_Deposit_QueueWithdrawal_Complete is IntegrationCheckUtils { _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); // Create a staker with a nonzero balance and corresponding strategies @@ -52,8 +51,7 @@ contract Integration_Deposit_QueueWithdrawal_Complete is IntegrationCheckUtils { _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); // Create a staker with a nonzero balance and corresponding strategies diff --git a/src/test/integration/tests/Deposit_Register_QueueWithdrawal_Complete.t.sol b/src/test/integration/tests/Deposit_Register_QueueWithdrawal_Complete.t.sol index 1e69fd8fa..9da5443a1 100644 --- a/src/test/integration/tests/Deposit_Register_QueueWithdrawal_Complete.t.sol +++ b/src/test/integration/tests/Deposit_Register_QueueWithdrawal_Complete.t.sol @@ -10,8 +10,7 @@ contract Integration_Deposit_Register_QueueWithdrawal_Complete is IntegrationChe _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); // Create a staker with a nonzero balance and corresponding strategies @@ -46,8 +45,7 @@ contract Integration_Deposit_Register_QueueWithdrawal_Complete is IntegrationChe _configRand({ _randomSeed: _random, _assetTypes: HOLDS_LST | HOLDS_ETH | HOLDS_ALL, - _userTypes: DEFAULT | ALT_METHODS, - _forkTypes: LOCAL | MAINNET + _userTypes: DEFAULT | ALT_METHODS }); // Create a staker with a nonzero balance and corresponding strategies diff --git a/src/test/integration/users/User.t.sol b/src/test/integration/users/User.t.sol index d7bf7d939..341103e4c 100644 --- a/src/test/integration/users/User.t.sol +++ b/src/test/integration/users/User.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; diff --git a/src/test/integration/users/User_M1.t.sol b/src/test/integration/users/User_M1.t.sol index 7b9369c00..c2f934130 100644 --- a/src/test/integration/users/User_M1.t.sol +++ b/src/test/integration/users/User_M1.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/test/integration/deprecatedInterfaces/mainnet/IEigenPod.sol"; import "src/test/integration/deprecatedInterfaces/mainnet/IEigenPodManager.sol"; diff --git a/src/test/mocks/BeaconChainOracleMock.sol b/src/test/mocks/BeaconChainOracleMock.sol index 485e8dbf9..890ca1a1e 100644 --- a/src/test/mocks/BeaconChainOracleMock.sol +++ b/src/test/mocks/BeaconChainOracleMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../contracts/interfaces/IBeaconChainOracle.sol"; diff --git a/src/test/mocks/DelegationManagerMock.sol b/src/test/mocks/DelegationManagerMock.sol index ac9423d26..3538b9b79 100644 --- a/src/test/mocks/DelegationManagerMock.sol +++ b/src/test/mocks/DelegationManagerMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; import "../../contracts/interfaces/IDelegationManager.sol"; @@ -201,4 +201,4 @@ contract DelegationManagerMock is IDelegationManager, Test { ) external { strategyManager.withdrawSharesAsTokens(recipient, strategy, shares, token); } -} \ No newline at end of file +} diff --git a/src/test/mocks/Dummy.sol b/src/test/mocks/Dummy.sol index cddebdf08..79160b45f 100644 --- a/src/test/mocks/Dummy.sol +++ b/src/test/mocks/Dummy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; contract EmptyContract { function foo() public pure returns (uint256) { diff --git a/src/test/mocks/ERC20Mock.sol b/src/test/mocks/ERC20Mock.sol index ac55a0173..8d5484d0f 100644 --- a/src/test/mocks/ERC20Mock.sol +++ b/src/test/mocks/ERC20Mock.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol) -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/interfaces/IERC20.sol"; import "@openzeppelin/contracts/utils/Context.sol"; @@ -272,4 +272,4 @@ contract ERC20Mock is Context, IERC20 { * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} -} \ No newline at end of file +} diff --git a/src/test/mocks/ERC20_OneWeiFeeOnTransfer.sol b/src/test/mocks/ERC20_OneWeiFeeOnTransfer.sol index e660d6b8d..173acf69b 100644 --- a/src/test/mocks/ERC20_OneWeiFeeOnTransfer.sol +++ b/src/test/mocks/ERC20_OneWeiFeeOnTransfer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity =0.8.12; +pragma solidity ^0.8.12; // copy-pasted OZ code with _balances mapping made *internal* instead of private @@ -614,4 +614,4 @@ contract ERC20_OneWeiFeeOnTransfer is OpenZeppelin_ERC20PresetFixedSupply { _afterTokenTransfer(from, to, amount); } -} \ No newline at end of file +} diff --git a/src/test/mocks/ERC20_SetTransferReverting_Mock.sol b/src/test/mocks/ERC20_SetTransferReverting_Mock.sol index e865d4681..dd12a7fd3 100644 --- a/src/test/mocks/ERC20_SetTransferReverting_Mock.sol +++ b/src/test/mocks/ERC20_SetTransferReverting_Mock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; diff --git a/src/test/mocks/ETHDepositMock.sol b/src/test/mocks/ETHDepositMock.sol index 4a93558a2..8b8841974 100644 --- a/src/test/mocks/ETHDepositMock.sol +++ b/src/test/mocks/ETHDepositMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "../../contracts/interfaces/IETHPOSDeposit.sol"; diff --git a/src/test/mocks/EmptyContract.sol b/src/test/mocks/EmptyContract.sol index cddebdf08..79160b45f 100644 --- a/src/test/mocks/EmptyContract.sol +++ b/src/test/mocks/EmptyContract.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; contract EmptyContract { function foo() public pure returns (uint256) { diff --git a/src/test/mocks/IBeaconChainOracleMock.sol b/src/test/mocks/IBeaconChainOracleMock.sol index a0e6ab63f..7ef4cc680 100644 --- a/src/test/mocks/IBeaconChainOracleMock.sol +++ b/src/test/mocks/IBeaconChainOracleMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; /** * @title Interface for the BeaconStateOracle contract. @@ -64,4 +64,4 @@ interface IBeaconChainOracleMock { * @param stateRoot The Beacon Chain state root that the caller asserts was the correct root, at the specified `blockNumber`. */ function voteForBeaconChainStateRoot(uint64 blockNumber, bytes32 stateRoot) external; -} \ No newline at end of file +} diff --git a/src/test/mocks/OwnableMock.sol b/src/test/mocks/OwnableMock.sol index 52170e00e..11ba5c53f 100644 --- a/src/test/mocks/OwnableMock.sol +++ b/src/test/mocks/OwnableMock.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/access/Ownable.sol"; -contract OwnableMock is Ownable {} \ No newline at end of file +contract OwnableMock is Ownable {} diff --git a/src/test/mocks/SlasherMock.sol b/src/test/mocks/SlasherMock.sol index 0f3366c49..6524fc466 100644 --- a/src/test/mocks/SlasherMock.sol +++ b/src/test/mocks/SlasherMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; import "../../contracts/interfaces/ISlasher.sol"; @@ -75,4 +75,4 @@ contract SlasherMock is ISlasher, Test { /// @notice Getter function for fetching a single node in the operator's linked list (`_operatorToWhitelistedContractsByUpdate[operator]`). function operatorWhitelistedContractsLinkedListEntry(address operator, address node) external view returns (bool, uint256, uint256) {} -} \ No newline at end of file +} diff --git a/src/test/mocks/StrategyManagerMock.sol b/src/test/mocks/StrategyManagerMock.sol index e4ca2df19..f7ba6e901 100644 --- a/src/test/mocks/StrategyManagerMock.sol +++ b/src/test/mocks/StrategyManagerMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; import "@openzeppelin-upgrades/contracts/access/OwnableUpgradeable.sol"; @@ -133,4 +133,4 @@ contract StrategyManagerMock is function migrateQueuedWithdrawal(DeprecatedStruct_QueuedWithdrawal memory queuedWithdrawal) external returns (bool, bytes32) {} function calculateWithdrawalRoot(DeprecatedStruct_QueuedWithdrawal memory queuedWithdrawal) external pure returns (bytes32) {} -} \ No newline at end of file +} diff --git a/src/test/unit/AVSDirectoryUnit.t.sol b/src/test/unit/AVSDirectoryUnit.t.sol index d18b98fe9..8876651ca 100644 --- a/src/test/unit/AVSDirectoryUnit.t.sol +++ b/src/test/unit/AVSDirectoryUnit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/mocks/ERC1271WalletMock.sol"; diff --git a/src/test/unit/DelayedWithdrawalRouterUnit.t.sol b/src/test/unit/DelayedWithdrawalRouterUnit.t.sol index 40c5d661d..848d1319e 100644 --- a/src/test/unit/DelayedWithdrawalRouterUnit.t.sol +++ b/src/test/unit/DelayedWithdrawalRouterUnit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; @@ -471,4 +471,4 @@ contract DelayedWithdrawalRouterUnitTests is Test { _pseudorandomNumber = uint256(keccak256(abi.encode(_pseudorandomNumber))); return _pseudorandomNumber; } -} \ No newline at end of file +} diff --git a/src/test/unit/DelegationUnit.t.sol b/src/test/unit/DelegationUnit.t.sol index 18ceab731..6805993b4 100644 --- a/src/test/unit/DelegationUnit.t.sol +++ b/src/test/unit/DelegationUnit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/mocks/ERC1271WalletMock.sol"; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; @@ -2026,6 +2026,8 @@ contract DelegationManagerUnitTests_delegateToBySignature is DelegationManagerUn uint256 stakerExpiry, uint256 delegationApproverExpiry ) public filterFuzzedAddressInputs(caller) { + cheats.assume(caller != defaultOperator); + // roll to a very late timestamp skip(type(uint256).max / 2); @@ -2757,6 +2759,8 @@ contract DelegationManagerUnitTests_Undelegate is DelegationManagerUnitTests { * Emits a `StakerUndelegated` event */ function testFuzz_undelegate_noDelegateableShares(address staker) public filterFuzzedAddressInputs(staker) { + cheats.assume(staker != defaultOperator); + // register *this contract* as an operator and delegate from the `staker` to them _registerOperatorWithBaseDetails(defaultOperator); _delegateToOperatorWhoAcceptsAllStakers(staker, defaultOperator); @@ -3345,4 +3349,4 @@ contract DelegationManagerUnitTests_completeQueuedWithdrawal is DelegationManage assertEq(operatorSharesAfter, operatorSharesBefore + withdrawalAmount, "operator shares not increased correctly"); assertFalse(delegationManager.pendingWithdrawals(withdrawalRoot), "withdrawalRoot should be completed and marked false now"); } -} \ No newline at end of file +} diff --git a/src/test/unit/EigenPod-PodManagerUnit.t.sol b/src/test/unit/EigenPod-PodManagerUnit.t.sol index b0507257b..ca33ffde0 100644 --- a/src/test/unit/EigenPod-PodManagerUnit.t.sol +++ b/src/test/unit/EigenPod-PodManagerUnit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; diff --git a/src/test/unit/EigenPodManagerUnit.t.sol b/src/test/unit/EigenPodManagerUnit.t.sol index f88697273..bc553243c 100644 --- a/src/test/unit/EigenPodManagerUnit.t.sol +++ b/src/test/unit/EigenPodManagerUnit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; diff --git a/src/test/unit/EigenPodUnit.t.sol b/src/test/unit/EigenPodUnit.t.sol index e4458b944..6af23d1bd 100644 --- a/src/test/unit/EigenPodUnit.t.sol +++ b/src/test/unit/EigenPodUnit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; import "@openzeppelin/contracts/utils/Create2.sol"; @@ -1091,4 +1091,4 @@ contract EigenPodUnitTests_WithdrawalTests is EigenPodHarnessSetup, ProofParsing ); _; } -} \ No newline at end of file +} diff --git a/src/test/unit/PausableUnit.t.sol b/src/test/unit/PausableUnit.t.sol index 4d5bc3a52..c8f03aa92 100644 --- a/src/test/unit/PausableUnit.t.sol +++ b/src/test/unit/PausableUnit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; @@ -173,4 +173,4 @@ contract PausableUnitTests is Test { cheats.stopPrank(); } -} \ No newline at end of file +} diff --git a/src/test/unit/PauserRegistryUnit.t.sol b/src/test/unit/PauserRegistryUnit.t.sol index c29dde4f1..802c228e8 100644 --- a/src/test/unit/PauserRegistryUnit.t.sol +++ b/src/test/unit/PauserRegistryUnit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; @@ -98,4 +98,4 @@ contract PauserRegistryUnitTests is Test { pauserRegistry.setUnpauser(newUnpauser); cheats.stopPrank(); } -} \ No newline at end of file +} diff --git a/src/test/unit/StrategyBaseTVLLimitsUnit.sol b/src/test/unit/StrategyBaseTVLLimitsUnit.sol index b2a4ee7f3..6a2b1d8f9 100644 --- a/src/test/unit/StrategyBaseTVLLimitsUnit.sol +++ b/src/test/unit/StrategyBaseTVLLimitsUnit.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "./StrategyBaseUnit.t.sol"; @@ -283,4 +283,4 @@ contract StrategyBaseTVLLimitsUnitTests is StrategyBaseUnitTests { ) public virtual override filterToValidDepositAmounts(amountToDeposit) { StrategyBaseUnitTests.testWithdrawWithPriorTotalSharesAndAmountSharesNotEqual(amountToDeposit, sharesToWithdraw); } -} \ No newline at end of file +} diff --git a/src/test/unit/StrategyBaseUnit.t.sol b/src/test/unit/StrategyBaseUnit.t.sol index 9d33abf94..659acf1c8 100644 --- a/src/test/unit/StrategyBaseUnit.t.sol +++ b/src/test/unit/StrategyBaseUnit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol"; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; @@ -375,4 +375,4 @@ contract StrategyBaseUnitTests is Test { strategy.withdraw(address(this), underlyingToken, sharesToWithdraw); cheats.stopPrank(); } -} \ No newline at end of file +} diff --git a/src/test/unit/StrategyManagerUnit.t.sol b/src/test/unit/StrategyManagerUnit.t.sol index 578b5f3a0..d4793f901 100644 --- a/src/test/unit/StrategyManagerUnit.t.sol +++ b/src/test/unit/StrategyManagerUnit.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/mocks/ERC1271WalletMock.sol"; import "src/contracts/core/StrategyManager.sol"; diff --git a/src/test/utils/EigenLayerUnitTestBase.sol b/src/test/utils/EigenLayerUnitTestBase.sol index d0b533398..9a776e9bf 100644 --- a/src/test/utils/EigenLayerUnitTestBase.sol +++ b/src/test/utils/EigenLayerUnitTestBase.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; diff --git a/src/test/utils/EigenLayerUnitTestSetup.sol b/src/test/utils/EigenLayerUnitTestSetup.sol index a6d5bd0cf..5c8d86a4d 100644 --- a/src/test/utils/EigenLayerUnitTestSetup.sol +++ b/src/test/utils/EigenLayerUnitTestSetup.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "src/test/mocks/StrategyManagerMock.sol"; import "src/test/mocks/DelegationManagerMock.sol"; diff --git a/src/test/utils/Operators.sol b/src/test/utils/Operators.sol index 84287def6..7c5faabd6 100644 --- a/src/test/utils/Operators.sol +++ b/src/test/utils/Operators.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; import "forge-std/Script.sol"; diff --git a/src/test/utils/Owners.sol b/src/test/utils/Owners.sol index 5f93d50bf..9c32971ab 100644 --- a/src/test/utils/Owners.sol +++ b/src/test/utils/Owners.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; import "forge-std/Script.sol"; diff --git a/src/test/utils/ProofParsing.sol b/src/test/utils/ProofParsing.sol index 5baf260b7..fd69678ec 100644 --- a/src/test/utils/ProofParsing.sol +++ b/src/test/utils/ProofParsing.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "forge-std/Test.sol"; import "forge-std/StdJson.sol"; @@ -196,4 +196,4 @@ contract ProofParsing is Test { } return validatorFieldsProof; } -} \ No newline at end of file +} diff --git a/src/test/utils/SignatureCompaction.sol b/src/test/utils/SignatureCompaction.sol index dd5f0dcef..c10b2db1d 100644 --- a/src/test/utils/SignatureCompaction.sol +++ b/src/test/utils/SignatureCompaction.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BUSL-1.1 -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; diff --git a/src/test/utils/Utils.sol b/src/test/utils/Utils.sol index acae8d956..10c5653eb 100644 --- a/src/test/utils/Utils.sol +++ b/src/test/utils/Utils.sol @@ -1,4 +1,4 @@ -pragma solidity =0.8.12; +pragma solidity ^0.8.12; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import "src/contracts/strategies/StrategyBase.sol";