-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update submodule to 0.2.1 * use latest sdk * remove state dump, add eigenlayer-contracts submodule v0.4.3-mainnet-rewards-programmatic-incentives * scripts WIP * scripts working * makefile update, some cilppy * chore: update integration tests deps * exclude incredible-binding crate in ci * exclude incredible-binding in cargo check ci * ignore clippy in bindings crate * fmt * install forge in ci * add docker anvil in ci, comment the failing test for now * fix:enter correct directory in ci * port the rewards scripts and tests from hello world, use foundry-toolchain in ci * nudge ci * fix : payment script revert, todo: write correct reward params * payment script working * add payment script in make file * cleanup * remove eigenlayer-contracts from gitmodules * use get_signer, fmt * readme update * remapping * remove foundry toolchain ,install foundry using cargo * fix: yml * modify contract path in sh file, dd back toolchain for foundry * update deploy-eigenlayer.sh * update rev * fix: submodule in ci, update readme * add submodules in yml * update middleware * middleware update * add forge-std * testing ci * update rev * checking * update middleware * cd into contracts * update .sh * cd into contracts only once * hit and trial * fix: eigenlayer.sh script * vv * add submodule in ci * env in ci * 2 operators support * clean up * fix quorum, client * fix:tests * update readme * fix:merge conflicts * remove unwrap * use separate config file and reuse error * clippy * common config for test in operators * deploy-eigenlayer with debug comments * print return value in deploy-eigenlayer.sh * change foundry image to latest * clean up * update middleware to latest dev * add createOperatorDirectedAVSRewardsSubmissions in paymentslib * createOperatorDirectedAVSRewardsSubmissions in payment script working --------- Co-authored-by: supernovahs <[email protected]> Co-authored-by: Pablo Deymonnaz <[email protected]>
- Loading branch information
1 parent
c350328
commit 86e2a9b
Showing
10 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule eigenlayer-middleware
updated
10 files
+1 −1 | lib/eigenlayer-contracts | |
+36 −27 | src/EjectionManager.sol | |
+118 −28 | src/ServiceManagerBase.sol | |
+1 −1 | src/interfaces/IEjectionManager.sol | |
+31 −2 | src/interfaces/IServiceManager.sol | |
+73 −0 | src/unaudited/ECDSAServiceManagerBase.sol | |
+70 −11 | test/events/IServiceManagerBaseEvents.sol | |
+85 −20 | test/mocks/RewardsCoordinatorMock.sol | |
+51 −2 | test/unit/EjectionManagerUnit.t.sol | |
+644 −89 | test/unit/ServiceManagerBase.t.sol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"operator_addresses": ["0x0000000000000000000000000000000000000001"], | ||
"amount": [1] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.12; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import {IncredibleSquaringDeploymentLib} from "./utils/IncredibleSquaringDeploymentLib.sol"; | ||
import {CoreDeploymentLib} from "./utils/CoreDeploymentLib.sol"; | ||
import {SetupPaymentsLib} from "./utils/SetupPaymentsLib.sol"; | ||
import {IRewardsCoordinator} from "@eigenlayer/contracts/interfaces/IRewardsCoordinator.sol"; | ||
import {console2} from "forge-std/console2.sol"; | ||
import {UpgradeableProxyLib} from "./utils/UpgradeableProxyLib.sol"; | ||
import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; | ||
import {stdJson} from "forge-std/StdJson.sol"; | ||
|
||
contract OperatorDirectedPayments is Script { | ||
using stdJson for string; | ||
|
||
address private deployer; | ||
CoreDeploymentLib.DeploymentData coreDeployment; | ||
IncredibleSquaringDeploymentLib.DeploymentData incredibleSquaringDeployment; | ||
SetupPaymentsLib.OperatorConfig operatorRewardConfig; | ||
string internal constant filePath = "test/mockData/scratch/payment_info.json"; | ||
|
||
function setUp() public { | ||
deployer = vm.rememberKey(vm.envUint("PRIVATE_KEY")); | ||
vm.label(deployer, "Deployer"); | ||
|
||
coreDeployment = CoreDeploymentLib.readDeploymentJson("script/deployments/core/", block.chainid); | ||
incredibleSquaringDeployment = | ||
IncredibleSquaringDeploymentLib.readDeploymentJson("script/deployments/incredible-squaring/", block.chainid); | ||
operatorRewardConfig = SetupPaymentsLib.readOperatorConfig("operator_reward_config"); | ||
} | ||
|
||
function run() external { | ||
vm.startBroadcast(deployer); | ||
|
||
string memory json = vm.readFile(filePath); | ||
uint32 duration = uint32(json.readUint(".duration")); | ||
uint32 index_to_prove = uint32(json.readUint(".indexToProve")); | ||
uint256 num_payments = json.readUint(".numPayments"); | ||
address recipient = json.readAddress(".recipient"); | ||
address[] memory earners = json.readAddressArray(".earners"); | ||
bytes32[] memory earner_token_roots = json.readBytes32Array(".earnerTokenRoots"); | ||
uint32 start_time = uint32(previousDivisibleTimestamp(block.timestamp)); | ||
|
||
IRewardsCoordinator.OperatorReward[] memory operator_reward = | ||
new IRewardsCoordinator.OperatorReward[](operatorRewardConfig.operator_addr.length); | ||
|
||
for (uint256 i = 0; i < operator_reward.length; i++) { | ||
operator_reward[i] = IRewardsCoordinator.OperatorReward({ | ||
operator: operatorRewardConfig.operator_addr[i], | ||
amount: operatorRewardConfig.amount[i] | ||
}); | ||
} | ||
|
||
SetupPaymentsLib.createOperatorDirectedAVSRewardsSubmissions( | ||
incredibleSquaringDeployment.strategy, | ||
incredibleSquaringDeployment.incredibleSquaringServiceManager, | ||
operator_reward, | ||
num_payments, | ||
duration, | ||
start_time | ||
); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
|
||
function previousDivisibleTimestamp(uint256 blockTimestamp) public pure returns (uint256) { | ||
uint256 daySeconds = 86400; | ||
|
||
// Calculate the remainder to check how far blockTimestamp is from the nearest multiple of daySeconds | ||
uint256 remainder = blockTimestamp % daySeconds; | ||
|
||
if (remainder == 0) { | ||
// If blockTimestamp is already divisible by daySeconds, go two steps back | ||
return blockTimestamp - (2 * daySeconds); | ||
} else { | ||
// Otherwise, move back to the previous divisible timestamp and then one more step | ||
return blockTimestamp - remainder - daySeconds; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"lastUpdate":{"timestamp":"1732362263","block_number":"1"},"addresses":{"proxyAdmin":"0xe7f1725e7734ce288f8367e1bb143e90bb3f0512","delegation":"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9","delegationManagerImpl":"0x68b1d87f95878fe05b998f19b66f4baba5de1aed","avsDirectory":"0x5fc8d32690cc91d4c39d9d3abcbd16989f875707","avsDirectoryImpl":"0x3aa5ebb10dc797cac828524e59a333d0a371443c","strategyManager":"0xa513e6e4b8f2a923d98304ec87f64353c4d5c853","strategyManagerImpl":"0xc6e7df5e7b4f2a278906862b61205850344d4e7d","eigenPodManager":"0x8a791620dd6260079bf849dc5567adc3f2fdc318","eigenPodManagerImpl":"0x4ed7c70f96b99c776995fb64377f0d4ab3b0e1c1","strategyFactory":"0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae","rewardsCoordinator":"0xb7f8bc63bbcad18155201308c8f3540b07f84f5e","strategyBeacon":"0xc5a5c42992decbae36851359345fe25997f5c42d"}} | ||
{"lastUpdate":{"timestamp":"1732699447","block_number":"1"},"addresses":{"proxyAdmin":"0xe7f1725e7734ce288f8367e1bb143e90bb3f0512","delegation":"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9","delegationManagerImpl":"0x68b1d87f95878fe05b998f19b66f4baba5de1aed","avsDirectory":"0x5fc8d32690cc91d4c39d9d3abcbd16989f875707","avsDirectoryImpl":"0x3aa5ebb10dc797cac828524e59a333d0a371443c","strategyManager":"0xa513e6e4b8f2a923d98304ec87f64353c4d5c853","strategyManagerImpl":"0xc6e7df5e7b4f2a278906862b61205850344d4e7d","eigenPodManager":"0x8a791620dd6260079bf849dc5567adc3f2fdc318","eigenPodManagerImpl":"0x4ed7c70f96b99c776995fb64377f0d4ab3b0e1c1","strategyFactory":"0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae","rewardsCoordinator":"0xb7f8bc63bbcad18155201308c8f3540b07f84f5e","strategyBeacon":"0xc5a5c42992decbae36851359345fe25997f5c42d"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"lastUpdate":{"timestamp":"1732362303","block_number":"36"},"addresses":{"proxyAdmin":"0x99bba657f2bbc93c02d617f8ba121cb8fc104acf","IncredibleSquaringServiceManager":"0x8f86403a4de0bb5791fa46b8e795c547942fe4cf","incredibleSquaringServiceManagerImpl":"0x4c4a2f8c81640e47606d3fd77b353e87ba015584","IncredibleSquaringTaskManager":"0x809d550fca64d94bd9f66e60752a544199cfac3d","registryCoordinator":"0x1291be112d480055dafd8a610b7d1e203891c274","blsapkRegistry":"0xb7278a61aa25c888815afc32ad3cc52ff24fe575","indexRegistry":"0x82e01223d51eb87e16a03e24687edf0f294da6f1","stakeRegistry":"0x5eb3bc0a489c5a8288765d2336659ebca68fcd00","operatorStateRetriever":"0x7bc06c482dead17c0e297afbc32f6e63d3846650","strategy":"0x2b961e3959b79326a8e7f64ef0d2d825707669b5","token":"0x0000000000000000000000000000000000000000"}} | ||
{"lastUpdate":{"timestamp":"1732699449","block_number":"36"},"addresses":{"proxyAdmin":"0x99bba657f2bbc93c02d617f8ba121cb8fc104acf","IncredibleSquaringServiceManager":"0x8f86403a4de0bb5791fa46b8e795c547942fe4cf","incredibleSquaringServiceManagerImpl":"0x4c4a2f8c81640e47606d3fd77b353e87ba015584","IncredibleSquaringTaskManager":"0x809d550fca64d94bd9f66e60752a544199cfac3d","registryCoordinator":"0x1291be112d480055dafd8a610b7d1e203891c274","blsapkRegistry":"0xb7278a61aa25c888815afc32ad3cc52ff24fe575","indexRegistry":"0x82e01223d51eb87e16a03e24687edf0f294da6f1","stakeRegistry":"0x5eb3bc0a489c5a8288765d2336659ebca68fcd00","operatorStateRetriever":"0x7bc06c482dead17c0e297afbc32f6e63d3846650","strategy":"0x2b961e3959b79326a8e7f64ef0d2d825707669b5","token":"0x0000000000000000000000000000000000000000"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters