diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e8423bf32..e91f79440 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,15 +1,13 @@ name: Lint sol&js on: push: - branches: + branches: - main - - zkpay_dev pull_request: branches: - main - - zkpay_dev -jobs: +jobs: lint_contract: name: Lint contracts runs-on: ubuntu-latest @@ -19,7 +17,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v2 with: - node-version: 16.x + node-version: 18.x - run: yarn install --frozen-lockfile - name: Lint Check run: yarn lint_sol @@ -32,7 +30,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-node@v2 with: - node-version: 16.x + node-version: 18.x - run: yarn install --frozen-lockfile - name: Lint Check run: yarn lint_ts diff --git a/circuits/main_withdraw.input.json b/circuits/main_withdraw.input.json index 3e538019b..a77e0ccff 100644 --- a/circuits/main_withdraw.input.json +++ b/circuits/main_withdraw.input.json @@ -1 +1 @@ -{"enabled":1,"R8x":"7900057579831422969066755372143079471642596886732364045376106897045652807008","R8y":"8818544028041482152234736710206694128344868195461809522920816117882142230858","S":"566679549899229622296419731124176987168003503944743734081109116527164618222","Ax":"4854053237640473781395610862462666107784372287183459153936262864492585154525","Ay":"17441031726860011567553620519245579541047388794195077744833836453389085545835","M":"1979475358490882782695234604362398132934050455360496620085373760138828661113"} \ No newline at end of file +{"enabled":1,"R8x":"14835429160084229263980736429010862925093067454856770951220172356481476793011","R8y":"8395120844545464594124235125135514943153271556646889396555467812847391403203","S":"2503681320018556796117432633228684372939133139383604611918969220943130163612","Ax":"14028971658484380332061247268348191054127422804603118271234954431121924869048","Ay":"21837818007645860566633743767426957359972637892590699800114945700783710026893","M":"1979475358490882782695234604362398132934050455360496620085373760138828661113"} \ No newline at end of file diff --git a/core/lib/account.ts b/core/lib/account.ts index afc236905..0cd3bd9fe 100644 --- a/core/lib/account.ts +++ b/core/lib/account.ts @@ -257,60 +257,32 @@ export class AccountCircuit { static readonly PROOF_ID_TYPE_MIGRATE: number = 12; static readonly PROOF_ID_TYPE_UPDATE: number = 13; - proofId: number; - outputNCs: bigint[]; + proofId: number = 0; + outputNCs: bigint[] = []; // dataTreeRoot: bigint; // siblingsAC: bigint[]; - aliasHash: bigint; - accountPubKey: bigint[]; - signingPubKey: bigint[]; + aliasHash: bigint = 0n; + accountPubKey: bigint[] = []; + signingPubKey: bigint[] = []; - newAccountPubKey: bigint[]; - newSigningPubKey1: bigint[]; - newSigningPubKey2: bigint[]; + newAccountPubKey: bigint[] = []; + newSigningPubKey1: bigint[] = []; + newSigningPubKey2: bigint[] = []; - signatureR8: bigint[]; - signatureS: bigint; - enabled: bigint; + signatureR8: bigint[] = []; + signatureS: bigint = 0n; + enabled: bigint = 1n; // aux - accountNC: bigint; - newAccountNC: bigint; + accountNC: bigint = 0n; + newAccountNC: bigint = 0n; constructor( - proofId: number, - outputNCs: bigint[], - // dataTreeRoot: bigint, - // siblingsAC: bigint[], - aliasHash: bigint, - accountPubKey: bigint[], - signingPubKey: bigint[], - newAccountPubKey: bigint[], - newSigningPubKey1: bigint[], - newSigningPubKey2: bigint[], - signatureR8: bigint[], - signatureS: bigint, - accountNC: bigint, - newAccountNC: bigint, - enabled: bigint = 1n + ac: Partial ) { - // this.dataTreeRoot = dataTreeRoot; - // this.siblingsAC = siblingsAC; - this.proofId = proofId; - this.outputNCs = outputNCs; - this.aliasHash = aliasHash; - this.accountPubKey = accountPubKey; - this.signingPubKey = signingPubKey; - this.newAccountPubKey = newAccountPubKey; - this.newSigningPubKey1 = newSigningPubKey1; - this.newSigningPubKey2 = newSigningPubKey2; - this.signatureR8 = signatureR8; - this.signatureS = signatureS; - this.accountNC = accountNC; - this.newAccountNC = newAccountNC; - this.enabled = enabled; + Object.assign(this, ac); } static async createProofInput( @@ -370,9 +342,9 @@ export class AccountCircuit { */ let sig = await signingKey.sign(msghash); - return new AccountCircuit( + return new AccountCircuit({ proofId, - [outputNC1, outputNC2], + outputNCs: [outputNC1, outputNC2], // F.toObject(state.root()), // siblingsPad(leaf.siblings, F), aliasHash, @@ -381,11 +353,11 @@ export class AccountCircuit { newAccountPubKey, newSigningPubKey1, newSigningPubKey2, - [F.toObject(sig.R8[0]), F.toObject(sig.R8[1])], - sig.S, + signatureR8: [F.toObject(sig.R8[0]), F.toObject(sig.R8[1])], + signatureS: sig.S, accountNC, newAccountNC - ); + }); } toCircuitInput(proof: any) { diff --git a/core/package.json b/core/package.json index a7dbb8ce6..e93fe3b79 100644 --- a/core/package.json +++ b/core/package.json @@ -59,7 +59,6 @@ "consola": "^2.15.3", "ethers": "^5.6.8", "ffjavascript": "^0.2.55", - "@types/uuid": "^9.0.2", "ffjavascript-browser": "^0.0.3", "snarkjs": "^0.6.1" }, diff --git a/package.json b/package.json index a683aaff2..db1d62843 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,6 @@ "ethers": "^5.6.8", "express-async-errors": "^3.1.1", "ffjavascript": "^0.2.55", - "http-terminator": "^3.2.0", - "node-fetch": "2.6.9", "snarkjs": "^0.6.1" }, "devDependencies": { @@ -60,7 +58,7 @@ "eslint-config-google": "^0.14.0", "eslint-plugin-unused-imports": "^2.0.0", "hardhat": "^2.13.0", - "hardhat-gas-reporter": "^1.0.2", + "hardhat-gas-reporter": "^1.0.9", "lerna": "^6.6.2", "solhint": "^3.3.7", "supertest": "^6.3.3",