From 81984e3daa84025889d228eced169c1a1b0eb7c4 Mon Sep 17 00:00:00 2001 From: kachapah <60323455+Sidu28@users.noreply.github.com> Date: Fri, 8 Nov 2024 12:04:23 -0800 Subject: [PATCH] added to ReadMe --- .DS_Store | Bin 0 -> 8196 bytes README.md | 25 ++++++++++++++ contracts/script/SetupPayments.s.sol | 31 +++++++++++++++--- contracts/test/mockData/scratch/payments.json | 18 +++++----- package.json | 4 ++- 5 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..26e89e19d879dc82c18b4581d33584240f9a0ab1 GIT binary patch literal 8196 zcmeHMziSjh6n>Lir@Fe?sgP z6a)(^i5P4J3k!vmsT8ypzc(}9zPa5ytVHz9G4tl;y|>@D-|X%3_K3(V4?7K_c_ON# zvz?p8P|?`Wz0_v>$|+cbeCl-@tL?NuC`IamDxeCe0;+&2pbGpg3gDT|tv=zo@4Pyy z0;<4&sQ}*}Vsy5Nx4ED^xe1&2xI*uRPa59OrI;sMyKv@B<-6J|fU0SD1*6)k^yHBLApEjGV zUfRN1{Z4-P>Ez1WbD_U8)jzmZyc<|N*g-0AZ%_-kTN0P(^F`^CxL>X=oPE*pxIVX^ z7PwV@iHo}mx1+$_!e@=LG3@B}>v6xte|UE<`*z9V2gi^cCdC9iq8u>b(WaC(=q5Di zh8nOt^h+K;p6;D~yy1C>V@Mv8Vgeo(hK_k28ErzD_P8pwgQW`ytca4FP8=@m?>bJE zk;N`ekCgnP2Va?CL>=hV9@{I59!a0%lD`}6(0dy@itjjmDO&W6;( zx8QoMUD>_|9us3Fua8U5XTQ7aXG(mb)bGSg-nCZ=sNhMO(f~YpH#5vPgKKN%!=Nfg z^1T0kq+jV+Qpag=k{8ut=5>UI;Ij@50|lvZ`DN&pT block.timestamp) { + revert("End timestamp must be in the future. Please wait to generate new payments."); + } createAVSRewardsSubmissions(numPayments, amountPerPayment, startTimestamp); vm.stopBroadcast(); @@ -79,6 +93,7 @@ contract SetupPayments is Script, Test { earners = _getEarners(); submitPaymentRoot(earners, endTimestamp, numPayments, amountPerPayment); vm.stopBroadcast(); + numPaymentClaimSessions++; } function executeProcessClaim() public { @@ -118,7 +133,7 @@ contract SetupPayments is Script, Test { bytes32[] memory tokenLeaves = SetupPaymentsLib.createTokenLeaves( IRewardsCoordinator(coreDeployment.rewardsCoordinator), NUM_TOKEN_EARNINGS, - amountPerPayment, + amountPerPayment * numPaymentClaimSessions, helloWorldDeployment.strategy ); IRewardsCoordinator.EarnerTreeMerkleLeaf[] memory earnerLeaves = SetupPaymentsLib.createEarnerLeaves(earners, tokenLeaves); @@ -138,7 +153,15 @@ contract SetupPayments is Script, Test { } function _getEarnerLeaves(address[] memory earners, address strategy) internal returns (IRewardsCoordinator.EarnerTreeMerkleLeaf[] memory) { - bytes32[] memory tokenLeaves = SetupPaymentsLib.createTokenLeaves(IRewardsCoordinator(coreDeployment.rewardsCoordinator), NUM_TOKEN_EARNINGS, TOKEN_EARNINGS, strategy); + bytes32[] memory tokenLeaves = SetupPaymentsLib.createTokenLeaves( + IRewardsCoordinator(coreDeployment.rewardsCoordinator), + NUM_TOKEN_EARNINGS, + amountPerPayment * numPaymentClaimSessions, + strategy + ); + + emit log_named_uint("PAYMENT SESSIONS", numPaymentClaimSessions); + IRewardsCoordinator.EarnerTreeMerkleLeaf[] memory earnerLeaves = SetupPaymentsLib.createEarnerLeaves(earners, tokenLeaves); return earnerLeaves; diff --git a/contracts/test/mockData/scratch/payments.json b/contracts/test/mockData/scratch/payments.json index acc84b41..04027f39 100644 --- a/contracts/test/mockData/scratch/payments.json +++ b/contracts/test/mockData/scratch/payments.json @@ -1,15 +1,15 @@ { "leaves": [ - "0x855a8f20541c81d6176860d70e5052761e63753e3a596de4802d3469fbb66d51", - "0x855a8f20541c81d6176860d70e5052761e63753e3a596de4802d3469fbb66d51", - "0x855a8f20541c81d6176860d70e5052761e63753e3a596de4802d3469fbb66d51", - "0x855a8f20541c81d6176860d70e5052761e63753e3a596de4802d3469fbb66d51", - "0x855a8f20541c81d6176860d70e5052761e63753e3a596de4802d3469fbb66d51", - "0x855a8f20541c81d6176860d70e5052761e63753e3a596de4802d3469fbb66d51", - "0x855a8f20541c81d6176860d70e5052761e63753e3a596de4802d3469fbb66d51", - "0x855a8f20541c81d6176860d70e5052761e63753e3a596de4802d3469fbb66d51" + "0xdc4955d01f4e8f8fc13e61d1da56189f6db850395aebbbcbc211202b934970fc", + "0xdc4955d01f4e8f8fc13e61d1da56189f6db850395aebbbcbc211202b934970fc", + "0xdc4955d01f4e8f8fc13e61d1da56189f6db850395aebbbcbc211202b934970fc", + "0xdc4955d01f4e8f8fc13e61d1da56189f6db850395aebbbcbc211202b934970fc", + "0xdc4955d01f4e8f8fc13e61d1da56189f6db850395aebbbcbc211202b934970fc", + "0xdc4955d01f4e8f8fc13e61d1da56189f6db850395aebbbcbc211202b934970fc", + "0xdc4955d01f4e8f8fc13e61d1da56189f6db850395aebbbcbc211202b934970fc", + "0xdc4955d01f4e8f8fc13e61d1da56189f6db850395aebbbcbc211202b934970fc" ], "tokenLeaves": [ - "0x5a388246e7ca57a446739415dfaa85443f20b442a0b81409e962cd986a71ba98" + "0xe0c89917f508e4c4cb8aff33403a849560a853d87c90011da2a9bb86811fa248" ] } \ No newline at end of file diff --git a/package.json b/package.json index 3870830a..7fe5456c 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,13 @@ "scripts": { "start:operator": "ts-node operator/index.ts", "start:traffic": "ts-node operator/createNewTasks.ts", - "start:anvil": "anvil", + "start:anvil": "anvil --block-time 0.002", "deploy:core": "cd contracts && forge script script/DeployEigenLayerCore.s.sol --rpc-url http://localhost:8545 --broadcast", "deploy:hello-world": "cd contracts && forge script script/HelloWorldDeployer.s.sol --rpc-url http://localhost:8545 --broadcast", "deploy:core-debug": "cd contracts && forge script script/DeployEigenLayerCore.s.sol --rpc-url http://localhost:8545 --broadcast --revert-strings debug", "deploy:hello-world-debug": "cd contracts && forge script script/HelloWorldDeployer.s.sol --rpc-url http://localhost:8545 --broadcast --revert-strings debug", + "run:create-payments-root": "cd contracts && forge script script/SetupPayments.s.sol --rpc-url http://localhost:8545 --broadcast -v --sender 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "run:claim-payments": "cd contracts && forge script script/SetupPayments.s.sol --rpc-url http://localhost:8545 --broadcast --sig \"executeProcessClaim()\" -v --sender 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", "build": "cd contracts && forge build", "extract:abis": "node utils/abis.js", "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest"