Skip to content

Commit

Permalink
Add sudoku validity holesky address as env var
Browse files Browse the repository at this point in the history
  • Loading branch information
xqft committed Sep 27, 2024
1 parent e9afbf0 commit 32e9732
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ ETH_CHAIN=<devnet/holesky>
MINA_RPC_URL=<url>
SAVE_PROOF=true/false # also false if other than "true" or variable were to be not defined

## A Mina fee payer account is needed for running the Sudoku example
#FEEPAYER_KEY=<private_key>
## These are necessary for running the Sudoku example
#FEEPAYER_KEY=<mina_private_key>
#SUDOKU_VALIDITY_HOLESKY_ADDRESS=<contract_addr>

## These can be skipped if using devnet with Anvil.
# BATCHER_ADDR=<optional>
Expand Down
8 changes: 6 additions & 2 deletions example/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use std::{process, str::FromStr, time::SystemTime};

const MINA_ZKAPP_ADDRESS: &str = "B62qmpq1JBejZYDQrZwASPRM5oLXW346WoXgbApVf5HJZXMWFPWFPuA";
const SUDOKU_VALIDITY_DEVNET_ADDRESS: &str = "0xb19b36b1456E65E3A6D514D3F715f204BD59f431";
const SUDOKU_VALIDITY_HOLESKY_ADDRESS: &str = "0xeAB6068E1e06941A9d47734FB49C3B9dD69E054d";

sol!(
#[allow(clippy::too_many_arguments)]
Expand Down Expand Up @@ -186,7 +185,12 @@ async fn main() {
debug!("Creating contract instance");
let sudoku_address = match chain {
Chain::Devnet => SUDOKU_VALIDITY_DEVNET_ADDRESS,
Chain::Holesky => SUDOKU_VALIDITY_HOLESKY_ADDRESS,
Chain::Holesky => {
&std::env::var("SUDOKU_VALIDITY_HOLESKY_ADDRESS").unwrap_or_else(|err| {
error!("Could not read SUDOKU_VALIDITY_HOLESKY_ADDRESS env var: {err}");
process::exit(1);
})
}
_ => todo!(),
};
let contract =
Expand Down

0 comments on commit 32e9732

Please sign in to comment.