-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Smart contracts update: Groth16Proof instead of bytes (#683)
* Smart contracts update: Groth16Proof instead of bytes * Use dummy verifier for now, until we can create ZK proofs * Fix tests: submit proof only when slot is filled * Submit dummy proofs for now * More detailed log when proof submission failed * Use dummy verifier for integration tests For now at least * Fix mistake in blanket renaming to ethProvider * Update to latest codex-contracts-eth * feat: zkey-hash from chain * Fix zkeyHash --------- Co-authored-by: Adam Uhlíř <[email protected]>
- Loading branch information
1 parent
403b9ba
commit 2cf892c
Showing
26 changed files
with
164 additions
and
88 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
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
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,33 @@ | ||
import pkg/stint | ||
import pkg/contractabi | ||
import pkg/ethers/fields | ||
|
||
type | ||
Groth16Proof* = object | ||
a*: G1Point | ||
b*: G2Point | ||
c*: G1Point | ||
G1Point* = object | ||
x*: UInt256 | ||
y*: UInt256 | ||
G2Point* = object | ||
x*: array[2, UInt256] | ||
y*: array[2, UInt256] | ||
|
||
func solidityType*(_: type G1Point): string = | ||
solidityType(G1Point.fieldTypes) | ||
|
||
func solidityType*(_: type G2Point): string = | ||
solidityType(G2Point.fieldTypes) | ||
|
||
func solidityType*(_: type Groth16Proof): string = | ||
solidityType(Groth16Proof.fieldTypes) | ||
|
||
func encode*(encoder: var AbiEncoder, point: G1Point) = | ||
encoder.write(point.fieldValues) | ||
|
||
func encode*(encoder: var AbiEncoder, point: G2Point) = | ||
encoder.write(point.fieldValues) | ||
|
||
func encode*(encoder: var AbiEncoder, proof: Groth16Proof) = | ||
encoder.write(proof.fieldValues) |
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
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
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
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
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
Oops, something went wrong.