@layerzerolabs/verify-contract 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2 -2
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -434,7 +434,7 @@ f\rff\u0491fN\x8Eg\b
|
|
|
434
434
|
\xEA\f\xF4\xFE\u0100\u0129\u012B\u012E\u0146\u0157\u0159\u016C \u0173"\u0178$\u017E&\u0196(\u0198*\u019D,\u019F.\u01B00\u01C02\u01C84\u01D96\u01DB8\u01E8:\u01EB<\u01F3>\u01F5@\u0204B\u0211D\u0218F\u0225H\u022CJ\u0239L\u023DN\u024AP\u0257R\u0261T\u0263V\u0270X\u0272Z\u0274\\\u0282^\u0284\`\u0286b\u029Ed\u02A0f\u02A3h\u02ACj\u02B7l\u02C0n\u02C8p\u02CAr\u02CDt\u02DDv\u02E9x\u02EBz\u02F3|\u02F6~\u02F9\x80\u02FF\x82\u0302\x84\u0306\x86\u0311\x88\u031A\x8A\u0325\x8C\u0334\x8E\u0348\x90\u03A0\x92\u03A2\x94\u03AA\x96\u03B5\x98\u03C1\x9A\u03C3\x9C\u03C8\x9E\u03E2\xA0\u03E7\xA2\u03E9\xA4\u03F1\xA6\u0401\xA8\u0407\xAA\u0412\xAC\u0414\xAE\u041C\xB0\u0420\xB2\u0423\xB4\u0431\xB6\u0433\xB8\u043F\xBA\u0442\xBC\u044E\xBE\u0457\xC0\u0473\xC2\u0475\xC4\u0479\xC6\u047C\xC8\u0480\xCA\u048F\xCC\xD8\xCD\xD8
|
|
435
435
|
\xCE\xD8\f\xCF\xD8> \xD0\xD8:\xD1\xD8,\xD2\xD82\xD3\xD8\xD4\xD8 \xD5\xD8"\xD6\xD8$\xD7\xCC\xD7\xCD\xD7\xCE\xD7\xCF\xD7\xD0\xD7\xD1\xD7\xD2\xD7\xD3\xD7\xD4\xD7\xD5\xD7\xD6\xD8\xDB\xD9\xD7\xD9\xDA\xDA\xDC\xDB\xD9\xDC\xDD\x07\xDD\xDE\xDF\x07\xDF\xE0\xE0\xE1\b\xE1\xE2\x07\xE2\xE3\xE4\xC4c\xE4\x07\xE5\xE9\x07\xE6\xE9
|
|
436
436
|
\xE7\xE9\x8EH\xE8\xE5\xE8\xE6\xE8\xE7\xE9 \xEA\xF1\b\xEB\xED\x07\xEC\xEB\xEC\xED\xED\xEE\xEE\xF0\b\xEF\xEC\xF0\xF3\xF1\xEF\xF1\xF2\xF2\v\xF3\xF1\xF4\xF5 \xF5\r\xF6\xF8\f\x07\xF7\xF6\xF7\xF8\xF8\xF9\xF9\xFF\x07\x84\xFA\xFC\f\x07\xFB\xFA\xFB\xFC\xFC\xFD\xFD\xFF\x07i\xFE\xF7\xFE\xFB\xFF\u0100\u0103\xC4c\u0101\u0102\x07\u0102\u0104\xC4c\u0103\u0101\u0103\u0104\u0104\u0105\u0106\x07\u0106\u0109\v\u0107\u0108\x07\u0108\u010A\xC4c\u0109\u0107\u0109\u010A\u010A\u010B\u010B\u010C\x07\u010C\u012A\u010D\u0110\x07\u010E\u0111\x07\u010F\u0111\xC4c\u0110\u010E\u0110\u010F\u0111\u0114\u0112\u0113\x07\u0113\u0115\xC4c\u0114\u0112\u0114\u0115\u0115\u0116\u0116\u0117\x07\u0117\u0118\v\u0118\u0119\x07\u0119\u012A\u011A\u011B\x07\u011B\u011C\x07\u011C\u0121 \u011D\u011E\x07\u011E\u0120 \u011F\u011D\u0120\u0123\u0121\u011F\u0121\u0122\u0122\u0124\u0123\u0121\u0124\u0125\x07\u0125\u0126\x07\u0126\u0127\v\u0127\u0128\x07\u0128\u012A\u0129\u0105\u0129\u010D\u0129\u011A\u012A\u012B\u012C\x07\x83\u012C\u012D\u012F\x07\u012E\u012D\u012E\u012F\u012F\u0130\u0130\u0131 \u0131\u013B\xC4c\u0132\u0133\x07\u0133\u0138\r\u0134\u0135\x07\u0135\u0137\r\u0136\u0134\u0137\u013A\u0138\u0136\u0138\u0139\u0139\u013C\u013A\u0138\u013B\u0132\u013B\u013C\u013C\u013D\u013D\u0141\x07\u013E\u0140\u013F\u013E\u0140\u0143\u0141\u013F\u0141\u0142\u0142\u0144\u0143\u0141\u0144\u0145\x07\u0145\u0146\u014CP)\u0147\u0149\x07\u0148\u014A\x92J\u0149\u0148\u0149\u014A\u014A\u014B\u014B\u014D\x07\u014C\u0147\u014C\u014D\u014D\u014E\u0158\u014F\u0158$\u0150\u0158,\u0151\u0158.\u0152\u01582\u0153\u0158:\u0154\u0158> \u0155\u0158 \u0156\u0158"\u0157\u014E\u0157\u014F\u0157\u0150\u0157\u0151\u0157\u0152\u0157\u0153\u0157\u0154\u0157\u0155\u0157\u0156\u0158\x1B\u0159\u0162N(\u015A\u0161\x07y\u015B\u0161\x07v\u015C\u0161\x07x\u015D\u0161\x07p\u015E\u0161\x07q\u015F\u0161\xC8e\u0160\u015A\u0160\u015B\u0160\u015C\u0160\u015D\u0160\u015E\u0160\u015F\u0161\u0164\u0162\u0160\u0162\u0163\u0163\u0165\u0164\u0162\u0165\u0168\xC4c\u0166\u0167\x07\r\u0167\u0169\x8EH\u0168\u0166\u0168\u0169\u0169\u016A\u016A\u016B\x07\u016B\u016C\u016DN(\u016D\u016E\x07p\u016E\u016F\xC4c\u016F\u0170\x07\r\u0170\u0171\x8EH\u0171\u0172\x07\u0172\u0173\u0174\x07\x1B\u0174\u0175\xC4c\u0175\u0176@!\u0176\u0177\x07\u0177!\u0178\u0179\x07|\u0179\u017A\xC4c\u017A\u017B\x07\u017B\u017C\x8CG\u017C\u017D\x07\u017D#\u017E\u017F\x07\u017F\u0180&\u0180\u0183\x07\u0181\u0184\x07\u0182\u0184N(\u0183\u0181\u0183\u0182\u0184\u0186\u0185\u0187\x07~\u0186\u0185\u0186\u0187\u0187\u0188\u0188\u0189\x07\u0189%\u018A\u0197P)\u018B\u018C\x07\u018C\u0191(\u018D\u018E\x07\u018E\u0190(\u018F\u018D\u0190\u0193\u0191\u018F\u0191\u0192\u0192\u0194\u0193\u0191\u0194\u0195\x07\u0195\u0197\u0196\u018A\u0196\u018B\u0197'\u0198\u019BP)\u0199\u019A\x07\u019A\u019C*\u019B\u0199\u019B\u019C\u019C)\u019D\u019E \u019E+\u019F\u01A0\x07&`;O._serializedATNSegment1="\u01A0\u01A1\xC4c\u01A1\u01AC\x07\u01A2\u01A3L'\u01A3\u01A9\x07\u01A4\u01A5L'\u01A5\u01A6\x07\u01A6\u01A8\u01A7\u01A4\u01A8\u01AB\u01A9\u01A7\u01A9\u01AA\u01AA\u01AD\u01AB\u01A9\u01AC\u01A2\u01AC\u01AD\u01AD\u01AE\u01AE\u01AF\x07\u01AF-\u01B0\u01B1\x07'\u01B1\u01B3\xC4c\u01B2\u01B4@!\u01B3\u01B2\u01B3\u01B4\u01B4\u01B9\u01B5\u01B8\x07z\u01B6\u01B8\xC8e\u01B7\u01B5\u01B7\u01B6\u01B8\u01BB\u01B9\u01B7\u01B9\u01BA\u01BA\u01BE\u01BB\u01B9\u01BC\u01BF\x07\u01BD\u01BF`1\u01BE\u01BC\u01BE\u01BD\u01BF/\u01C0\u01C6\xC4c\u01C1\u01C3\x07\u01C2\u01C4\x92J\u01C3\u01C2\u01C3\u01C4\u01C4\u01C5\u01C5\u01C7\x07\u01C6\u01C1\u01C6\u01C7\u01C71\u01C8\u01C94\x1B\u01C9\u01CA@!\u01CA\u01CC8\u01CB\u01CD6\u01CC\u01CB\u01CC\u01CD\u01CD\u01D0\u01CE\u01D1\x07\u01CF\u01D1`1\u01D0\u01CE\u01D0\u01CF\u01D13\u01D2\u01D4\x07(\u01D3\u01D5\xC4c\u01D4\u01D3\u01D4\u01D5\u01D5\u01DA\u01D6\u01DA\x07\x7F\u01D7\u01DA\x07\x80\u01D8\u01DA\x07\x81\u01D9\u01D2\u01D9\u01D6\u01D9\u01D7\u01D9\u01D8\u01DA5\u01DB\u01DC\x07)\u01DC\u01DD@!\u01DD7\u01DE\u01E7\x07t\u01DF\u01E7\x07y\u01E0\u01E7\x07v\u01E1\u01E7\x07x\u01E2\u01E7\x07z\u01E3\u01E7^0\u01E4\u01E70\u01E5\u01E7\xC8e\u01E6\u01DE\u01E6\u01DF\u01E6\u01E0\u01E6\u01E1\u01E6\u01E2\u01E6\u01E3\u01E6\u01E4\u01E6\u01E5\u01E7\u01EA\u01E8\u01E6\u01E8\u01E9\u01E99\u01EA\u01E8\u01EB\u01EC\x07*\u01EC\u01ED\xC4c\u01ED\u01EFD#\u01EE\u01F0\x07n\u01EF\u01EE\u01EF\u01F0\u01F0\u01F1\u01F1\u01F2\x07\u01F2;\u01F3\u01F4\xC4c\u01F4=\u01F5\u01F6\x07+\u01F6\u01F7\xC4c\u01F7\u01F9\x07\u01F8\u01FA<\u01F9\u01F8\u01F9\u01FA\u01FA\u01FF\u01FB\u01FC\x07\u01FC\u01FE<\u01FD\u01FB\u01FE\u0201\u01FF\u01FD\u01FF\u0200\u0200\u0202\u0201\u01FF\u0202\u0203\x07\u0203?\u0204\u020D\x07\u0205\u020AB\"\u0206\u0207\x07\u0207\u0209B\"\u0208\u0206\u0209\u020C\u020A\u0208\u020A\u020B\u020B\u020E\u020C\u020A\u020D\u0205\u020D\u020E\u020E\u020F\u020F\u0210\x07\u0210A\u0211\u0213N(\u0212\u0214\\/\u0213\u0212\u0213\u0214\u0214\u0216\u0215\u0217\xC4c\u0216\u0215\u0216\u0217\u0217C\u0218\u0221\x07\u0219\u021EF$\u021A\u021B\x07\u021B\u021DF$\u021C\u021A\u021D\u0220\u021E\u021C\u021E\u021F\u021F\u0222\u0220\u021E\u0221\u0219\u0221\u0222\u0222\u0223\u0223\u0224\x07\u0224E\u0225\u0227N(\u0226\u0228\x07u\u0227\u0226\u0227\u0228\u0228\u022A\u0229\u022B\xC4c\u022A\u0229\u022A\u022B\u022BG\u022C\u0235\x07\u022D\u0232J&\u022E\u022F\x07\u022F\u0231J&\u0230\u022E\u0231\u0234\u0232\u0230\u0232\u0233\u0233\u0236\u0234\u0232\u0235\u022D\u0235\u0236\u0236\u0237\u0237\u0238\x07\u0238I\u0239\u023BN(\u023A\u023C\\/\u023B\u023A\u023B\u023C\u023CK\u023D\u023FN(\u023E\u0240\\/\u023F\u023E\u023F\u0240\u0240\u0241\u0241\u0242\xC4c\u0242M\u0243\u0244\b(\u0244\u024B\x8CG\u0245\u024BP)\u0246\u024BT+\u0247\u024BZ.\u0248\u0249\x07.\u0249\u024B\x07w\u024A\u0243\u024A\u0245\u024A\u0246\u024A\u0247\u024A\u0248\u024B\u0254\u024C\u024D\f\u024D\u024F\x07,\u024E\u0250\x8EH\u024F\u024E\u024F\u0250\u0250\u0251\u0251\u0253\x07-\u0252\u024C\u0253\u0256\u0254\u0252\u0254\u0255\u0255O\u0256\u0254\u0257\u025C\xC4c\u0258\u0259\x07/\u0259\u025B\xC4c\u025A\u0258\u025B\u025E\u025C\u025A\u025C\u025D\u025DQ\u025E\u025C\u025F\u0262\x8CG\u0260\u0262P)\u0261\u025F\u0261\u0260\u0262S\u0263\u0264\x070\u0264\u0265\x07\u0265\u0267R*\u0266\u0268V,\u0267\u0266\u0267\u0268\u0268\u0269\u0269\u026A\x071\u026A\u026CN(\u026B\u026DX-\u026C\u026B\u026C\u026D\u026D\u026E\u026E\u026F\x07\u026FU\u0270\u0271\xC4c\u0271W\u0272\u0273\xC4c\u0273Y\u0274\u0275\x07(\u0275\u027BH%\u0276\u027A\x07v\u0277\u027A\x07t\u0278\u027A^0\u0279\u0276\u0279\u0277\u0279\u0278\u027A\u027D\u027B\u0279\u027B\u027C\u027C\u0280\u027D\u027B\u027E\u027F\x07)\u027F\u0281H%\u0280\u027E\u0280\u0281\u0281[\u0282\u0283 \u0283]\u0284\u0285 \u0285_\u0286\u028A\x07\u0287\u0289b2\u0288\u0287\u0289\u028C\u028A\u0288\u028A\u028B\u028B\u028D\u028C\u028A\u028D\u028E\x07\u028Ea\u028F\u029Ff4\u0290\u029Fh5\u0291\u029Fl7\u0292\u029Fr:\u0293\u029F`1\u0294\u029Ft;\u0295\u029Fx=\u0296\u029Fz>\u0297\u029F|?\u0298\u029F~@\u0299\u029F\x80A\u029A\u029F\x82B\u029B\u029Fn8\u029C\u029Fp9\u029D\u029F\x84C\u029E\u028F\u029E\u0290\u029E\u0291\u029E\u0292\u029E\u0293\u029E\u0294\u029E\u0295\u029E\u0296\u029E\u0297\u029E\u0298\u029E\u0299\u029E\u029A\u029E\u029B\u029E\u029C\u029E\u029D\u029Fc\u02A0\u02A1\x8EH\u02A1\u02A2\x07\u02A2e\u02A3\u02A4\x075\u02A4\u02A5\x07\u02A5\u02A6\x8EH\u02A6\u02A7\x07\u02A7\u02AAb2\u02A8\u02A9\x076\u02A9\u02ABb2\u02AA\u02A8\u02AA\u02AB\u02ABg\u02AC\u02AD\x077\u02AD\u02AF\x8EH\u02AE\u02B06\u02AF\u02AE\u02AF\u02B0\u02B0\u02B1\u02B1\u02B3`1\u02B2\u02B4j6\u02B3\u02B2\u02B4\u02B5\u02B5\u02B3\u02B5\u02B6\u02B6i\u02B7\u02BC\x078\u02B8\u02BA\xC4c\u02B9\u02B8\u02B9\u02BA\u02BA\u02BB\u02BB\u02BD@!\u02BC\u02B9\u02BC\u02BD\u02BD\u02BE\u02BE\u02BF`1\u02BFk\u02C0\u02C1\x079\u02C1\u02C2\x07\u02C2\u02C3\x8EH\u02C3\u02C4\x07\u02C4\u02C5b2\u02C5m\u02C6\u02C9\x86D\u02C7\u02C9d3\u02C8\u02C6\u02C8\u02C7\u02C9o\u02CA\u02CB\x07:\u02CB\u02CC`1\u02CCq\u02CD\u02CE\x07\u02CE\u02D1\x07\u02CF\u02D2n8\u02D0\u02D2\x07\u02D1\u02CF\u02D1\u02D0\u02D2\u02D5\u02D3\u02D6d3\u02D4\u02D6\x07\u02D5\u02D3\u02D5\u02D4\u02D6\u02D8\u02D7\u02D9\x8EH\u02D8\u02D7\u02D8\u02D9\u02D9\u02DA\u02DA\u02DB\x07\u02DB\u02DCb2\u02DCs\u02DD\u02DF\x07;\u02DE\u02E0\x07\x83\u02DF\u02DE\u02DF\u02E0\u02E0\u02E5\u02E1\u02E2\x07\u02E2\u02E3v<\u02E3\u02E4\x07\u02E4\u02E6\u02E5\u02E1\u02E5\u02E6\u02E6\u02E7\u02E7\u02E8\x9CO\u02E8u\u02E9\u02EA\xCAf\u02EAw\u02EB\u02EC\x07<\u02EC\u02EDb2\u02ED\u02EE\x079\u02EE\u02EF\x07\u02EF\u02F0\x8EH\u02F0\u02F1\x07\u02F1\u02F2\x07\u02F2y\u02F3\u02F4\x07r\u02F4\u02F5\x07\u02F5{\u02F6\u02F7\x07o\u02F7\u02F8\x07\u02F8}\u02F9\u02FB\x07=\u02FA\u02FC\x8EH\u02FB\u02FA\u02FB\u02FC\u02FC\u02FD\u02FD\u02FE\x07\u02FE\x7F\u02FF\u0300\x07>\u0300\u0301\x07\u0301\x81\u0302\u0303\x07?\u0303\u0304\x9AN\u0304\u0305\x07\u0305\x83\u0306\u0307\x07@\u0307\u0308\x9AN\u0308\u0309\x07\u0309\x85\u030A\u030B\x07A\u030B\u0312\x8AF\u030C\u0312L'\u030D\u030E\x07\u030E\u030F\x88E\u030F\u0310\x07\u0310\u0312\u0311\u030A\u0311\u030C\u0311\u030D\u0312\u0315\u0313\u0314\x07\r\u0314\u0316\x8EH\u0315\u0313\u0315\u0316\u0316\u0317\u0317\u0318\x07\u0318\x87\u0319\u031BL'\u031A\u0319\u031A\u031B\u031B\u0322\u031C\u031E\x07\u031D\u031FL'\u031E\u031D\u031E\u031F\u031F\u0321\u0320\u031C\u0321\u0324\u0322\u0320\u0322\u0323\u0323\x89\u0324\u0322\u0325\u032C\x07\u0326\u0328\xC4c\u0327\u0326\u0327\u0328\u0328\u0329\u0329\u032B\x07\u032A\u0327\u032B\u032E\u032C\u032A\u032C\u032D\u032D\u0330\u032E\u032C\u032F\u0331\xC4c\u0330\u032F\u0330\u0331\u0331\u0332\u0332\u0333\x07\u0333\x8B\u0334\u0335 \x07\u0335\x8D\u0336\u0337\bH\u0337\u0338\x07G\u0338\u0349N(\u0339\u033A\x07\u033A\u033B\x8EH\u033B\u033C\x07\u033C\u0349\u033D\u033E \b\u033E\u0349\x8EH\u033F\u0340 \u0340\u0349\x8EH\u0341\u0342\x07I\u0342\u0349\x8EH\u0343\u0344\x07J\u0344\u0349\x8EH\u0345\u0346\x07\b\u0346\u0349\x8EH\u0347\u0349\x90I\u0348\u0336\u0348\u0339\u0348\u033D\u0348\u033F\u0348\u0341\u0348\u0343\u0348\u0345\u0348\u0347\u0349\u0394\u034A\u034B\f\u034B\u034C\x07K\u034C\u0393\x8EH\u034D\u034E\f\u034E\u034F \n\u034F\u0393\x8EH\u0350\u0351\f\u0351\u0352 \u0352\u0393\x8EH\u0353\u0354\f\r\u0354\u0355 \v\u0355\u0393\x8EH\u0356\u0357\f\f\u0357\u0358\x07\u0358\u0393\x8EH\r\u0359\u035A\f\v\u035A\u035B\x07\x07\u035B\u0393\x8EH\f\u035C\u035D\f\n\u035D\u035E\x07\u035E\u0393\x8EH\v\u035F\u0360\f \u0360\u0361 \f\u0361\u0393\x8EH\n\u0362\u0363\f\b\u0363\u0364 \r\u0364\u0393\x8EH \u0365\u0366\f\x07\u0366\u0367\x07N\u0367\u0393\x8EH\b\u0368\u0369\f\u0369\u036A\x07\u036A\u0393\x8EH\x07\u036B\u036C\f\u036C\u036D\x07O\u036D\u036E\x8EH\u036E\u036F\x07H\u036F\u0370\x8EH\u0370\u0393\u0371\u0372\f\u0372\u0373 \u0373\u0393\x8EH\u0374\u0375\f\u0375\u0393 \b\u0376\u0377\f\x1B\u0377\u0378\x07,\u0378\u0379\x8EH\u0379\u037A\x07-\u037A\u0393\u037B\u037C\f\u037C\u037E\x07,\u037D\u037F\x8EH\u037E\u037D\u037E\u037F\u037F\u0380\u0380\u0382\x07H\u0381\u0383\x8EH\u0382\u0381\u0382\u0383\u0383\u0384\u0384\u0393\x07-\u0385\u0386\f\u0386\u0387\x07/\u0387\u0393\xC4c\u0388\u0389\f\u0389\u038A\x07\u038A\u038B\x94K\u038B\u038C\x07\u038C\u0393\u038D\u038E\f\u038E\u038F\x07\u038F\u0390\x98M\u0390\u0391\x07\u0391\u0393\u0392\u034A\u0392\u034D\u0392\u0350\u0392\u0353\u0392\u0356\u0392\u0359\u0392\u035C\u0392\u035F\u0392\u0362\u0392\u0365\u0392\u0368\u0392\u036B\u0392\u0371\u0392\u0374\u0392\u0376\u0392\u037B\u0392\u0385\u0392\u0388\u0392\u038D\u0393\u0396\u0394\u0392\u0394\u0395\u0395\x8F\u0396\u0394\u0397\u03A1\x07h\u0398\u03A1\xC2b\u0399\u03A1\xC6d\u039A\u03A1\xCAf\u039B\u03A1\xC4c\u039C\u03A1\x07|\u039D\u03A1\x07w\u039E\u03A1\xC0a\u039F\u03A1N(\u03A0\u0397\u03A0\u0398\u03A0\u0399\u03A0\u039A\u03A0\u039B\u03A0\u039C\u03A0\u039D\u03A0\u039E\u03A0\u039F\u03A1\x91\u03A2\u03A7\x8EH\u03A3\u03A4\x07\u03A4\u03A6\x8EH\u03A5\u03A3\u03A6\u03A9\u03A7\u03A5\u03A7\u03A8\u03A8\x93\u03A9\u03A7\u03AA\u03AF\x96L\u03AB\u03AC\x07\u03AC\u03AE\x96L\u03AD\u03AB\u03AE\u03B1\u03AF\u03AD\u03AF\u03B0\u03B0\u03B3\u03B1\u03AF\u03B2\u03B4\x07\u03B3\u03B2\u03B3\u03B4\u03B4\x95\u03B5\u03B6\xC4c\u03B6\u03B7\x07H\u03B7\u03B8\x8EH\u03B8\x97\u03B9\u03BB\x07\u03BA\u03BC\x94K\u03BB\u03BA\u03BB\u03BC\u03BC\u03BD\u03BD\u03C2\x07\u03BE\u03C0\x92J\u03BF\u03BE\u03BF\u03C0\u03C0\u03C2\u03C1\u03B9\u03C1\u03BF\u03C2\x99\u03C3\u03C4\x8EH\u03C4\u03C5\x07\u03C5\u03C6\x98M\u03C6\u03C7\x07\u03C7\x9B\u03C8\u03CC\x07\u03C9\u03CB\x9EP\u03CA\u03C9\u03CB\u03CE\u03CC\u03CA\u03CC\u03CD\u03CD\u03CF\u03CE\u03CC\u03CF\u03D0\x07\u03D0\x9D\u03D1\u03E3\xC4c\u03D2\u03E3\x9CO\u03D3\u03E3\xA0Q\u03D4\u03E3\xA6T\u03D5\u03E3\xA8U\u03D6\u03E3\xAEX\u03D7\u03E3\xB0Y\u03D8\u03E3\xB2Z\u03D9\u03E3\xB6\\\u03DA\u03E3\xBA^\u03DB\u03E3\xBC_\u03DC\u03E3\x07o\u03DD\u03E3\x07r\u03DE\u03E3\x07s\u03DF\u03E3\xC2b\u03E0\u03E3\xCAf\u03E1\u03E3\xC6d\u03E2\u03D1\u03E2\u03D2\u03E2\u03D3\u03E2\u03D4\u03E2\u03D5\u03E2\u03D6\u03E2\u03D7\u03E2\u03D8\u03E2\u03D9\u03E2\u03DA\u03E2\u03DB\u03E2\u03DC\u03E2\u03DD\u03E2\u03DE\u03E2\u03DF\u03E2\u03E0\u03E2\u03E1\u03E3\x9F\u03E4\u03E8\xA4S\u03E5\u03E8\xBE`\u03E6\u03E8\xA2R\u03E7\u03E4\u03E7\u03E5\u03E7\u03E6\u03E8\xA1\u03E9\u03EA\xC4c\u03EA\u03EB\x07/\u03EB\u03EC\xC4c\u03EC\xA3\u03ED\u03F2\x07=\u03EE\u03F2\x07.\u03EF\u03F2\x07D\u03F0\u03F2\xC4c\u03F1\u03ED\u03F1\u03EE\u03F1\u03EF\u03F1\u03F0\u03F2\u03FF\u03F3\u03F5\x07\u03F4\u03F6\xA0Q\u03F5\u03F4\u03F5\u03F6\u03F6\u03FB\u03F7\u03F8\x07\u03F8\u03FA\xA0Q\u03F9\u03F7\u03FA\u03FD\u03FB\u03F9\u03FB\u03FC\u03FC\u03FE\u03FD\u03FB\u03FE\u0400\x07\u03FF\u03F3\u03FF\u0400\u0400\xA5\u0401\u0402\x07Z\u0402\u0405\xAAV\u0403\u0404\x07[\u0404\u0406\xA0Q\u0405\u0403\u0405\u0406\u0406\xA7\u0407\u0408\xAAV\u0408\u0409\x07[\u0409\u040A\xA0Q\u040A\xA9\u040B\u0413\xC4c\u040C\u0413\xA2R\u040D\u0413\xACW\u040E\u040F\x07\u040F\u0410\xACW\u0410\u0411\x07\u0411\u0413\u0412\u040B\u0412\u040C\u0412\u040D\u0412\u040E\u0413\xAB\u0414\u0419\xC4c\u0415\u0416\x07\u0416\u0418\xC4c\u0417\u0415\u0418\u041B\u0419\u0417\u0419\u041A\u041A\xAD\u041B\u0419\u041C\u041D\xA0Q\u041D\u041E\x07\\\u041E\u041F\xC4c\u041F\xAF\u0420\u0421\xC4c\u0421\u0422\x07H\u0422\xB1\u0423\u0424\x07]\u0424\u0428\xA0Q\u0425\u0427\xB4[\u0426\u0425\u0427\u042A\u0428\u0426\u0428\u0429\u0429\xB3\u042A\u0428\u042B\u042C\x07^\u042C\u042D\xBE`\u042D\u042E\x9CO\u042E\u0432\u042F\u0430\x07_\u0430\u0432\x9CO\u0431\u042B\u0431\u042F\u0432\xB5\u0433\u0434\x07(\u0434\u0435\xC4c\u0435\u0437\x07\u0436\u0438\xACW\u0437\u0436\u0437\u0438\u0438\u0439\u0439\u043B\x07\u043A\u043C\xB8]\u043B\u043A\u043B\u043C\u043C\u043D\u043D\u043E\x9CO\u043E";O._serializedATNSegment2="\xB7\u043F\u0440\x07`\u0440\u0441\xACW\u0441\xB9\u0442\u0445\x07\u0443\u0446\x9CO\u0444\u0446\xA0Q\u0445\u0443\u0445\u0444\u0446\u0447\u0447\u044A\xA0Q\u0448\u044B\x9CO\u0449\u044B\xA0Q\u044A\u0448\u044A\u0449\u044B\u044C\u044C\u044D\x9CO\u044D\xBB\u044E\u044F\x075\u044F\u0450\xA0Q\u0450\u0451\x9CO\u0451\xBD\u0452\u0458\xCAf\u0453\u0458\x07i\u0454\u0458\x07j\u0455\u0458\xC6d\u0456\u0458\x07h\u0457\u0452\u0457\u0453\u0457\u0454\u0457\u0455\u0457\u0456\u0458\xBF\u0459\u045B\x07\u045A\u045C\x8EH\u045B\u045A\u045B\u045C\u045C\u0463\u045D\u045F\x07\u045E\u0460\x8EH\u045F\u045E\u045F\u0460\u0460\u0462\u0461\u045D\u0462\u0465\u0463\u0461\u0463\u0464\u0464\u0466\u0465\u0463\u0466\u0474\x07\u0467\u0470\x07,\u0468\u046D\x8EH\u0469\u046A\x07\u046A\u046C\x8EH\u046B\u0469\u046C\u046F\u046D\u046B\u046D\u046E\u046E\u0471\u046F\u046D\u0470\u0468\u0470\u0471\u0471\u0472\u0472\u0474\x07-\u0473\u0459\u0473\u0467\u0474\xC1\u0475\u0477 \u0476\u0478\x07k\u0477\u0476\u0477\u0478\u0478\xC3\u0479\u047A \u047A\xC5\u047B\u047D\x07l\u047C\u047B\u047D\u047E\u047E\u047C\u047E\u047F\u047F\xC7\u0480\u048C\x07b\u0481\u0482\x07\u0482\u0487P)\u0483\u0484\x07\u0484\u0486P)\u0485\u0483\u0486\u0489\u0487\u0485\u0487\u0488\u0488\u048A\u0489\u0487\u048A\u048B\x07\u048B\u048D\u048C\u0481\u048C\u048D\u048D\xC9\u048E\u0490\x07\x83\u048F\u048E\u0490\u0491\u0491\u048F\u0491\u0492\u0492\xCB\x84\xD7\xD9\xE8\xEC\xF1\xF7\xFB\xFE\u0103\u0109\u0110\u0114\u0121\u0129\u012E\u0138\u013B\u0141\u0149\u014C\u0157\u0160\u0162\u0168\u0183\u0186\u0191\u0196\u019B\u01A9\u01AC\u01B3\u01B7\u01B9\u01BE\u01C3\u01C6\u01CC\u01D0\u01D4\u01D9\u01E6\u01E8\u01EF\u01F9\u01FF\u020A\u020D\u0213\u0216\u021E\u0221\u0227\u022A\u0232\u0235\u023B\u023F\u024A\u024F\u0254\u025C\u0261\u0267\u026C\u0279\u027B\u0280\u028A\u029E\u02AA\u02AF\u02B5\u02B9\u02BC\u02C8\u02D1\u02D5\u02D8\u02DF\u02E5\u02FB\u0311\u0315\u031A\u031E\u0322\u0327\u032C\u0330\u0348\u037E\u0382\u0392\u0394\u03A0\u03A7\u03AF\u03B3\u03BB\u03BF\u03C1\u03CC\u03E2\u03E7\u03F1\u03F5\u03FB\u03FF\u0405\u0412\u0419\u0428\u0431\u0437\u043B\u0445\u044A\u0457\u045B\u045F\u0463\u046D\u0470\u0473\u0477\u047E\u0487\u048C\u0491";O._serializedATN=fN.join([p._serializedATNSegment0,p._serializedATNSegment1,p._serializedATNSegment2],"");var lK=class extends me.ParserRuleContext{EOF(){return this.getToken(O.EOF,0)}pragmaDirective(t){return t===void 0?this.getRuleContexts(A_):this.getRuleContext(t,A_)}importDirective(t){return t===void 0?this.getRuleContexts(S_):this.getRuleContext(t,S_)}contractDefinition(t){return t===void 0?this.getRuleContexts(R_):this.getRuleContext(t,R_)}enumDefinition(t){return t===void 0?this.getRuleContexts(_f):this.getRuleContext(t,_f)}eventDefinition(t){return t===void 0?this.getRuleContexts(gf):this.getRuleContext(t,gf)}structDefinition(t){return t===void 0?this.getRuleContexts(pf):this.getRuleContext(t,pf)}functionDefinition(t){return t===void 0?this.getRuleContexts(mf):this.getRuleContext(t,mf)}fileLevelConstant(t){return t===void 0?this.getRuleContexts(F_):this.getRuleContext(t,F_)}customErrorDefinition(t){return t===void 0?this.getRuleContexts(hf):this.getRuleContext(t,hf)}typeDefinition(t){return t===void 0?this.getRuleContexts(ff):this.getRuleContext(t,ff)}usingForDeclaration(t){return t===void 0?this.getRuleContexts(df):this.getRuleContext(t,df)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_sourceUnit}enterRule(t){t.enterSourceUnit&&t.enterSourceUnit(this);}exitRule(t){t.exitSourceUnit&&t.exitSourceUnit(this);}accept(t){return t.visitSourceUnit?t.visitSourceUnit(this):t.visitChildren(this)}},A_=class extends me.ParserRuleContext{pragmaName(){return this.getRuleContext(0,dN)}pragmaValue(){return this.getRuleContext(0,pN)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_pragmaDirective}enterRule(t){t.enterPragmaDirective&&t.enterPragmaDirective(this);}exitRule(t){t.exitPragmaDirective&&t.exitPragmaDirective(this);}accept(t){return t.visitPragmaDirective?t.visitPragmaDirective(this):t.visitChildren(this)}},dN=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_pragmaName}enterRule(t){t.enterPragmaName&&t.enterPragmaName(this);}exitRule(t){t.exitPragmaName&&t.exitPragmaName(this);}accept(t){return t.visitPragmaName?t.visitPragmaName(this):t.visitChildren(this)}},pN=class extends me.ParserRuleContext{version(){return this.tryGetRuleContext(0,mN)}expression(){return this.tryGetRuleContext(0,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_pragmaValue}enterRule(t){t.enterPragmaValue&&t.enterPragmaValue(this);}exitRule(t){t.exitPragmaValue&&t.exitPragmaValue(this);}accept(t){return t.visitPragmaValue?t.visitPragmaValue(this):t.visitChildren(this)}},mN=class extends me.ParserRuleContext{versionConstraint(t){return t===void 0?this.getRuleContexts(w_):this.getRuleContext(t,w_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_version}enterRule(t){t.enterVersion&&t.enterVersion(this);}exitRule(t){t.exitVersion&&t.exitVersion(this);}accept(t){return t.visitVersion?t.visitVersion(this):t.visitChildren(this)}},gN=class extends me.ParserRuleContext{constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_versionOperator}enterRule(t){t.enterVersionOperator&&t.enterVersionOperator(this);}exitRule(t){t.exitVersionOperator&&t.exitVersionOperator(this);}accept(t){return t.visitVersionOperator?t.visitVersionOperator(this):t.visitChildren(this)}},w_=class extends me.ParserRuleContext{VersionLiteral(){return this.tryGetToken(O.VersionLiteral,0)}versionOperator(){return this.tryGetRuleContext(0,gN)}DecimalNumber(){return this.tryGetToken(O.DecimalNumber,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_versionConstraint}enterRule(t){t.enterVersionConstraint&&t.enterVersionConstraint(this);}exitRule(t){t.exitVersionConstraint&&t.exitVersionConstraint(this);}accept(t){return t.visitVersionConstraint?t.visitVersionConstraint(this):t.visitChildren(this)}},D_=class extends me.ParserRuleContext{identifier(t){return t===void 0?this.getRuleContexts(Ve):this.getRuleContext(t,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_importDeclaration}enterRule(t){t.enterImportDeclaration&&t.enterImportDeclaration(this);}exitRule(t){t.exitImportDeclaration&&t.exitImportDeclaration(this);}accept(t){return t.visitImportDeclaration?t.visitImportDeclaration(this):t.visitChildren(this)}},S_=class extends me.ParserRuleContext{importPath(){return this.getRuleContext(0,_N)}identifier(t){return t===void 0?this.getRuleContexts(Ve):this.getRuleContext(t,Ve)}importDeclaration(t){return t===void 0?this.getRuleContexts(D_):this.getRuleContext(t,D_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_importDirective}enterRule(t){t.enterImportDirective&&t.enterImportDirective(this);}exitRule(t){t.exitImportDirective&&t.exitImportDirective(this);}accept(t){return t.visitImportDirective?t.visitImportDirective(this):t.visitChildren(this)}},_N=class extends me.ParserRuleContext{StringLiteralFragment(){return this.getToken(O.StringLiteralFragment,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_importPath}enterRule(t){t.enterImportPath&&t.enterImportPath(this);}exitRule(t){t.exitImportPath&&t.exitImportPath(this);}accept(t){return t.visitImportPath?t.visitImportPath(this):t.visitChildren(this)}},R_=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}inheritanceSpecifier(t){return t===void 0?this.getRuleContexts(N_):this.getRuleContext(t,N_)}contractPart(t){return t===void 0?this.getRuleContexts(O_):this.getRuleContext(t,O_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_contractDefinition}enterRule(t){t.enterContractDefinition&&t.enterContractDefinition(this);}exitRule(t){t.exitContractDefinition&&t.exitContractDefinition(this);}accept(t){return t.visitContractDefinition?t.visitContractDefinition(this):t.visitChildren(this)}},N_=class extends me.ParserRuleContext{userDefinedTypeName(){return this.getRuleContext(0,xn)}expressionList(){return this.tryGetRuleContext(0,Pf)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_inheritanceSpecifier}enterRule(t){t.enterInheritanceSpecifier&&t.enterInheritanceSpecifier(this);}exitRule(t){t.exitInheritanceSpecifier&&t.exitInheritanceSpecifier(this);}accept(t){return t.visitInheritanceSpecifier?t.visitInheritanceSpecifier(this):t.visitChildren(this)}},O_=class extends me.ParserRuleContext{stateVariableDeclaration(){return this.tryGetRuleContext(0,yN)}usingForDeclaration(){return this.tryGetRuleContext(0,df)}structDefinition(){return this.tryGetRuleContext(0,pf)}modifierDefinition(){return this.tryGetRuleContext(0,bN)}functionDefinition(){return this.tryGetRuleContext(0,mf)}eventDefinition(){return this.tryGetRuleContext(0,gf)}enumDefinition(){return this.tryGetRuleContext(0,_f)}customErrorDefinition(){return this.tryGetRuleContext(0,hf)}typeDefinition(){return this.tryGetRuleContext(0,ff)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_contractPart}enterRule(t){t.enterContractPart&&t.enterContractPart(this);}exitRule(t){t.exitContractPart&&t.exitContractPart(this);}accept(t){return t.visitContractPart?t.visitContractPart(this):t.visitChildren(this)}},yN=class extends me.ParserRuleContext{typeName(){return this.getRuleContext(0,Or)}identifier(){return this.getRuleContext(0,Ve)}PublicKeyword(t){return t===void 0?this.getTokens(O.PublicKeyword):this.getToken(O.PublicKeyword,t)}InternalKeyword(t){return t===void 0?this.getTokens(O.InternalKeyword):this.getToken(O.InternalKeyword,t)}PrivateKeyword(t){return t===void 0?this.getTokens(O.PrivateKeyword):this.getToken(O.PrivateKeyword,t)}ConstantKeyword(t){return t===void 0?this.getTokens(O.ConstantKeyword):this.getToken(O.ConstantKeyword,t)}ImmutableKeyword(t){return t===void 0?this.getTokens(O.ImmutableKeyword):this.getToken(O.ImmutableKeyword,t)}overrideSpecifier(t){return t===void 0?this.getRuleContexts(Ns):this.getRuleContext(t,Ns)}expression(){return this.tryGetRuleContext(0,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_stateVariableDeclaration}enterRule(t){t.enterStateVariableDeclaration&&t.enterStateVariableDeclaration(this);}exitRule(t){t.exitStateVariableDeclaration&&t.exitStateVariableDeclaration(this);}accept(t){return t.visitStateVariableDeclaration?t.visitStateVariableDeclaration(this):t.visitChildren(this)}},F_=class extends me.ParserRuleContext{typeName(){return this.getRuleContext(0,Or)}ConstantKeyword(){return this.getToken(O.ConstantKeyword,0)}identifier(){return this.getRuleContext(0,Ve)}expression(){return this.getRuleContext(0,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_fileLevelConstant}enterRule(t){t.enterFileLevelConstant&&t.enterFileLevelConstant(this);}exitRule(t){t.exitFileLevelConstant&&t.exitFileLevelConstant(this);}accept(t){return t.visitFileLevelConstant?t.visitFileLevelConstant(this):t.visitChildren(this)}},hf=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}parameterList(){return this.getRuleContext(0,Ho)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_customErrorDefinition}enterRule(t){t.enterCustomErrorDefinition&&t.enterCustomErrorDefinition(this);}exitRule(t){t.exitCustomErrorDefinition&&t.exitCustomErrorDefinition(this);}accept(t){return t.visitCustomErrorDefinition?t.visitCustomErrorDefinition(this):t.visitChildren(this)}},ff=class extends me.ParserRuleContext{TypeKeyword(){return this.getToken(O.TypeKeyword,0)}identifier(){return this.getRuleContext(0,Ve)}elementaryTypeName(){return this.getRuleContext(0,Lf)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_typeDefinition}enterRule(t){t.enterTypeDefinition&&t.enterTypeDefinition(this);}exitRule(t){t.exitTypeDefinition&&t.exitTypeDefinition(this);}accept(t){return t.visitTypeDefinition?t.visitTypeDefinition(this):t.visitChildren(this)}},df=class extends me.ParserRuleContext{usingForObject(){return this.getRuleContext(0,vN)}typeName(){return this.tryGetRuleContext(0,Or)}GlobalKeyword(){return this.tryGetToken(O.GlobalKeyword,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_usingForDeclaration}enterRule(t){t.enterUsingForDeclaration&&t.enterUsingForDeclaration(this);}exitRule(t){t.exitUsingForDeclaration&&t.exitUsingForDeclaration(this);}accept(t){return t.visitUsingForDeclaration?t.visitUsingForDeclaration(this):t.visitChildren(this)}},vN=class extends me.ParserRuleContext{userDefinedTypeName(){return this.tryGetRuleContext(0,xn)}usingForObjectDirective(t){return t===void 0?this.getRuleContexts(L_):this.getRuleContext(t,L_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_usingForObject}enterRule(t){t.enterUsingForObject&&t.enterUsingForObject(this);}exitRule(t){t.exitUsingForObject&&t.exitUsingForObject(this);}accept(t){return t.visitUsingForObject?t.visitUsingForObject(this):t.visitChildren(this)}},L_=class extends me.ParserRuleContext{userDefinedTypeName(){return this.getRuleContext(0,xn)}userDefinableOperators(){return this.tryGetRuleContext(0,xN)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_usingForObjectDirective}enterRule(t){t.enterUsingForObjectDirective&&t.enterUsingForObjectDirective(this);}exitRule(t){t.exitUsingForObjectDirective&&t.exitUsingForObjectDirective(this);}accept(t){return t.visitUsingForObjectDirective?t.visitUsingForObjectDirective(this):t.visitChildren(this)}},xN=class extends me.ParserRuleContext{constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_userDefinableOperators}enterRule(t){t.enterUserDefinableOperators&&t.enterUserDefinableOperators(this);}exitRule(t){t.exitUserDefinableOperators&&t.exitUserDefinableOperators(this);}accept(t){return t.visitUserDefinableOperators?t.visitUserDefinableOperators(this):t.visitChildren(this)}},pf=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}variableDeclaration(t){return t===void 0?this.getRuleContexts(Io):this.getRuleContext(t,Io)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_structDefinition}enterRule(t){t.enterStructDefinition&&t.enterStructDefinition(this);}exitRule(t){t.exitStructDefinition&&t.exitStructDefinition(this);}accept(t){return t.visitStructDefinition?t.visitStructDefinition(this):t.visitChildren(this)}},bN=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}block(){return this.tryGetRuleContext(0,Ps)}parameterList(){return this.tryGetRuleContext(0,Ho)}VirtualKeyword(t){return t===void 0?this.getTokens(O.VirtualKeyword):this.getToken(O.VirtualKeyword,t)}overrideSpecifier(t){return t===void 0?this.getRuleContexts(Ns):this.getRuleContext(t,Ns)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_modifierDefinition}enterRule(t){t.enterModifierDefinition&&t.enterModifierDefinition(this);}exitRule(t){t.exitModifierDefinition&&t.exitModifierDefinition(this);}accept(t){return t.visitModifierDefinition?t.visitModifierDefinition(this):t.visitChildren(this)}},P_=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}expressionList(){return this.tryGetRuleContext(0,Pf)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_modifierInvocation}enterRule(t){t.enterModifierInvocation&&t.enterModifierInvocation(this);}exitRule(t){t.exitModifierInvocation&&t.exitModifierInvocation(this);}accept(t){return t.visitModifierInvocation?t.visitModifierInvocation(this):t.visitChildren(this)}},mf=class extends me.ParserRuleContext{functionDescriptor(){return this.getRuleContext(0,EN)}parameterList(){return this.getRuleContext(0,Ho)}modifierList(){return this.getRuleContext(0,CN)}block(){return this.tryGetRuleContext(0,Ps)}returnParameters(){return this.tryGetRuleContext(0,u1)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_functionDefinition}enterRule(t){t.enterFunctionDefinition&&t.enterFunctionDefinition(this);}exitRule(t){t.exitFunctionDefinition&&t.exitFunctionDefinition(this);}accept(t){return t.visitFunctionDefinition?t.visitFunctionDefinition(this):t.visitChildren(this)}},EN=class extends me.ParserRuleContext{identifier(){return this.tryGetRuleContext(0,Ve)}ConstructorKeyword(){return this.tryGetToken(O.ConstructorKeyword,0)}FallbackKeyword(){return this.tryGetToken(O.FallbackKeyword,0)}ReceiveKeyword(){return this.tryGetToken(O.ReceiveKeyword,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_functionDescriptor}enterRule(t){t.enterFunctionDescriptor&&t.enterFunctionDescriptor(this);}exitRule(t){t.exitFunctionDescriptor&&t.exitFunctionDescriptor(this);}accept(t){return t.visitFunctionDescriptor?t.visitFunctionDescriptor(this):t.visitChildren(this)}},u1=class extends me.ParserRuleContext{parameterList(){return this.getRuleContext(0,Ho)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_returnParameters}enterRule(t){t.enterReturnParameters&&t.enterReturnParameters(this);}exitRule(t){t.exitReturnParameters&&t.exitReturnParameters(this);}accept(t){return t.visitReturnParameters?t.visitReturnParameters(this):t.visitChildren(this)}},CN=class extends me.ParserRuleContext{ExternalKeyword(t){return t===void 0?this.getTokens(O.ExternalKeyword):this.getToken(O.ExternalKeyword,t)}PublicKeyword(t){return t===void 0?this.getTokens(O.PublicKeyword):this.getToken(O.PublicKeyword,t)}InternalKeyword(t){return t===void 0?this.getTokens(O.InternalKeyword):this.getToken(O.InternalKeyword,t)}PrivateKeyword(t){return t===void 0?this.getTokens(O.PrivateKeyword):this.getToken(O.PrivateKeyword,t)}VirtualKeyword(t){return t===void 0?this.getTokens(O.VirtualKeyword):this.getToken(O.VirtualKeyword,t)}stateMutability(t){return t===void 0?this.getRuleContexts(bu):this.getRuleContext(t,bu)}modifierInvocation(t){return t===void 0?this.getRuleContexts(P_):this.getRuleContext(t,P_)}overrideSpecifier(t){return t===void 0?this.getRuleContexts(Ns):this.getRuleContext(t,Ns)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_modifierList}enterRule(t){t.enterModifierList&&t.enterModifierList(this);}exitRule(t){t.exitModifierList&&t.exitModifierList(this);}accept(t){return t.visitModifierList?t.visitModifierList(this):t.visitChildren(this)}},gf=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}eventParameterList(){return this.getRuleContext(0,TN)}AnonymousKeyword(){return this.tryGetToken(O.AnonymousKeyword,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_eventDefinition}enterRule(t){t.enterEventDefinition&&t.enterEventDefinition(this);}exitRule(t){t.exitEventDefinition&&t.exitEventDefinition(this);}accept(t){return t.visitEventDefinition?t.visitEventDefinition(this):t.visitChildren(this)}},I_=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_enumValue}enterRule(t){t.enterEnumValue&&t.enterEnumValue(this);}exitRule(t){t.exitEnumValue&&t.exitEnumValue(this);}accept(t){return t.visitEnumValue?t.visitEnumValue(this):t.visitChildren(this)}},_f=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}enumValue(t){return t===void 0?this.getRuleContexts(I_):this.getRuleContext(t,I_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_enumDefinition}enterRule(t){t.enterEnumDefinition&&t.enterEnumDefinition(this);}exitRule(t){t.exitEnumDefinition&&t.exitEnumDefinition(this);}accept(t){return t.visitEnumDefinition?t.visitEnumDefinition(this):t.visitChildren(this)}},Ho=class extends me.ParserRuleContext{parameter(t){return t===void 0?this.getRuleContexts(k_):this.getRuleContext(t,k_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_parameterList}enterRule(t){t.enterParameterList&&t.enterParameterList(this);}exitRule(t){t.exitParameterList&&t.exitParameterList(this);}accept(t){return t.visitParameterList?t.visitParameterList(this):t.visitChildren(this)}},k_=class extends me.ParserRuleContext{typeName(){return this.getRuleContext(0,Or)}storageLocation(){return this.tryGetRuleContext(0,Ff)}identifier(){return this.tryGetRuleContext(0,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_parameter}enterRule(t){t.enterParameter&&t.enterParameter(this);}exitRule(t){t.exitParameter&&t.exitParameter(this);}accept(t){return t.visitParameter?t.visitParameter(this):t.visitChildren(this)}},TN=class extends me.ParserRuleContext{eventParameter(t){return t===void 0?this.getRuleContexts(M_):this.getRuleContext(t,M_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_eventParameterList}enterRule(t){t.enterEventParameterList&&t.enterEventParameterList(this);}exitRule(t){t.exitEventParameterList&&t.exitEventParameterList(this);}accept(t){return t.visitEventParameterList?t.visitEventParameterList(this):t.visitChildren(this)}},M_=class extends me.ParserRuleContext{typeName(){return this.getRuleContext(0,Or)}IndexedKeyword(){return this.tryGetToken(O.IndexedKeyword,0)}identifier(){return this.tryGetRuleContext(0,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_eventParameter}enterRule(t){t.enterEventParameter&&t.enterEventParameter(this);}exitRule(t){t.exitEventParameter&&t.exitEventParameter(this);}accept(t){return t.visitEventParameter?t.visitEventParameter(this):t.visitChildren(this)}},B_=class extends me.ParserRuleContext{functionTypeParameter(t){return t===void 0?this.getRuleContexts(j_):this.getRuleContext(t,j_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_functionTypeParameterList}enterRule(t){t.enterFunctionTypeParameterList&&t.enterFunctionTypeParameterList(this);}exitRule(t){t.exitFunctionTypeParameterList&&t.exitFunctionTypeParameterList(this);}accept(t){return t.visitFunctionTypeParameterList?t.visitFunctionTypeParameterList(this):t.visitChildren(this)}},j_=class extends me.ParserRuleContext{typeName(){return this.getRuleContext(0,Or)}storageLocation(){return this.tryGetRuleContext(0,Ff)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_functionTypeParameter}enterRule(t){t.enterFunctionTypeParameter&&t.enterFunctionTypeParameter(this);}exitRule(t){t.exitFunctionTypeParameter&&t.exitFunctionTypeParameter(this);}accept(t){return t.visitFunctionTypeParameter?t.visitFunctionTypeParameter(this):t.visitChildren(this)}},Io=class extends me.ParserRuleContext{typeName(){return this.getRuleContext(0,Or)}identifier(){return this.getRuleContext(0,Ve)}storageLocation(){return this.tryGetRuleContext(0,Ff)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_variableDeclaration}enterRule(t){t.enterVariableDeclaration&&t.enterVariableDeclaration(this);}exitRule(t){t.exitVariableDeclaration&&t.exitVariableDeclaration(this);}accept(t){return t.visitVariableDeclaration?t.visitVariableDeclaration(this):t.visitChildren(this)}},Or=class extends me.ParserRuleContext{elementaryTypeName(){return this.tryGetRuleContext(0,Lf)}userDefinedTypeName(){return this.tryGetRuleContext(0,xn)}mapping(){return this.tryGetRuleContext(0,wN)}typeName(){return this.tryGetRuleContext(0,Or)}expression(){return this.tryGetRuleContext(0,Be)}functionTypeName(){return this.tryGetRuleContext(0,RN)}PayableKeyword(){return this.tryGetToken(O.PayableKeyword,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_typeName}enterRule(t){t.enterTypeName&&t.enterTypeName(this);}exitRule(t){t.exitTypeName&&t.exitTypeName(this);}accept(t){return t.visitTypeName?t.visitTypeName(this):t.visitChildren(this)}},xn=class extends me.ParserRuleContext{identifier(t){return t===void 0?this.getRuleContexts(Ve):this.getRuleContext(t,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_userDefinedTypeName}enterRule(t){t.enterUserDefinedTypeName&&t.enterUserDefinedTypeName(this);}exitRule(t){t.exitUserDefinedTypeName&&t.exitUserDefinedTypeName(this);}accept(t){return t.visitUserDefinedTypeName?t.visitUserDefinedTypeName(this):t.visitChildren(this)}},AN=class extends me.ParserRuleContext{elementaryTypeName(){return this.tryGetRuleContext(0,Lf)}userDefinedTypeName(){return this.tryGetRuleContext(0,xn)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_mappingKey}enterRule(t){t.enterMappingKey&&t.enterMappingKey(this);}exitRule(t){t.exitMappingKey&&t.exitMappingKey(this);}accept(t){return t.visitMappingKey?t.visitMappingKey(this):t.visitChildren(this)}},wN=class extends me.ParserRuleContext{mappingKey(){return this.getRuleContext(0,AN)}typeName(){return this.getRuleContext(0,Or)}mappingKeyName(){return this.tryGetRuleContext(0,DN)}mappingValueName(){return this.tryGetRuleContext(0,SN)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_mapping}enterRule(t){t.enterMapping&&t.enterMapping(this);}exitRule(t){t.exitMapping&&t.exitMapping(this);}accept(t){return t.visitMapping?t.visitMapping(this):t.visitChildren(this)}},DN=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_mappingKeyName}enterRule(t){t.enterMappingKeyName&&t.enterMappingKeyName(this);}exitRule(t){t.exitMappingKeyName&&t.exitMappingKeyName(this);}accept(t){return t.visitMappingKeyName?t.visitMappingKeyName(this):t.visitChildren(this)}},SN=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_mappingValueName}enterRule(t){t.enterMappingValueName&&t.enterMappingValueName(this);}exitRule(t){t.exitMappingValueName&&t.exitMappingValueName(this);}accept(t){return t.visitMappingValueName?t.visitMappingValueName(this):t.visitChildren(this)}},RN=class extends me.ParserRuleContext{functionTypeParameterList(t){return t===void 0?this.getRuleContexts(B_):this.getRuleContext(t,B_)}InternalKeyword(t){return t===void 0?this.getTokens(O.InternalKeyword):this.getToken(O.InternalKeyword,t)}ExternalKeyword(t){return t===void 0?this.getTokens(O.ExternalKeyword):this.getToken(O.ExternalKeyword,t)}stateMutability(t){return t===void 0?this.getRuleContexts(bu):this.getRuleContext(t,bu)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_functionTypeName}enterRule(t){t.enterFunctionTypeName&&t.enterFunctionTypeName(this);}exitRule(t){t.exitFunctionTypeName&&t.exitFunctionTypeName(this);}accept(t){return t.visitFunctionTypeName?t.visitFunctionTypeName(this):t.visitChildren(this)}},Ff=class extends me.ParserRuleContext{constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_storageLocation}enterRule(t){t.enterStorageLocation&&t.enterStorageLocation(this);}exitRule(t){t.exitStorageLocation&&t.exitStorageLocation(this);}accept(t){return t.visitStorageLocation?t.visitStorageLocation(this):t.visitChildren(this)}},bu=class extends me.ParserRuleContext{PureKeyword(){return this.tryGetToken(O.PureKeyword,0)}ConstantKeyword(){return this.tryGetToken(O.ConstantKeyword,0)}ViewKeyword(){return this.tryGetToken(O.ViewKeyword,0)}PayableKeyword(){return this.tryGetToken(O.PayableKeyword,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_stateMutability}enterRule(t){t.enterStateMutability&&t.enterStateMutability(this);}exitRule(t){t.exitStateMutability&&t.exitStateMutability(this);}accept(t){return t.visitStateMutability?t.visitStateMutability(this):t.visitChildren(this)}},Ps=class extends me.ParserRuleContext{statement(t){return t===void 0?this.getRuleContexts(bn):this.getRuleContext(t,bn)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_block}enterRule(t){t.enterBlock&&t.enterBlock(this);}exitRule(t){t.exitBlock&&t.exitBlock(this);}accept(t){return t.visitBlock?t.visitBlock(this):t.visitChildren(this)}},bn=class extends me.ParserRuleContext{ifStatement(){return this.tryGetRuleContext(0,NN)}tryStatement(){return this.tryGetRuleContext(0,ON)}whileStatement(){return this.tryGetRuleContext(0,FN)}forStatement(){return this.tryGetRuleContext(0,PN)}block(){return this.tryGetRuleContext(0,Ps)}inlineAssemblyStatement(){return this.tryGetRuleContext(0,IN)}doWhileStatement(){return this.tryGetRuleContext(0,MN)}continueStatement(){return this.tryGetRuleContext(0,BN)}breakStatement(){return this.tryGetRuleContext(0,jN)}returnStatement(){return this.tryGetRuleContext(0,qN)}throwStatement(){return this.tryGetRuleContext(0,UN)}emitStatement(){return this.tryGetRuleContext(0,HN)}simpleStatement(){return this.tryGetRuleContext(0,c1)}uncheckedStatement(){return this.tryGetRuleContext(0,LN)}revertStatement(){return this.tryGetRuleContext(0,VN)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_statement}enterRule(t){t.enterStatement&&t.enterStatement(this);}exitRule(t){t.exitStatement&&t.exitStatement(this);}accept(t){return t.visitStatement?t.visitStatement(this):t.visitChildren(this)}},l1=class extends me.ParserRuleContext{expression(){return this.getRuleContext(0,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_expressionStatement}enterRule(t){t.enterExpressionStatement&&t.enterExpressionStatement(this);}exitRule(t){t.exitExpressionStatement&&t.exitExpressionStatement(this);}accept(t){return t.visitExpressionStatement?t.visitExpressionStatement(this):t.visitChildren(this)}},NN=class extends me.ParserRuleContext{expression(){return this.getRuleContext(0,Be)}statement(t){return t===void 0?this.getRuleContexts(bn):this.getRuleContext(t,bn)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_ifStatement}enterRule(t){t.enterIfStatement&&t.enterIfStatement(this);}exitRule(t){t.exitIfStatement&&t.exitIfStatement(this);}accept(t){return t.visitIfStatement?t.visitIfStatement(this):t.visitChildren(this)}},ON=class extends me.ParserRuleContext{expression(){return this.getRuleContext(0,Be)}block(){return this.getRuleContext(0,Ps)}returnParameters(){return this.tryGetRuleContext(0,u1)}catchClause(t){return t===void 0?this.getRuleContexts(q_):this.getRuleContext(t,q_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_tryStatement}enterRule(t){t.enterTryStatement&&t.enterTryStatement(this);}exitRule(t){t.exitTryStatement&&t.exitTryStatement(this);}accept(t){return t.visitTryStatement?t.visitTryStatement(this):t.visitChildren(this)}},q_=class extends me.ParserRuleContext{block(){return this.getRuleContext(0,Ps)}parameterList(){return this.tryGetRuleContext(0,Ho)}identifier(){return this.tryGetRuleContext(0,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_catchClause}enterRule(t){t.enterCatchClause&&t.enterCatchClause(this);}exitRule(t){t.exitCatchClause&&t.exitCatchClause(this);}accept(t){return t.visitCatchClause?t.visitCatchClause(this):t.visitChildren(this)}},FN=class extends me.ParserRuleContext{expression(){return this.getRuleContext(0,Be)}statement(){return this.getRuleContext(0,bn)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_whileStatement}enterRule(t){t.enterWhileStatement&&t.enterWhileStatement(this);}exitRule(t){t.exitWhileStatement&&t.exitWhileStatement(this);}accept(t){return t.visitWhileStatement?t.visitWhileStatement(this):t.visitChildren(this)}},c1=class extends me.ParserRuleContext{variableDeclarationStatement(){return this.tryGetRuleContext(0,$N)}expressionStatement(){return this.tryGetRuleContext(0,l1)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_simpleStatement}enterRule(t){t.enterSimpleStatement&&t.enterSimpleStatement(this);}exitRule(t){t.exitSimpleStatement&&t.exitSimpleStatement(this);}accept(t){return t.visitSimpleStatement?t.visitSimpleStatement(this):t.visitChildren(this)}},LN=class extends me.ParserRuleContext{block(){return this.getRuleContext(0,Ps)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_uncheckedStatement}enterRule(t){t.enterUncheckedStatement&&t.enterUncheckedStatement(this);}exitRule(t){t.exitUncheckedStatement&&t.exitUncheckedStatement(this);}accept(t){return t.visitUncheckedStatement?t.visitUncheckedStatement(this):t.visitChildren(this)}},PN=class extends me.ParserRuleContext{statement(){return this.getRuleContext(0,bn)}simpleStatement(){return this.tryGetRuleContext(0,c1)}expressionStatement(){return this.tryGetRuleContext(0,l1)}expression(){return this.tryGetRuleContext(0,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_forStatement}enterRule(t){t.enterForStatement&&t.enterForStatement(this);}exitRule(t){t.exitForStatement&&t.exitForStatement(this);}accept(t){return t.visitForStatement?t.visitForStatement(this):t.visitChildren(this)}},IN=class extends me.ParserRuleContext{assemblyBlock(){return this.getRuleContext(0,En)}StringLiteralFragment(){return this.tryGetToken(O.StringLiteralFragment,0)}inlineAssemblyStatementFlag(){return this.tryGetRuleContext(0,kN)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_inlineAssemblyStatement}enterRule(t){t.enterInlineAssemblyStatement&&t.enterInlineAssemblyStatement(this);}exitRule(t){t.exitInlineAssemblyStatement&&t.exitInlineAssemblyStatement(this);}accept(t){return t.visitInlineAssemblyStatement?t.visitInlineAssemblyStatement(this):t.visitChildren(this)}},kN=class extends me.ParserRuleContext{stringLiteral(){return this.getRuleContext(0,Lu)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_inlineAssemblyStatementFlag}enterRule(t){t.enterInlineAssemblyStatementFlag&&t.enterInlineAssemblyStatementFlag(this);}exitRule(t){t.exitInlineAssemblyStatementFlag&&t.exitInlineAssemblyStatementFlag(this);}accept(t){return t.visitInlineAssemblyStatementFlag?t.visitInlineAssemblyStatementFlag(this):t.visitChildren(this)}},MN=class extends me.ParserRuleContext{statement(){return this.getRuleContext(0,bn)}expression(){return this.getRuleContext(0,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_doWhileStatement}enterRule(t){t.enterDoWhileStatement&&t.enterDoWhileStatement(this);}exitRule(t){t.exitDoWhileStatement&&t.exitDoWhileStatement(this);}accept(t){return t.visitDoWhileStatement?t.visitDoWhileStatement(this):t.visitChildren(this)}},BN=class extends me.ParserRuleContext{ContinueKeyword(){return this.getToken(O.ContinueKeyword,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_continueStatement}enterRule(t){t.enterContinueStatement&&t.enterContinueStatement(this);}exitRule(t){t.exitContinueStatement&&t.exitContinueStatement(this);}accept(t){return t.visitContinueStatement?t.visitContinueStatement(this):t.visitChildren(this)}},jN=class extends me.ParserRuleContext{BreakKeyword(){return this.getToken(O.BreakKeyword,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_breakStatement}enterRule(t){t.enterBreakStatement&&t.enterBreakStatement(this);}exitRule(t){t.exitBreakStatement&&t.exitBreakStatement(this);}accept(t){return t.visitBreakStatement?t.visitBreakStatement(this):t.visitChildren(this)}},qN=class extends me.ParserRuleContext{expression(){return this.tryGetRuleContext(0,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_returnStatement}enterRule(t){t.enterReturnStatement&&t.enterReturnStatement(this);}exitRule(t){t.exitReturnStatement&&t.exitReturnStatement(this);}accept(t){return t.visitReturnStatement?t.visitReturnStatement(this):t.visitChildren(this)}},UN=class extends me.ParserRuleContext{constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_throwStatement}enterRule(t){t.enterThrowStatement&&t.enterThrowStatement(this);}exitRule(t){t.exitThrowStatement&&t.exitThrowStatement(this);}accept(t){return t.visitThrowStatement?t.visitThrowStatement(this):t.visitChildren(this)}},HN=class extends me.ParserRuleContext{functionCall(){return this.getRuleContext(0,p1)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_emitStatement}enterRule(t){t.enterEmitStatement&&t.enterEmitStatement(this);}exitRule(t){t.exitEmitStatement&&t.exitEmitStatement(this);}accept(t){return t.visitEmitStatement?t.visitEmitStatement(this):t.visitChildren(this)}},VN=class extends me.ParserRuleContext{functionCall(){return this.getRuleContext(0,p1)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_revertStatement}enterRule(t){t.enterRevertStatement&&t.enterRevertStatement(this);}exitRule(t){t.exitRevertStatement&&t.exitRevertStatement(this);}accept(t){return t.visitRevertStatement?t.visitRevertStatement(this):t.visitChildren(this)}},$N=class extends me.ParserRuleContext{identifierList(){return this.tryGetRuleContext(0,KN)}variableDeclaration(){return this.tryGetRuleContext(0,Io)}variableDeclarationList(){return this.tryGetRuleContext(0,zN)}expression(){return this.tryGetRuleContext(0,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_variableDeclarationStatement}enterRule(t){t.enterVariableDeclarationStatement&&t.enterVariableDeclarationStatement(this);}exitRule(t){t.exitVariableDeclarationStatement&&t.exitVariableDeclarationStatement(this);}accept(t){return t.visitVariableDeclarationStatement?t.visitVariableDeclarationStatement(this):t.visitChildren(this)}},zN=class extends me.ParserRuleContext{variableDeclaration(t){return t===void 0?this.getRuleContexts(Io):this.getRuleContext(t,Io)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_variableDeclarationList}enterRule(t){t.enterVariableDeclarationList&&t.enterVariableDeclarationList(this);}exitRule(t){t.exitVariableDeclarationList&&t.exitVariableDeclarationList(this);}accept(t){return t.visitVariableDeclarationList?t.visitVariableDeclarationList(this):t.visitChildren(this)}},KN=class extends me.ParserRuleContext{identifier(t){return t===void 0?this.getRuleContexts(Ve):this.getRuleContext(t,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_identifierList}enterRule(t){t.enterIdentifierList&&t.enterIdentifierList(this);}exitRule(t){t.exitIdentifierList&&t.exitIdentifierList(this);}accept(t){return t.visitIdentifierList?t.visitIdentifierList(this):t.visitChildren(this)}},Lf=class extends me.ParserRuleContext{Int(){return this.tryGetToken(O.Int,0)}Uint(){return this.tryGetToken(O.Uint,0)}Byte(){return this.tryGetToken(O.Byte,0)}Fixed(){return this.tryGetToken(O.Fixed,0)}Ufixed(){return this.tryGetToken(O.Ufixed,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_elementaryTypeName}enterRule(t){t.enterElementaryTypeName&&t.enterElementaryTypeName(this);}exitRule(t){t.exitElementaryTypeName&&t.exitElementaryTypeName(this);}accept(t){return t.visitElementaryTypeName?t.visitElementaryTypeName(this):t.visitChildren(this)}},Be=class extends me.ParserRuleContext{expression(t){return t===void 0?this.getRuleContexts(Be):this.getRuleContext(t,Be)}typeName(){return this.tryGetRuleContext(0,Or)}identifier(){return this.tryGetRuleContext(0,Ve)}nameValueList(){return this.tryGetRuleContext(0,f1)}functionCallArguments(){return this.tryGetRuleContext(0,d1)}primaryExpression(){return this.tryGetRuleContext(0,h1)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_expression}enterRule(t){t.enterExpression&&t.enterExpression(this);}exitRule(t){t.exitExpression&&t.exitExpression(this);}accept(t){return t.visitExpression?t.visitExpression(this):t.visitChildren(this)}},h1=class extends me.ParserRuleContext{BooleanLiteral(){return this.tryGetToken(O.BooleanLiteral,0)}numberLiteral(){return this.tryGetRuleContext(0,y1)}hexLiteral(){return this.tryGetRuleContext(0,kf)}stringLiteral(){return this.tryGetRuleContext(0,Lu)}identifier(){return this.tryGetRuleContext(0,Ve)}TypeKeyword(){return this.tryGetToken(O.TypeKeyword,0)}PayableKeyword(){return this.tryGetToken(O.PayableKeyword,0)}tupleExpression(){return this.tryGetRuleContext(0,iO)}typeName(){return this.tryGetRuleContext(0,Or)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_primaryExpression}enterRule(t){t.enterPrimaryExpression&&t.enterPrimaryExpression(this);}exitRule(t){t.exitPrimaryExpression&&t.exitPrimaryExpression(this);}accept(t){return t.visitPrimaryExpression?t.visitPrimaryExpression(this):t.visitChildren(this)}},Pf=class extends me.ParserRuleContext{expression(t){return t===void 0?this.getRuleContexts(Be):this.getRuleContext(t,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_expressionList}enterRule(t){t.enterExpressionList&&t.enterExpressionList(this);}exitRule(t){t.exitExpressionList&&t.exitExpressionList(this);}accept(t){return t.visitExpressionList?t.visitExpressionList(this):t.visitChildren(this)}},f1=class extends me.ParserRuleContext{nameValue(t){return t===void 0?this.getRuleContexts(U_):this.getRuleContext(t,U_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_nameValueList}enterRule(t){t.enterNameValueList&&t.enterNameValueList(this);}exitRule(t){t.exitNameValueList&&t.exitNameValueList(this);}accept(t){return t.visitNameValueList?t.visitNameValueList(this):t.visitChildren(this)}},U_=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}expression(){return this.getRuleContext(0,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_nameValue}enterRule(t){t.enterNameValue&&t.enterNameValue(this);}exitRule(t){t.exitNameValue&&t.exitNameValue(this);}accept(t){return t.visitNameValue?t.visitNameValue(this):t.visitChildren(this)}},d1=class extends me.ParserRuleContext{nameValueList(){return this.tryGetRuleContext(0,f1)}expressionList(){return this.tryGetRuleContext(0,Pf)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_functionCallArguments}enterRule(t){t.enterFunctionCallArguments&&t.enterFunctionCallArguments(this);}exitRule(t){t.exitFunctionCallArguments&&t.exitFunctionCallArguments(this);}accept(t){return t.visitFunctionCallArguments?t.visitFunctionCallArguments(this):t.visitChildren(this)}},p1=class extends me.ParserRuleContext{expression(){return this.getRuleContext(0,Be)}functionCallArguments(){return this.getRuleContext(0,d1)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_functionCall}enterRule(t){t.enterFunctionCall&&t.enterFunctionCall(this);}exitRule(t){t.exitFunctionCall&&t.exitFunctionCall(this);}accept(t){return t.visitFunctionCall?t.visitFunctionCall(this):t.visitChildren(this)}},En=class extends me.ParserRuleContext{assemblyItem(t){return t===void 0?this.getRuleContexts(H_):this.getRuleContext(t,H_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyBlock}enterRule(t){t.enterAssemblyBlock&&t.enterAssemblyBlock(this);}exitRule(t){t.exitAssemblyBlock&&t.exitAssemblyBlock(this);}accept(t){return t.visitAssemblyBlock?t.visitAssemblyBlock(this):t.visitChildren(this)}},H_=class extends me.ParserRuleContext{identifier(){return this.tryGetRuleContext(0,Ve)}assemblyBlock(){return this.tryGetRuleContext(0,En)}assemblyExpression(){return this.tryGetRuleContext(0,Wr)}assemblyLocalDefinition(){return this.tryGetRuleContext(0,WN)}assemblyAssignment(){return this.tryGetRuleContext(0,YN)}assemblyStackAssignment(){return this.tryGetRuleContext(0,JN)}labelDefinition(){return this.tryGetRuleContext(0,ZN)}assemblySwitch(){return this.tryGetRuleContext(0,XN)}assemblyFunctionDefinition(){return this.tryGetRuleContext(0,QN)}assemblyFor(){return this.tryGetRuleContext(0,tO)}assemblyIf(){return this.tryGetRuleContext(0,rO)}BreakKeyword(){return this.tryGetToken(O.BreakKeyword,0)}ContinueKeyword(){return this.tryGetToken(O.ContinueKeyword,0)}LeaveKeyword(){return this.tryGetToken(O.LeaveKeyword,0)}numberLiteral(){return this.tryGetRuleContext(0,y1)}stringLiteral(){return this.tryGetRuleContext(0,Lu)}hexLiteral(){return this.tryGetRuleContext(0,kf)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyItem}enterRule(t){t.enterAssemblyItem&&t.enterAssemblyItem(this);}exitRule(t){t.exitAssemblyItem&&t.exitAssemblyItem(this);}accept(t){return t.visitAssemblyItem?t.visitAssemblyItem(this):t.visitChildren(this)}},Wr=class extends me.ParserRuleContext{assemblyCall(){return this.tryGetRuleContext(0,GN)}assemblyLiteral(){return this.tryGetRuleContext(0,_1)}assemblyMember(){return this.tryGetRuleContext(0,m1)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyExpression}enterRule(t){t.enterAssemblyExpression&&t.enterAssemblyExpression(this);}exitRule(t){t.exitAssemblyExpression&&t.exitAssemblyExpression(this);}accept(t){return t.visitAssemblyExpression?t.visitAssemblyExpression(this):t.visitChildren(this)}},m1=class extends me.ParserRuleContext{identifier(t){return t===void 0?this.getRuleContexts(Ve):this.getRuleContext(t,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyMember}enterRule(t){t.enterAssemblyMember&&t.enterAssemblyMember(this);}exitRule(t){t.exitAssemblyMember&&t.exitAssemblyMember(this);}accept(t){return t.visitAssemblyMember?t.visitAssemblyMember(this):t.visitChildren(this)}},GN=class extends me.ParserRuleContext{identifier(){return this.tryGetRuleContext(0,Ve)}assemblyExpression(t){return t===void 0?this.getRuleContexts(Wr):this.getRuleContext(t,Wr)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyCall}enterRule(t){t.enterAssemblyCall&&t.enterAssemblyCall(this);}exitRule(t){t.exitAssemblyCall&&t.exitAssemblyCall(this);}accept(t){return t.visitAssemblyCall?t.visitAssemblyCall(this):t.visitChildren(this)}},WN=class extends me.ParserRuleContext{assemblyIdentifierOrList(){return this.getRuleContext(0,g1)}assemblyExpression(){return this.tryGetRuleContext(0,Wr)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyLocalDefinition}enterRule(t){t.enterAssemblyLocalDefinition&&t.enterAssemblyLocalDefinition(this);}exitRule(t){t.exitAssemblyLocalDefinition&&t.exitAssemblyLocalDefinition(this);}accept(t){return t.visitAssemblyLocalDefinition?t.visitAssemblyLocalDefinition(this):t.visitChildren(this)}},YN=class extends me.ParserRuleContext{assemblyIdentifierOrList(){return this.getRuleContext(0,g1)}assemblyExpression(){return this.getRuleContext(0,Wr)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyAssignment}enterRule(t){t.enterAssemblyAssignment&&t.enterAssemblyAssignment(this);}exitRule(t){t.exitAssemblyAssignment&&t.exitAssemblyAssignment(this);}accept(t){return t.visitAssemblyAssignment?t.visitAssemblyAssignment(this):t.visitChildren(this)}},g1=class extends me.ParserRuleContext{identifier(){return this.tryGetRuleContext(0,Ve)}assemblyMember(){return this.tryGetRuleContext(0,m1)}assemblyIdentifierList(){return this.tryGetRuleContext(0,If)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyIdentifierOrList}enterRule(t){t.enterAssemblyIdentifierOrList&&t.enterAssemblyIdentifierOrList(this);}exitRule(t){t.exitAssemblyIdentifierOrList&&t.exitAssemblyIdentifierOrList(this);}accept(t){return t.visitAssemblyIdentifierOrList?t.visitAssemblyIdentifierOrList(this):t.visitChildren(this)}},If=class extends me.ParserRuleContext{identifier(t){return t===void 0?this.getRuleContexts(Ve):this.getRuleContext(t,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyIdentifierList}enterRule(t){t.enterAssemblyIdentifierList&&t.enterAssemblyIdentifierList(this);}exitRule(t){t.exitAssemblyIdentifierList&&t.exitAssemblyIdentifierList(this);}accept(t){return t.visitAssemblyIdentifierList?t.visitAssemblyIdentifierList(this):t.visitChildren(this)}},JN=class extends me.ParserRuleContext{assemblyExpression(){return this.getRuleContext(0,Wr)}identifier(){return this.getRuleContext(0,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyStackAssignment}enterRule(t){t.enterAssemblyStackAssignment&&t.enterAssemblyStackAssignment(this);}exitRule(t){t.exitAssemblyStackAssignment&&t.exitAssemblyStackAssignment(this);}accept(t){return t.visitAssemblyStackAssignment?t.visitAssemblyStackAssignment(this):t.visitChildren(this)}},ZN=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_labelDefinition}enterRule(t){t.enterLabelDefinition&&t.enterLabelDefinition(this);}exitRule(t){t.exitLabelDefinition&&t.exitLabelDefinition(this);}accept(t){return t.visitLabelDefinition?t.visitLabelDefinition(this):t.visitChildren(this)}},XN=class extends me.ParserRuleContext{assemblyExpression(){return this.getRuleContext(0,Wr)}assemblyCase(t){return t===void 0?this.getRuleContexts(V_):this.getRuleContext(t,V_)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblySwitch}enterRule(t){t.enterAssemblySwitch&&t.enterAssemblySwitch(this);}exitRule(t){t.exitAssemblySwitch&&t.exitAssemblySwitch(this);}accept(t){return t.visitAssemblySwitch?t.visitAssemblySwitch(this):t.visitChildren(this)}},V_=class extends me.ParserRuleContext{assemblyLiteral(){return this.tryGetRuleContext(0,_1)}assemblyBlock(){return this.getRuleContext(0,En)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyCase}enterRule(t){t.enterAssemblyCase&&t.enterAssemblyCase(this);}exitRule(t){t.exitAssemblyCase&&t.exitAssemblyCase(this);}accept(t){return t.visitAssemblyCase?t.visitAssemblyCase(this):t.visitChildren(this)}},QN=class extends me.ParserRuleContext{identifier(){return this.getRuleContext(0,Ve)}assemblyBlock(){return this.getRuleContext(0,En)}assemblyIdentifierList(){return this.tryGetRuleContext(0,If)}assemblyFunctionReturns(){return this.tryGetRuleContext(0,eO)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyFunctionDefinition}enterRule(t){t.enterAssemblyFunctionDefinition&&t.enterAssemblyFunctionDefinition(this);}exitRule(t){t.exitAssemblyFunctionDefinition&&t.exitAssemblyFunctionDefinition(this);}accept(t){return t.visitAssemblyFunctionDefinition?t.visitAssemblyFunctionDefinition(this):t.visitChildren(this)}},eO=class extends me.ParserRuleContext{assemblyIdentifierList(){return this.tryGetRuleContext(0,If)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyFunctionReturns}enterRule(t){t.enterAssemblyFunctionReturns&&t.enterAssemblyFunctionReturns(this);}exitRule(t){t.exitAssemblyFunctionReturns&&t.exitAssemblyFunctionReturns(this);}accept(t){return t.visitAssemblyFunctionReturns?t.visitAssemblyFunctionReturns(this):t.visitChildren(this)}},tO=class extends me.ParserRuleContext{assemblyExpression(t){return t===void 0?this.getRuleContexts(Wr):this.getRuleContext(t,Wr)}assemblyBlock(t){return t===void 0?this.getRuleContexts(En):this.getRuleContext(t,En)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyFor}enterRule(t){t.enterAssemblyFor&&t.enterAssemblyFor(this);}exitRule(t){t.exitAssemblyFor&&t.exitAssemblyFor(this);}accept(t){return t.visitAssemblyFor?t.visitAssemblyFor(this):t.visitChildren(this)}},rO=class extends me.ParserRuleContext{assemblyExpression(){return this.getRuleContext(0,Wr)}assemblyBlock(){return this.getRuleContext(0,En)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyIf}enterRule(t){t.enterAssemblyIf&&t.enterAssemblyIf(this);}exitRule(t){t.exitAssemblyIf&&t.exitAssemblyIf(this);}accept(t){return t.visitAssemblyIf?t.visitAssemblyIf(this):t.visitChildren(this)}},_1=class extends me.ParserRuleContext{stringLiteral(){return this.tryGetRuleContext(0,Lu)}DecimalNumber(){return this.tryGetToken(O.DecimalNumber,0)}HexNumber(){return this.tryGetToken(O.HexNumber,0)}hexLiteral(){return this.tryGetRuleContext(0,kf)}BooleanLiteral(){return this.tryGetToken(O.BooleanLiteral,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_assemblyLiteral}enterRule(t){t.enterAssemblyLiteral&&t.enterAssemblyLiteral(this);}exitRule(t){t.exitAssemblyLiteral&&t.exitAssemblyLiteral(this);}accept(t){return t.visitAssemblyLiteral?t.visitAssemblyLiteral(this):t.visitChildren(this)}},iO=class extends me.ParserRuleContext{expression(t){return t===void 0?this.getRuleContexts(Be):this.getRuleContext(t,Be)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_tupleExpression}enterRule(t){t.enterTupleExpression&&t.enterTupleExpression(this);}exitRule(t){t.exitTupleExpression&&t.exitTupleExpression(this);}accept(t){return t.visitTupleExpression?t.visitTupleExpression(this):t.visitChildren(this)}},y1=class extends me.ParserRuleContext{DecimalNumber(){return this.tryGetToken(O.DecimalNumber,0)}HexNumber(){return this.tryGetToken(O.HexNumber,0)}NumberUnit(){return this.tryGetToken(O.NumberUnit,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_numberLiteral}enterRule(t){t.enterNumberLiteral&&t.enterNumberLiteral(this);}exitRule(t){t.exitNumberLiteral&&t.exitNumberLiteral(this);}accept(t){return t.visitNumberLiteral?t.visitNumberLiteral(this):t.visitChildren(this)}},Ve=class extends me.ParserRuleContext{ReceiveKeyword(){return this.tryGetToken(O.ReceiveKeyword,0)}GlobalKeyword(){return this.tryGetToken(O.GlobalKeyword,0)}ConstructorKeyword(){return this.tryGetToken(O.ConstructorKeyword,0)}PayableKeyword(){return this.tryGetToken(O.PayableKeyword,0)}LeaveKeyword(){return this.tryGetToken(O.LeaveKeyword,0)}Identifier(){return this.tryGetToken(O.Identifier,0)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_identifier}enterRule(t){t.enterIdentifier&&t.enterIdentifier(this);}exitRule(t){t.exitIdentifier&&t.exitIdentifier(this);}accept(t){return t.visitIdentifier?t.visitIdentifier(this):t.visitChildren(this)}},kf=class extends me.ParserRuleContext{HexLiteralFragment(t){return t===void 0?this.getTokens(O.HexLiteralFragment):this.getToken(O.HexLiteralFragment,t)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_hexLiteral}enterRule(t){t.enterHexLiteral&&t.enterHexLiteral(this);}exitRule(t){t.exitHexLiteral&&t.exitHexLiteral(this);}accept(t){return t.visitHexLiteral?t.visitHexLiteral(this):t.visitChildren(this)}},Ns=class extends me.ParserRuleContext{userDefinedTypeName(t){return t===void 0?this.getRuleContexts(xn):this.getRuleContext(t,xn)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_overrideSpecifier}enterRule(t){t.enterOverrideSpecifier&&t.enterOverrideSpecifier(this);}exitRule(t){t.exitOverrideSpecifier&&t.exitOverrideSpecifier(this);}accept(t){return t.visitOverrideSpecifier?t.visitOverrideSpecifier(this):t.visitChildren(this)}},Lu=class extends me.ParserRuleContext{StringLiteralFragment(t){return t===void 0?this.getTokens(O.StringLiteralFragment):this.getToken(O.StringLiteralFragment,t)}constructor(t,e){super(t,e);}get ruleIndex(){return O.RULE_stringLiteral}enterRule(t){t.enterStringLiteral&&t.enterStringLiteral(this);}exitRule(t){t.exitStringLiteral&&t.exitStringLiteral(this);}accept(t){return t.visitStringLiteral?t.visitStringLiteral(this):t.visitChildren(this)}},cK=["SourceUnit","PragmaDirective","ImportDirective","ContractDefinition","InheritanceSpecifier","StateVariableDeclaration","UsingForDeclaration","StructDefinition","ModifierDefinition","ModifierInvocation","FunctionDefinition","EventDefinition","CustomErrorDefinition","RevertStatement","EnumValue","EnumDefinition","VariableDeclaration","UserDefinedTypeName","Mapping","ArrayTypeName","FunctionTypeName","Block","ExpressionStatement","IfStatement","WhileStatement","ForStatement","InlineAssemblyStatement","DoWhileStatement","ContinueStatement","Break","Continue","BreakStatement","ReturnStatement","EmitStatement","ThrowStatement","VariableDeclarationStatement","ElementaryTypeName","FunctionCall","AssemblyBlock","AssemblyCall","AssemblyLocalDefinition","AssemblyAssignment","AssemblyStackAssignment","LabelDefinition","AssemblySwitch","AssemblyCase","AssemblyFunctionDefinition","AssemblyFor","AssemblyIf","TupleExpression","NameValueExpression","BooleanLiteral","NumberLiteral","Identifier","BinaryOperation","UnaryOperation","NewExpression","Conditional","StringLiteral","HexLiteral","HexNumber","DecimalNumber","MemberAccess","IndexAccess","IndexRangeAccess","NameValueList","UncheckedStatement","TryStatement","CatchClause","FileLevelConstant","AssemblyMemberAccess","TypeDefinition"],hK=["+","-","*","/","**","%","<<",">>","&&","||",",,","&",",","^","<",">","<=",">=","==","!=","=",",=","^=","&=","<<=",">>=","+=","-=","*=","/=","%=","|","|="],fK=["-","+","++","--","~","after","delete","!"],dK=qt(Pz()),pK=qt(Df()),mK=class extends dK.AbstractParseTreeVisitor{constructor(t){super(),this.options=t,this.result=null;}defaultResult(){throw new Error("Unknown node")}aggregateResult(){return {type:""}}visitSourceUnit(t){var e;let i={type:"SourceUnit",children:((e=t.children)!=null?e:[]).filter(n=>!(n instanceof pK.ErrorNode)).slice(0,-1).map(n=>this.visit(n))},s=this._addMeta(i,t);return this.result=s,s}visitContractPart(t){return this.visit(t.getChild(0))}visitContractDefinition(t){let e=this._toText(t.identifier()),r=this._toText(t.getChild(0));this._currentContract=e;let i={type:"ContractDefinition",name:e,baseContracts:t.inheritanceSpecifier().map(s=>this.visitInheritanceSpecifier(s)),subNodes:t.contractPart().map(s=>this.visit(s)),kind:r};return this._addMeta(i,t)}visitStateVariableDeclaration(t){let e=this.visitTypeName(t.typeName()),r=t.identifier(),i=this._toText(r),s=null,n=t.expression();n&&(s=this.visitExpression(n));let o="default";t.InternalKeyword().length>0?o="internal":t.PublicKeyword().length>0?o="public":t.PrivateKeyword().length>0&&(o="private");let a=!1;t.ConstantKeyword().length>0&&(a=!0);let u,l=t.overrideSpecifier();l.length===0?u=null:u=l[0].userDefinedTypeName().map(f=>this.visitUserDefinedTypeName(f));let h=!1;t.ImmutableKeyword().length>0&&(h=!0);let c={type:"VariableDeclaration",typeName:e,name:i,identifier:this.visitIdentifier(r),expression:s,visibility:o,isStateVar:!0,isDeclaredConst:a,isIndexed:!1,isImmutable:h,override:u,storageLocation:null},d={type:"StateVariableDeclaration",variables:[this._addMeta(c,t)],initialValue:s};return this._addMeta(d,t)}visitVariableDeclaration(t){let e=null,r=t.storageLocation();r&&(e=this._toText(r));let i=t.identifier(),s={type:"VariableDeclaration",typeName:this.visitTypeName(t.typeName()),name:this._toText(i),identifier:this.visitIdentifier(i),storageLocation:e,isStateVar:!1,isIndexed:!1,expression:null};return this._addMeta(s,t)}visitVariableDeclarationStatement(t){let e=[],r=t.variableDeclaration(),i=t.identifierList(),s=t.variableDeclarationList();r!==void 0?e=[this.visitVariableDeclaration(r)]:i!==void 0?e=this.buildIdentifierList(i):s&&(e=this.buildVariableDeclarationList(s));let n=null,o=t.expression();o&&(n=this.visitExpression(o));let a={type:"VariableDeclarationStatement",variables:e,initialValue:n};return this._addMeta(a,t)}visitStatement(t){return this.visit(t.getChild(0))}visitSimpleStatement(t){return this.visit(t.getChild(0))}visitEventDefinition(t){let e=t.eventParameterList().eventParameter().map(i=>{let s=this.visitTypeName(i.typeName()),n=null,o=i.identifier();o&&(n=this._toText(o));let a={type:"VariableDeclaration",typeName:s,name:n,identifier:o!==void 0?this.visitIdentifier(o):null,isStateVar:!1,isIndexed:i.IndexedKeyword()!==void 0,storageLocation:null,expression:null};return this._addMeta(a,i)}),r={type:"EventDefinition",name:this._toText(t.identifier()),parameters:e,isAnonymous:t.AnonymousKeyword()!==void 0};return this._addMeta(r,t)}visitBlock(t){let e={type:"Block",statements:t.statement().map(r=>this.visitStatement(r))};return this._addMeta(e,t)}visitParameter(t){let e=null,r=t.storageLocation();r!==void 0&&(e=this._toText(r));let i=null,s=t.identifier();s!==void 0&&(i=this._toText(s));let n={type:"VariableDeclaration",typeName:this.visitTypeName(t.typeName()),name:i,identifier:s!==void 0?this.visitIdentifier(s):null,storageLocation:e,isStateVar:!1,isIndexed:!1,expression:null};return this._addMeta(n,t)}visitFunctionDefinition(t){let e=!1,r=!1,i=!1,s=!1,n=null,o=[],a=null,u="default",l=null,h=t.block();h!==void 0&&(l=this.visitBlock(h));let c=t.modifierList().modifierInvocation().map(x=>this.visitModifierInvocation(x)),d=null;t.modifierList().stateMutability().length>0&&(d=this._stateMutabilityToText(t.modifierList().stateMutability(0)));let f=t.returnParameters();switch(this._toText(t.functionDescriptor().getChild(0))){case"constructor":o=t.parameterList().parameter().map(x=>this.visit(x)),t.modifierList().InternalKeyword().length>0?u="internal":t.modifierList().PublicKeyword().length>0?u="public":u="default",e=!0;break;case"fallback":o=t.parameterList().parameter().map(x=>this.visit(x)),a=f!==void 0?this.visitReturnParameters(f):null,u="external",r=!0;break;case"receive":u="external",i=!0;break;case"function":{let x=t.functionDescriptor().identifier();n=x!==void 0?this._toText(x):"",o=t.parameterList().parameter().map(_=>this.visit(_)),a=f!==void 0?this.visitReturnParameters(f):null,t.modifierList().ExternalKeyword().length>0?u="external":t.modifierList().InternalKeyword().length>0?u="internal":t.modifierList().PublicKeyword().length>0?u="public":t.modifierList().PrivateKeyword().length>0&&(u="private"),e=n===this._currentContract,r=n==="";break}}t.modifierList().VirtualKeyword().length>0&&(s=!0);let m,g=t.modifierList().overrideSpecifier();g.length===0?m=null:m=g[0].userDefinedTypeName().map(x=>this.visitUserDefinedTypeName(x));let v={type:"FunctionDefinition",name:n,parameters:o,returnParameters:a,body:l,visibility:u,modifiers:c,override:m,isConstructor:e,isReceiveEther:i,isFallback:r,isVirtual:s,stateMutability:d};return this._addMeta(v,t)}visitEnumDefinition(t){let e={type:"EnumDefinition",name:this._toText(t.identifier()),members:t.enumValue().map(r=>this.visitEnumValue(r))};return this._addMeta(e,t)}visitEnumValue(t){let e={type:"EnumValue",name:this._toText(t.identifier())};return this._addMeta(e,t)}visitElementaryTypeName(t){let e={type:"ElementaryTypeName",name:this._toText(t),stateMutability:null};return this._addMeta(e,t)}visitIdentifier(t){let e={type:"Identifier",name:this._toText(t)};return this._addMeta(e,t)}visitTypeName(t){var e;if(t.children!==void 0&&t.children.length>2){let r=null;if(t.children.length===4){let n=t.expression();if(n===void 0)throw new Error("Assertion error: a typeName with 4 children should have an expression");r=this.visitExpression(n);}let i=t.typeName(),s={type:"ArrayTypeName",baseTypeName:this.visitTypeName(i),length:r};return this._addMeta(s,t)}if(((e=t.children)==null?void 0:e.length)===2){let r={type:"ElementaryTypeName",name:this._toText(t.getChild(0)),stateMutability:this._toText(t.getChild(1))};return this._addMeta(r,t)}if(t.elementaryTypeName()!==void 0)return this.visitElementaryTypeName(t.elementaryTypeName());if(t.userDefinedTypeName()!==void 0)return this.visitUserDefinedTypeName(t.userDefinedTypeName());if(t.mapping()!==void 0)return this.visitMapping(t.mapping());if(t.functionTypeName()!==void 0)return this.visitFunctionTypeName(t.functionTypeName());throw new Error("Assertion error: unhandled type name case")}visitUserDefinedTypeName(t){let e={type:"UserDefinedTypeName",namePath:this._toText(t)};return this._addMeta(e,t)}visitUsingForDeclaration(t){let e=null,r=t.typeName();r!==void 0&&(e=this.visitTypeName(r));let i=t.GlobalKeyword()!==void 0,s=t.usingForObject(),n=s.userDefinedTypeName(),o;if(n!==void 0)o={type:"UsingForDeclaration",isGlobal:i,typeName:e,libraryName:this._toText(n),functions:[],operators:[]};else {let a=s.usingForObjectDirective(),u=[],l=[];for(let h of a){u.push(this._toText(h.userDefinedTypeName()));let c=h.userDefinableOperators();c!==void 0?l.push(this._toText(c)):l.push(null);}o={type:"UsingForDeclaration",isGlobal:i,typeName:e,libraryName:null,functions:u,operators:l};}return this._addMeta(o,t)}visitPragmaDirective(t){let e=t.pragmaValue().version(),r=this._toText(t.pragmaValue());(e==null?void 0:e.children)!==void 0&&(r=e.children.map(s=>this._toText(s)).join(" "));let i={type:"PragmaDirective",name:this._toText(t.pragmaName()),value:r};return this._addMeta(i,t)}visitInheritanceSpecifier(t){let e=t.expressionList(),r=e!==void 0?e.expression().map(s=>this.visitExpression(s)):[],i={type:"InheritanceSpecifier",baseName:this.visitUserDefinedTypeName(t.userDefinedTypeName()),arguments:r};return this._addMeta(i,t)}visitModifierInvocation(t){let e=t.expressionList(),r;e!=null?r=e.expression().map(s=>this.visit(s)):t.children!==void 0&&t.children.length>1?r=[]:r=null;let i={type:"ModifierInvocation",name:this._toText(t.identifier()),arguments:r};return this._addMeta(i,t)}visitFunctionTypeName(t){let e=t.functionTypeParameterList(0).functionTypeParameter().map(o=>this.visitFunctionTypeParameter(o)),r=[];t.functionTypeParameterList().length>1&&(r=t.functionTypeParameterList(1).functionTypeParameter().map(o=>this.visitFunctionTypeParameter(o)));let i="default";t.InternalKeyword().length>0?i="internal":t.ExternalKeyword().length>0&&(i="external");let s=null;t.stateMutability().length>0&&(s=this._toText(t.stateMutability(0)));let n={type:"FunctionTypeName",parameterTypes:e,returnTypes:r,visibility:i,stateMutability:s};return this._addMeta(n,t)}visitFunctionTypeParameter(t){let e=null;t.storageLocation()&&(e=this._toText(t.storageLocation()));let r={type:"VariableDeclaration",typeName:this.visitTypeName(t.typeName()),name:null,identifier:null,storageLocation:e,isStateVar:!1,isIndexed:!1,expression:null};return this._addMeta(r,t)}visitThrowStatement(t){let e={type:"ThrowStatement"};return this._addMeta(e,t)}visitReturnStatement(t){let e=null,r=t.expression();r&&(e=this.visitExpression(r));let i={type:"ReturnStatement",expression:e};return this._addMeta(i,t)}visitEmitStatement(t){let e={type:"EmitStatement",eventCall:this.visitFunctionCall(t.functionCall())};return this._addMeta(e,t)}visitCustomErrorDefinition(t){let e={type:"CustomErrorDefinition",name:this._toText(t.identifier()),parameters:this.visitParameterList(t.parameterList())};return this._addMeta(e,t)}visitTypeDefinition(t){let e={type:"TypeDefinition",name:this._toText(t.identifier()),definition:this.visitElementaryTypeName(t.elementaryTypeName())};return this._addMeta(e,t)}visitRevertStatement(t){let e={type:"RevertStatement",revertCall:this.visitFunctionCall(t.functionCall())};return this._addMeta(e,t)}visitFunctionCall(t){let e=[],r=[],i=[],s=t.functionCallArguments(),n=s.expressionList(),o=s.nameValueList();if(n)e=n.expression().map(u=>this.visitExpression(u));else if(o)for(let u of o.nameValue())e.push(this.visitExpression(u.expression())),r.push(this._toText(u.identifier())),i.push(this.visitIdentifier(u.identifier()));let a={type:"FunctionCall",expression:this.visitExpression(t.expression()),arguments:e,names:r,identifiers:i};return this._addMeta(a,t)}visitStructDefinition(t){let e={type:"StructDefinition",name:this._toText(t.identifier()),members:t.variableDeclaration().map(r=>this.visitVariableDeclaration(r))};return this._addMeta(e,t)}visitWhileStatement(t){let e={type:"WhileStatement",condition:this.visitExpression(t.expression()),body:this.visitStatement(t.statement())};return this._addMeta(e,t)}visitDoWhileStatement(t){let e={type:"DoWhileStatement",condition:this.visitExpression(t.expression()),body:this.visitStatement(t.statement())};return this._addMeta(e,t)}visitIfStatement(t){let e=this.visitStatement(t.statement(0)),r=null;t.statement().length>1&&(r=this.visitStatement(t.statement(1)));let i={type:"IfStatement",condition:this.visitExpression(t.expression()),trueBody:e,falseBody:r};return this._addMeta(i,t)}visitTryStatement(t){let e=null,r=t.returnParameters();r!==void 0&&(e=this.visitReturnParameters(r));let i=t.catchClause().map(n=>this.visitCatchClause(n)),s={type:"TryStatement",expression:this.visitExpression(t.expression()),returnParameters:e,body:this.visitBlock(t.block()),catchClauses:i};return this._addMeta(s,t)}visitCatchClause(t){let e=null;if(t.parameterList()&&(e=this.visitParameterList(t.parameterList())),t.identifier()&&this._toText(t.identifier())!=="Error"&&this._toText(t.identifier())!=="Panic")throw new Error('Expected "Error" or "Panic" identifier in catch clause');let r=null,i=t.identifier();i!==void 0&&(r=this._toText(i));let s={type:"CatchClause",isReasonStringType:r==="Error",kind:r,parameters:e,body:this.visitBlock(t.block())};return this._addMeta(s,t)}visitExpressionStatement(t){if(!t)return null;let e={type:"ExpressionStatement",expression:this.visitExpression(t.expression())};return this._addMeta(e,t)}visitNumberLiteral(t){var e;let r=this._toText(t.getChild(0)),i=null;((e=t.children)==null?void 0:e.length)===2&&(i=this._toText(t.getChild(1)));let s={type:"NumberLiteral",number:r,subdenomination:i};return this._addMeta(s,t)}visitMappingKey(t){if(t.elementaryTypeName())return this.visitElementaryTypeName(t.elementaryTypeName());if(t.userDefinedTypeName())return this.visitUserDefinedTypeName(t.userDefinedTypeName());throw new Error("Expected MappingKey to have either elementaryTypeName or userDefinedTypeName")}visitMapping(t){let e=t.mappingKeyName(),r=t.mappingValueName(),i={type:"Mapping",keyType:this.visitMappingKey(t.mappingKey()),keyName:e===void 0?null:this.visitIdentifier(e.identifier()),valueType:this.visitTypeName(t.typeName()),valueName:r===void 0?null:this.visitIdentifier(r.identifier())};return this._addMeta(i,t)}visitModifierDefinition(t){let e=null;t.parameterList()&&(e=this.visitParameterList(t.parameterList()));let r=!1;t.VirtualKeyword().length>0&&(r=!0);let i,s=t.overrideSpecifier();s.length===0?i=null:i=s[0].userDefinedTypeName().map(u=>this.visitUserDefinedTypeName(u));let n=null,o=t.block();o!==void 0&&(n=this.visitBlock(o));let a={type:"ModifierDefinition",name:this._toText(t.identifier()),parameters:e,body:n,isVirtual:r,override:i};return this._addMeta(a,t)}visitUncheckedStatement(t){let e={type:"UncheckedStatement",block:this.visitBlock(t.block())};return this._addMeta(e,t)}visitExpression(t){let e;switch(t.children.length){case 1:{let r=t.tryGetRuleContext(0,h1);if(r===void 0)throw new Error("Assertion error: primary expression should exist when children length is 1");return this.visitPrimaryExpression(r)}case 2:if(e=this._toText(t.getChild(0)),e==="new"){let r={type:"NewExpression",typeName:this.visitTypeName(t.typeName())};return this._addMeta(r,t)}if(fK.includes(e)){let r={type:"UnaryOperation",operator:e,subExpression:this.visitExpression(t.getRuleContext(0,Be)),isPrefix:!0};return this._addMeta(r,t)}if(e=this._toText(t.getChild(1)),["++","--"].includes(e)){let r={type:"UnaryOperation",operator:e,subExpression:this.visitExpression(t.getRuleContext(0,Be)),isPrefix:!1};return this._addMeta(r,t)}break;case 3:if(this._toText(t.getChild(0))==="("&&this._toText(t.getChild(2))===")"){let r={type:"TupleExpression",components:[this.visitExpression(t.getRuleContext(0,Be))],isArray:!1};return this._addMeta(r,t)}if(e=this._toText(t.getChild(1)),e==="."){let r={type:"MemberAccess",expression:this.visitExpression(t.expression(0)),memberName:this._toText(t.identifier())};return this._addMeta(r,t)}if(gK(e)){let r={type:"BinaryOperation",operator:e,left:this.visitExpression(t.expression(0)),right:this.visitExpression(t.expression(1))};return this._addMeta(r,t)}break;case 4:if(this._toText(t.getChild(1))==="("&&this._toText(t.getChild(3))===")"){let r=[],i=[],s=[],n=t.functionCallArguments();if(n.expressionList())r=n.expressionList().expression().map(a=>this.visitExpression(a));else if(n.nameValueList())for(let a of n.nameValueList().nameValue())r.push(this.visitExpression(a.expression())),i.push(this._toText(a.identifier())),s.push(this.visitIdentifier(a.identifier()));let o={type:"FunctionCall",expression:this.visitExpression(t.expression(0)),arguments:r,names:i,identifiers:s};return this._addMeta(o,t)}if(this._toText(t.getChild(1))==="["&&this._toText(t.getChild(3))==="]"){if(t.getChild(2).text===":"){let i={type:"IndexRangeAccess",base:this.visitExpression(t.expression(0))};return this._addMeta(i,t)}let r={type:"IndexAccess",base:this.visitExpression(t.expression(0)),index:this.visitExpression(t.expression(1))};return this._addMeta(r,t)}if(this._toText(t.getChild(1))==="{"&&this._toText(t.getChild(3))==="}"){let r={type:"NameValueExpression",expression:this.visitExpression(t.expression(0)),arguments:this.visitNameValueList(t.nameValueList())};return this._addMeta(r,t)}break;case 5:if(this._toText(t.getChild(1))==="?"&&this._toText(t.getChild(3))===":"){let r={type:"Conditional",condition:this.visitExpression(t.expression(0)),trueExpression:this.visitExpression(t.expression(1)),falseExpression:this.visitExpression(t.expression(2))};return this._addMeta(r,t)}if(this._toText(t.getChild(1))==="["&&this._toText(t.getChild(2))===":"&&this._toText(t.getChild(4))==="]"){let r={type:"IndexRangeAccess",base:this.visitExpression(t.expression(0)),indexEnd:this.visitExpression(t.expression(1))};return this._addMeta(r,t)}else if(this._toText(t.getChild(1))==="["&&this._toText(t.getChild(3))===":"&&this._toText(t.getChild(4))==="]"){let r={type:"IndexRangeAccess",base:this.visitExpression(t.expression(0)),indexStart:this.visitExpression(t.expression(1))};return this._addMeta(r,t)}break;case 6:if(this._toText(t.getChild(1))==="["&&this._toText(t.getChild(3))===":"&&this._toText(t.getChild(5))==="]"){let r={type:"IndexRangeAccess",base:this.visitExpression(t.expression(0)),indexStart:this.visitExpression(t.expression(1)),indexEnd:this.visitExpression(t.expression(2))};return this._addMeta(r,t)}break}throw new Error("Unrecognized expression")}visitNameValueList(t){let e=[],r=[],i=[];for(let n of t.nameValue())e.push(this._toText(n.identifier())),r.push(this.visitIdentifier(n.identifier())),i.push(this.visitExpression(n.expression()));let s={type:"NameValueList",names:e,identifiers:r,arguments:i};return this._addMeta(s,t)}visitFileLevelConstant(t){let e=this.visitTypeName(t.typeName()),r=t.identifier(),i=this._toText(r),s=this.visitExpression(t.expression()),n={type:"FileLevelConstant",typeName:e,name:i,initialValue:s,isDeclaredConst:!0,isImmutable:!1};return this._addMeta(n,t)}visitForStatement(t){let e=this.visitExpressionStatement(t.expressionStatement());e&&(e=e.expression);let r={type:"ForStatement",initExpression:t.simpleStatement()?this.visitSimpleStatement(t.simpleStatement()):null,conditionExpression:e,loopExpression:{type:"ExpressionStatement",expression:t.expression()!==void 0?this.visitExpression(t.expression()):null},body:this.visitStatement(t.statement())};return this._addMeta(r,t)}visitHexLiteral(t){let e=t.HexLiteralFragment().map(i=>this._toText(i)).map(i=>i.substring(4,i.length-1)),r={type:"HexLiteral",value:e.join(""),parts:e};return this._addMeta(r,t)}visitPrimaryExpression(t){if(t.BooleanLiteral()){let e={type:"BooleanLiteral",value:this._toText(t.BooleanLiteral())==="true"};return this._addMeta(e,t)}if(t.hexLiteral())return this.visitHexLiteral(t.hexLiteral());if(t.stringLiteral()){let e=t.stringLiteral().StringLiteralFragment().map(s=>{let n=this._toText(s),o=n.slice(0,7)==="unicode";o&&(n=n.slice(7));let a=n[0]==="'",u=n.substring(1,n.length-1);return {value:a?u.replace(new RegExp("\\\\'","g"),"'"):u.replace(new RegExp('\\\\"',"g"),'"'),isUnicode:o}}),r=e.map(s=>s.value),i={type:"StringLiteral",value:r.join(""),parts:r,isUnicode:e.map(s=>s.isUnicode)};return this._addMeta(i,t)}if(t.numberLiteral())return this.visitNumberLiteral(t.numberLiteral());if(t.TypeKeyword()){let e={type:"Identifier",name:"type"};return this._addMeta(e,t)}return t.typeName()?this.visitTypeName(t.typeName()):this.visit(t.getChild(0))}visitTupleExpression(t){let e=t.children.slice(1,-1),i={type:"TupleExpression",components:this._mapCommasToNulls(e).map(s=>s===null?null:this.visit(s)),isArray:this._toText(t.getChild(0))==="["};return this._addMeta(i,t)}buildIdentifierList(t){let e=t.children.slice(1,-1),r=t.identifier(),i=0;return this._mapCommasToNulls(e).map(s=>{if(!s)return null;let n=r[i];i++;let o={type:"VariableDeclaration",name:this._toText(n),identifier:this.visitIdentifier(n),isStateVar:!1,isIndexed:!1,typeName:null,storageLocation:null,expression:null};return this._addMeta(o,n)})}buildVariableDeclarationList(t){var e;let r=t.variableDeclaration(),i=0;return this._mapCommasToNulls((e=t.children)!=null?e:[]).map(s=>{if(!s)return null;let n=r[i];i++;let o=null;n.storageLocation()&&(o=this._toText(n.storageLocation()));let a=n.identifier(),u={type:"VariableDeclaration",name:this._toText(a),identifier:this.visitIdentifier(a),typeName:this.visitTypeName(n.typeName()),storageLocation:o,isStateVar:!1,isIndexed:!1,expression:null};return this._addMeta(u,n)})}visitImportDirective(t){let e=this._toText(t.importPath()),r=null,i=null,s=null,n=null;if(t.importDeclaration().length>0)s=t.importDeclaration().map(l=>{let h=this._toText(l.identifier(0)),c=null;return l.identifier().length>1&&(c=this._toText(l.identifier(1))),[h,c]}),n=t.importDeclaration().map(l=>{let h=this.visitIdentifier(l.identifier(0)),c=null;return l.identifier().length>1&&(c=this.visitIdentifier(l.identifier(1))),[h,c]});else {let l=t.identifier();if(l.length!==0)if(l.length===1){let h=t.identifier(0);r=this._toText(h),i=this.visitIdentifier(h);}else if(l.length===2){let h=t.identifier(1);r=this._toText(h),i=this.visitIdentifier(h);}else throw new Error("Assertion error: an import should have one or two identifiers")}let o=e.substring(1,e.length-1),a={type:"StringLiteral",value:o,parts:[o],isUnicode:[!1]},u={type:"ImportDirective",path:o,pathLiteral:this._addMeta(a,t.importPath()),unitAlias:r,unitAliasIdentifier:i,symbolAliases:s,symbolAliasesIdentifiers:n};return this._addMeta(u,t)}buildEventParameterList(t){return t.eventParameter().map(e=>{let r=this.visit(e.typeName()),i=e.identifier(),s=i?this._toText(i):null;return {type:"VariableDeclaration",typeName:r,name:s,isStateVar:!1,isIndexed:!!e.IndexedKeyword()}})}visitReturnParameters(t){return this.visitParameterList(t.parameterList())}visitParameterList(t){return t.parameter().map(e=>this.visitParameter(e))}visitInlineAssemblyStatement(t){let e=null;t.StringLiteralFragment()&&(e=this._toText(t.StringLiteralFragment()),e=e.substring(1,e.length-1));let r=[],i=t.inlineAssemblyStatementFlag();if(i!==void 0){let n=this._toText(i.stringLiteral());r.push(n.slice(1,n.length-1));}let s={type:"InlineAssemblyStatement",language:e,flags:r,body:this.visitAssemblyBlock(t.assemblyBlock())};return this._addMeta(s,t)}visitAssemblyBlock(t){let r={type:"AssemblyBlock",operations:t.assemblyItem().map(i=>this.visitAssemblyItem(i))};return this._addMeta(r,t)}visitAssemblyItem(t){let e;if(t.hexLiteral())return this.visitHexLiteral(t.hexLiteral());if(t.stringLiteral()){e=this._toText(t.stringLiteral());let r=e.substring(1,e.length-1),i={type:"StringLiteral",value:r,parts:[r],isUnicode:[!1]};return this._addMeta(i,t)}if(t.BreakKeyword()){let r={type:"Break"};return this._addMeta(r,t)}if(t.ContinueKeyword()){let r={type:"Continue"};return this._addMeta(r,t)}return this.visit(t.getChild(0))}visitAssemblyExpression(t){return this.visit(t.getChild(0))}visitAssemblyCall(t){let e=this._toText(t.getChild(0)),r=t.assemblyExpression().map(s=>this.visitAssemblyExpression(s)),i={type:"AssemblyCall",functionName:e,arguments:r};return this._addMeta(i,t)}visitAssemblyLiteral(t){let e;if(t.stringLiteral()){e=this._toText(t);let r=e.substring(1,e.length-1),i={type:"StringLiteral",value:r,parts:[r],isUnicode:[!1]};return this._addMeta(i,t)}if(t.BooleanLiteral()){let r={type:"BooleanLiteral",value:this._toText(t.BooleanLiteral())==="true"};return this._addMeta(r,t)}if(t.DecimalNumber()){let r={type:"DecimalNumber",value:this._toText(t)};return this._addMeta(r,t)}if(t.HexNumber()){let r={type:"HexNumber",value:this._toText(t)};return this._addMeta(r,t)}if(t.hexLiteral())return this.visitHexLiteral(t.hexLiteral());throw new Error("Should never reach here")}visitAssemblySwitch(t){let e={type:"AssemblySwitch",expression:this.visitAssemblyExpression(t.assemblyExpression()),cases:t.assemblyCase().map(r=>this.visitAssemblyCase(r))};return this._addMeta(e,t)}visitAssemblyCase(t){let e=null;this._toText(t.getChild(0))==="case"&&(e=this.visitAssemblyLiteral(t.assemblyLiteral()));let r={type:"AssemblyCase",block:this.visitAssemblyBlock(t.assemblyBlock()),value:e,default:e===null};return this._addMeta(r,t)}visitAssemblyLocalDefinition(t){let e=t.assemblyIdentifierOrList(),r;e.identifier()?r=[this.visitIdentifier(e.identifier())]:e.assemblyMember()?r=[this.visitAssemblyMember(e.assemblyMember())]:r=e.assemblyIdentifierList().identifier().map(n=>this.visitIdentifier(n));let i=null;t.assemblyExpression()!==void 0&&(i=this.visitAssemblyExpression(t.assemblyExpression()));let s={type:"AssemblyLocalDefinition",names:r,expression:i};return this._addMeta(s,t)}visitAssemblyFunctionDefinition(t){let e=t.assemblyIdentifierList(),r=e!==void 0?e.identifier().map(o=>this.visitIdentifier(o)):[],i=t.assemblyFunctionReturns(),s=i?i.assemblyIdentifierList().identifier().map(o=>this.visitIdentifier(o)):[],n={type:"AssemblyFunctionDefinition",name:this._toText(t.identifier()),arguments:r,returnArguments:s,body:this.visitAssemblyBlock(t.assemblyBlock())};return this._addMeta(n,t)}visitAssemblyAssignment(t){let e=t.assemblyIdentifierOrList(),r;e.identifier()?r=[this.visitIdentifier(e.identifier())]:e.assemblyMember()?r=[this.visitAssemblyMember(e.assemblyMember())]:r=e.assemblyIdentifierList().identifier().map(s=>this.visitIdentifier(s));let i={type:"AssemblyAssignment",names:r,expression:this.visitAssemblyExpression(t.assemblyExpression())};return this._addMeta(i,t)}visitAssemblyMember(t){let[e,r]=t.identifier(),i={type:"AssemblyMemberAccess",expression:this.visitIdentifier(e),memberName:this.visitIdentifier(r)};return this._addMeta(i,t)}visitLabelDefinition(t){let e={type:"LabelDefinition",name:this._toText(t.identifier())};return this._addMeta(e,t)}visitAssemblyStackAssignment(t){let e={type:"AssemblyStackAssignment",name:this._toText(t.identifier()),expression:this.visitAssemblyExpression(t.assemblyExpression())};return this._addMeta(e,t)}visitAssemblyFor(t){let e={type:"AssemblyFor",pre:this.visit(t.getChild(1)),condition:this.visit(t.getChild(2)),post:this.visit(t.getChild(3)),body:this.visit(t.getChild(4))};return this._addMeta(e,t)}visitAssemblyIf(t){let e={type:"AssemblyIf",condition:this.visitAssemblyExpression(t.assemblyExpression()),body:this.visitAssemblyBlock(t.assemblyBlock())};return this._addMeta(e,t)}visitContinueStatement(t){let e={type:"ContinueStatement"};return this._addMeta(e,t)}visitBreakStatement(t){let e={type:"BreakStatement"};return this._addMeta(e,t)}_toText(t){let e=t.text;if(e===void 0)throw new Error("Assertion error: text should never be undefiend");return e}_stateMutabilityToText(t){if(t.PureKeyword()!==void 0)return "pure";if(t.ConstantKeyword()!==void 0)return "constant";if(t.PayableKeyword()!==void 0)return "payable";if(t.ViewKeyword()!==void 0)return "view";throw new Error("Assertion error: non-exhaustive stateMutability check")}_loc(t){return {start:{line:t.start.line,column:t.start.charPositionInLine},end:{line:t.stop?t.stop.line:t.start.line,column:t.stop?t.stop.charPositionInLine:t.start.charPositionInLine}}}_range(t){var e,r;return [t.start.startIndex,(r=(e=t.stop)==null?void 0:e.stopIndex)!=null?r:t.start.startIndex]}_addMeta(t,e){let r={type:t.type};return this.options.loc===!0&&(t.loc=this._loc(e)),this.options.range===!0&&(t.range=this._range(e)),uf(uf({},r),t)}_mapCommasToNulls(t){if(t.length===0)return [];let e=[],r=!0;for(let i of t)if(r)this._toText(i)===","?e.push(null):(e.push(i),r=!1);else {if(this._toText(i)!==",")throw new Error("expected comma");r=!0;}return r&&e.push(null),e}};function gK(t){return hK.includes(t)}var _K=qt(Zz()),yK=class extends _K.default.error.ErrorListener{constructor(){super(),this._errors=[];}syntaxError(t,e,r,i,s){this._errors.push({message:s,line:r,column:i});}getErrors(){return this._errors}hasErrors(){return this._errors.length>0}},vK=yK,xK=qt(Qz()),bK=xK.default,EK=["var","bool","address","string","Int","Uint","Byte","Fixed","UFixed"];function CK(t,e){let r=t.lastIndexOf(e);return [t.substring(0,r),t.substring(r+1,t.length)]}function TK(t){return t.endsWith("'")&&(t=t.substring(0,t.length-1)),t.startsWith("'")&&(t=t.substring(1,t.length)),t}function AK(t){return t==="Identifier"||t==="from"?"Identifier":t==="TrueLiteral"||t==="FalseLiteral"?"Boolean":t==="VersionLiteral"?"Version":t==="StringLiteral"?"String":EK.includes(t)?"Type":t==="NumberUnit"?"Subdenomination":t==="DecimalNumber"?"Numeric":t==="HexLiteral"?"Hex":t==="ReservedKeyword"?"Reserved":/^\W+$/.test(t)?"Punctuator":"Keyword"}function wK(){return bK.split(`
|
|
437
|
-
`).map(t=>CK(t,"=")).reduce((t,[e,r])=>(t[parseInt(r,10)]=TK(e),t),{})}function nO(t,e){let r=wK();return t.map(s=>{var n,o;let u={type:AK(r[s.type]),value:s.text};return e.range===!0&&(u.range=[s.startIndex,s.stopIndex+1]),e.loc===!0&&(u.loc={start:{line:s.line,column:s.charPositionInLine},end:{line:s.line,column:s.charPositionInLine+((o=(n=s.text)==null?void 0:n.length)!=null?o:0)}}),u})}var sO=class extends Error{constructor(t){super();let{message:e,line:r,column:i}=t.errors[0];this.message=`${e} (${r}:${i})`,this.errors=t.errors,Error.captureStackTrace!==void 0?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;}};function DK(t,e={}){let r=new T_.ANTLRInputStream(t),i=new ue(r);return nO(i.getAllTokens(),e)}function SK(t,e={}){let r=new T_.ANTLRInputStream(t),i=new ue(r),s=new T_.CommonTokenStream(i),n=new O(s),o=new vK;i.removeErrorListeners(),i.addErrorListener(o),n.removeErrorListeners(),n.addErrorListener(o),n.buildParseTree=!0;let a=n.sourceUnit(),u=new mK(e);u.visit(a);let l=u.result;if(l===null)throw new Error("ast should never be null");let h=[];if(e.tokens===!0&&(h=nO(s.getTokens(),e)),e.tolerant!==!0&&o.hasErrors())throw new sO({errors:o.getErrors()});return e.tolerant===!0&&o.hasErrors()&&(l.errors=o.getErrors()),e.tokens===!0&&(l.tokens=h),l}function RK(t){if(typeof t!="object"||t===null)return !1;let e=t;return Object.prototype.hasOwnProperty.call(e,"type")&&typeof e.type=="string"?cK.includes(e.type):!1}function $_(t,e,r){if(Array.isArray(t)&&t.forEach(n=>$_(n,e,r)),!RK(t))return;let i=!0;if(e[t.type]!==void 0&&(i=e[t.type](t,r)),i===!1)return;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&$_(t[n],e,t);let s=t.type+":exit";e[s]!==void 0&&e[s](t,r);}});var B1=Gt(M1(),1),{program:UK,createCommand:HK,createArgument:VK,createOption:$K,CommanderError:zK,InvalidArgumentError:KK,InvalidOptionArgumentError:j1,Command:Bu,Argument:GK,Option:$i,Help:WK}=B1.default;var Ee="https://api.etherscan.io/v2/api",q1={ethereum:{chainId:1,apiUrl:Ee,aliases:["ethereum-mainnet"]},goerli:{chainId:5,apiUrl:Ee,aliases:["ethereum-goerli"]},sepolia:{chainId:11155111,apiUrl:Ee,aliases:["sepolia-testnet","eth-sepolia","ethereum-sepolia"]},holesky:{chainId:17e3,apiUrl:Ee,aliases:["holesky-testnet","ethereum-holesky"]},hoodi:{chainId:560048,apiUrl:Ee,aliases:["hoodi-testnet","ethereum-hoodi"]},polygon:{chainId:137,apiUrl:Ee,aliases:["polygon-mainnet"]},amoy:{chainId:80002,apiUrl:Ee,aliases:["polygon-amoy","polygon-sepolia","polygon-testnet"]},arbitrum:{chainId:42161,apiUrl:Ee,aliases:["arbitrum-mainnet"]},"arbitrum-nova":{chainId:42170,apiUrl:Ee,aliases:["arbitrum-nova-mainnet"]},"arbitrum-goerli":{chainId:421613,apiUrl:Ee},arbsep:{chainId:421614,apiUrl:Ee,aliases:["arbsep-testnet","arbitrum-sepolia","arbitrum-testnet"]},optimism:{chainId:10,apiUrl:Ee,aliases:["optimism-mainnet"]},"optimism-goerli":{chainId:420,apiUrl:Ee},optsep:{chainId:11155420,apiUrl:Ee,aliases:["optsep-testnet","optimism-sepolia","optimism-testnet"]},base:{chainId:8453,apiUrl:Ee,aliases:["base-mainnet"]},"base-sepolia":{chainId:84532,apiUrl:Ee,aliases:["base-testnet","basesep"]},"base-goerli":{chainId:84531,apiUrl:Ee},avalanche:{chainId:43114,apiUrl:Ee,aliases:["avalanche-mainnet"]},fuji:{chainId:43113,apiUrl:Ee,aliases:["avalanche-testnet","avalanche-fuji"]},bsc:{chainId:56,apiUrl:Ee,aliases:["bsc-mainnet"]},"bsc-testnet":{chainId:97,apiUrl:Ee},fantom:{chainId:250,apiUrl:Ee,aliases:["fantom-mainnet"]},"fantom-testnet":{chainId:4002,apiUrl:Ee},gnosis:{chainId:100,apiUrl:Ee,aliases:["gnosis-mainnet"]},blast:{chainId:81457,apiUrl:Ee,aliases:["blast-mainnet"]},"blast-sepolia":{chainId:168587773,apiUrl:Ee,aliases:["blast-sepolia-testnet","blast-testnet"]},linea:{chainId:59144,apiUrl:Ee,aliases:["linea-mainnet","zkconsensys","zkconsensys-mainnet"]},"linea-sepolia":{chainId:59141,apiUrl:Ee,aliases:["linea-sepolia-testnet","linea-testnet","lineasep"]},scroll:{chainId:534352,apiUrl:Ee,aliases:["scroll-mainnet"]},"scroll-sepolia":{chainId:534351,apiUrl:Ee,aliases:["scroll-sepolia-testnet","scroll-testnet"]},moonbeam:{chainId:1284,apiUrl:Ee,aliases:["moonbeam-mainnet"]},"moonbeam-testnet":{chainId:1287,apiUrl:Ee},moonriver:{chainId:1285,apiUrl:Ee,aliases:["moonriver-mainnet"]},fraxtal:{chainId:252,apiUrl:Ee,aliases:["fraxtal-mainnet"]},"fraxtal-hoodi":{chainId:2523,apiUrl:Ee,aliases:["fraxtal-hoodi-testnet","fraxtal-testnet"]},taiko:{chainId:167e3,apiUrl:Ee,aliases:["taiko-mainnet"]},"taiko-hoodi":{chainId:167013,apiUrl:Ee,aliases:["taiko-hoodi-testnet","taiko-testnet"]},abstract:{chainId:2741,apiUrl:Ee,aliases:["abstract-mainnet"]},"abstract-sepolia":{chainId:11124,apiUrl:Ee,aliases:["abstract-sepolia-testnet","abstract-testnet"]},apechain:{chainId:33139,apiUrl:Ee,aliases:["apechain-mainnet","ape"]},"apechain-curtis":{chainId:33111,apiUrl:Ee,aliases:["apechain-curtis-testnet","apechain-testnet","curtis"]},berachain:{chainId:80094,apiUrl:Ee,aliases:["berachain-mainnet","bera"]},"berachain-bepolia":{chainId:80069,apiUrl:Ee,aliases:["berachain-bepolia-testnet","berachain-testnet","bepolia"]},bittorrent:{chainId:199,apiUrl:Ee,aliases:["bittorrent-mainnet"]},"bittorrent-testnet":{chainId:1029,apiUrl:Ee},celo:{chainId:42220,apiUrl:Ee,aliases:["celo-mainnet"]},"celo-sepolia":{chainId:11142220,apiUrl:Ee,aliases:["celo-sepolia-testnet","celo-testnet"]},hyperevm:{chainId:999,apiUrl:Ee,aliases:["hyperevm-mainnet","hyperliquid"]},katana:{chainId:747474,apiUrl:Ee,aliases:["katana-mainnet"]},"katana-bokuto":{chainId:737373,apiUrl:Ee,aliases:["katana-bokuto-testnet","katana-testnet"]},mantle:{chainId:5e3,apiUrl:Ee,aliases:["mantle-mainnet"]},"mantle-sepolia":{chainId:5003,apiUrl:Ee,aliases:["mantle-sepolia-testnet","mantle-testnet","mantlesep"]},"memecore-testnet":{chainId:43521,apiUrl:Ee,aliases:["memecoreformicarium"]},"monad-testnet":{chainId:10143,apiUrl:Ee},opbnb:{chainId:204,apiUrl:Ee,aliases:["opbnb-mainnet"]},"opbnb-testnet":{chainId:5611,apiUrl:Ee},sei:{chainId:1329,apiUrl:Ee,aliases:["sei-mainnet"]},"sei-testnet":{chainId:1328,apiUrl:Ee},sonic:{chainId:146,apiUrl:Ee,aliases:["sonic-mainnet"]},"sonic-testnet":{chainId:14601,apiUrl:Ee},sophon:{chainId:50104,apiUrl:Ee,aliases:["sophon-mainnet"]},"sophon-sepolia":{chainId:531050104,apiUrl:Ee,aliases:["sophon-sepolia-testnet","sophon-testnet"]},swellchain:{chainId:1923,apiUrl:Ee,aliases:["swellchain-mainnet","swell"]},"swellchain-testnet":{chainId:1924,apiUrl:Ee},unichain:{chainId:130,apiUrl:Ee,aliases:["unichain-mainnet"]},"unichain-sepolia":{chainId:1301,apiUrl:Ee,aliases:["unichain-sepolia-testnet","unichain-testnet"]},world:{chainId:480,apiUrl:Ee,aliases:["world-mainnet","worldchain"]},"world-sepolia":{chainId:4801,apiUrl:Ee,aliases:["world-sepolia-testnet","world-testnet"]},xdc:{chainId:50,apiUrl:Ee,aliases:["xdc-mainnet"]},"xdc-apothem":{chainId:51,apiUrl:Ee,aliases:["xdc-apothem-testnet","xdc-testnet"]},zksync:{chainId:324,apiUrl:Ee,aliases:["zksync-mainnet"]},"zksync-sepolia":{chainId:300,apiUrl:Ee,aliases:["zksync-sepolia-testnet","zksync-testnet","zksyncsep"]},astar:{chainId:0,apiUrl:"https://astar.blockscout.com/api",aliases:["astar-mainnet"]},zkatana:{chainId:0,apiUrl:"https://astar-zkevm.explorer.startale.com/api",aliases:["zkatana-mainnet"]},aurora:{chainId:0,apiUrl:"https://explorer.mainnet.aurora.dev/api",aliases:["aurora-mainnet"]},ebi:{chainId:0,apiUrl:"https://explorer.ebi.xyz/api",aliases:["ebi-mainnet"]},etherlink:{chainId:0,apiUrl:"https://explorer.etherlink.com/api",aliases:["etherlink-mainnet"]},flare:{chainId:0,apiUrl:"https://api.routescan.io/v2/network/mainnet/evm/14/etherscan",aliases:["flare-mainnet"]},gravity:{chainId:0,apiUrl:"https://explorer.gravity.xyz/api",aliases:["gravity-mainnet"]},iota:{chainId:0,apiUrl:"https://explorer.evm.iota.org/api",aliases:["iota-mainnet"]},kava:{chainId:0,apiUrl:"https://kavascan.com/api",aliases:["kava-mainnet"]},"kava-testnet":{chainId:0,apiUrl:"https://testnet.kavascan.com/api"},klaytn:{chainId:0,apiUrl:"https://api-cypress.klaytnscope.com/api",aliases:["klaytn-mainnet"]},"klaytn-testnet":{chainId:0,apiUrl:"https://api-baobab.klaytnscope.com/api"},manta:{chainId:0,apiUrl:"https://pacific-explorer.manta.network/api",aliases:["manta-mainnet"]},metis:{chainId:0,apiUrl:"https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan",aliases:["metis-mainnet"]},mode:{chainId:0,apiUrl:"https://explorer.mode.network/api",aliases:["mode-mainnet"]},rarible:{chainId:0,apiUrl:"https://mainnet.explorer.rarichain.org/api",aliases:["rarible-mainnet"]},xchain:{chainId:0,apiUrl:"https://xchain-explorer.idex.io/api",aliases:["xchain-mainnet"]},xlayer:{chainId:0,apiUrl:"https://www.oklink.com/api/v5/explorer/contract/verify-source-code-plugin/XLAYER",aliases:["xlayer-mainnet"]}};var hd=class{constructor(){Vi(this,"apiUrls",new Map);Vi(this,"chainIds",new Map);for(let[e,r]of Object.entries(q1)){let i=r.apiUrl,s=r.chainId;if(i&&this.apiUrls.set(e,i),s&&this.chainIds.set(e,s),r.aliases)for(let n of r.aliases)i&&this.apiUrls.set(n,i),s&&this.chainIds.set(n,s);}}getApiUrl(e){return this.apiUrls.get(e)}getChainId(e){return this.chainIds.get(e)}getAllNetworkNames(){return Array.from(new Set([...this.apiUrls.keys(),...this.chainIds.keys()]))}getSupportedNetworks(){let e=new Map,r=this.getAllNetworkNames();for(let i of r)e.set(i,{chainId:this.getChainId(i),apiUrl:this.getApiUrl(i)});return e}},U1=new hd,fd=t=>U1.getApiUrl(t),dd=t=>U1.getChainId(t);var H1=t=>{try{let e=new URL(t);return !e.hostname.startsWith("api.")&&!e.hostname.startsWith("api-")?void 0:(e.hostname=e.hostname.replace(/^api[.-]/,""),e.pathname="/",e.toString())}catch(e){return}},V1=(t,e)=>{try{let r=new URL(t);return r.pathname=`/address/${e}`,r.toString()}catch(r){return}};var Er=Gt(Go()),Zt={default:Er.default.white,error:Er.default.red,success:Er.default.green,palette:[Er.default.magenta,Er.default.cyan,Er.default.yellow,Er.default.blue,Er.default.magentaBright,Er.default.cyanBright,Er.default.blueBright]},wd=t=>{let e=Math.min(Math.max(0,t.length-2),4),r=t.length-e,i=t.slice(0,e),s=Array.from({length:r}).fill("*").join("");return `${i}${s}`},Dd=(t,e=" ")=>r=>{t.info(""),Object.entries(r).forEach(([i,s])=>{Array.isArray(s)?(t.info(`${i}:`),s.forEach(n=>{t.info(`${e} - ${Er.default.bold(xy(n))}`);})):t.info(`${i}:${e}${Er.default.bold(xy(s))}`);});},xy=t=>{if(t==null)return "-";switch(typeof t){case"boolean":return t?T4:A4;default:return String(t)}},T4=Zt.success`✓`,A4=Zt.error`⚠`;var zu=Gt(Go()),Sd=(t,e)=>Object.entries(e!=null?e:{}).reduce((r,[i,s])=>{if(s==null)return r;let n=s.apiUrl||D4(i)||fd(i);aO__default.default(n,Zt.error`Missing scan API URL for network ${Zt.default(i)}
|
|
437
|
+
`).map(t=>CK(t,"=")).reduce((t,[e,r])=>(t[parseInt(r,10)]=TK(e),t),{})}function nO(t,e){let r=wK();return t.map(s=>{var n,o;let u={type:AK(r[s.type]),value:s.text};return e.range===!0&&(u.range=[s.startIndex,s.stopIndex+1]),e.loc===!0&&(u.loc={start:{line:s.line,column:s.charPositionInLine},end:{line:s.line,column:s.charPositionInLine+((o=(n=s.text)==null?void 0:n.length)!=null?o:0)}}),u})}var sO=class extends Error{constructor(t){super();let{message:e,line:r,column:i}=t.errors[0];this.message=`${e} (${r}:${i})`,this.errors=t.errors,Error.captureStackTrace!==void 0?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack;}};function DK(t,e={}){let r=new T_.ANTLRInputStream(t),i=new ue(r);return nO(i.getAllTokens(),e)}function SK(t,e={}){let r=new T_.ANTLRInputStream(t),i=new ue(r),s=new T_.CommonTokenStream(i),n=new O(s),o=new vK;i.removeErrorListeners(),i.addErrorListener(o),n.removeErrorListeners(),n.addErrorListener(o),n.buildParseTree=!0;let a=n.sourceUnit(),u=new mK(e);u.visit(a);let l=u.result;if(l===null)throw new Error("ast should never be null");let h=[];if(e.tokens===!0&&(h=nO(s.getTokens(),e)),e.tolerant!==!0&&o.hasErrors())throw new sO({errors:o.getErrors()});return e.tolerant===!0&&o.hasErrors()&&(l.errors=o.getErrors()),e.tokens===!0&&(l.tokens=h),l}function RK(t){if(typeof t!="object"||t===null)return !1;let e=t;return Object.prototype.hasOwnProperty.call(e,"type")&&typeof e.type=="string"?cK.includes(e.type):!1}function $_(t,e,r){if(Array.isArray(t)&&t.forEach(n=>$_(n,e,r)),!RK(t))return;let i=!0;if(e[t.type]!==void 0&&(i=e[t.type](t,r)),i===!1)return;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&$_(t[n],e,t);let s=t.type+":exit";e[s]!==void 0&&e[s](t,r);}});var B1=Gt(M1(),1),{program:UK,createCommand:HK,createArgument:VK,createOption:$K,CommanderError:zK,InvalidArgumentError:KK,InvalidOptionArgumentError:j1,Command:Bu,Argument:GK,Option:$i,Help:WK}=B1.default;var Ee="https://api.etherscan.io/v2/api",q1={ethereum:{chainId:1,apiUrl:Ee,aliases:["ethereum-mainnet"]},goerli:{chainId:5,apiUrl:Ee,aliases:["ethereum-goerli"]},sepolia:{chainId:11155111,apiUrl:Ee,aliases:["sepolia-testnet","eth-sepolia","ethereum-sepolia"]},holesky:{chainId:17e3,apiUrl:Ee,aliases:["holesky-testnet","ethereum-holesky"]},hoodi:{chainId:560048,apiUrl:Ee,aliases:["hoodi-testnet","ethereum-hoodi"]},polygon:{chainId:137,apiUrl:Ee,aliases:["polygon-mainnet"]},amoy:{chainId:80002,apiUrl:Ee,aliases:["polygon-amoy","polygon-sepolia","polygon-testnet"]},arbitrum:{chainId:42161,apiUrl:Ee,aliases:["arbitrum-mainnet"]},"arbitrum-nova":{chainId:42170,apiUrl:Ee,aliases:["arbitrum-nova-mainnet"]},"arbitrum-goerli":{chainId:421613,apiUrl:Ee},arbsep:{chainId:421614,apiUrl:Ee,aliases:["arbsep-testnet","arbitrum-sepolia","arbitrum-testnet"]},optimism:{chainId:10,apiUrl:Ee,aliases:["optimism-mainnet"]},"optimism-goerli":{chainId:420,apiUrl:Ee},optsep:{chainId:11155420,apiUrl:Ee,aliases:["optsep-testnet","optimism-sepolia","optimism-testnet"]},base:{chainId:8453,apiUrl:Ee,aliases:["base-mainnet"]},"base-sepolia":{chainId:84532,apiUrl:Ee,aliases:["base-testnet","basesep"]},"base-goerli":{chainId:84531,apiUrl:Ee},avalanche:{chainId:43114,apiUrl:Ee,aliases:["avalanche-mainnet"]},fuji:{chainId:43113,apiUrl:Ee,aliases:["avalanche-testnet","avalanche-fuji"]},bsc:{chainId:56,apiUrl:Ee,aliases:["bsc-mainnet"]},"bsc-testnet":{chainId:97,apiUrl:Ee},fantom:{chainId:250,apiUrl:Ee,aliases:["fantom-mainnet"]},"fantom-testnet":{chainId:4002,apiUrl:Ee},gnosis:{chainId:100,apiUrl:Ee,aliases:["gnosis-mainnet"]},blast:{chainId:81457,apiUrl:Ee,aliases:["blast-mainnet"]},"blast-sepolia":{chainId:168587773,apiUrl:Ee,aliases:["blast-sepolia-testnet","blast-testnet"]},linea:{chainId:59144,apiUrl:Ee,aliases:["linea-mainnet","zkconsensys","zkconsensys-mainnet"]},"linea-sepolia":{chainId:59141,apiUrl:Ee,aliases:["linea-sepolia-testnet","linea-testnet","lineasep"]},scroll:{chainId:534352,apiUrl:Ee,aliases:["scroll-mainnet"]},"scroll-sepolia":{chainId:534351,apiUrl:Ee,aliases:["scroll-sepolia-testnet","scroll-testnet"]},moonbeam:{chainId:1284,apiUrl:Ee,aliases:["moonbeam-mainnet"]},"moonbeam-testnet":{chainId:1287,apiUrl:Ee},moonriver:{chainId:1285,apiUrl:Ee,aliases:["moonriver-mainnet"]},fraxtal:{chainId:252,apiUrl:Ee,aliases:["fraxtal-mainnet"]},"fraxtal-hoodi":{chainId:2523,apiUrl:Ee,aliases:["fraxtal-hoodi-testnet","fraxtal-testnet"]},taiko:{chainId:167e3,apiUrl:Ee,aliases:["taiko-mainnet"]},"taiko-hoodi":{chainId:167013,apiUrl:Ee,aliases:["taiko-hoodi-testnet","taiko-testnet"]},abstract:{chainId:2741,apiUrl:Ee,aliases:["abstract-mainnet"]},"abstract-sepolia":{chainId:11124,apiUrl:Ee,aliases:["abstract-sepolia-testnet","abstract-testnet"]},apechain:{chainId:33139,apiUrl:Ee,aliases:["apechain-mainnet","ape"]},"apechain-curtis":{chainId:33111,apiUrl:Ee,aliases:["apechain-curtis-testnet","apechain-testnet","curtis"]},berachain:{chainId:80094,apiUrl:Ee,aliases:["berachain-mainnet","bera"]},"berachain-bepolia":{chainId:80069,apiUrl:Ee,aliases:["berachain-bepolia-testnet","berachain-testnet","bepolia"]},bittorrent:{chainId:199,apiUrl:Ee,aliases:["bittorrent-mainnet"]},"bittorrent-testnet":{chainId:1029,apiUrl:Ee},celo:{chainId:42220,apiUrl:Ee,aliases:["celo-mainnet"]},"celo-sepolia":{chainId:11142220,apiUrl:Ee,aliases:["celo-sepolia-testnet","celo-testnet"]},hyperevm:{chainId:999,apiUrl:Ee,aliases:["hyperevm-mainnet","hyperliquid","hyperliquid-mainnet"]},katana:{chainId:747474,apiUrl:Ee,aliases:["katana-mainnet"]},"katana-bokuto":{chainId:737373,apiUrl:Ee,aliases:["katana-bokuto-testnet","katana-testnet"]},mantle:{chainId:5e3,apiUrl:Ee,aliases:["mantle-mainnet"]},"mantle-sepolia":{chainId:5003,apiUrl:Ee,aliases:["mantle-sepolia-testnet","mantle-testnet","mantlesep"]},"memecore-testnet":{chainId:43521,apiUrl:Ee,aliases:["memecoreformicarium"]},monad:{chainId:143,apiUrl:Ee,aliases:["monad-mainnet"]},"monad-testnet":{chainId:10143,apiUrl:Ee},opbnb:{chainId:204,apiUrl:Ee,aliases:["opbnb-mainnet"]},"opbnb-testnet":{chainId:5611,apiUrl:Ee},sei:{chainId:1329,apiUrl:Ee,aliases:["sei-mainnet"]},"sei-testnet":{chainId:1328,apiUrl:Ee},sonic:{chainId:146,apiUrl:Ee,aliases:["sonic-mainnet"]},"sonic-testnet":{chainId:14601,apiUrl:Ee},sophon:{chainId:50104,apiUrl:Ee,aliases:["sophon-mainnet"]},"sophon-sepolia":{chainId:531050104,apiUrl:Ee,aliases:["sophon-sepolia-testnet","sophon-testnet"]},swellchain:{chainId:1923,apiUrl:Ee,aliases:["swellchain-mainnet","swell"]},"swellchain-testnet":{chainId:1924,apiUrl:Ee},unichain:{chainId:130,apiUrl:Ee,aliases:["unichain-mainnet"]},"unichain-sepolia":{chainId:1301,apiUrl:Ee,aliases:["unichain-sepolia-testnet","unichain-testnet"]},world:{chainId:480,apiUrl:Ee,aliases:["world-mainnet","worldchain"]},"world-sepolia":{chainId:4801,apiUrl:Ee,aliases:["world-sepolia-testnet","world-testnet"]},xdc:{chainId:50,apiUrl:Ee,aliases:["xdc-mainnet"]},"xdc-apothem":{chainId:51,apiUrl:Ee,aliases:["xdc-apothem-testnet","xdc-testnet"]},zksync:{chainId:324,apiUrl:Ee,aliases:["zksync-mainnet"]},"zksync-sepolia":{chainId:300,apiUrl:Ee,aliases:["zksync-sepolia-testnet","zksync-testnet","zksyncsep"]},astar:{chainId:0,apiUrl:"https://astar.blockscout.com/api",aliases:["astar-mainnet"]},zkatana:{chainId:0,apiUrl:"https://astar-zkevm.explorer.startale.com/api",aliases:["zkatana-mainnet"]},aurora:{chainId:0,apiUrl:"https://explorer.mainnet.aurora.dev/api",aliases:["aurora-mainnet"]},ebi:{chainId:0,apiUrl:"https://explorer.ebi.xyz/api",aliases:["ebi-mainnet"]},etherlink:{chainId:0,apiUrl:"https://explorer.etherlink.com/api",aliases:["etherlink-mainnet"]},flare:{chainId:0,apiUrl:"https://api.routescan.io/v2/network/mainnet/evm/14/etherscan",aliases:["flare-mainnet"]},gravity:{chainId:0,apiUrl:"https://explorer.gravity.xyz/api",aliases:["gravity-mainnet"]},iota:{chainId:0,apiUrl:"https://explorer.evm.iota.org/api",aliases:["iota-mainnet"]},kava:{chainId:0,apiUrl:"https://kavascan.com/api",aliases:["kava-mainnet"]},"kava-testnet":{chainId:0,apiUrl:"https://testnet.kavascan.com/api"},klaytn:{chainId:0,apiUrl:"https://api-cypress.klaytnscope.com/api",aliases:["klaytn-mainnet"]},"klaytn-testnet":{chainId:0,apiUrl:"https://api-baobab.klaytnscope.com/api"},manta:{chainId:0,apiUrl:"https://pacific-explorer.manta.network/api",aliases:["manta-mainnet"]},metis:{chainId:0,apiUrl:"https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan",aliases:["metis-mainnet"]},mode:{chainId:0,apiUrl:"https://explorer.mode.network/api",aliases:["mode-mainnet"]},rarible:{chainId:0,apiUrl:"https://mainnet.explorer.rarichain.org/api",aliases:["rarible-mainnet"]},xchain:{chainId:0,apiUrl:"https://xchain-explorer.idex.io/api",aliases:["xchain-mainnet"]},xlayer:{chainId:0,apiUrl:"https://www.oklink.com/api/v5/explorer/contract/verify-source-code-plugin/XLAYER",aliases:["xlayer-mainnet"]}};var hd=class{constructor(){Vi(this,"apiUrls",new Map);Vi(this,"chainIds",new Map);for(let[e,r]of Object.entries(q1)){let i=r.apiUrl,s=r.chainId;if(i&&this.apiUrls.set(e,i),s&&this.chainIds.set(e,s),r.aliases)for(let n of r.aliases)i&&this.apiUrls.set(n,i),s&&this.chainIds.set(n,s);}}getApiUrl(e){return this.apiUrls.get(e)}getChainId(e){return this.chainIds.get(e)}getAllNetworkNames(){return Array.from(new Set([...this.apiUrls.keys(),...this.chainIds.keys()]))}getSupportedNetworks(){let e=new Map,r=this.getAllNetworkNames();for(let i of r)e.set(i,{chainId:this.getChainId(i),apiUrl:this.getApiUrl(i)});return e}},U1=new hd,fd=t=>U1.getApiUrl(t),dd=t=>U1.getChainId(t);var H1=t=>{try{let e=new URL(t);return !e.hostname.startsWith("api.")&&!e.hostname.startsWith("api-")?void 0:(e.hostname=e.hostname.replace(/^api[.-]/,""),e.pathname="/",e.toString())}catch(e){return}},V1=(t,e)=>{try{let r=new URL(t);return r.pathname=`/address/${e}`,r.toString()}catch(r){return}};var Er=Gt(Go()),Zt={default:Er.default.white,error:Er.default.red,success:Er.default.green,palette:[Er.default.magenta,Er.default.cyan,Er.default.yellow,Er.default.blue,Er.default.magentaBright,Er.default.cyanBright,Er.default.blueBright]},wd=t=>{let e=Math.min(Math.max(0,t.length-2),4),r=t.length-e,i=t.slice(0,e),s=Array.from({length:r}).fill("*").join("");return `${i}${s}`},Dd=(t,e=" ")=>r=>{t.info(""),Object.entries(r).forEach(([i,s])=>{Array.isArray(s)?(t.info(`${i}:`),s.forEach(n=>{t.info(`${e} - ${Er.default.bold(xy(n))}`);})):t.info(`${i}:${e}${Er.default.bold(xy(s))}`);});},xy=t=>{if(t==null)return "-";switch(typeof t){case"boolean":return t?T4:A4;default:return String(t)}},T4=Zt.success`✓`,A4=Zt.error`⚠`;var zu=Gt(Go()),Sd=(t,e)=>Object.entries(e!=null?e:{}).reduce((r,[i,s])=>{if(s==null)return r;let n=s.apiUrl||D4(i)||fd(i);aO__default.default(n,Zt.error`Missing scan API URL for network ${Zt.default(i)}
|
|
438
438
|
|
|
439
439
|
Please provide the API URL:
|
|
440
440
|
|
|
@@ -478,7 +478,7 @@ ${JSON.stringify(r)}`),await j3(async()=>{let i=await UV(this.props.apiUrl,r,thi
|
|
|
478
478
|
|
|
479
479
|
${JSON.stringify(i)}`),MS(i.result))throw new Error("API Rate limit has been exceeded");return i},3,async(i,s)=>{this.emit("retry",i,s),await ch(2e3);})}async __poll(r){for(;;){this.emit("poll",r);let i=await HV(this.props.apiUrl,r,this.props.chainId,this.props.apiKey);if(this.logger.verbose(`Received raw polling response from ${this.props.apiUrl}:
|
|
480
480
|
|
|
481
|
-
${JSON.stringify(i)}`),i.status===1)return {alreadyVerified:!1};if(kS(i.result))return {alreadyVerified:!0};if(qV(i.result)){await ch(1e4);continue}if(MS(i.result)){await ch(1e4);continue}throw new Error(`Verification failed with result "${i.result}", status ${i.status} (${i.message})`)}}},BS=(t,e)=>new Qg(t,e),qV=t=>!!(t!=null&&t.match(/Pending/gi)),kS=t=>!!(t!=null&&t.match(/already verified/gi)),MS=t=>!!(t!=null&&t.match(/rate/)),UV=async(t,e,r,i)=>{let s=new URL(t),n=t.includes("api.etherscan.io/v2");r!==void 0&&n&&s.searchParams.set("chainid",String(r)),i&&s.searchParams.set("apikey",i);let o=await Xg(s.toString(),{method:"POST",form:e}).json();return jS.parse(o)},HV=async(t,e,r,i)=>{let s=new URL(t);s.searchParams.set("module","contract"),s.searchParams.set("action","checkverifystatus"),s.searchParams.set("guid",e);let n=t.includes("api.etherscan.io/v2");r!==void 0&&n&&s.searchParams.set("chainid",String(r)),i&&s.searchParams.set("apikey",i);try{let o=await Xg(s).json();return jS.parse(o)}catch(o){throw new Error(`Failed to check verification status: ${o}`)}},VV=({apiKey:t,address:e,contractName:r,constructorArguments:i,compilerVersion:s,optimizerRuns:n=0,sourceCode:o,evmVersion:a,licenseType:u})=>{let l={action:"verifysourcecode",module:"contract",codeformat:"solidity-standard-json-input",contractaddress:e,contractname:r,compilerversion:`v${s}`,optimizationUsed:n>0?"1":"0",sourceCode:o};return t!=null&&(l.apikey=t),n!=null&&(l.runs=String(n)),i!=null&&(l.constructorArguements=i),a!=null&&(l.evmversion=a),u!=null&&(l.licenseType=String(u)),l},jS=ke.object({status:ke.coerce.number().nullish(),message:ke.string().nullish(),result:ke.string().nullish()});var Pu=Gt(Go());ke.object({enabled:ke.boolean().optional(),runs:ke.number().optional()});ke.record(ke.string(),ke.object({content:ke.string()}));var $V=ke.array(ke.record(ke.string(),ke.any())),zV=ke.object({language:ke.string(),compiler:ke.object({version:ke.string()}),settings:ke.object({compilationTarget:ke.record(ke.string(),ke.string()),evmVersion:ke.string(),optimizer:ke.object({enabled:ke.boolean().optional(),runs:ke.number().optional()})}),sources:ke.record(ke.string(),ke.object({content:ke.string()}))}),e_=ke.object({address:ke.string(),abi:$V,args:ke.array(ke.any()),solcInputHash:ke.string(),metadata:ke.string().transform((t,e)=>{try{return JSON.parse(t)}catch(r){return e.addIssue({code:"custom",message:"Invalid JSON"}),ke.NEVER}}).pipe(zV),bytecode:ke.string(),deployedBytecode:ke.string()});var t_=t=>{let{compilationTarget:e,...r}=t.settings,i=Object.entries(t.sources).reduce((s,[n,o])=>({...s,[n]:{content:o.content}}),{});return {language:t.language,settings:r,sources:i}};var tR=Gt(US());var HS="logger/5.7.0";var VS=!1,$S=!1,Bh={debug:1,default:2,info:2,warning:3,error:4,off:5},zS=Bh.default,i_=null;function KV(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch(r){t.push(e);}}),t.length)throw new Error("missing "+t.join(", "));if("\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken implementation")}catch(t){return t.message}return null}var KS=KV(),n_;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF";})(n_||(n_={}));var Gr;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED";})(Gr||(Gr={}));var GS="0123456789abcdef",Me=class t{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1});}_log(e,r){let i=e.toLowerCase();Bh[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(zS>Bh[i])&&console.log.apply(console,r);}debug(...e){this._log(t.levels.DEBUG,e);}info(...e){this._log(t.levels.INFO,e);}warn(...e){this._log(t.levels.WARNING,e);}makeError(e,r,i){if($S)return this.makeError("censored error",r,{});r||(r=t.errors.UNKNOWN_ERROR),i||(i={});let s=[];Object.keys(i).forEach(u=>{let l=i[u];try{if(l instanceof Uint8Array){let h="";for(let c=0;c<l.length;c++)h+=GS[l[c]>>4],h+=GS[l[c]&15];s.push(u+"=Uint8Array(0x"+h+")");}else s.push(u+"="+JSON.stringify(l));}catch(h){s.push(u+"="+JSON.stringify(i[u].toString()));}}),s.push(`code=${r}`),s.push(`version=${this.version}`);let n=e,o="";switch(r){case Gr.NUMERIC_FAULT:{o="NUMERIC_FAULT";let u=e;switch(u){case"overflow":case"underflow":case"division-by-zero":o+="-"+u;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Gr.CALL_EXCEPTION:case Gr.INSUFFICIENT_FUNDS:case Gr.MISSING_NEW:case Gr.NONCE_EXPIRED:case Gr.REPLACEMENT_UNDERPRICED:case Gr.TRANSACTION_REPLACED:case Gr.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),s.length&&(e+=" ("+s.join(", ")+")");let a=new Error(e);return a.reason=n,a.code=r,Object.keys(i).forEach(function(u){a[u]=i[u];}),a}throwError(e,r,i){throw this.makeError(e,r,i)}throwArgumentError(e,r,i){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:i})}assert(e,r,i,s){e||this.throwError(r,i,s);}assertArgument(e,r,i,s){e||this.throwArgumentError(r,i,s);}checkNormalize(e){KS&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:KS});}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}));}checkArgumentCount(e,r,i){i?i=": "+i:i="",e<r&&this.throwError("missing argument"+i,t.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+i,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r});}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name});}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name});}static globalLogger(){return i_||(i_=new t(HS)),i_}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),VS){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"});}$S=!!e,VS=!!r;}static setLogLevel(e){let r=Bh[e.toLowerCase()];if(r==null){t.globalLogger().warn("invalid log level - "+e);return}zS=r;}static from(e){return new t(e)}};Me.errors=Gr;Me.levels=n_;var WS="bytes/5.7.0";var Pi=new Me(WS);function JS(t){return !!t.toHexString}function nu(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return nu(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function YS(t){return typeof t=="number"&&t==t&&t%1===0}function jh(t){if(t==null)return !1;if(t.constructor===Uint8Array)return !0;if(typeof t=="string"||!YS(t.length)||t.length<0)return !1;for(let e=0;e<t.length;e++){let r=t[e];if(!YS(r)||r<0||r>=256)return !1}return !0}function Bt(t,e){if(e||(e={}),typeof t=="number"){Pi.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),nu(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),JS(t)&&(t=t.toHexString()),gr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Pi.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let s=0;s<r.length;s+=2)i.push(parseInt(r.substring(s,s+2),16));return nu(new Uint8Array(i))}return jh(t)?nu(new Uint8Array(t)):Pi.throwArgumentError("invalid arrayify value","value",t)}function Ii(t){let e=t.map(s=>Bt(s)),r=e.reduce((s,n)=>s+n.length,0),i=new Uint8Array(r);return e.reduce((s,n)=>(i.set(n,s),s+n.length),0),nu(i)}function gr(t,e){return !(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}var s_="0123456789abcdef";function Nt(t,e){if(e||(e={}),typeof t=="number"){Pi.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=s_[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),JS(t))return t.toHexString();if(gr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Pi.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(jh(t)){let r="0x";for(let i=0;i<t.length;i++){let s=t[i];r+=s_[(s&240)>>4]+s_[s&15];}return r}return Pi.throwArgumentError("invalid hexlify value","value",t)}function o_(t,e,r){return typeof t!="string"?t=Nt(t):(!gr(t)||t.length%2)&&Pi.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function ZS(t){let e="0x";return t.forEach(r=>{e+=Nt(r).substring(2);}),e}function qh(t,e){for(typeof t!="string"?t=Nt(t):gr(t)||Pi.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&Pi.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}var XS="bignumber/5.7.0";var Uh=tR.default.BN,ki=new Me(XS),a_={},QS=9007199254740991;var eR=!1,Pt=class t{constructor(e,r){e!==a_&&ki.throwError("cannot call constructor directly; use BigNumber.from",Me.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this);}fromTwos(e){return _r(Ge(this).fromTwos(e))}toTwos(e){return _r(Ge(this).toTwos(e))}abs(){return this._hex[0]==="-"?t.from(this._hex.substring(1)):this}add(e){return _r(Ge(this).add(Ge(e)))}sub(e){return _r(Ge(this).sub(Ge(e)))}div(e){return t.from(e).isZero()&&Br("division-by-zero","div"),_r(Ge(this).div(Ge(e)))}mul(e){return _r(Ge(this).mul(Ge(e)))}mod(e){let r=Ge(e);return r.isNeg()&&Br("division-by-zero","mod"),_r(Ge(this).umod(r))}pow(e){let r=Ge(e);return r.isNeg()&&Br("negative-power","pow"),_r(Ge(this).pow(r))}and(e){let r=Ge(e);return (this.isNegative()||r.isNeg())&&Br("unbound-bitwise-result","and"),_r(Ge(this).and(r))}or(e){let r=Ge(e);return (this.isNegative()||r.isNeg())&&Br("unbound-bitwise-result","or"),_r(Ge(this).or(r))}xor(e){let r=Ge(e);return (this.isNegative()||r.isNeg())&&Br("unbound-bitwise-result","xor"),_r(Ge(this).xor(r))}mask(e){return (this.isNegative()||e<0)&&Br("negative-width","mask"),_r(Ge(this).maskn(e))}shl(e){return (this.isNegative()||e<0)&&Br("negative-width","shl"),_r(Ge(this).shln(e))}shr(e){return (this.isNegative()||e<0)&&Br("negative-width","shr"),_r(Ge(this).shrn(e))}eq(e){return Ge(this).eq(Ge(e))}lt(e){return Ge(this).lt(Ge(e))}lte(e){return Ge(this).lte(Ge(e))}gt(e){return Ge(this).gt(Ge(e))}gte(e){return Ge(this).gte(Ge(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Ge(this).isZero()}toNumber(){try{return Ge(this).toNumber()}catch(e){Br("overflow","toNumber",this.toString());}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return ki.throwError("this platform does not support BigInt",Me.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?eR||(eR=!0,ki.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?ki.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Me.errors.UNEXPECTED_ARGUMENT,{}):ki.throwError("BigNumber.toString does not accept parameters",Me.errors.UNEXPECTED_ARGUMENT,{})),Ge(this).toString(10)}toHexString(){return this._hex}toJSON(e){return {type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof t)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new t(a_,su(e)):e.match(/^-?[0-9]+$/)?new t(a_,su(new Uh(e))):ki.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Br("underflow","BigNumber.from",e),(e>=QS||e<=-QS)&&Br("overflow","BigNumber.from",e),t.from(String(e));let r=e;if(typeof r=="bigint")return t.from(r.toString());if(jh(r))return t.from(Nt(r));if(r)if(r.toHexString){let i=r.toHexString();if(typeof i=="string")return t.from(i)}else {let i=r._hex;if(i==null&&r.type==="BigNumber"&&(i=r.hex),typeof i=="string"&&(gr(i)||i[0]==="-"&&gr(i.substring(1))))return t.from(i)}return ki.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return !!(e&&e._isBigNumber)}};function su(t){if(typeof t!="string")return su(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&ki.throwArgumentError("invalid hex","value",t),t=su(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return "0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function _r(t){return Pt.from(su(t))}function Ge(t){let e=Pt.from(t).toHexString();return e[0]==="-"?new Uh("-"+e.substring(3),16):new Uh(e.substring(2),16)}function Br(t,e,r){let i={fault:t,operation:e};return r!=null&&(i.value=r),ki.throwError(t,Me.errors.NUMERIC_FAULT,i)}function u_(t){return new Uh(t,36).toString(16)}var rR="properties/5.7.0";var iR=new Me(rR);function jt(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1});}function ou(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor;}return null}var WV={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function nR(t){if(t==null||WV[typeof t])return !0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return !1;let e=Object.keys(t);for(let r=0;r<e.length;r++){let i=null;try{i=t[e[r]];}catch(s){continue}if(!nR(i))return !1}return !0}return iR.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function YV(t){if(nR(t))return t;if(Array.isArray(t))return Object.freeze(t.map(e=>l_(e)));if(typeof t=="object"){let e={};for(let r in t){let i=t[r];i!==void 0&&jt(e,r,l_(i));}return e}return iR.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function l_(t){return YV(t)}var bs=class{constructor(e){for(let r in e)this[r]=l_(e[r]);}};var ci="abi/5.7.0";var We=new Me(ci),Es={},sR={calldata:!0,memory:!0,storage:!0},JV={calldata:!0,memory:!0};function Hh(t,e){if(t==="bytes"||t==="string"){if(sR[e])return !0}else if(t==="address"){if(e==="payable")return !0}else if((t.indexOf("[")>=0||t==="tuple")&&JV[e])return !0;return (sR[e]||e==="payable")&&We.throwArgumentError("invalid modifier","name",e),!1}function ZV(t,e){let r=t;function i(a){We.throwArgumentError(`unexpected character at position ${a}`,"param",t);}t=t.replace(/\s/g," ");function s(a){let u={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(u.indexed=!1),u}let n={type:"",name:"",state:{allowType:!0}},o=n;for(let a=0;a<t.length;a++){let u=t[a];switch(u){case"(":o.state.allowType&&o.type===""?o.type="tuple":o.state.allowParams||i(a),o.state.allowType=!1,o.type=No(o.type),o.components=[s(o)],o=o.components[0];break;case")":delete o.state,o.name==="indexed"&&(e||i(a),o.indexed=!0,o.name=""),Hh(o.type,o.name)&&(o.name=""),o.type=No(o.type);let l=o;o=o.parent,o||i(a),delete l.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,o.name==="indexed"&&(e||i(a),o.indexed=!0,o.name=""),Hh(o.type,o.name)&&(o.name=""),o.type=No(o.type);let h=s(o.parent);o.parent.components.push(h),delete o.parent,o=h;break;case" ":o.state.allowType&&o.type!==""&&(o.type=No(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&o.name!==""&&(o.name==="indexed"?(e||i(a),o.indexed&&i(a),o.indexed=!0,o.name=""):Hh(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||i(a),o.type+=u,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||i(a),o.type+=u,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=u,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=u,delete o.state.allowArray):o.state.readArray?o.type+=u:i(a);}}return o.parent&&We.throwArgumentError("unexpected eof","param",t),delete n.state,o.name==="indexed"?(e||i(r.length-7),o.indexed&&i(r.length-7),o.indexed=!0,o.name=""):Hh(o.type,o.name)&&(o.name=""),n.type=No(n.type),n}function Vh(t,e){for(let r in e)jt(t,r,e[r]);}var Ze=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),XV=new RegExp(/^(.*)\[([0-9]*)\]$/),yr=class t{constructor(e,r){e!==Es&&We.throwError("use fromString",Me.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Vh(this,r);let i=this.type.match(XV);i?Vh(this,{arrayLength:parseInt(i[2]||"-1"),arrayChildren:t.fromObject({type:i[1],components:this.components}),baseType:"array"}):Vh(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this);}format(e){if(e||(e=Ze.sighash),Ze[e]||We.throwArgumentError("invalid format type","format",e),e===Ze.json){let i={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.components&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==Ze.sighash&&(r+=this.type),r+="("+this.components.map(i=>i.format(e)).join(e===Ze.full?", ":",")+")"):r+=this.type,e!==Ze.sighash&&(this.indexed===!0&&(r+=" indexed"),e===Ze.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?t.fromString(e,r):t.fromObject(e)}static fromObject(e){return t.isParamType(e)?e:new t(Es,{name:e.name||null,type:No(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(t.fromObject):null})}static fromString(e,r){function i(s){return t.fromObject({name:s.name,type:s.type,indexed:s.indexed,components:s.components})}return i(ZV(e,!!r))}static isParamType(e){return !!(e!=null&&e._isParamType)}};function au(t,e){return e$(t).map(r=>yr.fromString(r,e))}var Cs=class t{constructor(e,r){e!==Es&&We.throwError("use a static from method",Me.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Vh(this,r),this._isFragment=!0,Object.freeze(this);}static from(e){return t.isFragment(e)?e:typeof e=="string"?t.fromString(e):t.fromObject(e)}static fromObject(e){if(t.isFragment(e))return e;switch(e.type){case"function":return As.fromObject(e);case"event":return Oo.fromObject(e);case"constructor":return Ts.fromObject(e);case"error":return $h.fromObject(e);case"fallback":case"receive":return null}return We.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Oo.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?As.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Ts.fromString(e.trim()):e.split(" ")[0]==="error"?$h.fromString(e.substring(5).trim()):We.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return !!(e&&e._isFragment)}},Oo=class t extends Cs{format(e){if(e||(e=Ze.sighash),Ze[e]||We.throwArgumentError("invalid format type","format",e),e===Ze.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});let r="";return e!==Ze.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===Ze.full?", ":",")+") ",e!==Ze.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?t.fromString(e):t.fromObject(e)}static fromObject(e){if(t.isEventFragment(e))return e;e.type!=="event"&&We.throwArgumentError("invalid event object","value",e);let r={name:uu(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(yr.fromObject):[],type:"event"};return new t(Es,r)}static fromString(e){let r=e.match(lu);r||We.throwArgumentError("invalid event string","value",e);let i=!1;return r[3].split(" ").forEach(s=>{switch(s.trim()){case"anonymous":i=!0;break;case"":break;default:We.warn("unknown modifier: "+s);}}),t.fromObject({name:r[1].trim(),anonymous:i,inputs:au(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}};function aR(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&We.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||We.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=Pt.from(r[1]),r[0]):t}function uR(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r);}});}function lR(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&We.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&We.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&We.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&We.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&We.throwArgumentError("unable to determine stateMutability","value",t),e}var Ts=class t extends Cs{format(e){if(e||(e=Ze.sighash),Ze[e]||We.throwArgumentError("invalid format type","format",e),e===Ze.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});e===Ze.sighash&&We.throwError("cannot format a constructor for sighash",Me.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(i=>i.format(e)).join(e===Ze.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?t.fromString(e):t.fromObject(e)}static fromObject(e){if(t.isConstructorFragment(e))return e;e.type!=="constructor"&&We.throwArgumentError("invalid constructor object","value",e);let r=lR(e);r.constant&&We.throwArgumentError("constructor cannot be constant","value",e);let i={name:null,type:e.type,inputs:e.inputs?e.inputs.map(yr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Pt.from(e.gas):null};return new t(Es,i)}static fromString(e){let r={type:"constructor"};e=aR(e,r);let i=e.match(lu);return (!i||i[1].trim()!=="constructor")&&We.throwArgumentError("invalid constructor string","value",e),r.inputs=au(i[2].trim(),!1),uR(i[3].trim(),r),t.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}},As=class t extends Ts{format(e){if(e||(e=Ze.sighash),Ze[e]||We.throwArgumentError("invalid format type","format",e),e===Ze.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e))),outputs:this.outputs.map(i=>JSON.parse(i.format(e)))});let r="";return e!==Ze.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===Ze.full?", ":",")+") ",e!==Ze.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(i=>i.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?t.fromString(e):t.fromObject(e)}static fromObject(e){if(t.isFunctionFragment(e))return e;e.type!=="function"&&We.throwArgumentError("invalid function object","value",e);let r=lR(e),i={type:e.type,name:uu(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(yr.fromObject):[],outputs:e.outputs?e.outputs.map(yr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Pt.from(e.gas):null};return new t(Es,i)}static fromString(e){let r={type:"function"};e=aR(e,r);let i=e.split(" returns ");i.length>2&&We.throwArgumentError("invalid function string","value",e);let s=i[0].match(lu);if(s||We.throwArgumentError("invalid function signature","value",e),r.name=s[1].trim(),r.name&&uu(r.name),r.inputs=au(s[2],!1),uR(s[3].trim(),r),i.length>1){let n=i[1].match(lu);(n[1].trim()!=""||n[3].trim()!="")&&We.throwArgumentError("unexpected tokens","value",e),r.outputs=au(n[2],!1);}else r.outputs=[];return t.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}};function oR(t){let e=t.format();return (e==="Error(string)"||e==="Panic(uint256)")&&We.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}var $h=class t extends Cs{format(e){if(e||(e=Ze.sighash),Ze[e]||We.throwArgumentError("invalid format type","format",e),e===Ze.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});let r="";return e!==Ze.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===Ze.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?t.fromString(e):t.fromObject(e)}static fromObject(e){if(t.isErrorFragment(e))return e;e.type!=="error"&&We.throwArgumentError("invalid error object","value",e);let r={type:e.type,name:uu(e.name),inputs:e.inputs?e.inputs.map(yr.fromObject):[]};return oR(new t(Es,r))}static fromString(e){let r={type:"error"},i=e.match(lu);return i||We.throwArgumentError("invalid error signature","value",e),r.name=i[1].trim(),r.name&&uu(r.name),r.inputs=au(i[2],!1),oR(t.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}};function No(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}var QV=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function uu(t){return (!t||!t.match(QV))&&We.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}var lu=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function e$(t){t=t.trim();let e=[],r="",i=0;for(let s=0;s<t.length;s++){let n=t[s];n===","&&i===0?(e.push(r),r=""):(r+=n,n==="("?i++:n===")"&&(i--,i===-1&&We.throwArgumentError("unbalanced parenthesis","value",t)));}return r&&e.push(r),e}var c_=new Me(ci);var Vt=class{constructor(e,r,i,s){this.name=e,this.type=r,this.localName=i,this.dynamic=s;}_throwError(e,r){c_.throwArgumentError(e,this.localName,r);}},ws=class{constructor(e){jt(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e);}get data(){return ZS(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Ii(e._data))}writeBytes(e){let r=Bt(e),i=r.length%this.wordSize;return i&&(r=Ii([r,this._padding.slice(i)])),this._writeData(r)}_getValue(e){let r=Bt(Pt.from(e));return r.length>this.wordSize&&c_.throwError("value out-of-bounds",Me.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Ii([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){let e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r);}}},zh=class t{constructor(e,r,i,s){jt(this,"_data",Bt(e)),jt(this,"wordSize",r||32),jt(this,"_coerceFunc",i),jt(this,"allowLoose",s),this._offset=0;}get data(){return Nt(this._data)}get consumed(){return this._offset}static coerce(e,r){let i=e.match("^u?int([0-9]+)$");return i&&parseInt(i[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):t.coerce(e,r)}_peekBytes(e,r,i){let s=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+s>this._data.length&&(this.allowLoose&&i&&this._offset+r<=this._data.length?s=r:c_.throwError("data out-of-bounds",Me.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+s})),this._data.slice(this._offset,this._offset+s)}subReader(e){return new t(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let i=this._peekBytes(0,e,!!r);return this._offset+=i.length,i.slice(0,e)}readValue(){return Pt.from(this.readBytes(this.wordSize))}};var hR=Gt(cR());function Ds(t){return "0x"+hR.default.keccak_256(Bt(t))}var fR="address/5.7.0";var cu=new Me(fR);function dR(t){gr(t,20)||cu.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let s=0;s<40;s++)r[s]=e[s].charCodeAt(0);let i=Bt(Ds(r));for(let s=0;s<40;s+=2)i[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(i[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return "0x"+e.join("")}var t$=9007199254740991;function r$(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}var h_={};for(let t=0;t<10;t++)h_[String(t)]=String(t);for(let t=0;t<26;t++)h_[String.fromCharCode(65+t)]=String(10+t);var pR=Math.floor(r$(t$));function i$(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(i=>h_[i]).join("");for(;e.length>=pR;){let i=e.substring(0,pR);e=parseInt(i,10)%97+e.substring(i.length);}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function hu(t){let e=null;if(typeof t!="string"&&cu.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=dR(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&cu.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==i$(t)&&cu.throwArgumentError("bad icap checksum","address",t),e=u_(t.substring(4));e.length<40;)e="0"+e;e=dR("0x"+e);}else cu.throwArgumentError("invalid address","address",t);return e}var Gh=class extends Vt{constructor(e){super("address","address",e,!1);}defaultValue(){return "0x0000000000000000000000000000000000000000"}encode(e,r){try{r=hu(r);}catch(i){this._throwError(i.message,r);}return e.writeValue(r)}decode(e){return hu(qh(e.readValue().toHexString(),20))}};var Wh=class extends Vt{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e;}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}};var Fo=new Me(ci);function f_(t,e,r){let i=null;if(Array.isArray(r))i=r;else if(r&&typeof r=="object"){let u={};i=e.map(l=>{let h=l.localName;return h||Fo.throwError("cannot encode object for signature with missing names",Me.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),u[h]&&Fo.throwError("cannot encode object for signature with duplicate names",Me.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),u[h]=!0,r[h]});}else Fo.throwArgumentError("invalid tuple value","tuple",r);e.length!==i.length&&Fo.throwArgumentError("types/value length mismatch","tuple",r);let s=new ws(t.wordSize),n=new ws(t.wordSize),o=[];e.forEach((u,l)=>{let h=i[l];if(u.dynamic){let c=n.length;u.encode(n,h);let d=s.writeUpdatableValue();o.push(f=>{d(f+c);});}else u.encode(s,h);}),o.forEach(u=>{u(s.length);});let a=t.appendWriter(s);return a+=t.appendWriter(n),a}function d_(t,e){let r=[],i=t.subReader(0);e.forEach(n=>{let o=null;if(n.dynamic){let a=t.readValue(),u=i.subReader(a.toNumber());try{o=n.decode(u);}catch(l){if(l.code===Me.errors.BUFFER_OVERRUN)throw l;o=l,o.baseType=n.name,o.name=n.localName,o.type=n.type;}}else try{o=n.decode(t);}catch(a){if(a.code===Me.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=n.name,o.name=n.localName,o.type=n.type;}o!=null&&r.push(o);});let s=e.reduce((n,o)=>{let a=o.localName;return a&&(n[a]||(n[a]=0),n[a]++),n},{});e.forEach((n,o)=>{let a=n.localName;if(!a||s[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;let u=r[o];u instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw u}}):r[a]=u;});for(let n=0;n<r.length;n++){let o=r[n];o instanceof Error&&Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}});}return Object.freeze(r)}var Yh=class extends Vt{constructor(e,r,i){let s=e.type+"["+(r>=0?r:"")+"]",n=r===-1||e.dynamic;super("array",s,i,n),this.coder=e,this.length=r;}defaultValue(){let e=this.coder.defaultValue(),r=[];for(let i=0;i<this.length;i++)r.push(e);return r}encode(e,r){Array.isArray(r)||this._throwError("expected array value",r);let i=this.length;i===-1&&(i=r.length,e.writeValue(r.length)),Fo.checkArgumentCount(r.length,i,"coder array"+(this.localName?" "+this.localName:""));let s=[];for(let n=0;n<r.length;n++)s.push(this.coder);return f_(e,s,r)}decode(e){let r=this.length;r===-1&&(r=e.readValue().toNumber(),r*32>e._data.length&&Fo.throwError("insufficient data length",Me.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let i=[];for(let s=0;s<r;s++)i.push(new Wh(this.coder));return e.coerce(this.name,d_(e,i))}};var Jh=class extends Vt{constructor(e){super("bool","bool",e,!1);}defaultValue(){return !1}encode(e,r){return e.writeValue(r?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}};var fu=class extends Vt{constructor(e,r){super(e,e,r,!0);}defaultValue(){return "0x"}encode(e,r){r=Bt(r);let i=e.writeValue(r.length);return i+=e.writeBytes(r),i}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}},Zh=class extends fu{constructor(e){super("bytes",e);}decode(e){return e.coerce(this.name,Nt(super.decode(e)))}};var Xh=class extends Vt{constructor(e,r){let i="bytes"+String(e);super(i,i,r,!1),this.size=e;}defaultValue(){return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,r){let i=Bt(r);return i.length!==this.size&&this._throwError("incorrect data length",r),e.writeBytes(i)}decode(e){return e.coerce(this.name,Nt(e.readBytes(this.size)))}};var Qh=class extends Vt{constructor(e){super("null","",e,!1);}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}};var p_=Pt.from(-1),m_=Pt.from(0),g_=Pt.from(1);var __=Pt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var ef=class extends Vt{constructor(e,r,i){let s=(r?"int":"uint")+e*8;super(s,s,i,!1),this.size=e,this.signed=r;}defaultValue(){return 0}encode(e,r){let i=Pt.from(r),s=__.mask(e.wordSize*8);if(this.signed){let n=s.mask(this.size*8-1);(i.gt(n)||i.lt(n.add(g_).mul(p_)))&&this._throwError("value out-of-bounds",r);}else (i.lt(m_)||i.gt(s.mask(this.size*8)))&&this._throwError("value out-of-bounds",r);return i=i.toTwos(this.size*8).mask(this.size*8),this.signed&&(i=i.fromTwos(this.size*8).toTwos(8*e.wordSize)),e.writeValue(i)}decode(e){let r=e.readValue().mask(this.size*8);return this.signed&&(r=r.fromTwos(this.size*8)),e.coerce(this.name,r)}};var mR="strings/5.7.0";var gR=new Me(mR),du;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD";})(du||(du={}));var vr;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation";})(vr||(vr={}));function n$(t,e,r,i,s){return gR.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function _R(t,e,r,i,s){if(t===vr.BAD_PREFIX||t===vr.UNEXPECTED_CONTINUE){let n=0;for(let o=e+1;o<r.length&&r[o]>>6===2;o++)n++;return n}return t===vr.OVERRUN?r.length-e-1:0}function s$(t,e,r,i,s){return t===vr.OVERLONG?(i.push(s),0):(i.push(65533),_R(t,e,r))}var yR=Object.freeze({error:n$,ignore:_R,replace:s$});function o$(t,e){e==null&&(e=yR.error),t=Bt(t);let r=[],i=0;for(;i<t.length;){let s=t[i++];if(!(s>>7)){r.push(s);continue}let n=null,o=null;if((s&224)===192)n=1,o=127;else if((s&240)===224)n=2,o=2047;else if((s&248)===240)n=3,o=65535;else {(s&192)===128?i+=e(vr.UNEXPECTED_CONTINUE,i-1,t,r):i+=e(vr.BAD_PREFIX,i-1,t,r);continue}if(i-1+n>=t.length){i+=e(vr.OVERRUN,i-1,t,r);continue}let a=s&(1<<8-n-1)-1;for(let u=0;u<n;u++){let l=t[i];if((l&192)!=128){i+=e(vr.MISSING_CONTINUE,i,t,r),a=null;break}a=a<<6|l&63,i++;}if(a!==null){if(a>1114111){i+=e(vr.OUT_OF_RANGE,i-1-n,t,r,a);continue}if(a>=55296&&a<=57343){i+=e(vr.UTF16_SURROGATE,i-1-n,t,r,a);continue}if(a<=o){i+=e(vr.OVERLONG,i-1-n,t,r,a);continue}r.push(a);}}return r}function pu(t,e=du.current){e!=du.current&&(gR.checkNormalize(),t=t.normalize(e));let r=[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);if(s<128)r.push(s);else if(s<2048)r.push(s>>6|192),r.push(s&63|128);else if((s&64512)==55296){i++;let n=t.charCodeAt(i);if(i>=t.length||(n&64512)!==56320)throw new Error("invalid utf-8 string");let o=65536+((s&1023)<<10)+(n&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);}else r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);}return Bt(r)}function a$(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function y_(t,e){return a$(o$(t,e))}var tf=class extends fu{constructor(e){super("string",e);}defaultValue(){return ""}encode(e,r){return super.encode(e,pu(r))}decode(e){return y_(super.decode(e))}};var Ss=class extends Vt{constructor(e,r){let i=!1,s=[];e.forEach(o=>{o.dynamic&&(i=!0),s.push(o.type);});let n="tuple("+s.join(",")+")";super("tuple",n,r,i),this.coders=e;}defaultValue(){let e=[];this.coders.forEach(i=>{e.push(i.defaultValue());});let r=this.coders.reduce((i,s)=>{let n=s.localName;return n&&(i[n]||(i[n]=0),i[n]++),i},{});return this.coders.forEach((i,s)=>{let n=i.localName;!n||r[n]!==1||(n==="length"&&(n="_length"),e[n]==null&&(e[n]=e[s]));}),Object.freeze(e)}encode(e,r){return f_(e,this.coders,r)}decode(e){return e.coerce(this.name,d_(e,this.coders))}};var rf=new Me(ci),u$=new RegExp(/^bytes([0-9]*)$/),l$=new RegExp(/^(u?int)([0-9]*)$/),v_=class{constructor(e){jt(this,"coerceFunc",e||null);}_getCoder(e){switch(e.baseType){case"address":return new Gh(e.name);case"bool":return new Jh(e.name);case"string":return new tf(e.name);case"bytes":return new Zh(e.name);case"array":return new Yh(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Ss((e.components||[]).map(i=>this._getCoder(i)),e.name);case"":return new Qh(e.name)}let r=e.type.match(l$);if(r){let i=parseInt(r[2]||"256");return (i===0||i>256||i%8!==0)&&rf.throwArgumentError("invalid "+r[1]+" bit length","param",e),new ef(i/8,r[1]==="int",e.name)}if(r=e.type.match(u$),r){let i=parseInt(r[1]);return (i===0||i>32)&&rf.throwArgumentError("invalid bytes length","param",e),new Xh(i,e.name)}return rf.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new zh(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new ws(this._getWordSize())}getDefaultValue(e){let r=e.map(s=>this._getCoder(yr.from(s)));return new Ss(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&rf.throwError("types/values length mismatch",Me.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});let i=e.map(o=>this._getCoder(yr.from(o))),s=new Ss(i,"_"),n=this._getWriter();return s.encode(n,r),n.data}decode(e,r,i){let s=e.map(o=>this._getCoder(yr.from(o)));return new Ss(s,"_").decode(this._getReader(Bt(r),i))}},vR=new v_;function Lo(t){return Ds(pu(t))}var It=new Me(ci);var nf=class extends bs{},sf=class extends bs{},x_=class extends bs{},mu=class extends bs{static isIndexed(e){return !!(e&&e._isIndexed)}},c$={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function xR(t,e){let r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}var gu=class{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,jt(this,"fragments",r.map(i=>Cs.from(i)).filter(i=>i!=null)),jt(this,"_abiCoder",ou(new.target,"getAbiCoder")()),jt(this,"functions",{}),jt(this,"errors",{}),jt(this,"events",{}),jt(this,"structs",{}),this.fragments.forEach(i=>{let s=null;switch(i.type){case"constructor":if(this.deploy){It.warn("duplicate definition - constructor");return}jt(this,"deploy",i);return;case"function":s=this.functions;break;case"event":s=this.events;break;case"error":s=this.errors;break;default:return}let n=i.format();if(s[n]){It.warn("duplicate definition - "+n);return}s[n]=i;}),this.deploy||jt(this,"deploy",Ts.from({payable:!1,type:"constructor"})),jt(this,"_isInterface",!0);}format(e){e||(e=Ze.full),e===Ze.sighash&&It.throwArgumentError("interface does not support formatting sighash","format",e);let r=this.fragments.map(i=>i.format(e));return e===Ze.json?JSON.stringify(r.map(i=>JSON.parse(i))):r}static getAbiCoder(){return vR}static getAddress(e){return hu(e)}static getSighash(e){return o_(Lo(e.format()),0,4)}static getEventTopic(e){return Lo(e.format())}getFunction(e){if(gr(e)){for(let i in this.functions)if(e===this.getSighash(i))return this.functions[i];It.throwArgumentError("no matching function","sighash",e);}if(e.indexOf("(")===-1){let i=e.trim(),s=Object.keys(this.functions).filter(n=>n.split("(")[0]===i);return s.length===0?It.throwArgumentError("no matching function","name",i):s.length>1&&It.throwArgumentError("multiple matching functions","name",i),this.functions[s[0]]}let r=this.functions[As.fromString(e).format()];return r||It.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(gr(e)){let i=e.toLowerCase();for(let s in this.events)if(i===this.getEventTopic(s))return this.events[s];It.throwArgumentError("no matching event","topichash",i);}if(e.indexOf("(")===-1){let i=e.trim(),s=Object.keys(this.events).filter(n=>n.split("(")[0]===i);return s.length===0?It.throwArgumentError("no matching event","name",i):s.length>1&&It.throwArgumentError("multiple matching events","name",i),this.events[s[0]]}let r=this.events[Oo.fromString(e).format()];return r||It.throwArgumentError("no matching event","signature",e),r}getError(e){if(gr(e)){let i=ou(this.constructor,"getSighash");for(let s in this.errors){let n=this.errors[s];if(e===i(n))return this.errors[s]}It.throwArgumentError("no matching error","sighash",e);}if(e.indexOf("(")===-1){let i=e.trim(),s=Object.keys(this.errors).filter(n=>n.split("(")[0]===i);return s.length===0?It.throwArgumentError("no matching error","name",i):s.length>1&&It.throwArgumentError("multiple matching errors","name",i),this.errors[s[0]]}let r=this.errors[As.fromString(e).format()];return r||It.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e);}catch(r){try{e=this.getError(e);}catch(i){throw r}}return ou(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),ou(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));let i=Bt(r);return Nt(i.slice(0,4))!==this.getSighash(e)&&It.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Nt(i)),this._decodeParams(e.inputs,i.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),Nt(Ii([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));let i=Bt(r);return Nt(i.slice(0,4))!==this.getSighash(e)&&It.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Nt(i)),this._decodeParams(e.inputs,i.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Nt(Ii([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let i=Bt(r),s=null,n="",o=null,a=null,u=null;switch(i.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,i)}catch(l){}break;case 4:{let l=Nt(i.slice(0,4)),h=c$[l];if(h)o=this._abiCoder.decode(h.inputs,i.slice(4)),a=h.name,u=h.signature,h.reason&&(s=o[0]),a==="Error"?n=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(n=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{let c=this.getError(l);o=this._abiCoder.decode(c.inputs,i.slice(4)),a=c.name,u=c.format();}catch(c){}break}}return It.throwError("call revert exception"+n,Me.errors.CALL_EXCEPTION,{method:e.format(),data:Nt(r),errorArgs:o,errorName:a,errorSignature:u,reason:s})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Nt(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&It.throwError("too many arguments for "+e.format(),Me.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let i=[];e.anonymous||i.push(this.getEventTopic(e));let s=(n,o)=>n.type==="string"?Lo(o):n.type==="bytes"?Ds(Nt(o)):(n.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),n.type.match(/^u?int/)&&(o=Pt.from(o).toHexString()),n.type==="address"&&this._abiCoder.encode(["address"],[o]),qh(Nt(o),32));for(r.forEach((n,o)=>{let a=e.inputs[o];if(!a.indexed){n!=null&&It.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,n);return}n==null?i.push(null):a.baseType==="array"||a.baseType==="tuple"?It.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,n):Array.isArray(n)?i.push(n.map(u=>s(a,u))):i.push(s(a,n));});i.length&&i[i.length-1]===null;)i.pop();return i}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));let i=[],s=[],n=[];return e.anonymous||i.push(this.getEventTopic(e)),r.length!==e.inputs.length&&It.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{let u=r[a];if(o.indexed)if(o.type==="string")i.push(Lo(u));else if(o.type==="bytes")i.push(Ds(u));else {if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");i.push(this._abiCoder.encode([o.type],[u]));}else s.push(o),n.push(u);}),{data:this._abiCoder.encode(s,n),topics:i}}decodeEventLog(e,r,i){if(typeof e=="string"&&(e=this.getEvent(e)),i!=null&&!e.anonymous){let d=this.getEventTopic(e);(!gr(i[0],32)||i[0].toLowerCase()!==d)&&It.throwError("fragment/topic mismatch",Me.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:i[0]}),i=i.slice(1);}let s=[],n=[],o=[];e.inputs.forEach((d,f)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(s.push(yr.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(s.push(d),o.push(!1)):(n.push(d),o.push(!1));});let a=i!=null?this._abiCoder.decode(s,Ii(i)):null,u=this._abiCoder.decode(n,r,!0),l=[],h=0,c=0;e.inputs.forEach((d,f)=>{if(d.indexed)if(a==null)l[f]=new mu({_isIndexed:!0,hash:null});else if(o[f])l[f]=new mu({_isIndexed:!0,hash:a[c++]});else try{l[f]=a[c++];}catch(m){l[f]=m;}else try{l[f]=u[h++];}catch(m){l[f]=m;}if(d.name&&l[d.name]==null){let m=l[f];m instanceof Error?Object.defineProperty(l,d.name,{enumerable:!0,get:()=>{throw xR(`property ${JSON.stringify(d.name)}`,m)}}):l[d.name]=m;}});for(let d=0;d<l.length;d++){let f=l[d];f instanceof Error&&Object.defineProperty(l,d,{enumerable:!0,get:()=>{throw xR(`index ${d}`,f)}});}return Object.freeze(l)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new sf({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:Pt.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return !r||r.anonymous?null:new nf({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){let r=Nt(e),i=this.getError(r.substring(0,10).toLowerCase());return i?new x_({args:this._abiCoder.decode(i.inputs,"0x"+r.substring(10)),errorFragment:i,name:i.name,signature:i.format(),sighash:this.getSighash(i)}):null}static isInterface(e){return !!(e&&e._isInterface)}};var Mf=Gt(oO()),x1=(t,e)=>e==null||e.length===0?void 0:new gu(t).encodeDeploy(e).slice(2),uO=t=>{try{let e=Mf.parse(t),r;return Mf.visit(e,{FunctionDefinition:s=>{s.isConstructor&&(r=s);}}),aO__default.default(r!=null,"Could not find constructor definition"),[{type:"constructor",inputs:r.parameters.map(({typeName:s},n)=>(aO__default.default(s!=null,`Missing a type definition for constructor parameter at position ${n}`),{type:lO(s)}))}]}catch(e){throw new Error(`Could not get an ABI from contract source: ${e}`)}},lO=t=>{switch(t.type){case"ElementaryTypeName":return t.name;case"ArrayTypeName":return `${lO(t.baseTypeName)}[]`;default:throw new Error(`Only primitive and array types are currently supported when constructing ABI from contract source, got ${t.type}`)}};var b1=t=>{var e;return {deployments:(e=t==null?void 0:t.deployments)!=null?e:NK__default.default.resolve(process.cwd(),"deployments")}},cO=t=>{if(t==null)return ()=>!0;switch(typeof t){case"boolean":return ()=>t;case"string":return e=>e===t;case"function":return t;case"object":if(Array.isArray(t)){let e=new Set(t);return r=>e.has(r)}if(t instanceof RegExp)return e=>t.test(e);throw new TypeError(`Invalid verify configuration: expected string, string[], boolean, function or a RegExp, got ${t}`);default:throw new TypeError(`Invalid verify configuration: expected string, string[], boolean, function or a RegExp, got ${t}`)}};var fO=t=>{try{return fs.lstatSync(t).isDirectory()}catch(e){return !1}},dO=t=>{try{return fs.lstatSync(t).isFile()}catch(e){return !1}};var gO=async(t,e)=>{let r=Sd(e,t.networks),i=b1(t.paths),s=Dd(e),n=yO(e),o=vO(s),a=t.contracts.flatMap(l=>{var Z;let{address:h,network:c,contractName:d,deployment:f}=l;e.info(`Collecting information for contract ${d} on network ${c}`);let m=r[c];if(m==null)return e.info(`No network configured for contract ${d} on network ${c}`),[];let g=`${NK.basename(f,".json")}.json`,v=NK.resolve(i.deployments,c,g);if(!dO(v))return e.error(Zt.error`Deployment file ${v} does not exist or is not a file`),[];let x=ge(v),_=e_.safeParse(x);if(!_.success)return e.error(Zt.error`No network configured for contract ${d} on network ${c}`),[];let E=_.data,b=NK.basename(d,".sol"),w=E.metadata.sources[d];if(w==null)return e.error(Zt.error`Missing source for contract ${d} for network ${c} in ${g}`),[];let D=Nd(w.content),N=l.constructorArguments==null?void 0:typeof l.constructorArguments=="string"?l.constructorArguments:x1(uO(w.content),l.constructorArguments),F=t_(E.metadata),H={apiUrl:m.apiUrl,apiKey:m.apiKey,chainId:m.chainId,address:h,contractName:`${d}:${b}`,constructorArguments:N,licenseType:D,compilerVersion:E.metadata.compiler.version,sourceCode:JSON.stringify(F),evmVersion:E.metadata.settings.evmVersion,optimizerRuns:(Z=E.metadata.settings.optimizer)==null?void 0:Z.runs};return s({Contract:d,Network:c,Address:H.address,License:H.licenseType,Arguments:l.constructorArguments?JSON.stringify(l.constructorArguments):void 0,Sources:Object.keys(E.metadata.sources),"Scan URL":H.apiUrl,"Scan API Key":H.apiKey?wd(H.apiKey):void 0}),[{networkName:c,networkConfig:m,submitProps:H}]});if(a.length===0)return e.warn("No contracts match the verification criteria, exiting"),[];if(t.dryRun)return e.debug("Dry run enabled, exiting"),[];let u=await Promise.all(n(a));return u.forEach(o),u},_O=async(t,e)=>{let r=cO(t.filter),i=Sd(e,t.networks),s=b1(t.paths),n=Dd(e),o=yO(e),a=vO(n);if(!fO(s.deployments))throw new Error(`Path ${s.deployments} is not a directory`);let u=new Set(fs.readdirSync(s.deployments)),l=Object.entries(i);e.debug("Verifying deployments for following networks:"),l.forEach(([d,f])=>{e.debug(` - ${d} (API URL ${f.apiUrl})`);});let h=l.flatMap(([d,f])=>{if(e.info(`Collecting deployments for ${d}...`),!u.has(d))return e.warn(`Could not find deployment for network ${d} in ${s.deployments}`),[];let m=NK.resolve(s.deployments,d);return fs.readdirSync(m).filter(v=>v.endsWith(".json")).flatMap(v=>{e.info(`Inspecting deployment file ${v} on network ${d}`);let x=NK.resolve(m,v),_=ge(x),E=e_.safeParse(_);if(!E.success)throw new Error(`Error parsing deployment file ${v} on network ${d}: ${E.error}`);let b=E.data,w=b.metadata.settings.compilationTarget;return Object.entries(w).flatMap(([D,N])=>{var y;if(!r(N,D,d))return e.debug(`Not verifying ${N} in ${v} on network ${d}`),[];let H=b.metadata.sources[D];if(H==null)return e.error(Zt.error`Could not find source for ${N} (${D})`),[];let Z=Nd(H.content),re=x1(b.abi,b.args),ae=t_(b.metadata),k={apiUrl:f.apiUrl,apiKey:f.apiKey,chainId:f.chainId,address:b.address,contractName:`${D}:${N}`,constructorArguments:re,licenseType:Z,compilerVersion:b.metadata.compiler.version,sourceCode:JSON.stringify(ae),evmVersion:b.metadata.settings.evmVersion,optimizerRuns:(y=b.metadata.settings.optimizer)==null?void 0:y.runs};return n({Contract:N,Network:d,Address:b.address,License:k.licenseType,Arguments:JSON.stringify(b.args),Sources:Object.keys(b.metadata.sources),"Scan URL":k.apiUrl,"Scan API Key":k.apiKey?wd(k.apiKey):void 0}),{submitProps:k,networkName:d,networkConfig:f}})})});if(h.length===0)return e.warn("No contracts match the verification criteria, exiting"),[];if(t.dryRun)return e.debug("Dry run enabled, exiting"),[];let c=await Promise.all(o(h));return c.forEach(a),c},yO=t=>e=>e.map(async(r,i)=>{let{submitProps:s}=r,n=Zt.palette[i%Zt.palette.length],o=`[${i+1}/${e.length}]`,a=Pu.default.bold(s.contractName),u=Pu.default.bold(r.networkName);t.info(n`Verifying contract ${a} for network ${u} ${o}`);try{let l=BS(s,t);l.on("poll",c=>{t.info(n`Polling for verification status of ${a} for network ${u} (GUID ${c}) ${o}`);}),l.on("retry",(c,d)=>{t.verbose(`Received an error: ${c}`),t.info(n`Retrying failed verification attempt of ${a} for network ${u} (attempt ${d+1}) ${o}`);});let h=await l.verify();return {artifact:r,result:h}}catch(l){return t.error(Zt.error`Problem verifying contract ${a} for network ${u} ${o}: ${l} `),{artifact:r,error:l}}}),vO=t=>({artifact:e,response:r,error:i})=>{let s=Pu.default.bold(e.submitProps.contractName),n=Pu.default.bold(e.networkName),o=e.networkConfig.browserUrl?V1(e.networkConfig.browserUrl,e.submitProps.address):void 0;t({Contract:s,Network:n,Result:i==null,"Was verified":r==null?void 0:r.alreadyVerified,"Contract URL":o,Error:i?Zt.error(i):void 0});};var xO="1.2.0";var bO=new $i("-l,--log-level <level>","Log level").choices(["error","warn","info","http","verbose","debug","silly"]).default("info"),EO=new $i("-d,--deployments <path>","Path to the deployments folder"),CO=new $i("--dry-run","Do not verify anything, just output the verifications that would be performed"),TO=new $i("-n,--network <network name>","Network to verify").makeOptionMandatory(),AO=new $i("-u,--api-url <url>","Scan API URL (fully qualified, with protocol and path)"),wO=new $i("-k,--api-key <key>","Scan API Key"),DO=new $i("--chain-id <id>","Chain ID for Etherscan API v2 (automatically set for well-known networks)").argParser(t=>parseInt(t,10)),FK=new Bu("non-target").description("Verifies a contract that does not have its own deployment file, i.e. has not been a target of a deployment").addOption(bO).addOption(CO).addOption(EO).addOption(TO).addOption(AO).addOption(wO).addOption(DO).requiredOption("--address <address>","Contract address to verify").requiredOption("--name <contract name>","Fully qualified contract name to verify, e.g. contracts/MyToken.sol").requiredOption("--deployment <deployment file name>","Deployment file name, e.g. MyOtherToken.json").option("--arguments <constructor arguments>",'JSON encoded array of constructor arguments, e.g. [1234, "0x0"]',t=>{if(t.startsWith("0x"))return t.slice(2);try{let e=JSON.parse(t);if(!Array.isArray(e))throw new Error(`Constructor arguments must be an array, got ${e}`);return e}catch(e){throw new j1(`Malformed constructor arguments specified: ${e}`)}}).action(async t=>{let e=hh(t.logLevel),r={dryRun:t.dryRun,paths:{deployments:t.deployments},networks:{[t.network]:{apiUrl:t.apiUrl,apiKey:t.apiKey,chainId:t.chainId}},contracts:[{network:t.network,address:t.address,contractName:t.name,deployment:t.deployment,constructorArguments:t.arguments}]};try{await gO(r,e);}catch(i){e.error(Zt.error`The verification script exited with an error: ${i}`),process.exit(1);}}),LK=new Bu("target").description("Verifies contracts that have been a part of a deployment, i.e. have their own deployment files").addOption(bO).addOption(CO).addOption(EO).addOption(TO).addOption(AO).addOption(wO).addOption(DO).option("-c,--contracts <contract names>","Comma-separated list of case-sensitive contract names to verify",t=>t!=null&&t.trim()?t.split(",").map(e=>e.trim()):void 0).action(async t=>{let e=hh(t.logLevel),r={dryRun:t.dryRun,paths:{deployments:t.deployments},networks:{[t.network]:{apiUrl:t.apiUrl,apiKey:t.apiKey,chainId:t.chainId}},filter:t.contracts};try{await _O(r,e);}catch(i){e.error(Zt.error`The verification script exited with an error: ${i}`),process.exit(1);}});new Bu("@layerzerolabs/verify-contract").version(xO).description("Verify a set of contracts based on hardhat-deploy outputs").addCommand(FK).addCommand(LK,{isDefault:!0}).parseAsync();
|
|
481
|
+
${JSON.stringify(i)}`),i.status===1)return {alreadyVerified:!1};if(kS(i.result))return {alreadyVerified:!0};if(qV(i.result)){await ch(1e4);continue}if(MS(i.result)){await ch(1e4);continue}throw new Error(`Verification failed with result "${i.result}", status ${i.status} (${i.message})`)}}},BS=(t,e)=>new Qg(t,e),qV=t=>!!(t!=null&&t.match(/Pending/gi)),kS=t=>!!(t!=null&&t.match(/already verified/gi)),MS=t=>!!(t!=null&&t.match(/rate/)),UV=async(t,e,r,i)=>{let s=new URL(t),n=t.includes("api.etherscan.io/v2");r!==void 0&&n&&s.searchParams.set("chainid",String(r)),i&&s.searchParams.set("apikey",i);let o=await Xg(s.toString(),{method:"POST",form:e}).json();return jS.parse(o)},HV=async(t,e,r,i)=>{let s=new URL(t);s.searchParams.set("module","contract"),s.searchParams.set("action","checkverifystatus"),s.searchParams.set("guid",e);let n=t.includes("api.etherscan.io/v2");r!==void 0&&n&&s.searchParams.set("chainid",String(r)),i&&s.searchParams.set("apikey",i);try{let o=await Xg(s).json();return jS.parse(o)}catch(o){throw new Error(`Failed to check verification status: ${o}`)}},VV=({apiKey:t,address:e,contractName:r,constructorArguments:i,compilerVersion:s,optimizerRuns:n=0,sourceCode:o,evmVersion:a,licenseType:u})=>{let l={action:"verifysourcecode",module:"contract",codeformat:"solidity-standard-json-input",contractaddress:e,contractname:r,compilerversion:`v${s}`,optimizationUsed:n>0?"1":"0",sourceCode:o};return t!=null&&(l.apikey=t),n!=null&&(l.runs=String(n)),i!=null&&(l.constructorArguements=i),a!=null&&(l.evmversion=a),u!=null&&(l.licenseType=String(u)),l},jS=ke.object({status:ke.coerce.number().nullish(),message:ke.string().nullish(),result:ke.string().nullish()});var Pu=Gt(Go());ke.object({enabled:ke.boolean().optional(),runs:ke.number().optional()});ke.record(ke.string(),ke.object({content:ke.string()}));var $V=ke.array(ke.record(ke.string(),ke.any())),zV=ke.object({language:ke.string(),compiler:ke.object({version:ke.string()}),settings:ke.object({compilationTarget:ke.record(ke.string(),ke.string()),evmVersion:ke.string(),optimizer:ke.object({enabled:ke.boolean().optional(),runs:ke.number().optional()})}),sources:ke.record(ke.string(),ke.object({content:ke.string()}))}),e_=ke.object({address:ke.string(),abi:$V,args:ke.array(ke.any()),solcInputHash:ke.string(),metadata:ke.string().transform((t,e)=>{try{return JSON.parse(t)}catch(r){return e.addIssue({code:"custom",message:"Invalid JSON"}),ke.NEVER}}).pipe(zV),bytecode:ke.string(),deployedBytecode:ke.string()});var t_=t=>{let{compilationTarget:e,...r}=t.settings,i=Object.entries(t.sources).reduce((s,[n,o])=>({...s,[n]:{content:o.content}}),{});return {language:t.language,settings:r,sources:i}};var tR=Gt(US());var HS="logger/5.7.0";var VS=!1,$S=!1,Bh={debug:1,default:2,info:2,warning:3,error:4,off:5},zS=Bh.default,i_=null;function KV(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch(r){t.push(e);}}),t.length)throw new Error("missing "+t.join(", "));if("\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken implementation")}catch(t){return t.message}return null}var KS=KV(),n_;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF";})(n_||(n_={}));var Gr;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED";})(Gr||(Gr={}));var GS="0123456789abcdef",Me=class t{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1});}_log(e,r){let i=e.toLowerCase();Bh[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(zS>Bh[i])&&console.log.apply(console,r);}debug(...e){this._log(t.levels.DEBUG,e);}info(...e){this._log(t.levels.INFO,e);}warn(...e){this._log(t.levels.WARNING,e);}makeError(e,r,i){if($S)return this.makeError("censored error",r,{});r||(r=t.errors.UNKNOWN_ERROR),i||(i={});let s=[];Object.keys(i).forEach(u=>{let l=i[u];try{if(l instanceof Uint8Array){let h="";for(let c=0;c<l.length;c++)h+=GS[l[c]>>4],h+=GS[l[c]&15];s.push(u+"=Uint8Array(0x"+h+")");}else s.push(u+"="+JSON.stringify(l));}catch(h){s.push(u+"="+JSON.stringify(i[u].toString()));}}),s.push(`code=${r}`),s.push(`version=${this.version}`);let n=e,o="";switch(r){case Gr.NUMERIC_FAULT:{o="NUMERIC_FAULT";let u=e;switch(u){case"overflow":case"underflow":case"division-by-zero":o+="-"+u;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Gr.CALL_EXCEPTION:case Gr.INSUFFICIENT_FUNDS:case Gr.MISSING_NEW:case Gr.NONCE_EXPIRED:case Gr.REPLACEMENT_UNDERPRICED:case Gr.TRANSACTION_REPLACED:case Gr.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),s.length&&(e+=" ("+s.join(", ")+")");let a=new Error(e);return a.reason=n,a.code=r,Object.keys(i).forEach(function(u){a[u]=i[u];}),a}throwError(e,r,i){throw this.makeError(e,r,i)}throwArgumentError(e,r,i){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:i})}assert(e,r,i,s){e||this.throwError(r,i,s);}assertArgument(e,r,i,s){e||this.throwArgumentError(r,i,s);}checkNormalize(e){KS&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:KS});}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}));}checkArgumentCount(e,r,i){i?i=": "+i:i="",e<r&&this.throwError("missing argument"+i,t.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+i,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r});}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name});}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name});}static globalLogger(){return i_||(i_=new t(HS)),i_}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),VS){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"});}$S=!!e,VS=!!r;}static setLogLevel(e){let r=Bh[e.toLowerCase()];if(r==null){t.globalLogger().warn("invalid log level - "+e);return}zS=r;}static from(e){return new t(e)}};Me.errors=Gr;Me.levels=n_;var WS="bytes/5.7.0";var Pi=new Me(WS);function JS(t){return !!t.toHexString}function nu(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return nu(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function YS(t){return typeof t=="number"&&t==t&&t%1===0}function jh(t){if(t==null)return !1;if(t.constructor===Uint8Array)return !0;if(typeof t=="string"||!YS(t.length)||t.length<0)return !1;for(let e=0;e<t.length;e++){let r=t[e];if(!YS(r)||r<0||r>=256)return !1}return !0}function Bt(t,e){if(e||(e={}),typeof t=="number"){Pi.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),nu(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),JS(t)&&(t=t.toHexString()),gr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Pi.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let s=0;s<r.length;s+=2)i.push(parseInt(r.substring(s,s+2),16));return nu(new Uint8Array(i))}return jh(t)?nu(new Uint8Array(t)):Pi.throwArgumentError("invalid arrayify value","value",t)}function Ii(t){let e=t.map(s=>Bt(s)),r=e.reduce((s,n)=>s+n.length,0),i=new Uint8Array(r);return e.reduce((s,n)=>(i.set(n,s),s+n.length),0),nu(i)}function gr(t,e){return !(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}var s_="0123456789abcdef";function Nt(t,e){if(e||(e={}),typeof t=="number"){Pi.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=s_[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),JS(t))return t.toHexString();if(gr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Pi.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(jh(t)){let r="0x";for(let i=0;i<t.length;i++){let s=t[i];r+=s_[(s&240)>>4]+s_[s&15];}return r}return Pi.throwArgumentError("invalid hexlify value","value",t)}function o_(t,e,r){return typeof t!="string"?t=Nt(t):(!gr(t)||t.length%2)&&Pi.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function ZS(t){let e="0x";return t.forEach(r=>{e+=Nt(r).substring(2);}),e}function qh(t,e){for(typeof t!="string"?t=Nt(t):gr(t)||Pi.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&Pi.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}var XS="bignumber/5.7.0";var Uh=tR.default.BN,ki=new Me(XS),a_={},QS=9007199254740991;var eR=!1,Pt=class t{constructor(e,r){e!==a_&&ki.throwError("cannot call constructor directly; use BigNumber.from",Me.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this);}fromTwos(e){return _r(Ge(this).fromTwos(e))}toTwos(e){return _r(Ge(this).toTwos(e))}abs(){return this._hex[0]==="-"?t.from(this._hex.substring(1)):this}add(e){return _r(Ge(this).add(Ge(e)))}sub(e){return _r(Ge(this).sub(Ge(e)))}div(e){return t.from(e).isZero()&&Br("division-by-zero","div"),_r(Ge(this).div(Ge(e)))}mul(e){return _r(Ge(this).mul(Ge(e)))}mod(e){let r=Ge(e);return r.isNeg()&&Br("division-by-zero","mod"),_r(Ge(this).umod(r))}pow(e){let r=Ge(e);return r.isNeg()&&Br("negative-power","pow"),_r(Ge(this).pow(r))}and(e){let r=Ge(e);return (this.isNegative()||r.isNeg())&&Br("unbound-bitwise-result","and"),_r(Ge(this).and(r))}or(e){let r=Ge(e);return (this.isNegative()||r.isNeg())&&Br("unbound-bitwise-result","or"),_r(Ge(this).or(r))}xor(e){let r=Ge(e);return (this.isNegative()||r.isNeg())&&Br("unbound-bitwise-result","xor"),_r(Ge(this).xor(r))}mask(e){return (this.isNegative()||e<0)&&Br("negative-width","mask"),_r(Ge(this).maskn(e))}shl(e){return (this.isNegative()||e<0)&&Br("negative-width","shl"),_r(Ge(this).shln(e))}shr(e){return (this.isNegative()||e<0)&&Br("negative-width","shr"),_r(Ge(this).shrn(e))}eq(e){return Ge(this).eq(Ge(e))}lt(e){return Ge(this).lt(Ge(e))}lte(e){return Ge(this).lte(Ge(e))}gt(e){return Ge(this).gt(Ge(e))}gte(e){return Ge(this).gte(Ge(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Ge(this).isZero()}toNumber(){try{return Ge(this).toNumber()}catch(e){Br("overflow","toNumber",this.toString());}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return ki.throwError("this platform does not support BigInt",Me.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?eR||(eR=!0,ki.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?ki.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Me.errors.UNEXPECTED_ARGUMENT,{}):ki.throwError("BigNumber.toString does not accept parameters",Me.errors.UNEXPECTED_ARGUMENT,{})),Ge(this).toString(10)}toHexString(){return this._hex}toJSON(e){return {type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof t)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new t(a_,su(e)):e.match(/^-?[0-9]+$/)?new t(a_,su(new Uh(e))):ki.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Br("underflow","BigNumber.from",e),(e>=QS||e<=-QS)&&Br("overflow","BigNumber.from",e),t.from(String(e));let r=e;if(typeof r=="bigint")return t.from(r.toString());if(jh(r))return t.from(Nt(r));if(r)if(r.toHexString){let i=r.toHexString();if(typeof i=="string")return t.from(i)}else {let i=r._hex;if(i==null&&r.type==="BigNumber"&&(i=r.hex),typeof i=="string"&&(gr(i)||i[0]==="-"&&gr(i.substring(1))))return t.from(i)}return ki.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return !!(e&&e._isBigNumber)}};function su(t){if(typeof t!="string")return su(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&ki.throwArgumentError("invalid hex","value",t),t=su(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return "0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function _r(t){return Pt.from(su(t))}function Ge(t){let e=Pt.from(t).toHexString();return e[0]==="-"?new Uh("-"+e.substring(3),16):new Uh(e.substring(2),16)}function Br(t,e,r){let i={fault:t,operation:e};return r!=null&&(i.value=r),ki.throwError(t,Me.errors.NUMERIC_FAULT,i)}function u_(t){return new Uh(t,36).toString(16)}var rR="properties/5.7.0";var iR=new Me(rR);function jt(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1});}function ou(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor;}return null}var WV={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function nR(t){if(t==null||WV[typeof t])return !0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return !1;let e=Object.keys(t);for(let r=0;r<e.length;r++){let i=null;try{i=t[e[r]];}catch(s){continue}if(!nR(i))return !1}return !0}return iR.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function YV(t){if(nR(t))return t;if(Array.isArray(t))return Object.freeze(t.map(e=>l_(e)));if(typeof t=="object"){let e={};for(let r in t){let i=t[r];i!==void 0&&jt(e,r,l_(i));}return e}return iR.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function l_(t){return YV(t)}var bs=class{constructor(e){for(let r in e)this[r]=l_(e[r]);}};var ci="abi/5.7.0";var We=new Me(ci),Es={},sR={calldata:!0,memory:!0,storage:!0},JV={calldata:!0,memory:!0};function Hh(t,e){if(t==="bytes"||t==="string"){if(sR[e])return !0}else if(t==="address"){if(e==="payable")return !0}else if((t.indexOf("[")>=0||t==="tuple")&&JV[e])return !0;return (sR[e]||e==="payable")&&We.throwArgumentError("invalid modifier","name",e),!1}function ZV(t,e){let r=t;function i(a){We.throwArgumentError(`unexpected character at position ${a}`,"param",t);}t=t.replace(/\s/g," ");function s(a){let u={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(u.indexed=!1),u}let n={type:"",name:"",state:{allowType:!0}},o=n;for(let a=0;a<t.length;a++){let u=t[a];switch(u){case"(":o.state.allowType&&o.type===""?o.type="tuple":o.state.allowParams||i(a),o.state.allowType=!1,o.type=No(o.type),o.components=[s(o)],o=o.components[0];break;case")":delete o.state,o.name==="indexed"&&(e||i(a),o.indexed=!0,o.name=""),Hh(o.type,o.name)&&(o.name=""),o.type=No(o.type);let l=o;o=o.parent,o||i(a),delete l.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,o.name==="indexed"&&(e||i(a),o.indexed=!0,o.name=""),Hh(o.type,o.name)&&(o.name=""),o.type=No(o.type);let h=s(o.parent);o.parent.components.push(h),delete o.parent,o=h;break;case" ":o.state.allowType&&o.type!==""&&(o.type=No(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&o.name!==""&&(o.name==="indexed"?(e||i(a),o.indexed&&i(a),o.indexed=!0,o.name=""):Hh(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||i(a),o.type+=u,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||i(a),o.type+=u,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=u,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=u,delete o.state.allowArray):o.state.readArray?o.type+=u:i(a);}}return o.parent&&We.throwArgumentError("unexpected eof","param",t),delete n.state,o.name==="indexed"?(e||i(r.length-7),o.indexed&&i(r.length-7),o.indexed=!0,o.name=""):Hh(o.type,o.name)&&(o.name=""),n.type=No(n.type),n}function Vh(t,e){for(let r in e)jt(t,r,e[r]);}var Ze=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),XV=new RegExp(/^(.*)\[([0-9]*)\]$/),yr=class t{constructor(e,r){e!==Es&&We.throwError("use fromString",Me.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Vh(this,r);let i=this.type.match(XV);i?Vh(this,{arrayLength:parseInt(i[2]||"-1"),arrayChildren:t.fromObject({type:i[1],components:this.components}),baseType:"array"}):Vh(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this);}format(e){if(e||(e=Ze.sighash),Ze[e]||We.throwArgumentError("invalid format type","format",e),e===Ze.json){let i={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.components&&(i.components=this.components.map(s=>JSON.parse(s.format(e)))),JSON.stringify(i)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==Ze.sighash&&(r+=this.type),r+="("+this.components.map(i=>i.format(e)).join(e===Ze.full?", ":",")+")"):r+=this.type,e!==Ze.sighash&&(this.indexed===!0&&(r+=" indexed"),e===Ze.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?t.fromString(e,r):t.fromObject(e)}static fromObject(e){return t.isParamType(e)?e:new t(Es,{name:e.name||null,type:No(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(t.fromObject):null})}static fromString(e,r){function i(s){return t.fromObject({name:s.name,type:s.type,indexed:s.indexed,components:s.components})}return i(ZV(e,!!r))}static isParamType(e){return !!(e!=null&&e._isParamType)}};function au(t,e){return e$(t).map(r=>yr.fromString(r,e))}var Cs=class t{constructor(e,r){e!==Es&&We.throwError("use a static from method",Me.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Vh(this,r),this._isFragment=!0,Object.freeze(this);}static from(e){return t.isFragment(e)?e:typeof e=="string"?t.fromString(e):t.fromObject(e)}static fromObject(e){if(t.isFragment(e))return e;switch(e.type){case"function":return As.fromObject(e);case"event":return Oo.fromObject(e);case"constructor":return Ts.fromObject(e);case"error":return $h.fromObject(e);case"fallback":case"receive":return null}return We.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Oo.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?As.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Ts.fromString(e.trim()):e.split(" ")[0]==="error"?$h.fromString(e.substring(5).trim()):We.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return !!(e&&e._isFragment)}},Oo=class t extends Cs{format(e){if(e||(e=Ze.sighash),Ze[e]||We.throwArgumentError("invalid format type","format",e),e===Ze.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});let r="";return e!==Ze.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===Ze.full?", ":",")+") ",e!==Ze.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?t.fromString(e):t.fromObject(e)}static fromObject(e){if(t.isEventFragment(e))return e;e.type!=="event"&&We.throwArgumentError("invalid event object","value",e);let r={name:uu(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(yr.fromObject):[],type:"event"};return new t(Es,r)}static fromString(e){let r=e.match(lu);r||We.throwArgumentError("invalid event string","value",e);let i=!1;return r[3].split(" ").forEach(s=>{switch(s.trim()){case"anonymous":i=!0;break;case"":break;default:We.warn("unknown modifier: "+s);}}),t.fromObject({name:r[1].trim(),anonymous:i,inputs:au(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}};function aR(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&We.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||We.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=Pt.from(r[1]),r[0]):t}function uR(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r);}});}function lR(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&We.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&We.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&We.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&We.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&We.throwArgumentError("unable to determine stateMutability","value",t),e}var Ts=class t extends Cs{format(e){if(e||(e=Ze.sighash),Ze[e]||We.throwArgumentError("invalid format type","format",e),e===Ze.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});e===Ze.sighash&&We.throwError("cannot format a constructor for sighash",Me.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(i=>i.format(e)).join(e===Ze.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?t.fromString(e):t.fromObject(e)}static fromObject(e){if(t.isConstructorFragment(e))return e;e.type!=="constructor"&&We.throwArgumentError("invalid constructor object","value",e);let r=lR(e);r.constant&&We.throwArgumentError("constructor cannot be constant","value",e);let i={name:null,type:e.type,inputs:e.inputs?e.inputs.map(yr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Pt.from(e.gas):null};return new t(Es,i)}static fromString(e){let r={type:"constructor"};e=aR(e,r);let i=e.match(lu);return (!i||i[1].trim()!=="constructor")&&We.throwArgumentError("invalid constructor string","value",e),r.inputs=au(i[2].trim(),!1),uR(i[3].trim(),r),t.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}},As=class t extends Ts{format(e){if(e||(e=Ze.sighash),Ze[e]||We.throwArgumentError("invalid format type","format",e),e===Ze.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(e))),outputs:this.outputs.map(i=>JSON.parse(i.format(e)))});let r="";return e!==Ze.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===Ze.full?", ":",")+") ",e!==Ze.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(i=>i.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?t.fromString(e):t.fromObject(e)}static fromObject(e){if(t.isFunctionFragment(e))return e;e.type!=="function"&&We.throwArgumentError("invalid function object","value",e);let r=lR(e),i={type:e.type,name:uu(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(yr.fromObject):[],outputs:e.outputs?e.outputs.map(yr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Pt.from(e.gas):null};return new t(Es,i)}static fromString(e){let r={type:"function"};e=aR(e,r);let i=e.split(" returns ");i.length>2&&We.throwArgumentError("invalid function string","value",e);let s=i[0].match(lu);if(s||We.throwArgumentError("invalid function signature","value",e),r.name=s[1].trim(),r.name&&uu(r.name),r.inputs=au(s[2],!1),uR(s[3].trim(),r),i.length>1){let n=i[1].match(lu);(n[1].trim()!=""||n[3].trim()!="")&&We.throwArgumentError("unexpected tokens","value",e),r.outputs=au(n[2],!1);}else r.outputs=[];return t.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}};function oR(t){let e=t.format();return (e==="Error(string)"||e==="Panic(uint256)")&&We.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}var $h=class t extends Cs{format(e){if(e||(e=Ze.sighash),Ze[e]||We.throwArgumentError("invalid format type","format",e),e===Ze.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(e)))});let r="";return e!==Ze.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(i=>i.format(e)).join(e===Ze.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?t.fromString(e):t.fromObject(e)}static fromObject(e){if(t.isErrorFragment(e))return e;e.type!=="error"&&We.throwArgumentError("invalid error object","value",e);let r={type:e.type,name:uu(e.name),inputs:e.inputs?e.inputs.map(yr.fromObject):[]};return oR(new t(Es,r))}static fromString(e){let r={type:"error"},i=e.match(lu);return i||We.throwArgumentError("invalid error signature","value",e),r.name=i[1].trim(),r.name&&uu(r.name),r.inputs=au(i[2],!1),oR(t.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}};function No(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}var QV=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function uu(t){return (!t||!t.match(QV))&&We.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}var lu=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function e$(t){t=t.trim();let e=[],r="",i=0;for(let s=0;s<t.length;s++){let n=t[s];n===","&&i===0?(e.push(r),r=""):(r+=n,n==="("?i++:n===")"&&(i--,i===-1&&We.throwArgumentError("unbalanced parenthesis","value",t)));}return r&&e.push(r),e}var c_=new Me(ci);var Vt=class{constructor(e,r,i,s){this.name=e,this.type=r,this.localName=i,this.dynamic=s;}_throwError(e,r){c_.throwArgumentError(e,this.localName,r);}},ws=class{constructor(e){jt(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e);}get data(){return ZS(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Ii(e._data))}writeBytes(e){let r=Bt(e),i=r.length%this.wordSize;return i&&(r=Ii([r,this._padding.slice(i)])),this._writeData(r)}_getValue(e){let r=Bt(Pt.from(e));return r.length>this.wordSize&&c_.throwError("value out-of-bounds",Me.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Ii([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){let e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r);}}},zh=class t{constructor(e,r,i,s){jt(this,"_data",Bt(e)),jt(this,"wordSize",r||32),jt(this,"_coerceFunc",i),jt(this,"allowLoose",s),this._offset=0;}get data(){return Nt(this._data)}get consumed(){return this._offset}static coerce(e,r){let i=e.match("^u?int([0-9]+)$");return i&&parseInt(i[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):t.coerce(e,r)}_peekBytes(e,r,i){let s=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+s>this._data.length&&(this.allowLoose&&i&&this._offset+r<=this._data.length?s=r:c_.throwError("data out-of-bounds",Me.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+s})),this._data.slice(this._offset,this._offset+s)}subReader(e){return new t(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let i=this._peekBytes(0,e,!!r);return this._offset+=i.length,i.slice(0,e)}readValue(){return Pt.from(this.readBytes(this.wordSize))}};var hR=Gt(cR());function Ds(t){return "0x"+hR.default.keccak_256(Bt(t))}var fR="address/5.7.0";var cu=new Me(fR);function dR(t){gr(t,20)||cu.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let s=0;s<40;s++)r[s]=e[s].charCodeAt(0);let i=Bt(Ds(r));for(let s=0;s<40;s+=2)i[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(i[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return "0x"+e.join("")}var t$=9007199254740991;function r$(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}var h_={};for(let t=0;t<10;t++)h_[String(t)]=String(t);for(let t=0;t<26;t++)h_[String.fromCharCode(65+t)]=String(10+t);var pR=Math.floor(r$(t$));function i$(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(i=>h_[i]).join("");for(;e.length>=pR;){let i=e.substring(0,pR);e=parseInt(i,10)%97+e.substring(i.length);}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function hu(t){let e=null;if(typeof t!="string"&&cu.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=dR(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&cu.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==i$(t)&&cu.throwArgumentError("bad icap checksum","address",t),e=u_(t.substring(4));e.length<40;)e="0"+e;e=dR("0x"+e);}else cu.throwArgumentError("invalid address","address",t);return e}var Gh=class extends Vt{constructor(e){super("address","address",e,!1);}defaultValue(){return "0x0000000000000000000000000000000000000000"}encode(e,r){try{r=hu(r);}catch(i){this._throwError(i.message,r);}return e.writeValue(r)}decode(e){return hu(qh(e.readValue().toHexString(),20))}};var Wh=class extends Vt{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e;}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}};var Fo=new Me(ci);function f_(t,e,r){let i=null;if(Array.isArray(r))i=r;else if(r&&typeof r=="object"){let u={};i=e.map(l=>{let h=l.localName;return h||Fo.throwError("cannot encode object for signature with missing names",Me.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),u[h]&&Fo.throwError("cannot encode object for signature with duplicate names",Me.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),u[h]=!0,r[h]});}else Fo.throwArgumentError("invalid tuple value","tuple",r);e.length!==i.length&&Fo.throwArgumentError("types/value length mismatch","tuple",r);let s=new ws(t.wordSize),n=new ws(t.wordSize),o=[];e.forEach((u,l)=>{let h=i[l];if(u.dynamic){let c=n.length;u.encode(n,h);let d=s.writeUpdatableValue();o.push(f=>{d(f+c);});}else u.encode(s,h);}),o.forEach(u=>{u(s.length);});let a=t.appendWriter(s);return a+=t.appendWriter(n),a}function d_(t,e){let r=[],i=t.subReader(0);e.forEach(n=>{let o=null;if(n.dynamic){let a=t.readValue(),u=i.subReader(a.toNumber());try{o=n.decode(u);}catch(l){if(l.code===Me.errors.BUFFER_OVERRUN)throw l;o=l,o.baseType=n.name,o.name=n.localName,o.type=n.type;}}else try{o=n.decode(t);}catch(a){if(a.code===Me.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=n.name,o.name=n.localName,o.type=n.type;}o!=null&&r.push(o);});let s=e.reduce((n,o)=>{let a=o.localName;return a&&(n[a]||(n[a]=0),n[a]++),n},{});e.forEach((n,o)=>{let a=n.localName;if(!a||s[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;let u=r[o];u instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw u}}):r[a]=u;});for(let n=0;n<r.length;n++){let o=r[n];o instanceof Error&&Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}});}return Object.freeze(r)}var Yh=class extends Vt{constructor(e,r,i){let s=e.type+"["+(r>=0?r:"")+"]",n=r===-1||e.dynamic;super("array",s,i,n),this.coder=e,this.length=r;}defaultValue(){let e=this.coder.defaultValue(),r=[];for(let i=0;i<this.length;i++)r.push(e);return r}encode(e,r){Array.isArray(r)||this._throwError("expected array value",r);let i=this.length;i===-1&&(i=r.length,e.writeValue(r.length)),Fo.checkArgumentCount(r.length,i,"coder array"+(this.localName?" "+this.localName:""));let s=[];for(let n=0;n<r.length;n++)s.push(this.coder);return f_(e,s,r)}decode(e){let r=this.length;r===-1&&(r=e.readValue().toNumber(),r*32>e._data.length&&Fo.throwError("insufficient data length",Me.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let i=[];for(let s=0;s<r;s++)i.push(new Wh(this.coder));return e.coerce(this.name,d_(e,i))}};var Jh=class extends Vt{constructor(e){super("bool","bool",e,!1);}defaultValue(){return !1}encode(e,r){return e.writeValue(r?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}};var fu=class extends Vt{constructor(e,r){super(e,e,r,!0);}defaultValue(){return "0x"}encode(e,r){r=Bt(r);let i=e.writeValue(r.length);return i+=e.writeBytes(r),i}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}},Zh=class extends fu{constructor(e){super("bytes",e);}decode(e){return e.coerce(this.name,Nt(super.decode(e)))}};var Xh=class extends Vt{constructor(e,r){let i="bytes"+String(e);super(i,i,r,!1),this.size=e;}defaultValue(){return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,r){let i=Bt(r);return i.length!==this.size&&this._throwError("incorrect data length",r),e.writeBytes(i)}decode(e){return e.coerce(this.name,Nt(e.readBytes(this.size)))}};var Qh=class extends Vt{constructor(e){super("null","",e,!1);}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}};var p_=Pt.from(-1),m_=Pt.from(0),g_=Pt.from(1);var __=Pt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var ef=class extends Vt{constructor(e,r,i){let s=(r?"int":"uint")+e*8;super(s,s,i,!1),this.size=e,this.signed=r;}defaultValue(){return 0}encode(e,r){let i=Pt.from(r),s=__.mask(e.wordSize*8);if(this.signed){let n=s.mask(this.size*8-1);(i.gt(n)||i.lt(n.add(g_).mul(p_)))&&this._throwError("value out-of-bounds",r);}else (i.lt(m_)||i.gt(s.mask(this.size*8)))&&this._throwError("value out-of-bounds",r);return i=i.toTwos(this.size*8).mask(this.size*8),this.signed&&(i=i.fromTwos(this.size*8).toTwos(8*e.wordSize)),e.writeValue(i)}decode(e){let r=e.readValue().mask(this.size*8);return this.signed&&(r=r.fromTwos(this.size*8)),e.coerce(this.name,r)}};var mR="strings/5.7.0";var gR=new Me(mR),du;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD";})(du||(du={}));var vr;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation";})(vr||(vr={}));function n$(t,e,r,i,s){return gR.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function _R(t,e,r,i,s){if(t===vr.BAD_PREFIX||t===vr.UNEXPECTED_CONTINUE){let n=0;for(let o=e+1;o<r.length&&r[o]>>6===2;o++)n++;return n}return t===vr.OVERRUN?r.length-e-1:0}function s$(t,e,r,i,s){return t===vr.OVERLONG?(i.push(s),0):(i.push(65533),_R(t,e,r))}var yR=Object.freeze({error:n$,ignore:_R,replace:s$});function o$(t,e){e==null&&(e=yR.error),t=Bt(t);let r=[],i=0;for(;i<t.length;){let s=t[i++];if(!(s>>7)){r.push(s);continue}let n=null,o=null;if((s&224)===192)n=1,o=127;else if((s&240)===224)n=2,o=2047;else if((s&248)===240)n=3,o=65535;else {(s&192)===128?i+=e(vr.UNEXPECTED_CONTINUE,i-1,t,r):i+=e(vr.BAD_PREFIX,i-1,t,r);continue}if(i-1+n>=t.length){i+=e(vr.OVERRUN,i-1,t,r);continue}let a=s&(1<<8-n-1)-1;for(let u=0;u<n;u++){let l=t[i];if((l&192)!=128){i+=e(vr.MISSING_CONTINUE,i,t,r),a=null;break}a=a<<6|l&63,i++;}if(a!==null){if(a>1114111){i+=e(vr.OUT_OF_RANGE,i-1-n,t,r,a);continue}if(a>=55296&&a<=57343){i+=e(vr.UTF16_SURROGATE,i-1-n,t,r,a);continue}if(a<=o){i+=e(vr.OVERLONG,i-1-n,t,r,a);continue}r.push(a);}}return r}function pu(t,e=du.current){e!=du.current&&(gR.checkNormalize(),t=t.normalize(e));let r=[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);if(s<128)r.push(s);else if(s<2048)r.push(s>>6|192),r.push(s&63|128);else if((s&64512)==55296){i++;let n=t.charCodeAt(i);if(i>=t.length||(n&64512)!==56320)throw new Error("invalid utf-8 string");let o=65536+((s&1023)<<10)+(n&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128);}else r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);}return Bt(r)}function a$(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function y_(t,e){return a$(o$(t,e))}var tf=class extends fu{constructor(e){super("string",e);}defaultValue(){return ""}encode(e,r){return super.encode(e,pu(r))}decode(e){return y_(super.decode(e))}};var Ss=class extends Vt{constructor(e,r){let i=!1,s=[];e.forEach(o=>{o.dynamic&&(i=!0),s.push(o.type);});let n="tuple("+s.join(",")+")";super("tuple",n,r,i),this.coders=e;}defaultValue(){let e=[];this.coders.forEach(i=>{e.push(i.defaultValue());});let r=this.coders.reduce((i,s)=>{let n=s.localName;return n&&(i[n]||(i[n]=0),i[n]++),i},{});return this.coders.forEach((i,s)=>{let n=i.localName;!n||r[n]!==1||(n==="length"&&(n="_length"),e[n]==null&&(e[n]=e[s]));}),Object.freeze(e)}encode(e,r){return f_(e,this.coders,r)}decode(e){return e.coerce(this.name,d_(e,this.coders))}};var rf=new Me(ci),u$=new RegExp(/^bytes([0-9]*)$/),l$=new RegExp(/^(u?int)([0-9]*)$/),v_=class{constructor(e){jt(this,"coerceFunc",e||null);}_getCoder(e){switch(e.baseType){case"address":return new Gh(e.name);case"bool":return new Jh(e.name);case"string":return new tf(e.name);case"bytes":return new Zh(e.name);case"array":return new Yh(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Ss((e.components||[]).map(i=>this._getCoder(i)),e.name);case"":return new Qh(e.name)}let r=e.type.match(l$);if(r){let i=parseInt(r[2]||"256");return (i===0||i>256||i%8!==0)&&rf.throwArgumentError("invalid "+r[1]+" bit length","param",e),new ef(i/8,r[1]==="int",e.name)}if(r=e.type.match(u$),r){let i=parseInt(r[1]);return (i===0||i>32)&&rf.throwArgumentError("invalid bytes length","param",e),new Xh(i,e.name)}return rf.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new zh(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new ws(this._getWordSize())}getDefaultValue(e){let r=e.map(s=>this._getCoder(yr.from(s)));return new Ss(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&rf.throwError("types/values length mismatch",Me.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});let i=e.map(o=>this._getCoder(yr.from(o))),s=new Ss(i,"_"),n=this._getWriter();return s.encode(n,r),n.data}decode(e,r,i){let s=e.map(o=>this._getCoder(yr.from(o)));return new Ss(s,"_").decode(this._getReader(Bt(r),i))}},vR=new v_;function Lo(t){return Ds(pu(t))}var It=new Me(ci);var nf=class extends bs{},sf=class extends bs{},x_=class extends bs{},mu=class extends bs{static isIndexed(e){return !!(e&&e._isIndexed)}},c$={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function xR(t,e){let r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}var gu=class{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,jt(this,"fragments",r.map(i=>Cs.from(i)).filter(i=>i!=null)),jt(this,"_abiCoder",ou(new.target,"getAbiCoder")()),jt(this,"functions",{}),jt(this,"errors",{}),jt(this,"events",{}),jt(this,"structs",{}),this.fragments.forEach(i=>{let s=null;switch(i.type){case"constructor":if(this.deploy){It.warn("duplicate definition - constructor");return}jt(this,"deploy",i);return;case"function":s=this.functions;break;case"event":s=this.events;break;case"error":s=this.errors;break;default:return}let n=i.format();if(s[n]){It.warn("duplicate definition - "+n);return}s[n]=i;}),this.deploy||jt(this,"deploy",Ts.from({payable:!1,type:"constructor"})),jt(this,"_isInterface",!0);}format(e){e||(e=Ze.full),e===Ze.sighash&&It.throwArgumentError("interface does not support formatting sighash","format",e);let r=this.fragments.map(i=>i.format(e));return e===Ze.json?JSON.stringify(r.map(i=>JSON.parse(i))):r}static getAbiCoder(){return vR}static getAddress(e){return hu(e)}static getSighash(e){return o_(Lo(e.format()),0,4)}static getEventTopic(e){return Lo(e.format())}getFunction(e){if(gr(e)){for(let i in this.functions)if(e===this.getSighash(i))return this.functions[i];It.throwArgumentError("no matching function","sighash",e);}if(e.indexOf("(")===-1){let i=e.trim(),s=Object.keys(this.functions).filter(n=>n.split("(")[0]===i);return s.length===0?It.throwArgumentError("no matching function","name",i):s.length>1&&It.throwArgumentError("multiple matching functions","name",i),this.functions[s[0]]}let r=this.functions[As.fromString(e).format()];return r||It.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(gr(e)){let i=e.toLowerCase();for(let s in this.events)if(i===this.getEventTopic(s))return this.events[s];It.throwArgumentError("no matching event","topichash",i);}if(e.indexOf("(")===-1){let i=e.trim(),s=Object.keys(this.events).filter(n=>n.split("(")[0]===i);return s.length===0?It.throwArgumentError("no matching event","name",i):s.length>1&&It.throwArgumentError("multiple matching events","name",i),this.events[s[0]]}let r=this.events[Oo.fromString(e).format()];return r||It.throwArgumentError("no matching event","signature",e),r}getError(e){if(gr(e)){let i=ou(this.constructor,"getSighash");for(let s in this.errors){let n=this.errors[s];if(e===i(n))return this.errors[s]}It.throwArgumentError("no matching error","sighash",e);}if(e.indexOf("(")===-1){let i=e.trim(),s=Object.keys(this.errors).filter(n=>n.split("(")[0]===i);return s.length===0?It.throwArgumentError("no matching error","name",i):s.length>1&&It.throwArgumentError("multiple matching errors","name",i),this.errors[s[0]]}let r=this.errors[As.fromString(e).format()];return r||It.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e);}catch(r){try{e=this.getError(e);}catch(i){throw r}}return ou(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),ou(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));let i=Bt(r);return Nt(i.slice(0,4))!==this.getSighash(e)&&It.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Nt(i)),this._decodeParams(e.inputs,i.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),Nt(Ii([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));let i=Bt(r);return Nt(i.slice(0,4))!==this.getSighash(e)&&It.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Nt(i)),this._decodeParams(e.inputs,i.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Nt(Ii([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let i=Bt(r),s=null,n="",o=null,a=null,u=null;switch(i.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,i)}catch(l){}break;case 4:{let l=Nt(i.slice(0,4)),h=c$[l];if(h)o=this._abiCoder.decode(h.inputs,i.slice(4)),a=h.name,u=h.signature,h.reason&&(s=o[0]),a==="Error"?n=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(n=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{let c=this.getError(l);o=this._abiCoder.decode(c.inputs,i.slice(4)),a=c.name,u=c.format();}catch(c){}break}}return It.throwError("call revert exception"+n,Me.errors.CALL_EXCEPTION,{method:e.format(),data:Nt(r),errorArgs:o,errorName:a,errorSignature:u,reason:s})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Nt(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&It.throwError("too many arguments for "+e.format(),Me.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let i=[];e.anonymous||i.push(this.getEventTopic(e));let s=(n,o)=>n.type==="string"?Lo(o):n.type==="bytes"?Ds(Nt(o)):(n.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),n.type.match(/^u?int/)&&(o=Pt.from(o).toHexString()),n.type==="address"&&this._abiCoder.encode(["address"],[o]),qh(Nt(o),32));for(r.forEach((n,o)=>{let a=e.inputs[o];if(!a.indexed){n!=null&&It.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,n);return}n==null?i.push(null):a.baseType==="array"||a.baseType==="tuple"?It.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,n):Array.isArray(n)?i.push(n.map(u=>s(a,u))):i.push(s(a,n));});i.length&&i[i.length-1]===null;)i.pop();return i}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));let i=[],s=[],n=[];return e.anonymous||i.push(this.getEventTopic(e)),r.length!==e.inputs.length&&It.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{let u=r[a];if(o.indexed)if(o.type==="string")i.push(Lo(u));else if(o.type==="bytes")i.push(Ds(u));else {if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");i.push(this._abiCoder.encode([o.type],[u]));}else s.push(o),n.push(u);}),{data:this._abiCoder.encode(s,n),topics:i}}decodeEventLog(e,r,i){if(typeof e=="string"&&(e=this.getEvent(e)),i!=null&&!e.anonymous){let d=this.getEventTopic(e);(!gr(i[0],32)||i[0].toLowerCase()!==d)&&It.throwError("fragment/topic mismatch",Me.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:i[0]}),i=i.slice(1);}let s=[],n=[],o=[];e.inputs.forEach((d,f)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(s.push(yr.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(s.push(d),o.push(!1)):(n.push(d),o.push(!1));});let a=i!=null?this._abiCoder.decode(s,Ii(i)):null,u=this._abiCoder.decode(n,r,!0),l=[],h=0,c=0;e.inputs.forEach((d,f)=>{if(d.indexed)if(a==null)l[f]=new mu({_isIndexed:!0,hash:null});else if(o[f])l[f]=new mu({_isIndexed:!0,hash:a[c++]});else try{l[f]=a[c++];}catch(m){l[f]=m;}else try{l[f]=u[h++];}catch(m){l[f]=m;}if(d.name&&l[d.name]==null){let m=l[f];m instanceof Error?Object.defineProperty(l,d.name,{enumerable:!0,get:()=>{throw xR(`property ${JSON.stringify(d.name)}`,m)}}):l[d.name]=m;}});for(let d=0;d<l.length;d++){let f=l[d];f instanceof Error&&Object.defineProperty(l,d,{enumerable:!0,get:()=>{throw xR(`index ${d}`,f)}});}return Object.freeze(l)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new sf({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:Pt.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return !r||r.anonymous?null:new nf({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){let r=Nt(e),i=this.getError(r.substring(0,10).toLowerCase());return i?new x_({args:this._abiCoder.decode(i.inputs,"0x"+r.substring(10)),errorFragment:i,name:i.name,signature:i.format(),sighash:this.getSighash(i)}):null}static isInterface(e){return !!(e&&e._isInterface)}};var Mf=Gt(oO()),x1=(t,e)=>e==null||e.length===0?void 0:new gu(t).encodeDeploy(e).slice(2),uO=t=>{try{let e=Mf.parse(t),r;return Mf.visit(e,{FunctionDefinition:s=>{s.isConstructor&&(r=s);}}),aO__default.default(r!=null,"Could not find constructor definition"),[{type:"constructor",inputs:r.parameters.map(({typeName:s},n)=>(aO__default.default(s!=null,`Missing a type definition for constructor parameter at position ${n}`),{type:lO(s)}))}]}catch(e){throw new Error(`Could not get an ABI from contract source: ${e}`)}},lO=t=>{switch(t.type){case"ElementaryTypeName":return t.name;case"ArrayTypeName":return `${lO(t.baseTypeName)}[]`;default:throw new Error(`Only primitive and array types are currently supported when constructing ABI from contract source, got ${t.type}`)}};var b1=t=>{var e;return {deployments:(e=t==null?void 0:t.deployments)!=null?e:NK__default.default.resolve(process.cwd(),"deployments")}},cO=t=>{if(t==null)return ()=>!0;switch(typeof t){case"boolean":return ()=>t;case"string":return e=>e===t;case"function":return t;case"object":if(Array.isArray(t)){let e=new Set(t);return r=>e.has(r)}if(t instanceof RegExp)return e=>t.test(e);throw new TypeError(`Invalid verify configuration: expected string, string[], boolean, function or a RegExp, got ${t}`);default:throw new TypeError(`Invalid verify configuration: expected string, string[], boolean, function or a RegExp, got ${t}`)}};var fO=t=>{try{return fs.lstatSync(t).isDirectory()}catch(e){return !1}},dO=t=>{try{return fs.lstatSync(t).isFile()}catch(e){return !1}};var gO=async(t,e)=>{let r=Sd(e,t.networks),i=b1(t.paths),s=Dd(e),n=yO(e),o=vO(s),a=t.contracts.flatMap(l=>{var Z;let{address:h,network:c,contractName:d,deployment:f}=l;e.info(`Collecting information for contract ${d} on network ${c}`);let m=r[c];if(m==null)return e.info(`No network configured for contract ${d} on network ${c}`),[];let g=`${NK.basename(f,".json")}.json`,v=NK.resolve(i.deployments,c,g);if(!dO(v))return e.error(Zt.error`Deployment file ${v} does not exist or is not a file`),[];let x=ge(v),_=e_.safeParse(x);if(!_.success)return e.error(Zt.error`No network configured for contract ${d} on network ${c}`),[];let E=_.data,b=NK.basename(d,".sol"),w=E.metadata.sources[d];if(w==null)return e.error(Zt.error`Missing source for contract ${d} for network ${c} in ${g}`),[];let D=Nd(w.content),N=l.constructorArguments==null?void 0:typeof l.constructorArguments=="string"?l.constructorArguments:x1(uO(w.content),l.constructorArguments),F=t_(E.metadata),H={apiUrl:m.apiUrl,apiKey:m.apiKey,chainId:m.chainId,address:h,contractName:`${d}:${b}`,constructorArguments:N,licenseType:D,compilerVersion:E.metadata.compiler.version,sourceCode:JSON.stringify(F),evmVersion:E.metadata.settings.evmVersion,optimizerRuns:(Z=E.metadata.settings.optimizer)==null?void 0:Z.runs};return s({Contract:d,Network:c,Address:H.address,License:H.licenseType,Arguments:l.constructorArguments?JSON.stringify(l.constructorArguments):void 0,Sources:Object.keys(E.metadata.sources),"Scan URL":H.apiUrl,"Scan API Key":H.apiKey?wd(H.apiKey):void 0}),[{networkName:c,networkConfig:m,submitProps:H}]});if(a.length===0)return e.warn("No contracts match the verification criteria, exiting"),[];if(t.dryRun)return e.debug("Dry run enabled, exiting"),[];let u=await Promise.all(n(a));return u.forEach(o),u},_O=async(t,e)=>{let r=cO(t.filter),i=Sd(e,t.networks),s=b1(t.paths),n=Dd(e),o=yO(e),a=vO(n);if(!fO(s.deployments))throw new Error(`Path ${s.deployments} is not a directory`);let u=new Set(fs.readdirSync(s.deployments)),l=Object.entries(i);e.debug("Verifying deployments for following networks:"),l.forEach(([d,f])=>{e.debug(` - ${d} (API URL ${f.apiUrl})`);});let h=l.flatMap(([d,f])=>{if(e.info(`Collecting deployments for ${d}...`),!u.has(d))return e.warn(`Could not find deployment for network ${d} in ${s.deployments}`),[];let m=NK.resolve(s.deployments,d);return fs.readdirSync(m).filter(v=>v.endsWith(".json")).flatMap(v=>{e.info(`Inspecting deployment file ${v} on network ${d}`);let x=NK.resolve(m,v),_=ge(x),E=e_.safeParse(_);if(!E.success)throw new Error(`Error parsing deployment file ${v} on network ${d}: ${E.error}`);let b=E.data,w=b.metadata.settings.compilationTarget;return Object.entries(w).flatMap(([D,N])=>{var y;if(!r(N,D,d))return e.debug(`Not verifying ${N} in ${v} on network ${d}`),[];let H=b.metadata.sources[D];if(H==null)return e.error(Zt.error`Could not find source for ${N} (${D})`),[];let Z=Nd(H.content),re=x1(b.abi,b.args),ae=t_(b.metadata),k={apiUrl:f.apiUrl,apiKey:f.apiKey,chainId:f.chainId,address:b.address,contractName:`${D}:${N}`,constructorArguments:re,licenseType:Z,compilerVersion:b.metadata.compiler.version,sourceCode:JSON.stringify(ae),evmVersion:b.metadata.settings.evmVersion,optimizerRuns:(y=b.metadata.settings.optimizer)==null?void 0:y.runs};return n({Contract:N,Network:d,Address:b.address,License:k.licenseType,Arguments:JSON.stringify(b.args),Sources:Object.keys(b.metadata.sources),"Scan URL":k.apiUrl,"Scan API Key":k.apiKey?wd(k.apiKey):void 0}),{submitProps:k,networkName:d,networkConfig:f}})})});if(h.length===0)return e.warn("No contracts match the verification criteria, exiting"),[];if(t.dryRun)return e.debug("Dry run enabled, exiting"),[];let c=await Promise.all(o(h));return c.forEach(a),c},yO=t=>e=>e.map(async(r,i)=>{let{submitProps:s}=r,n=Zt.palette[i%Zt.palette.length],o=`[${i+1}/${e.length}]`,a=Pu.default.bold(s.contractName),u=Pu.default.bold(r.networkName);t.info(n`Verifying contract ${a} for network ${u} ${o}`);try{let l=BS(s,t);l.on("poll",c=>{t.info(n`Polling for verification status of ${a} for network ${u} (GUID ${c}) ${o}`);}),l.on("retry",(c,d)=>{t.verbose(`Received an error: ${c}`),t.info(n`Retrying failed verification attempt of ${a} for network ${u} (attempt ${d+1}) ${o}`);});let h=await l.verify();return {artifact:r,result:h}}catch(l){return t.error(Zt.error`Problem verifying contract ${a} for network ${u} ${o}: ${l} `),{artifact:r,error:l}}}),vO=t=>({artifact:e,response:r,error:i})=>{let s=Pu.default.bold(e.submitProps.contractName),n=Pu.default.bold(e.networkName),o=e.networkConfig.browserUrl?V1(e.networkConfig.browserUrl,e.submitProps.address):void 0;t({Contract:s,Network:n,Result:i==null,"Was verified":r==null?void 0:r.alreadyVerified,"Contract URL":o,Error:i?Zt.error(i):void 0});};var xO="1.2.2";var bO=new $i("-l,--log-level <level>","Log level").choices(["error","warn","info","http","verbose","debug","silly"]).default("info"),EO=new $i("-d,--deployments <path>","Path to the deployments folder"),CO=new $i("--dry-run","Do not verify anything, just output the verifications that would be performed"),TO=new $i("-n,--network <network name>","Network to verify").makeOptionMandatory(),AO=new $i("-u,--api-url <url>","Scan API URL (fully qualified, with protocol and path)"),wO=new $i("-k,--api-key <key>","Scan API Key"),DO=new $i("--chain-id <id>","Chain ID for Etherscan API v2 (automatically set for well-known networks)").argParser(t=>parseInt(t,10)),FK=new Bu("non-target").description("Verifies a contract that does not have its own deployment file, i.e. has not been a target of a deployment").addOption(bO).addOption(CO).addOption(EO).addOption(TO).addOption(AO).addOption(wO).addOption(DO).requiredOption("--address <address>","Contract address to verify").requiredOption("--name <contract name>","Fully qualified contract name to verify, e.g. contracts/MyToken.sol").requiredOption("--deployment <deployment file name>","Deployment file name, e.g. MyOtherToken.json").option("--arguments <constructor arguments>",'JSON encoded array of constructor arguments, e.g. [1234, "0x0"]',t=>{if(t.startsWith("0x"))return t.slice(2);try{let e=JSON.parse(t);if(!Array.isArray(e))throw new Error(`Constructor arguments must be an array, got ${e}`);return e}catch(e){throw new j1(`Malformed constructor arguments specified: ${e}`)}}).action(async t=>{let e=hh(t.logLevel),r={dryRun:t.dryRun,paths:{deployments:t.deployments},networks:{[t.network]:{apiUrl:t.apiUrl,apiKey:t.apiKey,chainId:t.chainId}},contracts:[{network:t.network,address:t.address,contractName:t.name,deployment:t.deployment,constructorArguments:t.arguments}]};try{await gO(r,e);}catch(i){e.error(Zt.error`The verification script exited with an error: ${i}`),process.exit(1);}}),LK=new Bu("target").description("Verifies contracts that have been a part of a deployment, i.e. have their own deployment files").addOption(bO).addOption(CO).addOption(EO).addOption(TO).addOption(AO).addOption(wO).addOption(DO).option("-c,--contracts <contract names>","Comma-separated list of case-sensitive contract names to verify",t=>t!=null&&t.trim()?t.split(",").map(e=>e.trim()):void 0).action(async t=>{let e=hh(t.logLevel),r={dryRun:t.dryRun,paths:{deployments:t.deployments},networks:{[t.network]:{apiUrl:t.apiUrl,apiKey:t.apiKey,chainId:t.chainId}},filter:t.contracts};try{await _O(r,e);}catch(i){e.error(Zt.error`The verification script exited with an error: ${i}`),process.exit(1);}});new Bu("@layerzerolabs/verify-contract").version(xO).description("Verify a set of contracts based on hardhat-deploy outputs").addCommand(FK).addCommand(LK,{isDefault:!0}).parseAsync();
|
|
482
482
|
/*! Bundled license information:
|
|
483
483
|
|
|
484
484
|
safe-buffer/index.js:
|