Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
742c262
feat: update submodules
adiwajshing Feb 12, 2025
8f42137
feat: deploy eigen-core working
adiwajshing Feb 12, 2025
0cbf910
feat: deploy reclaim working
adiwajshing Feb 12, 2025
e68fabe
feat: run chain w docker
adiwajshing Feb 12, 2025
71f596e
feat: functional avs w new updates
adiwajshing Feb 12, 2025
658eee4
Merge branch 'main' into avs-rewards
adiwajshing Feb 13, 2025
ebb34d8
feat: take fee for claim creation
adiwajshing Feb 13, 2025
9eb92e1
feat: reward distribution init
adiwajshing Feb 15, 2025
1c0c490
test: distribution of rewards
adiwajshing Feb 26, 2025
723df82
test: resolve issues
adiwajshing Feb 26, 2025
3635241
chore: add payments json to gitignore
adiwajshing Feb 27, 2025
3454c58
fix: setting minFee
adiwajshing Feb 27, 2025
6a0a5f7
fix: ignore
adiwajshing Feb 27, 2025
b8d5d82
refactor: use owner instead of admins
adiwajshing Mar 17, 2025
0ea893b
chore: remove eigen core
adiwajshing Apr 7, 2025
d067439
chore: update eigen contracts
adiwajshing Apr 7, 2025
a4862cd
feat: deployable eigen core
adiwajshing Apr 7, 2025
58286b8
refactor: reclaim task manager
adiwajshing May 13, 2025
183fe15
feat: operator set deployment
adiwajshing May 13, 2025
f057a72
wip: registration of operator
adiwajshing May 15, 2025
e78657a
chore: add test operator metadata
adiwajshing May 19, 2025
7dee830
wip: register operator
adiwajshing Jun 4, 2025
c7ddf6e
wip: contracts update
adiwajshing Jun 4, 2025
afeeaac
chore: remove redundant files
adiwajshing Jun 4, 2025
9487d87
tmp: rm middleware
adiwajshing Jun 4, 2025
8f658eb
wip: update eigen
adiwajshing Jun 12, 2025
e0418e4
feat: deployable reclaim contracts
adiwajshing Jun 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ ngrok.yml
src/test.ts
.env.*
.cache
envs
envs
avs/contracts/mockData/payments.json
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
[submodule "avs/contracts/lib/forge-std"]
path = avs/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
branch = v1.8.2
[submodule "avs/contracts/lib/openzeppelin-contracts"]
path = avs/contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
branch = v4.7.3
[submodule "avs/contracts/lib/eigenlayer-middleware"]
path = avs/contracts/lib/eigenlayer-middleware
url = https://github.com/layr-Labs/eigenlayer-middleware
branch = v0.2.0-rc1-holesky-preprod-payments
3 changes: 3 additions & 0 deletions avs/contracts/.gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
45 changes: 45 additions & 0 deletions avs/contracts/config/core/31337.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"strategyManager": {
"init_paused_status": 0,
"initial_owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"initial_strategy_whitelister": "0x959922be3caee4b8cd9a407cc3ac1c251c2007b1",
"init_withdrawal_delay_blocks": 1
},
"delegationManager": {
"init_paused_status": 0,
"init_withdrawal_delay_blocks": 1,
"initial_owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"min_withdrawal_delay_blocks": 50400
},
"eigenPodManager": {
"init_paused_status": 0,
"initial_owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
},
"allocationManager": {
"init_paused_status": 0,
"initial_owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"deallocation_delay": 0,
"allocation_configuration_delay": 0
},
"strategyFactory": {
"init_paused_status": 0,
"initial_owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
},
"avsDirectory": {
"init_paused_status": 0,
"initial_owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
},
"rewardsCoordinator": {
"init_paused_status": 0,
"initial_owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"rewards_updater": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955",
"activation_delay": 0,
"default_split_bips": 1000,
"calculation_interval_seconds": 86400,
"MAX_REWARDS_DURATION": 864000,
"MAX_RETROACTIVE_LENGTH": 432000,
"MAX_FUTURE_LENGTH": 86400,
"GENESIS_REWARDS_TIMESTAMP": 1672531200,
"global_operator_commission_bips": 1000
}
}
10 changes: 10 additions & 0 deletions avs/contracts/config/reclaim/31337.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"addresses": {
"rewardsOwner": "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f",
"rewardsInitiator": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720"
},
"keys": {
"rewardsOwner": "0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97",
"rewardsInitiator": "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6"
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove and Secure Private Keys
Committing private keys directly in a repository poses a significant security risk. Move these keys to a secure vault or load them via environment variables at runtime, and update scripts to reference non-committed secrets.

🤖 Prompt for AI Agents
In avs/contracts/config/reclaim/31337.json lines 1 to 10, private keys are
committed directly in the file, which is a security risk. Remove the private
keys from this JSON file, store them securely in a vault or environment
variables, and modify any code or scripts that use these keys to load them
dynamically at runtime from the secure source instead of the committed file.

11 changes: 5 additions & 6 deletions avs/contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ libs = ["lib"]
fs_permissions = [{ access = "read-write", path = "./"}]

remappings = [
"@eigenlayer/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/src/",
"@eigenlayer/contracts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/src/contracts/",
"@eigenlayer/test/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/src/test/",
"@eigenlayer-scripts/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/script/",
"@eigenlayer-middleware/=lib/eigenlayer-middleware/",
"@openzeppelin/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts/",
"@openzeppelin-upgrades/=lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"@openzeppelin-upgrades/=lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/",
"forge-std/=lib/forge-std/src/"
]

Expand All @@ -24,6 +25,4 @@ optimizer_runs = 200
# Whether or not to use the Yul intermediate representation compilation pipeline
via_ir = false
# Override the Solidity version (this overrides `auto_detect_solc`)
auto_detect_solc = true

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
auto_detect_solc = true
2 changes: 1 addition & 1 deletion avs/contracts/lib/eigenlayer-middleware
2 changes: 1 addition & 1 deletion avs/contracts/lib/forge-std
Empty file added avs/contracts/mockData/.gitadd
Empty file.
13 changes: 13 additions & 0 deletions avs/contracts/reclaim.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"num_quorums": 1,
"operator_params": [10000,15000,100],
"operator_addr": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"operator_2_addr":"0x0b065a0423f076a340f37e16e1ce22e23d66caf2",
"contracts_registry_addr": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
"task_generator_addr": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"aggregator_addr":"0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"rewards_owner_addr": "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f",
"rewards_initiator_addr": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"rewards_owner_key": "0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97",
"rewards_initiator_key": "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6"
}
Comment on lines +1 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Critical security concern: Plaintext private keys in configuration file

