diff --git a/gas-bound-caller/README.md b/gas-bound-caller/README.md index 71962937b..0da52cd1f 100644 --- a/gas-bound-caller/README.md +++ b/gas-bound-caller/README.md @@ -48,4 +48,4 @@ Since `GasBoundCaller` would be the contract that calls the `_to` contract, the It should be deployed via a built-in CREATE2 factory on each individual chain. -TODO(EVM-585) +The current address on both sepolia testnet and mainnet for zkSync Era is `0xc706EC7dfA5D4Dc87f29f859094165E8290530f5`. diff --git a/gas-bound-caller/canonical-bytecodes/GasBoundCaller b/gas-bound-caller/canonical-bytecodes/GasBoundCaller index 17dcacc84..ab3f37e77 100644 --- a/gas-bound-caller/canonical-bytecodes/GasBoundCaller +++ b/gas-bound-caller/canonical-bytecodes/GasBoundCaller @@ -1 +1 @@ -0x00120000000000020006000000000002000000000301001900000060043002700000009e03400197000100000031035500020000003103550003000000310355000400000031035500050000003103550006000000310355000700000031035500080000003103550009000000310355000a000000310355000b000000310355000c000000310355000d000000310355000e000000310355000f000000310355001000000031035500110000000103550000009e0040019d0000008004000039000000400040043f00000001022001900000004d0000c13d000000040230008c000000a50000413d000000000201043b000000a002200197000000a10220009c000000a50000c13d000000040230008a000000600220008c000000a50000413d0000000402100370000000000802043b000000a20280009c000000a50000213d0000004402100370000000000202043b000000a30420009c000000a50000213d0000002304200039000000a405000041000000000634004b00000000060000190000000006058019000000a404400197000000000704004b0000000005008019000000a40440009c000000000506c019000000000405004b000000a50000c13d0000000404200039000000000441034f000000000604043b000000a30460009c000000a50000213d00000024052000390000000004560019000000000234004b000000a50000213d0000002401100370000000000201043b0000000003000414000003200100008a000000000113004b000000550000413d000000b10100004100000000001004350000001101000039000000040010043f000000b20100004100000274000104300000000001000416000000000101004b000000a50000c13d0000002001000039000001000010044300000120000004430000009f01000041000002730001042e0000000001000414000000000121004b000000620000a13d000000af01000041000000800010043f0000002001000039000000840010043f0000001401000039000000a40010043f000000b401000041000000c40010043f000000b5010000410000027400010430000200000006001d000100000005001d000500000004001d000600000008001d000000a501000041000000800010043f0000009e01000041000400000002001d0000000002000414000300000003001d0000009e0320009c0000000002018019000000c001200210000000a6011001c70000800b02000039027202680000040f00000003030000290000000403300069000003200a30008a0000000403a0006c00000000030000190000000103002039000000000303004b000000000a00c019000000000301001900000060033002700000009e03300197000000200430008c000000000403001900000020040080390000001f0540018f00000005064002720000008c0000613d00000000070000190000000508700210000000000981034f000000000909043b000000800880003900000000009804350000000107700039000000000867004b000000840000413d000000000705004b000000060b0000290000009c0000613d0000000506600210000000000761034f00000003055002100000008006600039000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f00000000005604350000000102200190000000050c000029000000a70000613d0000001f01400039000000600210018f00000080012001bf000000400010043f000000200330008c000000ca0000813d00000000010000190000027400010430000000400200043d0000001f0430018f0000000505300272000000b40000613d000000000600001900000005076002100000000008720019000000000771034f000000000707043b00000000007804350000000106600039000000000756004b000000ac0000413d000000000604004b000000c30000613d0000000505500210000000000151034f00000000055200190000000304400210000000000605043300000000064601cf000000000646022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000161019f00000000001504350000009e010000410000009e0420009c000000000201801900000040012002100000006002300210000000000121019f0000027400010430000000800900043d0000000004000414000000000600003100000011050003670000000003000416000000000703004b000000e80000c13d000000020300006b000000da0000613d00000001030000290000009e0330019700010000003503550000000007c6004b000000470000413d000000000535034f0000000006c600490000009e0360019700010000003503e50000009e0640009c000000f50000213d000400000009001d00050000000a001d00000000013503df000000c002400210000000a802200197000000aa022001c700010000002103b500000000012103af00000000020b00190000010f0000013d000000020700006b000000f10000613d00000001070000290000009e0770019700010000007503550000000008c6004b000000470000413d000000000575034f0000000006c600490000009e0660019700010000006503e5000000a70740009c000001030000413d000000af03000041000000000031043500000084032001bf00000020040000390000000000430435000000c403200039000000b3040000410000000000430435000000a402200039000000080300003900000000003204350000004001100210000000b0011001c70000027400010430000400000009001d00050000000a001d00000000016503df000000c002400210000000a802200197000000a9022001c700010000002103b500000000012103af000080090200003900000000040b0019000000000500001900000000060000190272026d0000040f000000000301001900000060033002700000009e033001970000000102200190000001d90000613d0000003f02300039000000ab02200197000000400600043d0000000002260019000000000462004b00000000040000190000000104004039000000a30520009c000001d50000213d0000000104400190000001d50000c13d000000400020043f000200000006001d00000000023604360000001f043000390000000504400272000001310000613d00000000050000310000001105500367000000000600001900000005076002100000000008720019000000000775034f000000000707043b00000000007804350000000106600039000000000746004b000001290000413d000000000400004b000001330000613d0000001f0430018f00000005033002720000013f0000613d000000000500001900000005065002100000000007620019000000000661034f000000000606043b00000000006704350000000105500039000000000635004b000001370000413d000000000504004b0000014e0000613d0000000503300210000000000131034f00000000023200190000000303400210000000000402043300000000043401cf000000000434022f000000000101043b0000010003300089000000000131022f00000000013101cf000000000141019f0000000000120435000000400400043d000600000004001d000000a50100004100000000001404350000009e0100004100000000020004140000009e0320009c00000000020180190000009e0340009c00000000010440190000004001100210000000c002200210000000000112019f000000ac011001c70000800b02000039027202680000040f000000060a000029000000000301001900000060033002700000009e03300197000000200430008c000000000403001900000020040080390000001f0540018f0000000506400272000001710000613d0000000007000019000000050870021000000000098a0019000000000881034f000000000808043b00000000008904350000000107700039000000000867004b000001690000413d00000000090a0019000000000705004b000001810000613d0000000506600210000000000761034f00000000066900190000000305500210000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f00000000005604350000000102200190000001f40000613d0000001f01400039000000600110018f0000000002910019000000000112004b00000000010000190000000101004039000300000002001d000000a30220009c000001d50000213d0000000101100190000001d50000c13d0000000301000029000000400010043f000000200130008c0000000501000029000000a50000413d000500000001001d0000000001090433000600000001001d000000ad01000041000000030400002900000000001404350000009e0100004100000000020004140000009e0320009c00000000020180190000009e0340009c00000000010440190000004001100210000000c002200210000000000112019f000000ac011001c70000800b02000039027202680000040f000000030b0000290000000605000029000000040450006a000000000354004b00000000030000190000000103002039000000000303004b000000000400c019000000000301001900000060033002700000009e03300197000000200530008c000000000503001900000020050080390000001f0650018f0000000507500272000001bf0000613d00000000080000190000000509800210000000000a9b0019000000000991034f000000000909043b00000000009a04350000000108800039000000000978004b000001b70000413d000000000806004b000001ce0000613d0000000507700210000000000871034f00000003077000290000000306600210000000000907043300000000096901cf000000000969022f000000000808043b0000010006600089000000000868022f00000000066801cf000000000696019f00000000006704350000000102200190000002110000613d0000001f01500039000000600110018f0000000301100029000000a30210009c0000022e0000a13d000000b101000041000000000010043500000041010000390000004a0000013d0000001f0430018f0000000502300272000001e40000613d00000000050000190000000506500210000000000761034f000000000707043b00000000007604350000000105500039000000000625004b000001dd0000413d000000000504004b000001f20000613d00000003044002100000000502200210000000000502043300000000054501cf000000000545022f000000000121034f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f000000000012043500000060013002100000027400010430000000400200043d0000001f0430018f0000000505300272000002010000613d000000000600001900000005076002100000000008720019000000000771034f000000000707043b00000000007804350000000106600039000000000756004b000001f90000413d000000000604004b000002100000613d0000000505500210000000000151034f00000000055200190000000304400210000000000605043300000000064601cf000000000646022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000161019f0000000000150435000000c30000013d000000400200043d0000001f0430018f00000005053002720000021e0000613d000000000600001900000005076002100000000008720019000000000771034f000000000707043b00000000007804350000000106600039000000000756004b000002160000413d000000000604004b0000022d0000613d0000000505500210000000000151034f00000000055200190000000304400210000000000605043300000000064601cf000000000646022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000161019f0000000000150435000000c30000013d000000400010043f000000200230008c000000a50000413d0000000302000029000000000302043300000000524300a9000000000503004b0000023b0000613d00000000533200d9000000000343004b000000470000c13d000000000302004b0000024c0000c13d0000000203000029000000200130008a0000000000210435000000400130008a00000040020000390000000000210435000000000203043300000060022000390000009e030000410000009e0420009c00000000020380190000009e0410009c000000000103801900000040011002100000006002200210000000000112019f000002730001042e00000000040004140000000503400029000000000443004b000000000400001900000001040040390000000104400190000000470000c13d000001910400008a000000000442004b000000470000213d0000019004200039000000000343004b0000023b0000813d0000004402100039000000ae03000041000000000032043500000024021000390000001a030000390000000000320435000000af0200004100000000002104350000000402100039000000200300003900000000003204350000009e020000410000009e0310009c0000000001028019000001000000013d0000026b002104230000000102000039000000000001042d0000000002000019000000000001042d00000270002104210000000102000039000000000001042d0000000002000019000000000001042d0000027200000432000002730001042e000002740001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0000000200000000000000000000000000000040000001000000000000000000ffffffff0000000000000000000000000000000000000000000000000000000041a8596c00000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffffff8000000000000000000000000000000000000000000000000000000000000000c0d5b949000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000800000000000000000000000000000000000000000000000000000000000000000000000010000000000000000ffffffff0000000000000000000000000000000000000000000000000100000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000040000000000000000000000007cb9357e000000000000000000000000000000000000000000000000000000004e6f7420656e6f7567682067617320666f72207075626461746100000000000008c379a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000004e487b710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000004f766572666c6f77000000000000000000000000000000000000000000000000476173206c696d697420697320746f6f206c6f7700000000000000000000000000000000000000000000000000000000000000640000008000000000000000006c300d3e2b009b9a5b1fe7d853a9ae64e30e1d513df698d5c9801da939df7831 \ No newline at end of file +0x00120000000000020007000000000002000000000301001900000060043002700000009303400197000100000031035500020000003103550003000000310355000400000031035500050000003103550006000000310355000700000031035500080000003103550009000000310355000a000000310355000b000000310355000c000000310355000d000000310355000e000000310355000f00000031035500100000003103550011000000010355000000930040019d0000008004000039000000400040043f0000000102200190000000420000c13d000000040230008c000000920000413d000000000201043b0000009502200197000000640430008c000000920000413d000000960220009c000000920000c13d0000000402100370000000000502043b000000970250009c000000920000213d0000004402100370000000000202043b000000980420009c000000920000213d0000002304200039000000000434004b000000920000813d0000000404200039000000000441034f000000000704043b000000980470009c000000920000213d00000024062000390000000004670019000000000234004b000000920000213d0000002401100370000000000201043b0000000003000414000000ab0130009c0000004a0000413d000000a60100004100000000001004350000001101000039000000040010043f000000a70100004100000248000104300000000001000416000000000101004b000000920000c13d0000002001000039000001000010044300000120000004430000009401000041000002470001042e0000000001000414000000000121004b000000570000a13d000000a401000041000000800010043f0000002001000039000000840010043f0000001401000039000000a40010043f000000a901000041000000c40010043f000000aa010000410000024800010430000300000007001d000200000006001d000600000004001d000700000005001d0000009901000041000000800010043f0000000001000414000500000002001d000000930210009c0000009301008041000000c0011002100000009a011001c70000800b02000039000400000003001d0246023c0000040f000000800a00003900000004030000290000032003300039000000050930006b0000000009004019000000000301001900000060033002700000009303300197000000200430008c000000200400003900000000040340190000001f0540018f0000000506400272000000790000613d000000000701034f000000007807043c000000000a8a0436000000a008a0008c000000750000c13d000000000705004b000000070b000029000000890000613d0000000506600210000000000761034f00000003055002100000008006600039000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f00000000005604350000000102200190000000060c000029000000940000613d0000001f01400039000000600210018f00000080012001bf000000400010043f000000200330008c000000b50000813d00000000010000190000024800010430000000400200043d0000001f0430018f0000000505300272000000a00000613d00000005065002100000000006620019000000000701034f0000000008020019000000007907043c0000000008980436000000000968004b0000009c0000c13d000000000604004b000000af0000613d0000000505500210000000000151034f00000000055200190000000304400210000000000605043300000000064601cf000000000646022f000000000101043b0000010004400089000000000141022f00000000014101cf000000000161019f00000000001504350000006001300210000000930320009c00000093020080410000004002200210000000000112019f0000024800010430000000800a00043d0000000004000414000000000600003100000011050003670000000003000416000000000703004b000000bf0000c13d000000030300006b000000c20000c13d000000c90000013d000000030700006b000000d70000c13d000000de0000013d0000000203000029000000930330019700010000003503550000000007c6004b0000003c0000413d000000000535034f0000000006c60049000000930360019700010000003503e5000000930640009c000000e20000213d00060000000a001d000500000009001d00000000013503df000000c0024002100000009c022001970000009e022001c700010000002103b500000000012103af00000000020b0019000000fc0000013d0000000207000029000000930770019700010000007503550000000008c6004b0000003c0000413d000000000575034f0000000006c60049000000930660019700010000006503e50000009b0740009c000000f00000413d000000a403000041000000000031043500000084032001bf00000020040000390000000000430435000000c403200039000000a8040000410000000000430435000000a402200039000000080300003900000000003204350000004001100210000000a5011001c7000002480001043000060000000a001d000500000009001d00000000016503df000000c0024002100000009c022001970000009d022001c700010000002103b500000000012103af000080090200003900000000040b001900000000050000190000000006000019024602410000040f0000000003010019000000600330027000000093033001970000000102200190000001450000613d0000001f023000390000009f042001970000003f02400039000000a002200197000000400700043d0000000002270019000000000572004b00000000050000190000000105004039000000980620009c000001e00000213d0000000105500190000001e00000c13d000000400020043f000700000007001d00000000023704360000001f0540018f00000005064002720000011d0000613d0000000006000031000000110660036700000000044200190000000007020019000000006806043c0000000007870436000000000847004b000001190000c13d000000000405004b0000011f0000613d0000001f0430018f000000050330027200000005033002100000012a0000613d0000000005320019000000000601034f0000000007020019000000006806043c0000000007870436000000000857004b000001260000c13d000000000504004b000001380000613d000000000131034f00000000023200190000000303400210000000000402043300000000043401cf000000000434022f000000000101043b0000010003300089000000000131022f00000000013101cf000000000141019f000000000012043500000007010000290000000001010433000000ac0210009c000000050200002900000006030000290000003c0000213d000600000003001d000500000002001d00000060021000390000001f031001900000015f0000c13d000200000002001d000001630000013d0000001f0430018f00000005023002720000014f0000613d0000000505200210000000000601034f0000000007000019000000006806043c0000000007870436000000000857004b0000014b0000c13d000000000504004b0000015d0000613d00000003044002100000000502200210000000000502043300000000054501cf000000000545022f000000000121034f000000000101043b0000010004400089000000000141022f00000000014101cf000000000151019f000000000012043500000060013002100000024800010430000000ad01100197000200800010003d000000020120006b0000003c0000413d000000400200043d00000099010000410000000001120436000300000001001d000000930120009c000400000002001d0000009301000041000000000102401900000040011002100000000002000414000000930320009c0000009302008041000000c002200210000000000112019f000000a1011001c70000800b020000390246023c0000040f000000030a000029000000000301001900000060033002700000009303300197000000200430008c000000200400003900000000040340190000001f0540018f0000000506400272000001840000613d000000000701034f0000000408000029000000007907043c00000000089804360000000009a8004b000001800000c13d000000000705004b000001930000613d0000000506600210000000000761034f00000004066000290000000305500210000000000806043300000000085801cf000000000858022f000000000707043b0000010005500089000000000757022f00000000055701cf000000000585019f00000000005604350000000102200190000001e60000613d0000001f01400039000000600110018f0000000402100029000000000112004b00000000010000190000000101004039000300000002001d000000980220009c000001e00000213d0000000101100190000001e00000c13d0000000301000029000000400010043f000000200130008c000000920000413d00000004010000290000000001010433000400000001001d000000a20100004100000003020000290000000001120436000100000001001d000000930120009c0000009301000041000000000102401900000040011002100000000002000414000000930320009c0000009302008041000000c002200210000000000112019f000000a1011001c70000800b020000390246023c0000040f000000010b0000290000000404000029000000060440006c0000000004004019000000000301001900000060033002700000009303300197000000200530008c000000200500003900000000050340190000001f0650018f0000000507500272000001ca0000613d000000000801034f0000000309000029000000008a08043c0000000009a90436000000000ab9004b000001c60000c13d000000000806004b000001d90000613d0000000507700210000000000871034f00000003077000290000000306600210000000000907043300000000096901cf000000000969022f000000000808043b0000010006600089000000000868022f00000000066801cf000000000696019f00000000006704350000000102200190000001f50000613d0000001f01500039000000600110018f0000000301100029000000980210009c000002040000a13d000000a60100004100000000001004350000004101000039000000040010043f000000a7010000410000024800010430000000400200043d0000001f0430018f00000005053002720000000505500210000001f20000613d0000000006520019000000000701034f0000000008020019000000007907043c0000000008980436000000000968004b000001ee0000c13d000000000604004b000000af0000613d000000a30000013d000000400200043d0000001f0430018f00000005053002720000000505500210000002010000613d0000000006520019000000000701034f0000000008020019000000007907043c0000000008980436000000000968004b000001fd0000c13d000000000604004b000000af0000613d000000a30000013d000000400010043f000000200230008c000000920000413d0000000302000029000000000302043300000000524300a9000000000503004b000002110000613d00000000533200d9000000000343004b0000003c0000c13d000000000302004b000002200000c13d0000000703000029000000200130008a0000000000210435000000400130008a000000400200003900000000002104350000000203000029000000930230009c00000093030080410000006002300210000000930310009c00000093010080410000004001100210000000000112019f000002470001042e00000000040004140000000503400029000000000443004b0000000004000019000000010400403900000001044001900000003c0000c13d000000ae0420009c0000003c0000213d0000019004200039000000000343004b000002110000813d0000004402100039000000a303000041000000000032043500000024021000390000001a030000390000000000320435000000a4020000410000000000210435000000040210003900000020030000390000000000320435000000930210009c00000093010080410000004001100210000000a5011001c700000248000104300000023f002104230000000102000039000000000001042d0000000002000019000000000001042d00000244002104210000000102000039000000000001042d0000000002000019000000000001042d0000024600000432000002470001042e000002480001043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffff0000000200000000000000000000000000000040000001000000000000000000ffffffff0000000000000000000000000000000000000000000000000000000041a8596c00000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000ffffffffffffffffc0d5b949000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000800000000000000000000000000000000000000000000000000000000000000000000000010000000000000000ffffffff0000000000000000000000000000000000000000000000000100000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ffffffe000000000000000000000000000000000000000000000000000000003ffffffe000000000000000000000000000000000000000040000000000000000000000007cb9357e000000000000000000000000000000000000000000000000000000004e6f7420656e6f7567682067617320666f72207075626461746100000000000008c379a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000640000000000000000000000004e487b710000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000240000000000000000000000004f766572666c6f77000000000000000000000000000000000000000000000000476173206c696d697420697320746f6f206c6f770000000000000000000000000000000000000000000000000000000000000064000000800000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffce0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe6f00000000000000000000000000000000000000000000000000000000000000007bc9b4807e68a011097f2718e93decaab653602c03d8374d604916f73035a054 \ No newline at end of file diff --git a/gas-bound-caller/hardhat.config.ts b/gas-bound-caller/hardhat.config.ts index 2c50fa5fc..d46561e37 100644 --- a/gas-bound-caller/hardhat.config.ts +++ b/gas-bound-caller/hardhat.config.ts @@ -1,30 +1,15 @@ import "@matterlabs/hardhat-zksync-chai-matchers"; import "@matterlabs/hardhat-zksync-node"; import "@matterlabs/hardhat-zksync-solc"; +import "@matterlabs/hardhat-zksync-verify"; import "@nomiclabs/hardhat-ethers"; import "hardhat-typechain"; -// This version of system contracts requires a pre release of the compiler -const COMPILER_VERSION = "1.5.0"; -const PRE_RELEASE_VERSION = "prerelease-a167aa3-code4rena"; -function getZksolcUrl(): string { - // @ts-ignore - const platform = { darwin: "macosx", linux: "linux", win32: "windows" }[process.platform]; - // @ts-ignore - const toolchain = { linux: "-musl", win32: "-gnu", darwin: "" }[process.platform]; - const arch = process.arch === "x64" ? "amd64" : process.arch; - const ext = process.platform === "win32" ? ".exe" : ""; - - return `https://github.com/matter-labs/era-compiler-solidity/releases/download/${PRE_RELEASE_VERSION}/zksolc-${platform}-${arch}${toolchain}-v${COMPILER_VERSION}${ext}`; -} - -console.log(`Using zksolc from ${getZksolcUrl()}`); - export default { zksolc: { + version: "1.5.0", compilerSource: "binary", settings: { - compilerPath: getZksolcUrl(), isSystem: true, }, }, @@ -55,6 +40,20 @@ export default { ethNetwork: "localhost", zksync: true, }, + zkSyncTestnet: { + url: "https://sepolia.era.zksync.dev", + ethNetwork: "sepolia", + zksync: true, + // contract verification endpoint + verifyURL: "https://explorer.sepolia.era.zksync.dev/contract_verification", + }, + zkSyncMainnet: { + url: "https://mainnet.era.zksync.io", + ethNetwork: "mainnet", + zksync: true, + // contract verification endpoint + verifyURL: "https://zksync2-mainnet-explorer.zksync.io/contract_verification", + }, }, paths: { sources: "./contracts", diff --git a/gas-bound-caller/package.json b/gas-bound-caller/package.json index de6220930..8943b4b2b 100644 --- a/gas-bound-caller/package.json +++ b/gas-bound-caller/package.json @@ -20,6 +20,7 @@ "devDependencies": { "@matterlabs/hardhat-zksync-chai-matchers": "^0.1.4", "@matterlabs/hardhat-zksync-node": "^0.0.1-beta.7", + "@matterlabs/hardhat-zksync-verify": "0.6.1", "@nomicfoundation/hardhat-chai-matchers": "^1.0.3", "@nomiclabs/hardhat-ethers": "^2.0.0", "@typechain/ethers-v5": "^2.0.0", @@ -54,6 +55,8 @@ "clean": "yarn clean:bootloader && yarn clean:system-contracts", "test": "yarn build && hardhat test --network zkSyncTestNode", "test-node": "hardhat node-zksync --tag v0.0.1-vm1.5.0", + "check-canonical-bytecode": "ts-node ./scripts/check-canonical-bytecode.ts", + "verify": "hardhat run scripts/verify.ts", "deploy-on-hyperchain": "ts-node ./scripts/deploy-on-hyperchain.ts", "deploy-on-localhost": "hardhat deploy --network localhost" } diff --git a/gas-bound-caller/scripts/verify.ts b/gas-bound-caller/scripts/verify.ts new file mode 100644 index 000000000..53ca9ef2a --- /dev/null +++ b/gas-bound-caller/scripts/verify.ts @@ -0,0 +1,31 @@ +// hardhat import should be the first import in the file +import * as hardhat from "hardhat"; + +const EXPECTED_ADDRESS = "0xc706EC7dfA5D4Dc87f29f859094165E8290530f5"; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function verifyPromise(address: string, constructorArguments?: Array, libraries?: object): Promise { + return new Promise((resolve, reject) => { + hardhat + .run("verify:verify", { address, constructorArguments, libraries }) + .then(() => resolve(`Successfully verified ${address}`)) + .catch((e) => reject(`Failed to verify ${address}\nError: ${e.message}`)); + }); +} + +async function main() { + if (process.env.CHAIN_ETH_NETWORK == "localhost") { + console.log("Skip contract verification on localhost"); + return; + } + + const message = await verifyPromise(EXPECTED_ADDRESS); + console.log(message.status == "fulfilled" ? message.value : message.reason); +} + +main() + .then(() => process.exit(0)) + .catch((err) => { + console.error("Error:", err.message || err); + process.exit(1); + }); diff --git a/yarn.lock b/yarn.lock index 6e6b7f723..86bd23e02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -752,6 +752,26 @@ sinon-chai "^3.7.0" undici "^5.14.0" +"@matterlabs/hardhat-zksync-verify@0.6.1": + version "0.6.1" + resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-verify/-/hardhat-zksync-verify-0.6.1.tgz#3fd83f4177ac0b138656ed93d4756ec27f1d329d" + integrity sha512-W9gI4k1UnuQ2MaBnK1f7E8Z2C4uHxpeDkzmB/ZCKClai2A3vK2jAbfqiQbX0HvuLq2OOq4dbx83KehAXjXoHlw== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@ethersproject/address" "5.7.0" + "@matterlabs/hardhat-zksync-solc" "^1.1.4" + "@nomicfoundation/hardhat-verify" "^2.0.0" + "@openzeppelin/contracts" "^4.9.2" + axios "^1.6.2" + cbor "^8.1.0" + chai "^4.3.6" + chalk "4.1.2" + debug "^4.1.1" + hardhat "^2.14.0" + sinon "^17.0.1" + sinon-chai "^3.7.0" + zksync-ethers "^5.0.0" + "@matterlabs/hardhat-zksync-verify@^0.2.0": version "0.2.2" resolved "https://registry.yarnpkg.com/@matterlabs/hardhat-zksync-verify/-/hardhat-zksync-verify-0.2.2.tgz#daa34bc4404096ed0f44461ee366c1cb0e5a4f2f" @@ -7517,6 +7537,13 @@ yocto-queue@^1.0.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== +zksync-ethers@^5.0.0: + version "5.8.0" + resolved "https://registry.yarnpkg.com/zksync-ethers/-/zksync-ethers-5.8.0.tgz#ff054345048f851c33cb6efcf2094f40d4da6063" + integrity sha512-/4qI5UElh0lspu0ew2IXBCO+O9kXEzZOM7JqvlfRWWGIUKZ+EDXnjIPgkH0y5/MnMT3FDq9koAAUCyZVWqHUJg== + dependencies: + ethers "~5.7.0" + "zksync-ethers@https://github.com/zksync-sdk/zksync-ethers#ethers-v5-feat/bridgehub": version "5.1.0" resolved "https://github.com/zksync-sdk/zksync-ethers#28ccbe7d67b170c202b17475e06a82002e6e3acc"