Skip to content

Commit

Permalink
Parameterize Sudoku Holesky address (#355)
Browse files Browse the repository at this point in the history
* [WIP] Start adding devnet flag

* Add devnet flag

* Point SDK to Mina branch

* Lock SDK branch

* Fix settlement contract

* Parameterize state and account contract addresses

* Update example address and unwrap bridge addresses

* Update Aligned

* Reuse BATCHER_ETH_ADDR

* Point SDK to VK branch

* Replace aligned SM env var name with used in SDK

* Fix clippy

* Remove zkapp state logging

* Parameterize Sudoku Holesky address
  • Loading branch information
gabrielbosio authored Oct 2, 2024
1 parent 0a7063b commit f3bb736
Showing 1 changed file with 11 additions and 8 deletions.
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

0 comments on commit f3bb736

Please sign in to comment.