-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parameterize Holesky contract addresses (#343)
* [WIP] Update Aligned to 0.7.0 We must wait until Aligned uploads the release for 0.7.0. Once it's uploaded we need to add a batcher payment service arg to the `updateChain` call in the Aligned polling service. * Update Aligned to 0.7.0 * Update Aligned branch * Update Aligned and Bridge contracts * Update Aligned Foundry submodule * Remove bridge addr constants and parameterize them
- Loading branch information
1 parent
b9ca11d
commit 7dac115
Showing
7 changed files
with
66 additions
and
76 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
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
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,32 @@ | ||
use aligned_sdk::core::types::Chain; | ||
|
||
use super::constants::{ | ||
ALIGNED_SM_DEVNET_ETH_ADDR, BRIDGE_ACCOUNT_DEVNET_ETH_ADDR, BRIDGE_DEVNET_ETH_ADDR, | ||
}; | ||
|
||
pub fn get_bridge_contract_addr(chain: &Chain) -> Result<String, String> { | ||
match chain { | ||
Chain::Devnet => Ok(BRIDGE_DEVNET_ETH_ADDR.to_owned()), | ||
Chain::Holesky => std::env::var("BRIDGE_HOLESKY_ETH_ADDR") | ||
.map_err(|err| format!("Error getting Bridge contract address: {err}")), | ||
_ => Err("Unimplemented Ethereum contract on selected chain".to_owned()), | ||
} | ||
} | ||
|
||
pub fn get_account_validation_contract_addr(chain: &Chain) -> Result<String, String> { | ||
match chain { | ||
Chain::Devnet => Ok(BRIDGE_ACCOUNT_DEVNET_ETH_ADDR.to_owned()), | ||
Chain::Holesky => std::env::var("BRIDGE_ACCOUNT_HOLESKY_ETH_ADDR") | ||
.map_err(|err| format!("Error getting Account validation contract address: {err}")), | ||
_ => Err("Unimplemented Ethereum contract on selected chain".to_owned()), | ||
} | ||
} | ||
|
||
pub fn get_aligned_sm_contract_addr(chain: &Chain) -> Result<String, String> { | ||
match chain { | ||
Chain::Devnet => Ok(ALIGNED_SM_DEVNET_ETH_ADDR.to_owned()), | ||
Chain::Holesky => std::env::var("ALIGNED_SM_HOLESKY_ETH_ADDR") | ||
.map_err(|err| format!("Error getting Aligned SM contract address: {err}")), | ||
_ => Err("Unimplemented Ethereum contract on selected chain".to_owned()), | ||
} | ||
} |
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,5 @@ | ||
pub mod constants; | ||
pub mod contract; | ||
pub mod env; | ||
pub mod wallet; | ||
pub mod wallet_alloy; |
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