-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
99 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"leaves": [ | ||
"0x0000000000000000000000000000000000000000000000000000000000000001", | ||
"0x0000000000000000000000000000000000000000000000000000000000000002" | ||
"0x29036a1d92861ffd464a1e285030fad3978a36f953ae33c160e606d2ac746c42", | ||
"0x29036a1d92861ffd464a1e285030fad3978a36f953ae33c160e606d2ac746c42", | ||
"0x29036a1d92861ffd464a1e285030fad3978a36f953ae33c160e606d2ac746c42", | ||
"0x29036a1d92861ffd464a1e285030fad3978a36f953ae33c160e606d2ac746c42" | ||
], | ||
"tokenLeaves": [ | ||
"0x0000000000000000000000000000000000000000000000000000000000000003", | ||
"0x0000000000000000000000000000000000000000000000000000000000000004" | ||
"0xf5d87050cb923194fe63c7ed2c45cbc913fa6ecf322f3631149c36d9460b3ad6" | ||
] | ||
} |
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,80 +1,81 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.0; | ||
// // SPDX-License-Identifier: UNLICENSED | ||
// pragma solidity ^0.8.0; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import {HelloWorldDeploymentLib} from "./utils/HelloWorldDeploymentLib.sol"; | ||
import {CoreDeploymentLib} from "./utils/CoreDeploymentLib.sol"; | ||
import {SetupPaymentsLib} from "./utils/SetupPaymentsLib.sol"; | ||
import {IRewardsCoordinator} from "@eigenlayer/contracts/interfaces/IRewardsCoordinator.sol"; | ||
// import {Script} from "forge-std/Script.sol"; | ||
// import {HelloWorldDeploymentLib} from "./utils/HelloWorldDeploymentLib.sol"; | ||
// import {CoreDeploymentLib} from "./utils/CoreDeploymentLib.sol"; | ||
// import {SetupPaymentsLib} from "./utils/SetupPaymentsLib.sol"; | ||
// import {IRewardsCoordinator} from "@eigenlayer/contracts/interfaces/IRewardsCoordinator.sol"; | ||
|
||
contract SetupPayments is Script { | ||
address private deployer; | ||
CoreDeploymentLib.DeploymentData coreDeployment; | ||
HelloWorldDeploymentLib.DeploymentData helloWorldDeployment; | ||
// contract SetupPayments is Script { | ||
// address private deployer; | ||
// CoreDeploymentLib.DeploymentData coreDeployment; | ||
// HelloWorldDeploymentLib.DeploymentData helloWorldDeployment; | ||
|
||
uint256 constant NUM_PAYMENTS = 8; | ||
uint256 constant NUM_TOKEN_EARNINGS = 1; | ||
uint256 constant TOKEN_EARNINGS = 100; | ||
// uint256 constant NUM_PAYMENTS = 8; | ||
// uint256 constant NUM_TOKEN_EARNINGS = 1; | ||
// uint256 constant TOKEN_EARNINGS = 100; | ||
|
||
function setUp() public { | ||
deployer = vm.rememberKey(vm.envUint("PRIVATE_KEY")); | ||
vm.label(deployer, "Deployer"); | ||
// function setUp() public { | ||
// deployer = vm.rememberKey(vm.envUint("PRIVATE_KEY")); | ||
// vm.label(deployer, "Deployer"); | ||
|
||
coreDeployment = CoreDeploymentLib.readDeploymentJson("deployments/core/", block.chainid); | ||
helloWorldDeployment = HelloWorldDeploymentLib.readDeploymentJson("deployments/hello-world/", block.chainid); | ||
} | ||
// coreDeployment = CoreDeploymentLib.readDeploymentJson("deployments/core/", block.chainid); | ||
// helloWorldDeployment = HelloWorldDeploymentLib.readDeploymentJson("deployments/hello-world/", block.chainid); | ||
// } | ||
|
||
function run() external { | ||
vm.startBroadcast(deployer); | ||
IRewardsCoordinator(coreDeployment.rewardsCoordinator).setRewardsUpdater(deployer); | ||
// function run() external { | ||
// vm.startBroadcast(deployer); | ||
// IRewardsCoordinator(coreDeployment.rewardsCoordinator).setRewardsUpdater(deployer); | ||
|
||
|
||
vm.stopBroadcast(); | ||
} | ||
// vm.stopBroadcast(); | ||
// } | ||
|
||
|
||
function createPaymentSubmissions(uint256 numPayments, uint256 amountPerPayment, uint32 duration, uint32 startTimestamp) public { | ||
SetupPaymentsLib.createPaymentSubmissions( | ||
IRewardsCoordinator(coreDeployment.rewardsCoordinator), | ||
helloWorldDeployment.strategy, | ||
numPayments, | ||
amountPerPayment, | ||
duration, | ||
startTimestamp | ||
); | ||
} | ||
// function createPaymentSubmissions(uint256 numPayments, uint256 amountPerPayment, uint32 duration, uint32 startTimestamp) public { | ||
// SetupPaymentsLib.createPaymentSubmissions( | ||
// IRewardsCoordinator(coreDeployment.rewardsCoordinator), | ||
// helloWorldDeployment.strategy, | ||
// numPayments, | ||
// amountPerPayment, | ||
// duration, | ||
// startTimestamp | ||
// ); | ||
// } | ||
|
||
function processClaim(string memory filePath, uint256 indexToProve, address recipient, IRewardsCoordinator.EarnerTreeMerkleLeaf calldata earnerLeaf) public { | ||
SetupPaymentsLib.processClaim( | ||
IRewardsCoordinator(coreDeployment.rewardsCoordinator), | ||
filePath, | ||
indexToProve, | ||
recipient, | ||
earnerLeaf, | ||
NUM_TOKEN_EARNINGS, | ||
helloWorldDeployment.strategy | ||
); | ||
} | ||
// function processClaim(string memory filePath, uint256 indexToProve, address recipient, IRewardsCoordinator.EarnerTreeMerkleLeaf calldata earnerLeaf) public { | ||
// SetupPaymentsLib.processClaim( | ||
// IRewardsCoordinator(coreDeployment.rewardsCoordinator), | ||
// filePath, | ||
// indexToProve, | ||
// recipient, | ||
// earnerLeaf, | ||
// NUM_TOKEN_EARNINGS, | ||
// helloWorldDeployment.strategy | ||
// ); | ||
// } | ||
|
||
function submitPaymentRoot(address[] calldata earners) public { | ||
SetupPaymentsLib.submitPaymentRoot( | ||
IRewardsCoordinator(coreDeployment.rewardsCoordinator), | ||
earners, | ||
helloWorldDeployment.strategy, | ||
NUM_PAYMENTS, | ||
NUM_TOKEN_EARNINGS, | ||
TOKEN_EARNINGS | ||
); | ||
} | ||
// function submitPaymentRoot(address[] calldata earners, uint32 endTimestamp) public { | ||
// SetupPaymentsLib.submitRoot( | ||
// IRewardsCoordinator(coreDeployment.rewardsCoordinator), | ||
// earners, | ||
// helloWorldDeployment.strategy, | ||
// endTimestamp, | ||
// NUM_PAYMENTS, | ||
// NUM_TOKEN_EARNINGS, | ||
// TOKEN_EARNINGS | ||
// ); | ||
// } | ||
|
||
function createPaymentRoot(address[] calldata earners) public returns (bytes32) { | ||
return SetupPaymentsLib.createPaymentRoot( | ||
IRewardsCoordinator(coreDeployment.rewardsCoordinator), | ||
earners, | ||
NUM_PAYMENTS, | ||
NUM_TOKEN_EARNINGS, | ||
TOKEN_EARNINGS, | ||
helloWorldDeployment.strategy | ||
); | ||
} | ||
} | ||
// function createPaymentRoot(address[] calldata earners) public returns (bytes32) { | ||
// return SetupPaymentsLib.createPaymentRoot( | ||
// IRewardsCoordinator(coreDeployment.rewardsCoordinator), | ||
// earners, | ||
// NUM_PAYMENTS, | ||
// NUM_TOKEN_EARNINGS, | ||
// TOKEN_EARNINGS, | ||
// helloWorldDeployment.strategy | ||
// ); | ||
// } | ||
// } |
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