From 4eeedecfa7b47cb726c3418e417ed02d838c63ab Mon Sep 17 00:00:00 2001 From: nikkolasg Date: Fri, 31 May 2024 23:25:21 +0200 Subject: [PATCH 1/2] mainnet contracts --- lgn-worker/src/avs/contract.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/lgn-worker/src/avs/contract.rs b/lgn-worker/src/avs/contract.rs index 4592838..23747f8 100644 --- a/lgn-worker/src/avs/contract.rs +++ b/lgn-worker/src/avs/contract.rs @@ -8,12 +8,14 @@ use std::sync::Arc; /// ZKMR service manager address as an argument (avs) to call the contract /// function `calculateOperatorAVSRegistrationDigestHash` /// - currently same address for mainnet and holesky -const ZKMR_SERVICE_MANAGER_ADDR: &str = "0xf98D5De1014110C65c51b85Ea55f73863215CC10"; +const HOLESKY_ZKMR_SERVICE_MANAGER_ADDR: &str = "0xf98D5De1014110C65c51b85Ea55f73863215CC10"; +const MAINNET_ZKMR_SERVICE_MANAGER_ADDR: &str = "0x22CAc0e6A1465F043428e8AeF737b3cb09D0eEDa"; /// ZKMRStakeRegistry contract address /// /// - currently same address for mainnet and holesky -const ZKMR_STAKE_REGISTRY_ADDR: &str = "0xf724cDC7C40fd6B59590C624E8F0E5E3843b4BE4"; +const HOLESKY_ZKMR_STAKE_REGISTRY_ADDR: &str = "0xf724cDC7C40fd6B59590C624E8F0E5E3843b4BE4"; +const MAINNET_ZKMR_STAKE_REGISTRY_ADDR: &str = "0x8dcdCc50Cc00Fe898b037bF61cCf3bf9ba46f15C"; /// AVSDirectory contract address /// from https://github.com/Layr-Labs/eigenlayer-contracts?tab=readme-ov-file#deployments @@ -64,23 +66,20 @@ impl Network { /// Returns the address of the lagrange registry necessary to register an operator /// on Lagrange Network AVS fn lagrange_registry_address(&self) -> Address { - // match self { - // // keeping optionality to have different address if it comes up one day - // _ => ZKMR_STAKE_REGISTRY_ADDR.to_string(), - // } - ZKMR_STAKE_REGISTRY_ADDR - .to_string() + match self { + Network::Mainnet => MAINNET_ZKMR_STAKE_REGISTRY_ADDR, + Network::Holesky => HOLESKY_ZKMR_STAKE_REGISTRY_ADDR, + }.to_string() .parse() .expect("invalid registry address") } /// Returns the address of the service manager contract. Necessary input to /// compute the right avs digest hash for the registration signature. fn lagrange_service_manager_address(&self) -> Address { - // match self { - // _ => ZKMR_SERVICE_MANAGER_ADDR.to_string(), - // } - ZKMR_SERVICE_MANAGER_ADDR - .to_string() + match self { + Network::Mainnet => MAINNET_ZKMR_SERVICE_MANAGER_ADDR, + Network::Holesky => HOLESKY_ZKMR_SERVICE_MANAGER_ADDR, + }.to_string() .parse() .expect("invalid service manager address") } From aa9ea4609883a68bbcaa1b6bf5902e4d3b98108a Mon Sep 17 00:00:00 2001 From: nikkolasg Date: Fri, 31 May 2024 23:27:09 +0200 Subject: [PATCH 2/2] fmt --- lgn-worker/src/avs/contract.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lgn-worker/src/avs/contract.rs b/lgn-worker/src/avs/contract.rs index 23747f8..58187fc 100644 --- a/lgn-worker/src/avs/contract.rs +++ b/lgn-worker/src/avs/contract.rs @@ -69,9 +69,10 @@ impl Network { match self { Network::Mainnet => MAINNET_ZKMR_STAKE_REGISTRY_ADDR, Network::Holesky => HOLESKY_ZKMR_STAKE_REGISTRY_ADDR, - }.to_string() - .parse() - .expect("invalid registry address") + } + .to_string() + .parse() + .expect("invalid registry address") } /// Returns the address of the service manager contract. Necessary input to /// compute the right avs digest hash for the registration signature. @@ -79,9 +80,10 @@ impl Network { match self { Network::Mainnet => MAINNET_ZKMR_SERVICE_MANAGER_ADDR, Network::Holesky => HOLESKY_ZKMR_SERVICE_MANAGER_ADDR, - }.to_string() - .parse() - .expect("invalid service manager address") + } + .to_string() + .parse() + .expect("invalid service manager address") } /// Returns the delegation manager contract address necessary to ensure an operator is /// already registered or not yet.