You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the docs, we can use proofs created in the browser as parameters for a method in a Smart Contract which will get verified by the contract as follows:
@methodfoo(proof: Proof){proof.verify().assertTrue();/* ... the rest of our method * For example using the total value as the fee for some other transaction. */}
First of all, the previous code does not compile due to:
Proof being a generic type (Proof<I, O>)
Not being able to use Proof directly (we need to subclass it).
assertTrue() is not available due to verify() returning void.
Note how we're able to use FakeProof despite expecting a RealProof. Either the code above is incorrect (should be written differently), or this is a bug.
The text was updated successfully, but these errors were encountered:
According to the docs, we can use proofs created in the browser as parameters for a method in a Smart Contract which will get verified by the contract as follows:
First of all, the previous code does not compile due to:
Proof
being a generic type (Proof<I, O>
)Proof
directly (we need to subclass it).assertTrue()
is not available due toverify()
returningvoid
.I followed the code in the examples repository (https://github.com/o1-labs/docs2/blob/main/examples/zkapps/09-recursion/src/rollup.ts) and I ended up with the following example:
Note how we're able to use
FakeProof
despite expecting aRealProof
. Either the code above is incorrect (should be written differently), or this is a bug.The text was updated successfully, but these errors were encountered: