diff --git a/build/bridge-poseidon/verification_key.json b/build/bridge-poseidon/verification_key.json deleted file mode 100644 index d9c957c65..000000000 --- a/build/bridge-poseidon/verification_key.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "protocol": "groth16", - "curve": "bn128", - "nPublic": 8, - "vk_alpha_1": [ - "9826102612444019598971726292155322920262990556597666784495836440149497399832", - "19306042773288790075242276771021156542967336305530693434926254308666848802447", - "1" - ], - "vk_beta_2": [ - [ - "11709165474840040946946745595791448911408466270777791981230246164437140367060", - "17140774433074847835437294053136211279115286885756251355735423649279771501446" - ], - [ - "13406181913652418521473381388233415126914654149256117392980857038410965309392", - "10645604259666538138432323124229298110502953003786923740034420887074507438898" - ], - [ - "1", - "0" - ] - ], - "vk_gamma_2": [ - [ - "10857046999023057135944570762232829481370756359578518086990519993285655852781", - "11559732032986387107991004021392285783925812861821192530917403151452391805634" - ], - [ - "8495653923123431417604973247489272438418190587263600148770280649306958101930", - "4082367875863433681332203403145435568316851327593401208105741076214120093531" - ], - [ - "1", - "0" - ] - ], - "vk_delta_2": [ - [ - "19315204825651011439654948597264326605700627242994399762330662188812706028055", - "10413612665261254107429415731300680590114467750443607804078403189929822734078" - ], - [ - "13586339986223597373353658685926624675070420732768997750432882215104273025656", - "4329901989680328961725631707518195113979336959378586566665401057986053008313" - ], - [ - "1", - "0" - ] - ], - "vk_alphabeta_12": [ - [ - [ - "2439608157467727301579294600860968720434284868459682270312882186951726502252", - "16786754479588474395433219580746885610211230285343519319980072705482774838582" - ], - [ - "16042816893186240124533701007457414837812524955392155658773327469045502111360", - "7208785482773212610324199145693333783394316024267520794427267344159302569816" - ], - [ - "3357728852336320773875156326489146268420947578190044635975712000267008390189", - "11012319200540032921234604078644572098375386149658391812859323102513762266961" - ] - ], - [ - [ - "2933394155530789190902962962934911111146842727762413252638161407289708057928", - "20973562630266551384285136770713506996708989971422917349307043167008527187094" - ], - [ - "11704398510465352546794262211027230498839309700884704045478842380518025635277", - "21305762546141569376152310763539727458582722769729202856071114072582983339082" - ], - [ - "17198095759999444133446135916008104688997842575118380586265352889189013061079", - "10036545781283010002083849245206008348216118867734950709007953106610672083372" - ] - ] - ], - "IC": [ - [ - "21705257116424771944012814690846358461959224549605498643855083501267534130166", - "5351693904126375309383777923010529608182560850683162779006455344314211822312", - "1" - ], - [ - "15487632154258787793540560889658267658682389683406831522210940926913542296067", - "19707553056754302703788667135446047665546818530188024161944437447675738675143", - "1" - ], - [ - "14450007319858575899620958532976549621250114424399041279445421784806196087117", - "2995270305745908399783074013722206780787422164324445228958520744939842511453", - "1" - ], - [ - "7954714456870210446077323537215357185964982664097917599546720270190548037326", - "18030790071115773172517333361449167990913307070881862802892189603104986569693", - "1" - ], - [ - "1559883256376132686793324764015022965532298194899017699453326698184959952978", - "2168246414649263593909795575920870380744393744684183576562034177821825948772", - "1" - ], - [ - "2881931977743329285940192156051385988976935099423796200253292188562030205259", - "20065971518044515601382258922405106783660069010200439244895433445197197742615", - "1" - ], - [ - "160300073244865726872571476837032287087053554985395181825752580042975796680", - "1154557325668791703539446862056873685633658781878024694242110867378739101360", - "1" - ], - [ - "14449181346144531758238686161173218574869563839387611349649465473423872480895", - "19082049753132911277324565947575544755147042067617477439747778593302828496621", - "1" - ], - [ - "13600641500531298923586268631374296309240454883529966541592815731599037702708", - "17203643492492393941073828538337952449708004951494779549095629623948575485306", - "1" - ] - ] -} \ No newline at end of file diff --git a/build/bridge-poseidon/verifier.sol b/build/bridge-poseidon/verifier.sol deleted file mode 100644 index 20d21ee34..000000000 --- a/build/bridge-poseidon/verifier.sol +++ /dev/null @@ -1,290 +0,0 @@ -// -// Copyright 2017 Christian Reitwiessner -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// 2019 OKIMS -// ported to solidity 0.6 -// fixed linter warnings -// added requiere error messages -// -// -// SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.6.11; -library Pairing { - struct G1Point { - uint X; - uint Y; - } - // Encoding of field elements is: X[0] * z + X[1] - struct G2Point { - uint[2] X; - uint[2] Y; - } - /// @return the generator of G1 - function P1() internal pure returns (G1Point memory) { - return G1Point(1, 2); - } - /// @return the generator of G2 - function P2() internal pure returns (G2Point memory) { - // Original code point - return G2Point( - [11559732032986387107991004021392285783925812861821192530917403151452391805634, - 10857046999023057135944570762232829481370756359578518086990519993285655852781], - [4082367875863433681332203403145435568316851327593401208105741076214120093531, - 8495653923123431417604973247489272438418190587263600148770280649306958101930] - ); - -/* - // Changed by Jordi point - return G2Point( - [10857046999023057135944570762232829481370756359578518086990519993285655852781, - 11559732032986387107991004021392285783925812861821192530917403151452391805634], - [8495653923123431417604973247489272438418190587263600148770280649306958101930, - 4082367875863433681332203403145435568316851327593401208105741076214120093531] - ); -*/ - } - /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero. - function negate(G1Point memory p) internal pure returns (G1Point memory r) { - // The prime q in the base field F_q for G1 - uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; - if (p.X == 0 && p.Y == 0) - return G1Point(0, 0); - return G1Point(p.X, q - (p.Y % q)); - } - /// @return r the sum of two points of G1 - function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) { - uint[4] memory input; - input[0] = p1.X; - input[1] = p1.Y; - input[2] = p2.X; - input[3] = p2.Y; - bool success; - // solium-disable-next-line security/no-inline-assembly - assembly { - success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60) - // Use "invalid" to make gas estimation work - switch success case 0 { invalid() } - } - require(success,"pairing-add-failed"); - } - /// @return r the product of a point on G1 and a scalar, i.e. - /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p. - function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) { - uint[3] memory input; - input[0] = p.X; - input[1] = p.Y; - input[2] = s; - bool success; - // solium-disable-next-line security/no-inline-assembly - assembly { - success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60) - // Use "invalid" to make gas estimation work - switch success case 0 { invalid() } - } - require (success,"pairing-mul-failed"); - } - /// @return the result of computing the pairing check - /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1 - /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should - /// return true. - function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) { - require(p1.length == p2.length,"pairing-lengths-failed"); - uint elements = p1.length; - uint inputSize = elements * 6; - uint[] memory input = new uint[](inputSize); - for (uint i = 0; i < elements; i++) - { - input[i * 6 + 0] = p1[i].X; - input[i * 6 + 1] = p1[i].Y; - input[i * 6 + 2] = p2[i].X[0]; - input[i * 6 + 3] = p2[i].X[1]; - input[i * 6 + 4] = p2[i].Y[0]; - input[i * 6 + 5] = p2[i].Y[1]; - } - uint[1] memory out; - bool success; - // solium-disable-next-line security/no-inline-assembly - assembly { - success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20) - // Use "invalid" to make gas estimation work - switch success case 0 { invalid() } - } - require(success,"pairing-opcode-failed"); - return out[0] != 0; - } - /// Convenience method for a pairing check for two pairs. - function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) { - G1Point[] memory p1 = new G1Point[](2); - G2Point[] memory p2 = new G2Point[](2); - p1[0] = a1; - p1[1] = b1; - p2[0] = a2; - p2[1] = b2; - return pairing(p1, p2); - } - /// Convenience method for a pairing check for three pairs. - function pairingProd3( - G1Point memory a1, G2Point memory a2, - G1Point memory b1, G2Point memory b2, - G1Point memory c1, G2Point memory c2 - ) internal view returns (bool) { - G1Point[] memory p1 = new G1Point[](3); - G2Point[] memory p2 = new G2Point[](3); - p1[0] = a1; - p1[1] = b1; - p1[2] = c1; - p2[0] = a2; - p2[1] = b2; - p2[2] = c2; - return pairing(p1, p2); - } - /// Convenience method for a pairing check for four pairs. - function pairingProd4( - G1Point memory a1, G2Point memory a2, - G1Point memory b1, G2Point memory b2, - G1Point memory c1, G2Point memory c2, - G1Point memory d1, G2Point memory d2 - ) internal view returns (bool) { - G1Point[] memory p1 = new G1Point[](4); - G2Point[] memory p2 = new G2Point[](4); - p1[0] = a1; - p1[1] = b1; - p1[2] = c1; - p1[3] = d1; - p2[0] = a2; - p2[1] = b2; - p2[2] = c2; - p2[3] = d2; - return pairing(p1, p2); - } -} -contract Verifier { - using Pairing for *; - struct VerifyingKey { - Pairing.G1Point alfa1; - Pairing.G2Point beta2; - Pairing.G2Point gamma2; - Pairing.G2Point delta2; - Pairing.G1Point[] IC; - } - struct Proof { - Pairing.G1Point A; - Pairing.G2Point B; - Pairing.G1Point C; - } - function verifyingKey() internal pure returns (VerifyingKey memory vk) { - vk.alfa1 = Pairing.G1Point( - 9826102612444019598971726292155322920262990556597666784495836440149497399832, - 19306042773288790075242276771021156542967336305530693434926254308666848802447 - ); - - vk.beta2 = Pairing.G2Point( - [17140774433074847835437294053136211279115286885756251355735423649279771501446, - 11709165474840040946946745595791448911408466270777791981230246164437140367060], - [10645604259666538138432323124229298110502953003786923740034420887074507438898, - 13406181913652418521473381388233415126914654149256117392980857038410965309392] - ); - vk.gamma2 = Pairing.G2Point( - [11559732032986387107991004021392285783925812861821192530917403151452391805634, - 10857046999023057135944570762232829481370756359578518086990519993285655852781], - [4082367875863433681332203403145435568316851327593401208105741076214120093531, - 8495653923123431417604973247489272438418190587263600148770280649306958101930] - ); - vk.delta2 = Pairing.G2Point( - [10413612665261254107429415731300680590114467750443607804078403189929822734078, - 19315204825651011439654948597264326605700627242994399762330662188812706028055], - [4329901989680328961725631707518195113979336959378586566665401057986053008313, - 13586339986223597373353658685926624675070420732768997750432882215104273025656] - ); - vk.IC = new Pairing.G1Point[](9); - - vk.IC[0] = Pairing.G1Point( - 21705257116424771944012814690846358461959224549605498643855083501267534130166, - 5351693904126375309383777923010529608182560850683162779006455344314211822312 - ); - - vk.IC[1] = Pairing.G1Point( - 15487632154258787793540560889658267658682389683406831522210940926913542296067, - 19707553056754302703788667135446047665546818530188024161944437447675738675143 - ); - - vk.IC[2] = Pairing.G1Point( - 14450007319858575899620958532976549621250114424399041279445421784806196087117, - 2995270305745908399783074013722206780787422164324445228958520744939842511453 - ); - - vk.IC[3] = Pairing.G1Point( - 7954714456870210446077323537215357185964982664097917599546720270190548037326, - 18030790071115773172517333361449167990913307070881862802892189603104986569693 - ); - - vk.IC[4] = Pairing.G1Point( - 1559883256376132686793324764015022965532298194899017699453326698184959952978, - 2168246414649263593909795575920870380744393744684183576562034177821825948772 - ); - - vk.IC[5] = Pairing.G1Point( - 2881931977743329285940192156051385988976935099423796200253292188562030205259, - 20065971518044515601382258922405106783660069010200439244895433445197197742615 - ); - - vk.IC[6] = Pairing.G1Point( - 160300073244865726872571476837032287087053554985395181825752580042975796680, - 1154557325668791703539446862056873685633658781878024694242110867378739101360 - ); - - vk.IC[7] = Pairing.G1Point( - 14449181346144531758238686161173218574869563839387611349649465473423872480895, - 19082049753132911277324565947575544755147042067617477439747778593302828496621 - ); - - vk.IC[8] = Pairing.G1Point( - 13600641500531298923586268631374296309240454883529966541592815731599037702708, - 17203643492492393941073828538337952449708004951494779549095629623948575485306 - ); - - } - function verify(uint[] memory input, Proof memory proof) internal view returns (uint) { - uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617; - VerifyingKey memory vk = verifyingKey(); - require(input.length + 1 == vk.IC.length,"verifier-bad-input"); - // Compute the linear combination vk_x - Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0); - for (uint i = 0; i < input.length; i++) { - require(input[i] < snark_scalar_field,"verifier-gte-snark-scalar-field"); - vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i])); - } - vk_x = Pairing.addition(vk_x, vk.IC[0]); - if (!Pairing.pairingProd4( - Pairing.negate(proof.A), proof.B, - vk.alfa1, vk.beta2, - vk_x, vk.gamma2, - proof.C, vk.delta2 - )) return 1; - return 0; - } - /// @return r bool true if proof is valid - function verifyProof( - uint[2] memory a, - uint[2][2] memory b, - uint[2] memory c, - uint[8] memory input - ) public view returns (bool r) { - Proof memory proof; - proof.A = Pairing.G1Point(a[0], a[1]); - proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]); - proof.C = Pairing.G1Point(c[0], c[1]); - uint[] memory inputValues = new uint[](input.length); - for(uint i = 0; i < input.length; i++){ - inputValues[i] = input[i]; - } - if (verify(inputValues, proof) == 0) { - return true; - } else { - return false; - } - } -} diff --git a/build/tornado/verification_key.json b/build/tornado/verification_key.json new file mode 100644 index 000000000..239eb0c96 --- /dev/null +++ b/build/tornado/verification_key.json @@ -0,0 +1,119 @@ +{ + "protocol": "groth16", + "curve": "bn128", + "nPublic": 6, + "vk_alpha_1": [ + "9285650181906102516544900346304408116306404925567549747090528098409525390500", + "6698067667527827943097359915680630617658184861433657900522986508035436682650", + "1" + ], + "vk_beta_2": [ + [ + "21036278248034621922368790167618434499119614834146770153664296723475309484201", + "4347673653478192616185732142561752210040222884049719486542960978143369039564" + ], + [ + "9457298852312180748473014023686092165379719184559813917757385980836931481431", + "16358378227922464668316929801145812144848518399243630477666872051462546229955" + ], + [ + "1", + "0" + ] + ], + "vk_gamma_2": [ + [ + "10857046999023057135944570762232829481370756359578518086990519993285655852781", + "11559732032986387107991004021392285783925812861821192530917403151452391805634" + ], + [ + "8495653923123431417604973247489272438418190587263600148770280649306958101930", + "4082367875863433681332203403145435568316851327593401208105741076214120093531" + ], + [ + "1", + "0" + ] + ], + "vk_delta_2": [ + [ + "19798119528557054505513880494119084073936524548296387090556145382398615900971", + "5049333464594984048182083535891139487551037856199197707780766815216989250708" + ], + [ + "3863487355010683221965614412028613785776653772335894995707744788509459836399", + "10206134672189570217049458179150101221893514369994655386218871288375401767033" + ], + [ + "1", + "0" + ] + ], + "vk_alphabeta_12": [ + [ + [ + "19146865444433726252755719948794452907755828474586857927103043390549804991642", + "3756068537462200087131255232922913879385496404212540679843972352138917405618" + ], + [ + "18821085417293575869034828500214887776917893196010227270559239760796395816157", + "17267566537605607410601932111949049853744326030413982249162090285407058796362" + ], + [ + "10406900519010914582008473155082403406712468624395635930366258701200455025558", + "19031110068934257856057027681038488773616968101058460913286441597126896941921" + ] + ], + [ + [ + "20611834312655813540379686800776580774215009148065285226831956369258029689103", + "5160215287542858273525495138008067405336349873123419863382065490505229614236" + ], + [ + "10790845302231648457291972623006513669557066658042354398850229719158670206337", + "21151023403547645142442928371375577900073831351603504665668564041594681201418" + ], + [ + "4551112961275019060247709419077815376958505924510199444342550591743316226221", + "19068088830843532402973776857867397050276108873749383165323891892014380581401" + ] + ] + ], + "IC": [ + [ + "18167192041286322695891659812632379461080258328314966833385764414516612538567", + "7530241632285976950134353118866835446671637504911534433633017627223741742576", + "1" + ], + [ + "15078752094092811674805018188862704179945199031937476577540762838387244859843", + "10932963456323794663731379356571060319099566181849712436289756916850340939696", + "1" + ], + [ + "16935070368584433943678625894384553049184186236683847209317498163983257352454", + "18811314818039859123665365488322939991683799951098692914615500610131047742350", + "1" + ], + [ + "10804812414317340393156139184489044020310018708580528887891615904965130946540", + "8281513356546433820909909405670589581404245529892947508062503785137690158550", + "1" + ], + [ + "1127318608308763119464385484703907549867436285899739699486968252721506746667", + "1764465202425741655155379015657193501205345856801124023694296345595002745553", + "1" + ], + [ + "16131867526951604229507527852129031094497761505135846114532220541955955739962", + "14544635709148995336910413375451629439385675543181955375259360609156044600752", + "1" + ], + [ + "6253787648482490748444279361618530988010681772751411869435478607980007175826", + "21227501387649728776960084752591269999375362944403124631290134574917907227140", + "1" + ] + ] +} \ No newline at end of file diff --git a/build/tornado/verifier.sol b/build/tornado/verifier.sol index 926af645a..84a5f91df 100644 --- a/build/tornado/verifier.sol +++ b/build/tornado/verifier.sol @@ -177,15 +177,15 @@ contract Verifier { } function verifyingKey() internal pure returns (VerifyingKey memory vk) { vk.alfa1 = Pairing.G1Point( - 3608948272729865012798965568771494574375798684226266177570667628870122763898, - 19285117649201631474081688975819395419412044843604242037119372618972330036397 + 9285650181906102516544900346304408116306404925567549747090528098409525390500, + 6698067667527827943097359915680630617658184861433657900522986508035436682650 ); vk.beta2 = Pairing.G2Point( - [7168612389437310859506407479196765022323912608035049576178104305798261064095, - 17448004540592627273985649630523677734376711648047417251240225237947190810184], - [15322869529993038813985060868874385067495365734761137693318994315601893590455, - 12441109047842353149498893133455778194021723534670957007914165874657283582299] + [4347673653478192616185732142561752210040222884049719486542960978143369039564, + 21036278248034621922368790167618434499119614834146770153664296723475309484201], + [16358378227922464668316929801145812144848518399243630477666872051462546229955, + 9457298852312180748473014023686092165379719184559813917757385980836931481431] ); vk.gamma2 = Pairing.G2Point( [11559732032986387107991004021392285783925812861821192530917403151452391805634, @@ -194,46 +194,46 @@ contract Verifier { 8495653923123431417604973247489272438418190587263600148770280649306958101930] ); vk.delta2 = Pairing.G2Point( - [4615295689213386282708227785604690986024524726493474234027851389028381833331, - 17069340672863484741103760724307463819034280728145375758805484170940706700745], - [11117905389866300851309201489518200403665460606808989090466473749518789657919, - 18475325198169621482760778898982391767342388619796443266209177078781254801405] + [5049333464594984048182083535891139487551037856199197707780766815216989250708, + 19798119528557054505513880494119084073936524548296387090556145382398615900971], + [10206134672189570217049458179150101221893514369994655386218871288375401767033, + 3863487355010683221965614412028613785776653772335894995707744788509459836399] ); vk.IC = new Pairing.G1Point[](7); vk.IC[0] = Pairing.G1Point( - 2623371417882895308483641533879649820943533632853285716632065660856128171311, - 16215958561489472876123231750821224013279602075628392196953232111324028629024 + 18167192041286322695891659812632379461080258328314966833385764414516612538567, + 7530241632285976950134353118866835446671637504911534433633017627223741742576 ); vk.IC[1] = Pairing.G1Point( - 18359165520220847539380083486786073270627085484429796631705307573393837675987, - 4033055793093750400854522746021466305327840817623306592638635666137477552092 + 15078752094092811674805018188862704179945199031937476577540762838387244859843, + 10932963456323794663731379356571060319099566181849712436289756916850340939696 ); vk.IC[2] = Pairing.G1Point( - 16137257109786729006690450567699358820783015817039374330216439930784689363797, - 8329428640940265699123482756991708340106389879220273541210889135236319003872 + 16935070368584433943678625894384553049184186236683847209317498163983257352454, + 18811314818039859123665365488322939991683799951098692914615500610131047742350 ); vk.IC[3] = Pairing.G1Point( - 9888896888996650927969815174506967782989542487419297992966646151287585543806, - 12279306429656181888061598203363055686533300816026840642653234795585701768386 + 10804812414317340393156139184489044020310018708580528887891615904965130946540, + 8281513356546433820909909405670589581404245529892947508062503785137690158550 ); vk.IC[4] = Pairing.G1Point( - 13385610805202462724178334155567502654439983387577914536445001385106639387428, - 17349217323363908275859519889982975046395791022871778287428169422316841641371 + 1127318608308763119464385484703907549867436285899739699486968252721506746667, + 1764465202425741655155379015657193501205345856801124023694296345595002745553 ); vk.IC[5] = Pairing.G1Point( - 1721399841682709066959535984380712195396111841964019078948586959265869296017, - 10982463765712954584575664710208512769837824095118468703231291921373272591228 + 16131867526951604229507527852129031094497761505135846114532220541955955739962, + 14544635709148995336910413375451629439385675543181955375259360609156044600752 ); vk.IC[6] = Pairing.G1Point( - 11222734002405248472145000883728467906391805064697971171720487527208116330104, - 7340411005604008313927810877219041012286045793508228778754949714607724950637 + 6253787648482490748444279361618530988010681772751411869435478607980007175826, + 21227501387649728776960084752591269999375362944403124631290134574917907227140 ); } diff --git a/contracts/Verifier.sol b/contracts/Verifier.sol index bae98e41d..4b86f476e 100644 --- a/contracts/Verifier.sol +++ b/contracts/Verifier.sol @@ -177,15 +177,15 @@ contract Verifier { } function verifyingKey() internal pure returns (VerifyingKey memory vk) { vk.alfa1 = Pairing.G1Point( - 3608948272729865012798965568771494574375798684226266177570667628870122763898, - 19285117649201631474081688975819395419412044843604242037119372618972330036397 + 9285650181906102516544900346304408116306404925567549747090528098409525390500, + 6698067667527827943097359915680630617658184861433657900522986508035436682650 ); vk.beta2 = Pairing.G2Point( - [7168612389437310859506407479196765022323912608035049576178104305798261064095, - 17448004540592627273985649630523677734376711648047417251240225237947190810184], - [15322869529993038813985060868874385067495365734761137693318994315601893590455, - 12441109047842353149498893133455778194021723534670957007914165874657283582299] + [4347673653478192616185732142561752210040222884049719486542960978143369039564, + 21036278248034621922368790167618434499119614834146770153664296723475309484201], + [16358378227922464668316929801145812144848518399243630477666872051462546229955, + 9457298852312180748473014023686092165379719184559813917757385980836931481431] ); vk.gamma2 = Pairing.G2Point( [11559732032986387107991004021392285783925812861821192530917403151452391805634, @@ -194,46 +194,46 @@ contract Verifier { 8495653923123431417604973247489272438418190587263600148770280649306958101930] ); vk.delta2 = Pairing.G2Point( - [4615295689213386282708227785604690986024524726493474234027851389028381833331, - 17069340672863484741103760724307463819034280728145375758805484170940706700745], - [11117905389866300851309201489518200403665460606808989090466473749518789657919, - 18475325198169621482760778898982391767342388619796443266209177078781254801405] + [5049333464594984048182083535891139487551037856199197707780766815216989250708, + 19798119528557054505513880494119084073936524548296387090556145382398615900971], + [10206134672189570217049458179150101221893514369994655386218871288375401767033, + 3863487355010683221965614412028613785776653772335894995707744788509459836399] ); vk.IC = new Pairing.G1Point[](7); vk.IC[0] = Pairing.G1Point( - 2623371417882895308483641533879649820943533632853285716632065660856128171311, - 16215958561489472876123231750821224013279602075628392196953232111324028629024 + 18167192041286322695891659812632379461080258328314966833385764414516612538567, + 7530241632285976950134353118866835446671637504911534433633017627223741742576 ); vk.IC[1] = Pairing.G1Point( - 18359165520220847539380083486786073270627085484429796631705307573393837675987, - 4033055793093750400854522746021466305327840817623306592638635666137477552092 + 15078752094092811674805018188862704179945199031937476577540762838387244859843, + 10932963456323794663731379356571060319099566181849712436289756916850340939696 ); vk.IC[2] = Pairing.G1Point( - 16137257109786729006690450567699358820783015817039374330216439930784689363797, - 8329428640940265699123482756991708340106389879220273541210889135236319003872 + 16935070368584433943678625894384553049184186236683847209317498163983257352454, + 18811314818039859123665365488322939991683799951098692914615500610131047742350 ); vk.IC[3] = Pairing.G1Point( - 9888896888996650927969815174506967782989542487419297992966646151287585543806, - 12279306429656181888061598203363055686533300816026840642653234795585701768386 + 10804812414317340393156139184489044020310018708580528887891615904965130946540, + 8281513356546433820909909405670589581404245529892947508062503785137690158550 ); vk.IC[4] = Pairing.G1Point( - 13385610805202462724178334155567502654439983387577914536445001385106639387428, - 17349217323363908275859519889982975046395791022871778287428169422316841641371 + 1127318608308763119464385484703907549867436285899739699486968252721506746667, + 1764465202425741655155379015657193501205345856801124023694296345595002745553 ); vk.IC[5] = Pairing.G1Point( - 1721399841682709066959535984380712195396111841964019078948586959265869296017, - 10982463765712954584575664710208512769837824095118468703231291921373272591228 + 16131867526951604229507527852129031094497761505135846114532220541955955739962, + 14544635709148995336910413375451629439385675543181955375259360609156044600752 ); vk.IC[6] = Pairing.G1Point( - 11222734002405248472145000883728467906391805064697971171720487527208116330104, - 7340411005604008313927810877219041012286045793508228778754949714607724950637 + 6253787648482490748444279361618530988010681772751411869435478607980007175826, + 21227501387649728776960084752591269999375362944403124631290134574917907227140 ); } @@ -277,10 +277,4 @@ contract Verifier { return false; } } - - function verifyProof(bytes calldata proof, uint[6] calldata inputs) external view returns (bool r) { - // solidity does not support decoding uint[2][2] yet - (uint[2] memory a, uint[2] memory b1, uint[2] memory b2, uint[2] memory c) = abi.decode(proof, (uint[2], uint[2], uint[2], uint[2])); - return verifyProof(a, [b1, b2], c, inputs); - } } diff --git a/hardhat.config.ts b/hardhat.config.ts index 818f4898a..e550af2d9 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,9 +1,10 @@ -import { task } from "hardhat/config"; +import { subtask, task } from "hardhat/config"; import "hardhat-artifactor"; import "@nomiclabs/hardhat-waffle"; import "@nomiclabs/hardhat-truffle5"; import "hardhat-circom"; + // This is a sample Hardhat task. To learn how to create your own go to // https://hardhat.org/guides/create-task.html task("accounts", "Prints the list of accounts", async (args, hre) => { @@ -14,9 +15,6 @@ task("accounts", "Prints the list of accounts", async (args, hre) => { } }); -// You need to export an object to set up your config -// Go to https://hardhat.org/config/ to learn more - export default { solidity: "0.8.0", circom: { diff --git a/package.json b/package.json index 3d36f0dbd..091b2aece 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "ffiasm": "^0.1.1", "ffjavascript": "^0.2.38", "hardhat": "^2.4.1", + "snarkjs": "^0.4.6", "truffle-assertions": "^0.9.2", "web3": "^1.3.6", "web3-utils": "^1.2.11" @@ -44,8 +45,8 @@ "circomlib": "^0.5.2", "ganache-cli": "^6.12.2", "hardhat-artifactor": "^0.2.0", + "ts-node": "^10.1.0" "hardhat-circom": "^1.0.1", "maci-crypto": "^0.9.1", - "snarkjs": "^0.4.6" } } diff --git a/scripts/verifySnark.js b/scripts/verifySnark.js new file mode 100644 index 000000000..4bc20e42b --- /dev/null +++ b/scripts/verifySnark.js @@ -0,0 +1,72 @@ +const fs = require('fs') +const path = require('path') + +const snarkjs = require('snarkjs') +const crypto = require('crypto') +const circomlib = require('circomlib') +const MerkleTree = require('../lib/tornado-withdraw/MerkleTree') +const bigInt = BigInt; +const utils = require("ffjavascript").utils; +const { + leBuff2int, + leInt2Buff, + unstringifyBigInts, + stringifyBigInts, +} = utils; + +const rbigint = (nbytes) => leBuff2int(crypto.randomBytes(nbytes)) +const pedersenHash = (data) => circomlib.babyJub.unpackPoint(circomlib.pedersenHash.hash(data))[0] +const getRandomRecipient = () => rbigint(20) + +function generateDeposit() { + let deposit = { + secret: rbigint(31), + nullifier: rbigint(31), + } + const preimage = Buffer.concat([leInt2Buff(deposit.nullifier, 31), leInt2Buff(deposit.secret, 31)]) + deposit.commitment = pedersenHash(preimage) + return deposit +} + +async function snarkVerify(proof) { + const verification_key = unstringifyBigInts(require('../build/tornado/verification_key.json')) + return await snarkjs.groth16.verify(verification_key, proof.publicSignals, proof.proof) +} + +async function runScript() +{ + let tree; + const levels = 30; + let prefix = 'test'; + tree = new MerkleTree(levels, null, prefix); + const recipient = getRandomRecipient(); + const fee = bigInt(1e17); + const refund = bigInt(0); + const relayer = getRandomRecipient(); + + const deposit = generateDeposit(); + await tree.insert(deposit.commitment); + const { root, path_elements, path_index } = await tree.path(0); + + const input = { + root, + nullifierHash: pedersenHash(leInt2Buff(deposit.nullifier, 31)), + nullifier: deposit.nullifier, + relayer, + recipient, + fee, + refund, + secret: deposit.secret, + pathElements: path_elements, + pathIndices: path_index, + }; + + // await fs.promises.writeFile('./input.json', JSON.stringify(stringifyBigInts(input))); + + const proof = await snarkjs.groth16.fullProve(input, "../artifacts/circuits/tornado/withdraw_30.wasm", "../build/tornado/circuit_final.zkey"); + let result = await snarkVerify(proof); + console.log(result); + return; +} + +runScript() \ No newline at end of file diff --git a/test/anchor/anchor.js b/test/anchor/anchor.js index aff3359cb..9d6659a95 100644 --- a/test/anchor/anchor.js +++ b/test/anchor/anchor.js @@ -3,9 +3,6 @@ * SPDX-License-Identifier: LGPL-3.0 */ const TruffleAssert = require('truffle-assertions'); -const Ethers = require('ethers'); - -const Helpers = require('../helpers'); const assert = require('assert'); const fs = require('fs') @@ -30,15 +27,10 @@ const MerkleTree = require('../../lib/bridgePoseidon-withdraw/MerkleTree') const utils = require("ffjavascript").utils; const { beBuff2int, - beInt2Buff, leBuff2int, leInt2Buff, } = utils; -const primeForField = beBuff2int(( - new BN('21888242871839275222246405745257275088548364400416034343698204186575808495617') -).toBuffer()); - function bigNumberToPaddedBytes(num, digits = 32) { var n = num.toString(16).replace(/^0x/, ''); while (n.length < (digits * 2)) { @@ -72,20 +64,6 @@ function generateDeposit(targetChainID = 0) { return deposit } -// eslint-disable-next-line no-unused-vars -function BNArrayToStringArray(array) { - const arrayToPrint = [] - array.forEach((item) => { - arrayToPrint.push(item.toString()) - }) - return arrayToPrint -} - -function snarkVerify(proof) { - const verification_key = require('../build/circuits/withdraw_verification_key.json') - return snarkjs['groth'].isValid(verification_key, proof, proof.publicSignals) -} - contract('AnchorPoseidon2', (accounts) => { let anchor const sender = accounts[0] diff --git a/test/tornado/withdraw.js b/test/tornado/withdraw.js index 520246323..91a676bb9 100644 --- a/test/tornado/withdraw.js +++ b/test/tornado/withdraw.js @@ -1,10 +1,9 @@ /* global artifacts, web3, contract */ require('chai').use(require('bn-chai')(web3.utils.BN)).use(require('chai-as-promised')).should() const fs = require('fs') +const path = require("path"); const { toBN, randomHex } = require('web3-utils') - -const Anchor = artifacts.require('./NativeAnchor.sol') const { NATIVE_AMOUNT, MERKLE_TREE_HEIGHT } = process.env const snarkjs = require('snarkjs') const bigInt = BigInt; @@ -13,6 +12,7 @@ const circomlib = require('circomlib') const MerkleTree = require('../../lib/tornado-withdraw/MerkleTree') const BN = require('bn.js'); const utils = require("ffjavascript").utils; +const TruffleAssert = require('truffle-assertions'); const { leBuff2int, leInt2Buff, @@ -37,43 +37,37 @@ function generateDeposit() { return deposit } -// eslint-disable-next-line no-unused-vars -function BNArrayToStringArray(array) { - const arrayToPrint = [] - array.forEach((item) => { - arrayToPrint.push(item.toString()) - }) - return arrayToPrint -} - function snarkVerify(proof) { - const verification_key = unstringifyBigInts2(require('../build/circuits/withdraw_verification_key.json')) + const verification_key = unstringifyBigInts2(require('../build/tornado/verification_key.json')) return snarkjs['groth'].isValid(verification_key, proof, proof.publicSignals) } +const HasherMimcContract = artifacts.require("MiMCSponge220"); +const VerifierMimcContract = artifacts.require("Verifier"); +const NativeAnchorContract = artifacts.require("NativeAnchor"); + contract('NativeAnchor', (accounts) => { - let anchor + let hasher; + let verifier; + let anchor; const sender = accounts[0] const operator = accounts[0] - const levels = MERKLE_TREE_HEIGHT || 16 + const levels = MERKLE_TREE_HEIGHT || 30 const value = NATIVE_AMOUNT || '1000000000000000000' // 1 ether + const maxRoots = 100; let prefix = 'test' let tree const fee = BigInt((new BN(`${NATIVE_AMOUNT}`).shrn(1)).toString()) || BigInt((new BN(`${1e17}`)).toString()) const refund = BigInt((new BN('0')).toString()) const recipient = getRandomRecipient() const relayer = accounts[1] - let groth16 - let circuit - let proving_key let createWitness - before(async () => { + beforeEach(async () => { + hasher = await HasherMimcContract.new(); + verifier = await VerifierMimcContract.new(); + anchor = await NativeAnchorContract.new(verifier.address, hasher.address, value, levels, maxRoots); tree = new MerkleTree(levels, null, prefix) - anchor = await Anchor.deployed() - groth16; - circuit = require('../build/circuits/withdraw.json') - proving_key = fs.readFileSync('build/circuits/withdraw_proving_key.bin').buffer createWitness = async (data) => { const wtns = {type: "mem"}; await snarkjs.wtns.calculate(data, path.join( @@ -85,14 +79,14 @@ contract('NativeAnchor', (accounts) => { } }) - describe('#constructor', () => { + describe.only('#constructor', () => { it('should initialize', async () => { const etherDenomination = await anchor.denomination() etherDenomination.should.be.eq.BN(toBN(value)) }) }) - describe('#deposit', () => { + describe.only('#deposit', () => { it('should emit event', async () => { let commitment = toFixedHex(42) let { logs } = await anchor.deposit(commitment, { value, from: sender }) @@ -101,8 +95,8 @@ contract('NativeAnchor', (accounts) => { logs[0].args.commitment.should.be.equal(commitment) logs[0].args.leafIndex.should.be.eq.BN(0) - commitment = toFixedHex(12) - ;({ logs } = await anchor.deposit(commitment, { value, from: accounts[2] })) + commitment = toFixedHex(12); + ({ logs } = await anchor.deposit(commitment, { value, from: accounts[2] })) logs[0].event.should.be.equal('Deposit') logs[0].args.commitment.should.be.equal(commitment) @@ -112,17 +106,16 @@ contract('NativeAnchor', (accounts) => { it('should throw if there is a such commitment', async () => { const commitment = toFixedHex(42) await anchor.deposit(commitment, { value, from: sender }).should.be.fulfilled - const error = await anchor.deposit(commitment, { value, from: sender }).should.be.rejected - error.reason.should.be.equal('The commitment has been submitted') + await TruffleAssert.reverts(anchor.deposit(commitment, { value, from: sender }), 'The commitment has been submitted'); }) }) // Use Node version >=12 - describe('snark proof verification on js side', () => { + describe.only('snark proof verification on js side', () => { it('should detect tampering', async () => { - const deposit = generateDeposit() - await tree.insert(deposit.commitment) - const { root, path_elements, path_index } = await tree.path(0) + const deposit = generateDeposit(); + await tree.insert(deposit.commitment); + const { root, path_elements, path_index } = await tree.path(0); const witness = { root, @@ -141,8 +134,8 @@ contract('NativeAnchor', (accounts) => { let res = await snarkjs.groth16.prove('build/tornado/circuit_final.zkey', wtns); proof = res.proof; publicSignals = res.publicSignals; - let tempProof = proof; let tempSignals = publicSignals; + // const vKey = JSON.parse(fs.readFileSync("./build/tornado/verification_key.json")); const vKey = await snarkjs.zKey.exportVerificationKey('build/tornado/circuit_final.zkey'); let result = await snarkjs.groth16.verify(vKey, publicSignals, proof); @@ -174,7 +167,6 @@ contract('NativeAnchor', (accounts) => { const deposit = generateDeposit() const user = accounts[4] await tree.insert(deposit.commitment) - const balanceUserBefore = await web3.eth.getBalance(user) // Uncomment to measure gas usage diff --git a/yarn.lock b/yarn.lock index 32258d9c0..b1ca9a590 100644 --- a/yarn.lock +++ b/yarn.lock @@ -905,6 +905,26 @@ strip-indent "^2.0.0" super-split "^1.1.0" +"@tsconfig/node10@^1.0.7": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" + integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== + +"@tsconfig/node12@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" + integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== + +"@tsconfig/node14@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" + integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== + +"@tsconfig/node16@^1.0.1": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e" + integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== + "@typechain/ethers-v5@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-2.0.0.tgz#cd3ca1590240d587ca301f4c029b67bfccd08810" @@ -1262,6 +1282,11 @@ anymatch@~3.1.1, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -2067,12 +2092,6 @@ blake2b-wasm@^1.1.0: dependencies: nanoassert "^1.0.0" -"blake2b-wasm@https://github.com/jbaylina/blake2b-wasm.git": - version "2.1.0" - resolved "https://github.com/jbaylina/blake2b-wasm.git#0d5f024b212429c7f50a7f533aa3a2406b5b42b3" - dependencies: - nanoassert "^1.0.0" - blake2b@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/blake2b/-/blake2b-2.1.3.tgz#f5388be424768e7c6327025dad0c3c6d83351bca" @@ -3023,6 +3042,11 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: safe-buffer "^5.0.1" sha.js "^2.4.8" +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + cross-fetch@^2.1.0, cross-fetch@^2.1.1: version "2.2.3" resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-2.2.3.tgz#e8a0b3c54598136e037f8650f8e823ccdfac198e" @@ -3305,6 +3329,11 @@ diff@5.0.0: resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -6345,6 +6374,11 @@ maci-crypto@^0.9.1: ethers "^4.0.45" ffjavascript "0.2.35" +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + map-age-cleaner@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" @@ -8291,20 +8325,6 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -snarkjs@^0.3.60: - version "0.3.60" - resolved "https://registry.yarnpkg.com/snarkjs/-/snarkjs-0.3.60.tgz#fe573e347a924af8ed162154e866e02ef8d8230c" - integrity sha512-l3QMKvr+KUetxlJq9TCS0KNxiUquUDYFqHIzn3TxNSPPlcQfIq6V0isZKCjuML+XNGaoJ7s+kfdAZ8qp/2yOYQ== - dependencies: - "@iden3/binfileutils" "0.0.8" - blake2b-wasm "https://github.com/jbaylina/blake2b-wasm.git" - circom_runtime "0.1.13" - fastfile "0.0.19" - ffjavascript "0.2.35" - logplease "^1.2.15" - r1csfile "0.0.32" - readline "^1.3.0" - snarkjs@^0.4.6: version "0.4.6" resolved "https://registry.yarnpkg.com/snarkjs/-/snarkjs-0.4.6.tgz#763a557a36765ca3b4b8715fa5e1a7fce7127016" @@ -8392,7 +8412,7 @@ source-map-support@^0.4.15: dependencies: source-map "^0.5.6" -source-map-support@^0.5.13, source-map-support@^0.5.19: +source-map-support@^0.5.13, source-map-support@^0.5.17, source-map-support@^0.5.19: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== @@ -8929,6 +8949,22 @@ ts-generator@^0.1.1: resolve "^1.8.1" ts-essentials "^1.0.0" +ts-node@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.1.0.tgz#e656d8ad3b61106938a867f69c39a8ba6efc966e" + integrity sha512-6szn3+J9WyG2hE+5W8e0ruZrzyk1uFLYye6IGMBadnOzDh8aP7t8CbFpsfCiEx2+wMixAhjFt7lOZC4+l+WbEA== + dependencies: + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + source-map-support "^0.5.17" + yn "3.1.1" + tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -10597,6 +10633,11 @@ yargs@~3.10.0: decamelize "^1.0.0" window-size "0.1.0" +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"