forked from Layr-Labs/incredible-squaring-avs
-
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.
Merge pull request #9 from Hydrogen-Labs/anzen-working-branch
Moar features
- Loading branch information
Showing
40 changed files
with
286 additions
and
72 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 |
---|---|---|
|
@@ -32,3 +32,6 @@ id_rsa | |
*/holesky/*.yaml | ||
!*/holesky/*sample*.yaml | ||
tests/keys/holesky*.json | ||
|
||
*.env | ||
!sample*.env |
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,20 @@ | ||
version: "3" | ||
|
||
services: | ||
aggregator: | ||
image: ghcr.io/hydrogen-labs/anzen-avs/aggregator/cmd/main.go:latest | ||
container_name: anzen-aggregator | ||
volumes: | ||
- ./:/anzen/ | ||
working_dir: /anzen | ||
ports: | ||
- "8090:8090" | ||
command: | ||
- --config | ||
- config-files/holesky/aggregator.yaml | ||
- --anzen-deployment | ||
- contracts/script/output/17000/anzen_avs_deployment_output.json | ||
- --ecdsa-private-key | ||
- ${ECDSA_PRIVATE_KEY} | ||
env_file: | ||
- .env |
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
File renamed without changes.
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
RPC_URL="" | ||
DEPLOYER_PRIVATE_KEY="" | ||
DEPLOYER_ADDR="" | ||
DEPLOYMENT_SALT="" | ||
DEPLOYMENT_SALT="" | ||
INIT_AGGREGATOR_ADDR="" | ||
INIT_TASK_GENERATOR_ADDR="" |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.9; | ||
|
||
import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; | ||
|
||
import {AnzenServiceManager, IServiceManager} from "../src/AnzenServiceManager.sol"; | ||
import {AVSReservesManagerFactory} from "../src/AVSReservesManagerFactory.sol"; | ||
import {SafetyFactorConfig} from "../src/SafetyFactorOracle.sol"; | ||
import "../../src/tests/mocks/ERC20Mock.sol"; | ||
|
||
import {Utils} from "./utils/Utils.sol"; | ||
|
||
import "forge-std/Test.sol"; | ||
import "forge-std/Script.sol"; | ||
import "forge-std/StdJson.sol"; | ||
import "forge-std/console.sol"; | ||
|
||
// # To deploy and verify our contract | ||
// forge script script/OnboardNewAvsToAnzen.s.sol:OnboardNewAvsToAnzen --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast -vvvv | ||
contract OnboardNewAvsToAnzen is Script, Utils { | ||
// DEPLOYMENT CONSTANTS | ||
|
||
bytes32 public salt = keccak256(abi.encodePacked(vm.envString("DEPLOYMENT_SALT"))); | ||
AVSReservesManagerFactory public avsReservesManagerFactory; | ||
|
||
address public avsServiceManagerAddr; | ||
|
||
ProxyAdmin public avsProxyAdmin; | ||
address public newAvsReservesManager; | ||
address public newAvsReservesManagerImplementation; | ||
uint32 public avsId; | ||
|
||
function run() external { | ||
address anzenCommunityMultisig = msg.sender; | ||
|
||
string memory anzenDeployedContracts = readOutput("anzen_avs_deployment_output"); | ||
|
||
avsReservesManagerFactory = AVSReservesManagerFactory( | ||
stdJson.readAddress(anzenDeployedContracts, ".addresses.avsReservesManagerFactory") | ||
); | ||
|
||
avsId = avsReservesManagerFactory.lastAVSReservesManagerId(); | ||
|
||
vm.startBroadcast(); | ||
_onboardAVSToAnzen(anzenCommunityMultisig); | ||
vm.stopBroadcast(); | ||
} | ||
|
||
function _onboardAVSToAnzen(address anzenCommunityMultisig) internal { | ||
// deploy proxy admin for ability to upgrade proxy contracts | ||
avsProxyAdmin = new ProxyAdmin(); | ||
|
||
// hard-coded inputs | ||
_churnSalt(); | ||
|
||
// TODO: make all of this inputs configurable with the environment | ||
SafetyFactorConfig memory safetyFactorConfig = SafetyFactorConfig(200_000, 300_000, 200_000, 200_000, 1 days); | ||
|
||
(newAvsReservesManager, newAvsReservesManagerImplementation) = avsReservesManagerFactory | ||
.createAVSReservesManager( | ||
address(avsProxyAdmin), | ||
safetyFactorConfig, | ||
anzenCommunityMultisig, | ||
avsServiceManagerAddr, | ||
new address[](0), | ||
new uint256[](0) | ||
); | ||
|
||
// write the output | ||
writeAvsOnboardingOutput( | ||
address(avsProxyAdmin), newAvsReservesManager, newAvsReservesManagerImplementation, avsId | ||
); | ||
} | ||
|
||
function _churnSalt() internal { | ||
salt = keccak256(abi.encode(salt)); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
contracts/script/output/17000/anzen_avs_deployment_output.json
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,17 @@ | ||
{ | ||
"addresses": { | ||
"anzenProxyAdmin": "0x2f54a8eb31eE7dB69ab1274E639b6D10be06bE38", | ||
"anzenServiceManager": "0x08F06c24c5D1A1dDb622648c1D4E7c154c9a6c99", | ||
"anzenServiceManagerImplementation": "0x119F2D9Cfc02Fe209389797590191a186f77C2a2", | ||
"anzenTaskManager": "0xCeCb4eD0260FDa2F7A6E7C82aD4446c9342A4dca", | ||
"anzenTaskManagerImplementation": "0x473639B80374CF706a3e1F60047a873E546F6A2a", | ||
"avsReservesManagerFactory": "0x0DCac0E6A5CeFe3EA3DE4154C73C71D9D2425835", | ||
"avsReservesManagerFactoryImplementation": "0xcd4Bfca45dA1B2af66aB31a7f53D859322253DB9", | ||
"erc20Strategy": "0x80528D6e9A2BAbFc766965E0E26d5aB08D9CFaF9", | ||
"operatorStateRetriever": "0x2BC7cD9f76a157eeAc36913190d4bdA737039474", | ||
"registryCoordinator": "0xFE5F9f731bfC44e232bFCDe65B224122fCCd40fe", | ||
"registryCoordinatorImplementation": "0x4160558A8D206dAFD0a918FB1C4C58D258e976fc", | ||
"safetyFactorOracle": "0xd99652eD79836802615D2C4bE76826fCeF988b8a", | ||
"safetyFactorOracleImplementation": "0x15A5E4b17e42Be4Cbf4bF7A888515beF1a4Ed97e" | ||
} | ||
} |
19 changes: 0 additions & 19 deletions
19
contracts/script/output/17000/holesky_anzen_avs_deployment_output.json
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
contracts/script/output/17000/onboarded_avs_outputs/0_deployment_output.json
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,7 @@ | ||
{ | ||
"avs_addresses": { | ||
"avsProxyAdmin": "0x2f54a8eb31eE7dB69ab1274E639b6D10be06bE38", | ||
"avsReservesManager": "0x17bb61b6a2F3F75F9E4371a305AB1985A2eA6712", | ||
"avsReservesManagerImplementation": "0xfF476333eDacBb5a2baf8c7CB15c6aB57c1fe675" | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
contracts/script/output/31337/onboarded_avs_outputs/0_deployment_output.json
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,7 @@ | ||
{ | ||
"avs_addresses": { | ||
"avsProxyAdmin": "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E", | ||
"avsReservesManager": "0x3c5bb6747794374fA8E812f2BAA33f63349cAB40", | ||
"avsReservesManagerImplementation": "0x47b36E824631e97E94d462F822181Ed08A459384" | ||
} | ||
} |
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
Oops, something went wrong.