This configuration file contains private keys in plaintext (lines 11-12), which presents a significant security risk if committed to version control.

Never store private keys in configuration files that might be committed to a repository. Instead:

  1. Use environment variables or a secure secrets management solution
  2. Replace the current implementation with a pattern like:
{
  "rewards_owner_key": "${REWARDS_OWNER_KEY}",
  "rewards_initiator_key": "${REWARDS_INITIATOR_KEY}"
}
  1. Update your deployment scripts to inject these values from secure sources

Also consider adding documentation comments explaining what each parameter represents, particularly the meaning of the numeric values in operator_params.

🤖 Prompt for AI Agents
In avs/contracts/reclaim.json lines 1 to 13, private keys are stored in
plaintext, which is a critical security risk. Remove the actual private key
values and replace them with environment variable placeholders like
"${REWARDS_OWNER_KEY}" and "${REWARDS_INITIATOR_KEY}". Update deployment scripts
to inject these secrets securely from environment variables or a secrets
manager. Additionally, add comments to document the purpose of each parameter,
especially clarifying the numeric values in "operator_params".

102 changes: 0 additions & 102 deletions avs/contracts/script/AddNewStrategy.s.sol

This file was deleted.

33 changes: 33 additions & 0 deletions avs/contracts/script/DeployEigenLayerCore.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;

import {Script} from "forge-std/Script.sol";
import {console2} from "forge-std/console2.sol";
import {CoreDeploymentLib} from "./utils/CoreDeploymentLib.sol";
import {UpgradeableProxyLib} from "./utils/UpgradeableProxyLib.sol";

contract DeployEigenlayerCore is Script {
using CoreDeploymentLib for *;
using UpgradeableProxyLib for address;

address internal deployer;
address internal proxyAdmin;
CoreDeploymentLib.DeploymentData internal deploymentData;
CoreDeploymentLib.DeploymentConfigData internal configData;

function setUp() public virtual {
deployer = vm.rememberKey(vm.envUint("PRIVATE_KEY"));
vm.label(deployer, "Deployer");
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for missing PRIVATE_KEY environment variable

The script will fail if the PRIVATE_KEY environment variable is not set, but without a clear error message.

Add validation for the required environment variable:

 function setUp() public virtual {
+    // Check if PRIVATE_KEY is set
+    string memory privateKeyStr = vm.envOr("PRIVATE_KEY", string(""));
+    require(bytes(privateKeyStr).length > 0, "PRIVATE_KEY environment variable not set");
+    
     deployer = vm.rememberKey(vm.envUint("PRIVATE_KEY"));
     vm.label(deployer, "Deployer");
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function setUp() public virtual {
deployer = vm.rememberKey(vm.envUint("PRIVATE_KEY"));
vm.label(deployer, "Deployer");
}
function setUp() public virtual {
// Check if PRIVATE_KEY is set
string memory privateKeyStr = vm.envOr("PRIVATE_KEY", string(""));
require(bytes(privateKeyStr).length > 0, "PRIVATE_KEY environment variable not set");
deployer = vm.rememberKey(vm.envUint("PRIVATE_KEY"));
vm.label(deployer, "Deployer");
}
🤖 Prompt for AI Agents
In avs/contracts/script/DeployEigenLayerCore.s.sol around lines 18 to 21, the
setUp function uses vm.envUint("PRIVATE_KEY") without checking if the
environment variable is set, which can cause unclear failures. Add validation to
check if the PRIVATE_KEY environment variable is present before using it, and if
missing, revert or throw an error with a clear message indicating that the
PRIVATE_KEY environment variable is required.


function run() external {
vm.startBroadcast(deployer);

configData = CoreDeploymentLib.readDeploymentConfigValues("config/core/", block.chainid);
proxyAdmin = UpgradeableProxyLib.deployProxyAdmin();
deploymentData = CoreDeploymentLib.deployContracts(deployer, proxyAdmin, configData);
vm.stopBroadcast();
string memory deploymentPath = "script/deployments/core/";
CoreDeploymentLib.writeDeploymentJson(deploymentPath, block.chainid, deploymentData);
}
}
Loading