File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,18 @@ template Withdraw(levels) {
5050 tree.pathElements[i] <== pathElements[i];
5151 tree.pathIndices[i] <== pathIndices[i];
5252 }
53+
54+ // Add hidden signals to make sure that tampering with recipient or fee will invalidate the snark proof
55+ // Most likely it is not required, but it's better to stay on the safe side and it only takes 2 constraints
56+ // Squares are used to prevent optimizer from removing those constraints
57+ signal recipientSquare;
58+ signal feeSquare;
59+ signal relayerSquare;
60+ signal refundSquare;
61+ recipientSquare <== recipient * recipient;
62+ feeSquare <== fee * fee;
63+ relayerSquare <== relayer * relayer;
64+ refundSquare <== refund * refund;
5365}
5466
5567component main = Withdraw(20 );
You can’t perform that action at this time.
0 commit comments