Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterize Sudoku Holesky address #355

Merged
merged 16 commits into from
Oct 2, 2024
Merged
Changes from all commits
Commits
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
19 changes: 11 additions & 8 deletions example/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ use mina_bridge_core::{
};
use std::{process, str::FromStr, time::SystemTime};

const MINA_ZKAPP_ADDRESS: &str = "B62qmpq1JBejZYDQrZwASPRM5oLXW346WoXgbApVf5HJZXMWFPWFPuA";
const MINA_ZKAPP_ADDRESS: &str = "B62qmKCv2HaPwVRHBKrDFGUpjSh3PPY9VqSa6ZweGAmj9hBQL4pfewn";
const SUDOKU_VALIDITY_DEVNET_ADDRESS: &str = "0x8ce361602B935680E8DeC218b820ff5056BeB7af";
const SUDOKU_VALIDITY_HOLESKY_ADDRESS: &str = "0x0091D1d9Bd92FFcfEb38383079AE849639224e3D";

sol!(
#[allow(clippy::too_many_arguments)]
Expand Down Expand Up @@ -70,6 +69,15 @@ async fn main() {
process::exit(1);
});

let sudoku_address = match chain {
Chain::Devnet => SUDOKU_VALIDITY_DEVNET_ADDRESS.to_string(),
Chain::Holesky => std::env::var("SUDOKU_VALIDITY_HOLESKY_ADDRESS").unwrap_or_else(|_| {
error!("Error getting Sudoku vality contract address");
process::exit(1);
}),
_ => todo!()
};

let wallet_alloy =
wallet_alloy::get_wallet(&chain, keystore_path.as_deref(), private_key.as_deref())
.unwrap_or_else(|err| {
Expand Down Expand Up @@ -194,13 +202,8 @@ async fn main() {
});

debug!("Creating contract instance");
let sudoku_address = match chain {
Chain::Devnet => SUDOKU_VALIDITY_DEVNET_ADDRESS,
Chain::Holesky => SUDOKU_VALIDITY_HOLESKY_ADDRESS,
_ => todo!(),
};
let contract =
SudokuValidity::new(Address::from_str(sudoku_address).unwrap(), provider);
SudokuValidity::new(Address::from_str(&sudoku_address).unwrap(), provider);

let call = contract.validateSolution(
proof_commitment.into(),
Expand Down