Created
October 13, 2024 06:15
-
-
Save numtel/6dee99a96fae01113f839a01af57c733 to your computer and use it in GitHub Desktop.
ZK Email SDK verify on Circuitscan
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
#!/bin/bash | |
# Set to any circuit on https://sdk.prove.email/ | |
CIRCUIT="strobe/proof-of-price-2" | |
INSTANCE_SIZE=128 | |
CHAIN=sepolia | |
CIRCUIT_DIR="${CIRCUIT//\//-}" | |
echo "Downloading $CIRCUIT to $CIRCUIT_DIR..." | |
mkdir $CIRCUIT_DIR | |
cd $CIRCUIT_DIR | |
curl -Lo project.zip https://sdk.prove.email/api/download/$CIRCUIT | |
unzip project.zip | |
CIRCUIT_NAME=`node -e " | |
process.stdout.write( | |
fs.readFileSync('index.ts', 'utf8') | |
.match(/path.join\(__dirname, \".\/circuit\/([a-zA-Z0-9_-]+).circom\"\)/)[1]) | |
"` | |
curl -Lo try.html https://sdk.prove.email/try/$CIRCUIT | |
# Circuit must be verified on sourcify or etherscan | |
CIRCUIT_ADDR=`node -e " | |
process.stdout.write( | |
fs.readFileSync('try.html', 'utf8') | |
.split('verifierContractAddress') | |
.pop() | |
.slice(5,47)) | |
"` | |
npm install | |
# This forces the cli to load dependencies from this root directory | |
echo '{"include":["node_modules"]}' >> circomkit.json | |
echo "Verifying $CIRCUIT_NAME at $CIRCUIT_ADDR on $CHAIN..." | |
MY_CMD="circuitscan verify:circom \ | |
circuit/$CIRCUIT_NAME.circom \ | |
$CHAIN \ | |
$CIRCUIT_ADDR \ | |
-k https://sdk.prove.email/api/download_zkey/$CIRCUIT \ | |
-v v2.1.8 \ | |
-s 0.7.4 \ | |
-i $INSTANCE_SIZE \ | |
" | |
echo "Running $MY_CMD" | |
eval $MY_CMD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment