-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add example script to generate a verifier contract
- Loading branch information
1 parent
297779a
commit a22d895
Showing
5 changed files
with
45 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[package] | ||
name = "hello_world" | ||
type = "bin" | ||
authors = [""] | ||
compiler_version = ">=0.29.0" | ||
|
||
[dependencies] |
10 changes: 10 additions & 0 deletions
10
noir/noir-repo/examples/codegen-verifier/codegen_verifier.sh
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,10 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
BACKEND=${BACKEND:-bb} | ||
|
||
nargo compile | ||
|
||
# TODO: backend should automatically generate vk if necessary. | ||
$BACKEND write_vk -b ./target/hello_world.json | ||
$BACKEND contract -v ./target/vk |
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,3 @@ | ||
fn main(x: Field, y: pub Field) { | ||
assert(x != y); | ||
} |
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,13 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# This file is used for Noir CI and is not required. | ||
|
||
BACKEND=${BACKEND:-bb} | ||
|
||
./codegen_verifier.sh | ||
|
||
if ! [ -f ./target/contract.sol ]; then | ||
printf '%s\n' "Contract not written to file" >&2 | ||
exit 1 | ||
fi |