Skip to content

Commit 931d39b

Browse files
committed
Cleanup debugging console logs
1 parent a9eaeb3 commit 931d39b

File tree

4 files changed

+0
-51
lines changed

4 files changed

+0
-51
lines changed

contracts/anchors/bridged/AnchorBase.sol

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
pragma solidity ^0.8.0;
77

8-
import "hardhat/console.sol";
98
import "../../trees/MerkleTreePoseidon.sol";
109
import "../../interfaces/IVerifier.sol";
1110
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
@@ -237,7 +236,6 @@ abstract contract AnchorBase is MerkleTreePoseidon, ReentrancyGuard {
237236
bytes calldata _proof,
238237
PublicInputs calldata _publicInputs
239238
) external payable nonReentrant {
240-
console.logBytes( _publicInputs._roots);
241239
require(_publicInputs._fee <= denomination, "Fee exceeds transfer value");
242240
require(!nullifierHashes[_publicInputs._nullifierHash], "The note has been already spent");
243241

@@ -251,8 +249,6 @@ abstract contract AnchorBase is MerkleTreePoseidon, ReentrancyGuard {
251249
_publicInputs._refund
252250
);
253251

254-
console.logBytes32(roots[0]);
255-
256252
require(isValidRoots(roots), "Invalid roots");
257253
require(verify(_proof, encodedInput), "Invalid withdraw proof");
258254

contracts/verifiers/Verifier2.sol

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
//
1212
//
1313
// SPDX-License-Identifier: GPL-3.0
14-
import "hardhat/console.sol";
15-
1614
pragma solidity ^0.8.0;
1715
library Pairing {
1816
struct G1Point {
@@ -280,25 +278,11 @@ contract Verifier2 {
280278
uint[2] memory c,
281279
uint[9] memory input
282280
) public view returns (bool r) {
283-
console.log("input[0]: %s", input[0]);
284-
console.log("input[1]: %s", input[1]);
285-
console.log("input[2]: %s", input[2]);
286-
console.log("input[3]: %s", input[3]);
287-
console.log("input[4]: %s", input[4]);
288-
console.log("input[5]: %s", input[5]);
289-
console.log("input[6]: %s", input[6]);
290-
console.log("input[7]: %s", input[7]);
291-
console.log("input[8]: %s", input[8]);
292-
293281
Proof memory proof;
294282
proof.A = Pairing.G1Point(a[0], a[1]);
295283
proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);
296284
proof.C = Pairing.G1Point(c[0], c[1]);
297285
uint[] memory inputValues = new uint[](input.length);
298-
console.log('proof A: %s, %s', a[0], a[1]);
299-
console.log('proof B[0]: [%s, %s]', b[0][0], b[0][1]);
300-
console.log('proof B[1]: [%s, %s]', b[1][0], b[1][1]);
301-
console.log('proof C: %s, %s', c[0], c[1]);
302286
for(uint i = 0; i < input.length; i++){
303287
inputValues[i] = input[i];
304288
}

contracts/verifiers/Verifier3.sol

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
//
1212
//
1313
// SPDX-License-Identifier: GPL-3.0
14-
import "hardhat/console.sol";
15-
1614
pragma solidity ^0.8.0;
1715
library Pairing {
1816
struct G1Point {
@@ -285,25 +283,11 @@ contract Verifier3 {
285283
uint[2] memory c,
286284
uint[10] memory input
287285
) public view returns (bool r) {
288-
console.log("input[0]: %s", input[0]);
289-
console.log("input[1]: %s", input[1]);
290-
console.log("input[2]: %s", input[2]);
291-
console.log("input[3]: %s", input[3]);
292-
console.log("input[4]: %s", input[4]);
293-
console.log("input[5]: %s", input[5]);
294-
console.log("input[6]: %s", input[6]);
295-
console.log("input[7]: %s", input[7]);
296-
console.log("input[8]: %s", input[8]);
297-
console.log("input[9]: %s", input[9]);
298286

299287
Proof memory proof;
300288
proof.A = Pairing.G1Point(a[0], a[1]);
301289
proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);
302290
proof.C = Pairing.G1Point(c[0], c[1]);
303-
console.log('proof A: %s, %s', a[0], a[1]);
304-
console.log('proof B[0]: [%s, %s]', b[0][0], b[0][1]);
305-
console.log('proof B[1]: [%s, %s]', b[1][0], b[1][1]);
306-
console.log('proof C: %s, %s', c[0], c[1]);
307291
uint[] memory inputValues = new uint[](input.length);
308292
for(uint i = 0; i < input.length; i++){
309293
inputValues[i] = input[i];

lib/darkwebb/Anchor.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ class Anchor {
184184

185185
public static async generateWithdrawProofCallData(proof: any, publicSignals: any) {
186186
const result = await Anchor.groth16ExportSolidityCallData(proof, publicSignals);
187-
console.log('output from groth16ExportSolidityCallData', result);
188187
const fullProof = JSON.parse("[" + result + "]");
189188
const pi_a = fullProof[0];
190189
const pi_b = fullProof[1];
@@ -353,13 +352,10 @@ class Anchor {
353352
let proof = res.proof;
354353
let publicSignals = res.publicSignals;
355354

356-
console.log('publicSignals passed to generateWithdrawProofCallData: ', publicSignals);
357-
358355
const vKey = await snarkjs.zKey.exportVerificationKey(this.circuitZkeyPath);
359356
res = await snarkjs.groth16.verify(vKey, publicSignals, proof);
360357

361358
let proofEncoded = await Anchor.generateWithdrawProofCallData(proof, publicSignals);
362-
console.log('proofEncoded: ', proofEncoded);
363359
return proofEncoded;
364360
}
365361

@@ -457,8 +453,6 @@ class Anchor {
457453
pathIndices,
458454
);
459455

460-
console.log('anchor input', input);
461-
462456
const wtns = await this.createWitness(input);
463457
let proofEncoded = await this.proveAndVerify(wtns);
464458

@@ -474,8 +468,6 @@ class Anchor {
474468

475469
const publicInputs = Anchor.convertArgsArrayToStruct(args);
476470

477-
console.log('args from normal withdraw', args);
478-
479471
//@ts-ignore
480472
let tx = await this.contract.withdrawAndUnwrap(`0x${proofEncoded}`, publicInputs, tokenAddress, { gasLimit: '0x5B8D80' });
481473
const receipt = await tx.wait();
@@ -497,18 +489,15 @@ class Anchor {
497489
tokenAddress: string,
498490
) {
499491
const { pathElements, pathIndices, merkleRoot } = merkleProof;
500-
console.log('merkle root: ', toFixedHex(merkleRoot));
501492
const isKnownNeighborRoot = await this.contract.isKnownNeighborRoot(deposit.originChainId, toFixedHex(merkleRoot));
502493
if (!isKnownNeighborRoot) {
503494
throw new Error("Neighbor root not found");
504495
}
505496
refreshCommitment = (refreshCommitment) ? refreshCommitment : '0';
506497

507498
const lastRoot = await this.tree.get_root();
508-
console.log('lastRoot: ', toFixedHex(lastRoot));
509499

510500
const roots = await this.populateRootsForProof();
511-
console.log('roots from anchor bridged withdraw: ', roots);
512501

513502
const input = await this.generateWitnessInput(
514503
deposit.deposit,
@@ -523,8 +512,6 @@ class Anchor {
523512
pathIndices,
524513
);
525514

526-
console.log('input: ', input);
527-
528515
const wtns = await this.createWitness(input);
529516
let proofEncoded = await this.proveAndVerify(wtns);
530517

@@ -540,8 +527,6 @@ class Anchor {
540527

541528
const publicInputs = Anchor.convertArgsArrayToStruct(args);
542529

543-
console.log('public inputs: ', publicInputs);
544-
545530
//@ts-ignore
546531
let tx = await this.contract.withdraw(
547532
`0x${proofEncoded}`,

0 commit comments

Comments
 (0)