diff --git a/src/components/ModalOsnap.vue b/src/components/ModalOsnap.vue index 7892de77..589dfb82 100644 --- a/src/components/ModalOsnap.vue +++ b/src/components/ModalOsnap.vue @@ -18,7 +18,7 @@ const href = computed(() => spaceUrl, spaceName: props.spaceName, safeAddress: props.treasury.address, - network: props.treasury.network as Network, + network: props.treasury.network as Network }) ); diff --git a/src/components/SettingsTreasuriesBlockItem.vue b/src/components/SettingsTreasuriesBlockItem.vue index 0c32c0e8..a82b99d9 100644 --- a/src/components/SettingsTreasuriesBlockItem.vue +++ b/src/components/SettingsTreasuriesBlockItem.vue @@ -8,20 +8,22 @@ defineProps<{ }>(); const emit = defineEmits<{ - removeTreasury: [index: number] - editTreasury: [index: number] - configureOsnap: [index: number, isEnabled: boolean] + removeTreasury: [index: number]; + editTreasury: [index: number]; + configureOsnap: [index: number, isEnabled: boolean]; }>(); \ No newline at end of file + /> + diff --git a/src/plugins/oSnap/components/HandleOutcome/Template.vue b/src/plugins/oSnap/components/HandleOutcome/Template.vue deleted file mode 100644 index 5b27ff58..00000000 --- a/src/plugins/oSnap/components/HandleOutcome/Template.vue +++ /dev/null @@ -1,6 +0,0 @@ - - - \ No newline at end of file diff --git a/src/plugins/oSnap/components/HandleOutcome/steps/AssertionDisputedInOO.vue b/src/plugins/oSnap/components/HandleOutcome/steps/AssertionDisputedInOO.vue index 7150dde4..4aab1415 100644 --- a/src/plugins/oSnap/components/HandleOutcome/steps/AssertionDisputedInOO.vue +++ b/src/plugins/oSnap/components/HandleOutcome/steps/AssertionDisputedInOO.vue @@ -16,7 +16,8 @@ const oracleUiLink = getOracleUiLink( diff --git a/src/plugins/oSnap/components/Input/MethodParameter.vue b/src/plugins/oSnap/components/Input/MethodParameter.vue index a306c3f5..fe8a25ba 100644 --- a/src/plugins/oSnap/components/Input/MethodParameter.vue +++ b/src/plugins/oSnap/components/Input/MethodParameter.vue @@ -33,7 +33,7 @@ const inputType = computed(() => { }); const label = `${props.parameter.name} (${props.parameter.type})`; -const arrayPlaceholder = `E.g. ["text", 123, 0x123]` +const arrayPlaceholder = `E.g. ["text", 123, 0x123]`; const isInputValid = computed(() => { if (!isDirty.value) return true; @@ -49,7 +49,7 @@ const newValue = ref(props.value); watch(props.parameter, () => { newValue.value = ''; isDirty.value = false; -}) +}); watch(newValue, () => { if (isInputValid.value) { @@ -110,7 +110,7 @@ function onChange(value: string) { :model-value="value" @update:modelValue="onChange($event)" > - + - +
-
- diff --git a/src/plugins/oSnap/components/TransactionBuilder/Transaction.vue b/src/plugins/oSnap/components/TransactionBuilder/Transaction.vue index 7dcdb938..d122ea0a 100644 --- a/src/plugins/oSnap/components/TransactionBuilder/Transaction.vue +++ b/src/plugins/oSnap/components/TransactionBuilder/Transaction.vue @@ -46,7 +46,7 @@ function updateTransaction(transaction: TTransaction) { - diff --git a/src/plugins/oSnap/constants.ts b/src/plugins/oSnap/constants.ts index 91a2bd12..4b5dc1ea 100644 --- a/src/plugins/oSnap/constants.ts +++ b/src/plugins/oSnap/constants.ts @@ -1,1100 +1,1100 @@ export const safePrefixes = { - 1: "eth", - 2: "exp", - 3: "rop", - 4: "rin", - 5: "gor", - 6: "kot", - 7: "tch", - 8: "ubq", - 9: "tubq", - 10: "oeth", - 11: "meta", - 12: "kal", - 13: "dstg", - 14: "flr", - 15: "diode", - 16: "cflr", - 17: "tfi", - 18: "TST", - 19: "sgb", - 20: "esc", - 21: "esct", - 22: "eladid", - 23: "eladidt", - 24: "kardiachain", - 25: "cro", - 26: "L1test", - 27: "shib", - 28: "BobaRinkeby", - 29: "L1", - 30: "rsk", - 31: "trsk", - 32: "GooDT", - 33: "GooD", - 34: "dth", - 35: "tbwg", - 36: "dx", - 37: "xpla", - 38: "val", - 39: "u2u", - 40: "TelosEVM", - 41: "TelosEVMTestnet", - 42: "lukso", - 43: "pangolin", - 44: "crab", - 45: "pangoro", - 46: "darwinia", - 47: "aic", - 48: "etmp", - 49: "etmpTest", - 50: "xdc", - 51: "txdc", - 52: "cet", - 53: "tcet", - 54: "OP", - 55: "ZYX", - 56: "bnb", - 57: "sys", - 58: "OntologyMainnet", - 59: "eos-legacy", - 60: "go", - 61: "etc", - 62: "tetc", - 63: "metc", - 64: "ellaism", - 65: "tokt", - 66: "okt", - 67: "dbm", - 68: "SO1", - 69: "okov", - 70: "hsc", - 71: "cfxtest", - 72: "dxc", - 73: "FNCY", - 74: "idchain", - 75: "DSC", - 76: "mix", - 77: "spoa", - 78: "primuschain", - 79: "zenith", - 80: "GeneChain", - 81: "joc", - 82: "Meter", - 83: "MeterTest", - 84: "linqto-devnet", - 85: "gttest", - 86: "gt", - 87: "nnw", - 88: "tomo", - 89: "tomot", - 90: "gar-s0", - 91: "gar-s1", - 92: "gar-s2", - 93: "gar-s3", - 94: "sdlt", - 95: "camdl", - 96: "bkc", - 97: "bnbt", - 98: "six", - 99: "poa", - 100: "gno", - 101: "eti", - 102: "tw3g", - 103: "WLC", - 104: "tklc", - 105: "dw3g", - 106: "vlx", - 107: "ntn", - 108: "TT", - 109: "shibariumecosystem", - 110: "xpr", - 111: "ETL", - 112: "coinbit", - 113: "deh", - 114: "c2flr", - 115: "debank-testnet", - 116: "debank-mainnet", - 117: "auptick", - 118: "arcology", - 119: "enuls", - 120: "enulst", - 121: "REAL", - 122: "fuse", - 123: "spark", - 124: "dwu", - 125: "OYchainTestnet", - 126: "OYchainMainnet", - 127: "feth", - 128: "heco", - 134: "rlc", - 135: "AlyxTestnet", - 136: "deam", - 137: "matic", - 138: "dfio-meta-main", - 139: "woop", - 141: "OPtest", - 142: "dax", - 144: "PHI", - 148: "shimmerevm-mainnet", - 150: "sixt", - 151: "rbn", - 152: "rbn-devnet", - 153: "rbn-testnet", - 154: "rbn-tge", - 155: "tenet-testnet", - 156: "obe", - 160: "eva", - 161: "wall-e", - 162: "tpht", - 163: "pht", - 165: "omni_testnet", - 167: "atoshi", - 168: "aioz", - 169: "manta", - 170: "hoosmartchain", - 172: "resil", - 180: "ame", - 186: "Seele", - 188: "BMC", - 189: "BMCT", - 193: "cem", - 195: "tokb", - 196: "okb", - 197: "NEUTR", - 198: "bit", - 199: "BTT", - 200: "aox", - 201: "moactest", - 204: "obnb", - 208: "utx", - 210: "BTN", - 211: "EDI", - 212: "makalu", - 217: "SIN2", - 218: "SO1-old", - 222: "ASK", - 225: "LA", - 226: "TLA", - 230: "SDX", - 236: "deamtest", - 242: "plgchain", - 246: "ewt", - 248: "OAS", - 250: "ftm", - 255: "kroma", - 256: "hecot", - 258: "setm", - 259: "neon", - 262: "SUR", - 269: "hpb", - 271: "EGONm", - 274: "lachain", - 280: "zksync-goerli", - 288: "Boba", - 291: "orderly", - 295: "hedera-mainnet", - 296: "hedera-testnet", - 297: "hedera-previewnet", - 298: "hedera-localnet", - 300: "ogc", - 301: "Bobaopera", - 303: "ncnt", - 309: "wyz", - 311: "omax", - 313: "ncn", - 314: "filecoin", - 321: "kcs", - 322: "kcst", - 324: "zksync", - 333: "w3q", - 335: "DFKTEST", - 336: "sdn", - 338: "tcro", - 345: "YVM", - 361: "theta-mainnet", - 363: "theta-sapphire", - 364: "theta-amber", - 365: "theta-testnet", - 369: "pls", - 371: "tCNT", - 385: "lisinski", - 400: "hpn", - 401: "ozo_tst", - 411: "pepe", - 416: "SX", - 418: "latestnet", - 420: "ogor", - 424: "PGN", - 427: "zeeth", - 443: "obs-testnet", - 444: "synapse-sepolia", - 456: "arzio", - 462: "tarea", - 499: "rupx", - 500: "Camino", - 501: "Columbus", - 512: "aac", - 513: "aact", - 516: "gz-mainnet", - 520: "xt", - 529: "fire", - 530: "FxCore", - 534: "CNDL", - 542: "PAW", - 555: "CLASS", - 558: "tao", - 568: "dct", - 570: "sys-rollux", - 588: "metis-stardust", - 592: "astr", - 595: "maca", - 596: "tkar", - 597: "taca", - 599: "metis-goerli", - 600: "mesh-chain-testnet", - 601: "PEER", - 614: "glq", - 634: "avocado", - 647: "SX-Testnet", - 648: "ace", - 666: "pixie-chain-testnet", - 667: "laos", - 668: "junca", - 669: "juncat", - 686: "kar", - 700: "SNS", - 707: "bcs", - 708: "tbcs", - 710: "fury", - 719: "shibarium", - 721: "LYC", - 740: "tcanto", - 741: "vsct", - 742: "SPAY", - 766: "qom", - 776: "opc", - 777: "cth", - 786: "maal", - 787: "aca", - 788: "taero", - 789: "peth", - 800: "LUCID", - 803: "haic", - 808: "PFTEST", - 813: "meer", - 818: "BOC", - 820: "clo", - 821: "tclo", - 841: "tara", - 842: "taratest", - 859: "zeethdev", - 868: "FSCMainnet", - 876: "BNKEN", - 877: "DXT", - 880: "ambros", - 888: "wan", - 900: "gar-test-s0", - 901: "gar-test-s1", - 902: "gar-test-s2", - 903: "gar-test-s3", - 909: "PF", - 910: "DBONE", - 917: "tfire", - 919: "modesep", - 927: "ydk", - 940: "tpls", - 941: "t2bpls", - 942: "t3pls", - 943: "t4pls", - 956: "munode", - 963: "btc20", - 970: "ccn", - 971: "Huygens", - 972: "Ascraeus", - 977: "yeti", - 980: "top_evm", - 985: "memochain", - 989: "top", - 990: "ELm", - 997: "5ire", - 998: "ln", - 999: "twan", - 1000: "gton", - 1001: "Baobab", - 1002: "kai", - 1003: "tet", - 1004: "t-ekta", - 1007: "tnew", - 1008: "eun", - 1010: "EVC", - 1012: "new", - 1022: "sku", - 1023: "tclv", - 1024: "clv", - 1028: "tbtt", - 1030: "cfx", - 1031: "prx", - 1038: "bronos-testnet", - 1039: "bronos-mainnet", - 1071: "shimmerevm-testnet-deprecated", - 1072: "shimmerevm-testnet", - 1079: "mintara-testnet", - 1080: "mintara", - 1088: "metis-andromeda", - 1089: "humans", - 1099: "moac", - 1101: "zkevm", - 1107: "tblxq", - 1108: "blxq", - 1111: "wemix", - 1112: "twemix", - 1115: "tcore", - 1116: "core", - 1117: "DOGSm", - 1130: "DFI", - 1131: "DFI-T", - 1133: "changi", - 1138: "ASARt", - 1139: "MATH", - 1140: "tMATH", - 1149: "Plexchain", - 1170: "auoc", - 1177: "sht", - 1197: "iora", - 1201: "avis", - 1202: "wtt", - 1213: "popcat", - 1214: "enter", - 1229: "xzo", - 1230: "UltronTestnet", - 1231: "UtronMainnet", - 1234: "step", - 1243: "ARC", - 1244: "TARC", - 1246: "om", - 1252: "CICT", - 1280: "HO", - 1284: "mbeam", - 1285: "mriver", - 1286: "mrock-old", - 1287: "mbase", - 1288: "mrock", - 1291: "swtr", - 1294: "Bobabeam", - 1297: "Bobabase", - 1311: "TDOS", - 1314: "alyx", - 1319: "aia", - 1320: "aiatestnet", - 1337: "geth", - 1338: "ELST", - 1339: "ELSM", - 1353: "CIC", - 1369: "zafic", - 1379: "KLC", - 1388: "ASAR", - 1392: "mun", - 1402: "zkevmtest", - 1422: "testnet-zkEVM-mango-pre-audit-upgraded", - 1433: "RIK", - 1440: "LAS", - 1442: "testnet-zkEVM-mango", - 1452: "gil", - 1455: "CTEX", - 1501: "chainx", - 1506: "Sherpax", - 1507: "SherpaxTestnet", - 1515: "beagle", - 1559: "tenet", - 1618: "cate", - 1620: "ath", - 1657: "bta", - 1662: "Yuma", - 1663: "Gobi", - 1688: "LUDAN", - 1701: "AnytypeChain", - 1707: "TBSI", - 1708: "tTBSI", - 1718: "PCM", - 1773: "TeaParty", - 1777: "gauss", - 1804: "kerleano", - 1807: "rAna", - 1818: "cube", - 1819: "cubet", - 1856: "tsf", - 1875: "wbt", - 1881: "gitshockchain", - 1890: "lightlink_phoenix", - 1891: "lightlink_pegasus", - 1898: "boya", - 1907: "bitci", - 1908: "tbitci", - 1945: "onus-testnet", - 1951: "dchain-mainnet", - 1954: "Dexilla", - 1967: "mtc", - 1969: "tscs", - 1970: "scs", - 1971: "atlr", - 1975: "onus-mainnet", - 1984: "euntest", - 1985: "satoshie", - 1986: "satoshie_testnet", - 1987: "egem", - 1994: "ekta", - 1995: "edx", - 2000: "dc", - 2001: "milkAda", - 2002: "milkALGO", - 2008: "cloudwalk_testnet", - 2009: "cloudwalk_mainnet", - 2016: "NetZm", - 2018: "pmint_dev", - 2019: "pmint_test", - 2020: "pmint", - 2021: "edg", - 2022: "edgt", - 2023: "taycan-testnet", - 2025: "rpg", - 2031: "cfg", - 2032: "ncfg", - 2037: "kiwi", - 2038: "shraptest", - 2043: "otp", - 2044: "Shrapnel", - 2047: "stos-testnet", - 2048: "stos-mainnet", - 2049: "movo", - 2077: "QKA", - 2088: "air", - 2089: "algl", - 2100: "eco", - 2101: "esp", - 2109: "exn", - 2122: "Metad", - 2124: "MEU", - 2137: "bigsb", - 2138: "dfio-meta-test", - 2151: "boa", - 2152: "fra", - 2153: "findora-testnet", - 2154: "findora-forge", - 2199: "msn", - 2202: "ABNm", - 2203: "BTC", - 2213: "evanesco", - 2221: "tkava", - 2222: "kava", - 2223: "VChain", - 2241: "KRST", - 2300: "bomb", - 2309: "arevia", - 2323: "sma", - 2330: "alt", - 2332: "smam", - 2357: "deprecated-kroma-sepolia", - 2358: "kroma-sepolia", - 2399: "bombt", - 2400: "TCGV", - 2415: "xodex", - 2484: "u2u_nebulas", - 2559: "ktoc", - 2569: "tpc", - 2606: "pocrnet", - 2611: "REDLC", - 2612: "EZChain", - 2613: "Fuji-EZChain", - 2625: "twbt", - 2710: "tmorph", - 2888: "BobaGoerli", - 2999: "bty", - 3000: "cennz-r", - 3001: "cennz-n", - 3003: "cau", - 3011: "3ULL", - 3031: "ORL", - 3068: "bfc", - 3141: "filecoin-hyperspace", - 3269: "dubx", - 3270: "testdubx", - 3306: "debounce-devnet", - 3331: "zcrbeach", - 3333: "w3q-t", - 3334: "w3q-g", - 3400: "prb", - 3434: "SCAIt", - 3500: "prbtestnet", - 3501: "jfin", - 3601: "pando-mainnet", - 3602: "pando-testnet", - 3636: "BTCt", - 3637: "BTCm", - 3666: "jouleverse", - 3690: "btx", - 3693: "empire", - 3698: "SPCt", - 3699: "SPCm", - 3701: "xplatest", - 3737: "csb", - 3797: "alv", - 3888: "kalymainnet", - 3889: "kalytestnet", - 3912: "drac", - 3939: "dost", - 3966: "dyno", - 3967: "tdyno", - 3999: "ycc", - 4000: "ozo", - 4001: "PERIUM", - 4002: "tftm", - 4051: "BobaoperaTestnet", - 4061: "Nahmii3Mainnet", - 4062: "Nahmii3Testnet", - 4090: "Oasis", - 4096: "BNIt", - 4099: "BNIm", - 4102: "aioz-testnet", - 4139: "humans_testnet", - 4141: "TPBXt", - 4181: "PHIv1", - 4201: "lukso-testnet", - 4242: "nexi", - 4328: "BobaFujiTestnet", - 4337: "beam", - 4444: "html", - 4460: "orderlyl2", - 4689: "iotex-mainnet", - 4690: "iotex-testnet", - 4759: "TESTMEV", - 4777: "TBXN", - 4918: "txvm", - 4919: "xvm", - 4999: "BXN", - 5000: "mantle", - 5001: "mantle-testnet", - 5002: "treasurenet", - 5005: "tntest", - 5165: "ftn", - 5177: "tlc", - 5197: "es", - 5234: "hmnd", - 5290: "_old_fire", - 5315: "UZMI", - 5353: "ttrn", - 5522: "VEX", - 5551: "Nahmii", - 5553: "NahmiiTestnet", - 5555: "cverse", - 5611: "obnbt", - 5616: "ARCT", - 5678: "TanssiCC", - 5700: "tsys", - 5729: "hik", - 5758: "satst", - 5777: "ggui", - 5851: "OntologyTestnet", - 5869: "rbd", - 6065: "TRESTEST", - 6066: "TRESMAIN", - 6102: "cascadia", - 6118: "UPTN-TEST", - 6119: "UPTN", - 6502: "Peerpay", - 6552: "SRC-test", - 6565: "fox", - 6626: "pixie-chain", - 6688: "iris", - 6789: "STANDm", - 6969: "tombchain", - 6999: "psc", - 7000: "zetachain-mainnet", - 7001: "zetachain-athens", - 7027: "ELLA", - 7070: "planq", - 7171: "bitrock", - 7331: "kly", - 7332: "EON", - 7341: "shyft", - 7484: "raba", - 7518: "MEV", - 7575: "tadil", - 7576: "adil", - 7668: "trn-mainnet", - 7672: "trn-porcini", - 7700: "canto", - 7701: "TestnetCanto", - 7771: "tbitrock", - 7777: "RiseOfTheWarbotsTestnet", - 7878: "tscas", - 7895: "ard", - 7979: "dos", - 8000: "teleport", - 8001: "teleport-testnet", - 8029: "mdgl", - 12357: "rei", - 7363: "dnd", - 9052: "acrechain", - 8080: "Liberty10", - 8081: "Liberty20", - 8082: "Sphinx10", - 8086: "BitEth", - 8098: "StreamuX", - 8131: "meertest", - 8132: "meermix", - 8133: "meerpriv", - 8134: "amana", - 8135: "flana", - 8136: "mizana", - 8181: "tBOC", - 8217: "Cypress", - 8272: "BTON", - 8285: "Kortho", - 8387: "fuck", - 8453: "base", - 8654: "toki", - 8655: "toki-testnet", - 8723: "olo", - 8724: "tolo", - 8738: "alph", - 8768: "tmy", - 8848: "maro", - 8880: "unq", - 8881: "qtz", - 8882: "opl", - 8883: "sph", - 8888: "XANAChain", - 8889: "vsc", - 8898: "mmt", - 8899: "jbc", - 8989: "gmmt", - 8995: "berg", - 9000: "evmos-testnet", - 9001: "evmos", - 9012: "brb", - 9100: "GENEC", - 9170: "_old_tfire", - 9223: "COF", - 9339: "DOGSt", - 9527: "trpg", - 9528: "QETTest", - 9559: "testneon", - 9700: "MainnetDev", - 9728: "BobaBnbTestnet", - 9768: "NetZt", - 9779: "pn", - 9790: "carbon", - 9792: "carbon-testnet", - 9818: "tIMP", - 9819: "IMP", - 9977: "tMIND", - 9990: "AGNG", - 9996: "MIND", - 9997: "alt-testnet", - 9999: "myn", - 10000: "smartbch", - 10001: "smartbchtest", - 10024: "gon", - 10081: "joct", - 10086: "SJ", - 10101: "GEN", - 10200: "chi", - 10201: "PWR", - 10243: "aa", - 10248: "0xt", - 10395: "TWLC", - 10507: "Jade", - 10508: "Snow", - 10823: "CCP", - 10946: "quadrans", - 10947: "quadranstestnet", - 11110: "astra", - 11111: "WAGMI", - 11115: "astra-testnet", - 11119: "hbit", - 11235: "ISLM", - 11437: "shyftt", - 11612: "SRDXt", - 11888: "SAN", - 11891: "Arianee", - 12009: "sats", - 12051: "tZERO", - 12052: "ZERO", - 12123: "BRC", - 12306: "fibo", - 12321: "blgchain", - 12345: "steptest", - 12611: "astrzk", - 12715: "tRIK", - 12890: "tqnet", - 13000: "SPS", - 13308: "Credit", - 13337: "beam-testnet", - 13381: "Phoenix", - 13812: "sus", - 14000: "SPS-Test", - 14853: "hmnd-t5", - 15551: "loop", - 15555: "TrustTestnet", - 15557: "eos-testnet", - 16000: "mtt", - 16001: "mtttest", - 16507: "Genesys", - 16688: "nyancat", - 16718: "airdao", - 16888: "tivar", - 17000: "holesky", - 17171: "G8Cm", - 17180: "PCT", - 17777: "eos", - 18000: "ZKST", - 18122: "STN", - 18159: "pom", - 18181: "G8Ct", - 18686: "MXCzkEVM", - 19011: "HMV", - 19845: "btcix", - 20001: "Camelark", - 20729: "CLOTestnet", - 20736: "p12", - 21337: "cennz-a", - 21816: "omc", - 22023: "SFL", - 22040: "airdao-test", - 22222: "NAUTCHAIN", - 22776: "map", - 23006: "ABNt", - 23118: "opside", - 23294: "sapphire", - 23295: "sapphire-testnet", - 24484: "web", - 24734: "mintme", - 25888: "GOLDT", - 25925: "bkct", - 26026: "frm", - 26600: "HTZ", - 26863: "OAC", - 28528: "obgor", - 30067: "Piece", - 30103: "ceri", - 31102: "esn", - 31223: "CLDTX", - 31224: "CLD", - 31337: "got", - 31415: "filecoin-wallaby", - 32520: "Brise", - 32659: "fsn", - 32769: "zil", - 32990: "zil-isolated-server", - 33101: "zil-testnet", - 33333: "avs", - 33385: "zil-devnet", - 33469: "zq2-devnet", - 35011: "j2o", - 35441: "q", - 35443: "q-testnet", - 38400: "cmrpg", - 38401: "ttrpg", - 39797: "nrg", - 39815: "oho", - 41500: "ox-beta", - 42069: "PC", - 42161: "arb1", - 42170: "arb-nova", - 42220: "celo", - 42261: "emerald-testnet", - 42262: "emerald", - 42801: "GST", - 42888: "keth", - 43110: "avaeth", - 43113: "Fuji", - 43114: "avax", - 43288: "bobaavax", - 44444: "FREN", - 44787: "ALFA", - 45000: "AutobahnNetwork", - 46688: "tfsn", - 47805: "REI", - 49049: "floripa", - 49088: "tbfc", - 49797: "tnrg", - 50001: "LOE", - 50021: "tgton", - 51178: "Opside-Testnet", - 51712: "SRDXm", - 53935: "DFK", - 54211: "ISLMT", - 54321: "ToronetTestnet", - 55004: "teth", - 55555: "reichain", - 55556: "trei", - 56288: "BobaBnb", - 56789: "VELO", - 57000: "tsys-rollux", - 58008: "sepPGN", - 59140: "linea-testnet", - 59144: "linea", - 60000: "TKM-test0", - 60001: "TKM-test1", - 60002: "TKM-test2", - 60103: "TKM-test103", - 61800: "aium-dev", - 61803: "Etica", - 61916: "DoKEN", - 62320: "BKLV", - 62621: "mtv", - 63000: "ecs", - 63001: "ecs-testnet", - 65450: "SRC", - 67390: "mcl", - 67588: "Cosmic", - 69420: "cndr", - 70000: "TKM0", - 70001: "TKM1", - 70002: "TKM2", - 70103: "TKM103", - 71111: "GuapX", - 71393: "ckb", - 71401: "gw-testnet-v1", - 71402: "gw-mainnet-v1", - 73799: "vt", - 73927: "mvm", - 75000: "resin", - 77238: "fnc", - 77612: "vscm", - 77777: "Toronet", - 78110: "firenze", - 78281: "dfly", - 78430: "amplify", - 78431: "bulletin", - 78432: "conduit", - 79879: "STANDt", - 80001: "maticmum", - 81341: "amanatest", - 81342: "amanamix", - 81343: "amanapriv", - 81351: "flanatest", - 81352: "flanamix", - 81353: "flanapriv", - 81361: "mizanatest", - 81362: "mizanamix", - 81363: "mizanapriv", - 81720: "qnet", - 84531: "basegor", - 84886: "Aerie", - 85449: "Cyber", - 88002: "NAUTTest", - 88880: "chz", - 88888: "ivar", - 90210: "bvhl", - 91002: "NAUT", - 92001: "lambda-testnet", - 96970: "mantis", - 97288: "BobaBnbOld", - 99099: "ELt", - 99998: "usctest", - 99999: "usc", - 100000: "qkc-r", - 100001: "qkc-s0", - 100002: "qkc-s1", - 100003: "qkc-s2", - 100004: "qkc-s3", - 100005: "qkc-s4", - 100006: "qkc-s5", - 100007: "qkc-s6", - 100008: "qkc-s7", - 100009: "vechain", - 100010: "vechain-testnet", - 100100: "chi1", - 101010: "SVRNt", - 103090: "CRFI", - 108801: "bro", - 110000: "qkc-d-r", - 110001: "qkc-d-s0", - 110002: "qkc-d-s1", - 110003: "qkc-d-s2", - 110004: "qkc-d-s3", - 110005: "qkc-d-s4", - 110006: "qkc-d-s5", - 110007: "qkc-d-s6", - 110008: "qkc-d-s7", - 111000: "testsbr", - 111111: "sbr", - 112358: "metao", - 123456: "dadil", - 131419: "ETND", - 142857: "ICPlaza", - 167004: "taiko-a2", - 167005: "taiko-l2", - 167006: "taiko-l3", - 167007: "tko-jolnir", - 188881: "condor", - 200101: "milkTAda", - 200202: "milkTAlgo", - 200625: "aka", - 201018: "alaya", - 201030: "alayadev", - 201804: "myth", - 202020: "tDSC", - 202624: "twl-jellie", - 210425: "platon", - 220315: "mas", - 221230: "reap", - 221231: "reap-testnet", - 224168: "TAFECO", - 230315: "hsktest", - 234666: "hym", - 246529: "ats", - 246785: "atstau", - 247253: "saakuru-testnet", - 256256: "cmp-mainnet", - 266256: "gz-testnet", - 271271: "EGONt", - 281121: "SoChain", - 314159: "filecoin-calibration", - 330844: "tc", - 333331: "avst", - 333666: "oonetest", - 333777: "oonedev", - 333888: "sparta", - 333999: "olympus", - 355113: "Bitfinity", - 373737: "hap-testnet", - 381931: "metal", - 381932: "Tahoe", - 404040: "TPBXm", - 420420: "KEK", - 420666: "tKEK", - 420692: "alterium", - 421611: "arb-rinkeby", - 421613: "arb-goerli", - 421614: "arb-sep", - 424242: "fastexTestnet", - 431140: "markr-go", - 432201: "dexalot-testnet", - 432204: "dexalot", - 444900: "wlkt", - 471100: "psep", - 474142: "oc", - 512512: "cmp", - 513100: "ethf", - 534351: "scr-sepolia", - 534352: "scr", - 534353: "scr-alpha", - 534354: "scr-prealpha", - 534849: "shi", - 535037: "BESC", - 622277: "rth", - 641230: "BRNKC", - 651940: "ALL", - 666666: "vpioneer", - 751230: "BRNKCTEST", - 761412: "Miexs", - 776877: "mdlrm", - 800001: "octa", - 827431: "CURVEm", - 846000: "bloqs4good", - 888888: "vision", - 900000: "psc-s0", - 910000: "psc-t-s0", - 920000: "psc-d-s0", - 920001: "psc-d-s1", - 923018: "tFNCY", - 955305: "elv", - 1261120: "azktn", - 1313114: "etho", - 1313500: "xero", - 1337702: "kintsugi", - 1337802: "kiln", - 1337803: "zhejiang", - 2021398: "dbk", - 2099156: "plian-mainnet", - 2203181: "platondev", - 2206132: "platondev2", - 3141592: "filecoin-butterfly", - 3441005: "mantaTestnet", - 4000003: "alt-zerogas", - 4281033: "worldscal", - 5167003: "MXC", - 5555555: "imversed", - 5555558: "imversed-testnet", - 7225878: "saakuru", - 7355310: "vsl", - 7668378: "tqom", - 7762959: "music", - 7777777: "zora", - 8007736: "plian-mainnet-l2", - 8794598: "hap", - 8888881: "quarix-testnet", - 8888888: "quarix", - 10067275: "plian-testnet-l2", - 10101010: "SVRNm", - 11155111: "sep", - 13371337: "tpep", - 14288640: "anduschain-mainnet", - 16658437: "plian-testnet", - 18289463: "ilt", - 20180430: "spectrum", - 20181205: "qki", - 20201022: "pg", - 22052002: "xlon", - 27082017: "exlvolta", - 27082022: "exl", - 28945486: "auxi", - 29032022: "fla", - 31415926: "filecoin-local", - 35855456: "JOYS", - 43214913: "mais", - 61717561: "aqua", - 65010000: "bakerloo-0", - 65100000: "piccadilly-0", - 88888888: "team", - 99415706: "TOYS", - 192837465: "GTH", - 222000222: "kanazawa", - 245022926: "neonevm-devnet", - 245022934: "neonevm-mainnet", - 245022940: "neonevm-testnet", - 278611351: "razor", - 311752642: "oneledger", - 333000333: "meld", - 344106930: "calypso-testnet", - 356256156: "tGTH", - 486217935: "dGTH", - 503129905: "nebula-staging", - 1122334455: "ipos", - 1146703430: "cyb", - 1273227453: "human-mainnet", - 1313161554: "aurora", - 1313161555: "aurora-testnet", - 1313161556: "aurora-betanet", - 1351057110: "chaos-tenet", - 1380996178: "rptr", - 1482601649: "nebula-mainnet", - 1564830818: "calypso-mainnet", - 1666600000: "hmy-s0", - 1666600001: "hmy-s1", - 1666600002: "hmy-s2", - 1666600003: "hmy-s3", - 1666700000: "hmy-b-s0", - 1666700001: "hmy-b-s1", - 1666900000: "hmy-ps-s0", - 1666900001: "hmy-ps-s1", - 2021121117: "hop", - 2046399126: "europa", - 2863311531: "a8", - 3125659152: "pirl", - 4216137055: "frankenstein", - 11297108099: "tpalm", - 11297108109: "palm", - 111222333444: "alphabet", - 197710212030: "ntt", - 197710212031: "ntt-haradev", - 383414847825: "zeniq", - 666301171999: "ipdc", - 6022140761023: "mole", - 868455272153094: "gw-testnet-v1-deprecated" + 1: 'eth', + 2: 'exp', + 3: 'rop', + 4: 'rin', + 5: 'gor', + 6: 'kot', + 7: 'tch', + 8: 'ubq', + 9: 'tubq', + 10: 'oeth', + 11: 'meta', + 12: 'kal', + 13: 'dstg', + 14: 'flr', + 15: 'diode', + 16: 'cflr', + 17: 'tfi', + 18: 'TST', + 19: 'sgb', + 20: 'esc', + 21: 'esct', + 22: 'eladid', + 23: 'eladidt', + 24: 'kardiachain', + 25: 'cro', + 26: 'L1test', + 27: 'shib', + 28: 'BobaRinkeby', + 29: 'L1', + 30: 'rsk', + 31: 'trsk', + 32: 'GooDT', + 33: 'GooD', + 34: 'dth', + 35: 'tbwg', + 36: 'dx', + 37: 'xpla', + 38: 'val', + 39: 'u2u', + 40: 'TelosEVM', + 41: 'TelosEVMTestnet', + 42: 'lukso', + 43: 'pangolin', + 44: 'crab', + 45: 'pangoro', + 46: 'darwinia', + 47: 'aic', + 48: 'etmp', + 49: 'etmpTest', + 50: 'xdc', + 51: 'txdc', + 52: 'cet', + 53: 'tcet', + 54: 'OP', + 55: 'ZYX', + 56: 'bnb', + 57: 'sys', + 58: 'OntologyMainnet', + 59: 'eos-legacy', + 60: 'go', + 61: 'etc', + 62: 'tetc', + 63: 'metc', + 64: 'ellaism', + 65: 'tokt', + 66: 'okt', + 67: 'dbm', + 68: 'SO1', + 69: 'okov', + 70: 'hsc', + 71: 'cfxtest', + 72: 'dxc', + 73: 'FNCY', + 74: 'idchain', + 75: 'DSC', + 76: 'mix', + 77: 'spoa', + 78: 'primuschain', + 79: 'zenith', + 80: 'GeneChain', + 81: 'joc', + 82: 'Meter', + 83: 'MeterTest', + 84: 'linqto-devnet', + 85: 'gttest', + 86: 'gt', + 87: 'nnw', + 88: 'tomo', + 89: 'tomot', + 90: 'gar-s0', + 91: 'gar-s1', + 92: 'gar-s2', + 93: 'gar-s3', + 94: 'sdlt', + 95: 'camdl', + 96: 'bkc', + 97: 'bnbt', + 98: 'six', + 99: 'poa', + 100: 'gno', + 101: 'eti', + 102: 'tw3g', + 103: 'WLC', + 104: 'tklc', + 105: 'dw3g', + 106: 'vlx', + 107: 'ntn', + 108: 'TT', + 109: 'shibariumecosystem', + 110: 'xpr', + 111: 'ETL', + 112: 'coinbit', + 113: 'deh', + 114: 'c2flr', + 115: 'debank-testnet', + 116: 'debank-mainnet', + 117: 'auptick', + 118: 'arcology', + 119: 'enuls', + 120: 'enulst', + 121: 'REAL', + 122: 'fuse', + 123: 'spark', + 124: 'dwu', + 125: 'OYchainTestnet', + 126: 'OYchainMainnet', + 127: 'feth', + 128: 'heco', + 134: 'rlc', + 135: 'AlyxTestnet', + 136: 'deam', + 137: 'matic', + 138: 'dfio-meta-main', + 139: 'woop', + 141: 'OPtest', + 142: 'dax', + 144: 'PHI', + 148: 'shimmerevm-mainnet', + 150: 'sixt', + 151: 'rbn', + 152: 'rbn-devnet', + 153: 'rbn-testnet', + 154: 'rbn-tge', + 155: 'tenet-testnet', + 156: 'obe', + 160: 'eva', + 161: 'wall-e', + 162: 'tpht', + 163: 'pht', + 165: 'omni_testnet', + 167: 'atoshi', + 168: 'aioz', + 169: 'manta', + 170: 'hoosmartchain', + 172: 'resil', + 180: 'ame', + 186: 'Seele', + 188: 'BMC', + 189: 'BMCT', + 193: 'cem', + 195: 'tokb', + 196: 'okb', + 197: 'NEUTR', + 198: 'bit', + 199: 'BTT', + 200: 'aox', + 201: 'moactest', + 204: 'obnb', + 208: 'utx', + 210: 'BTN', + 211: 'EDI', + 212: 'makalu', + 217: 'SIN2', + 218: 'SO1-old', + 222: 'ASK', + 225: 'LA', + 226: 'TLA', + 230: 'SDX', + 236: 'deamtest', + 242: 'plgchain', + 246: 'ewt', + 248: 'OAS', + 250: 'ftm', + 255: 'kroma', + 256: 'hecot', + 258: 'setm', + 259: 'neon', + 262: 'SUR', + 269: 'hpb', + 271: 'EGONm', + 274: 'lachain', + 280: 'zksync-goerli', + 288: 'Boba', + 291: 'orderly', + 295: 'hedera-mainnet', + 296: 'hedera-testnet', + 297: 'hedera-previewnet', + 298: 'hedera-localnet', + 300: 'ogc', + 301: 'Bobaopera', + 303: 'ncnt', + 309: 'wyz', + 311: 'omax', + 313: 'ncn', + 314: 'filecoin', + 321: 'kcs', + 322: 'kcst', + 324: 'zksync', + 333: 'w3q', + 335: 'DFKTEST', + 336: 'sdn', + 338: 'tcro', + 345: 'YVM', + 361: 'theta-mainnet', + 363: 'theta-sapphire', + 364: 'theta-amber', + 365: 'theta-testnet', + 369: 'pls', + 371: 'tCNT', + 385: 'lisinski', + 400: 'hpn', + 401: 'ozo_tst', + 411: 'pepe', + 416: 'SX', + 418: 'latestnet', + 420: 'ogor', + 424: 'PGN', + 427: 'zeeth', + 443: 'obs-testnet', + 444: 'synapse-sepolia', + 456: 'arzio', + 462: 'tarea', + 499: 'rupx', + 500: 'Camino', + 501: 'Columbus', + 512: 'aac', + 513: 'aact', + 516: 'gz-mainnet', + 520: 'xt', + 529: 'fire', + 530: 'FxCore', + 534: 'CNDL', + 542: 'PAW', + 555: 'CLASS', + 558: 'tao', + 568: 'dct', + 570: 'sys-rollux', + 588: 'metis-stardust', + 592: 'astr', + 595: 'maca', + 596: 'tkar', + 597: 'taca', + 599: 'metis-goerli', + 600: 'mesh-chain-testnet', + 601: 'PEER', + 614: 'glq', + 634: 'avocado', + 647: 'SX-Testnet', + 648: 'ace', + 666: 'pixie-chain-testnet', + 667: 'laos', + 668: 'junca', + 669: 'juncat', + 686: 'kar', + 700: 'SNS', + 707: 'bcs', + 708: 'tbcs', + 710: 'fury', + 719: 'shibarium', + 721: 'LYC', + 740: 'tcanto', + 741: 'vsct', + 742: 'SPAY', + 766: 'qom', + 776: 'opc', + 777: 'cth', + 786: 'maal', + 787: 'aca', + 788: 'taero', + 789: 'peth', + 800: 'LUCID', + 803: 'haic', + 808: 'PFTEST', + 813: 'meer', + 818: 'BOC', + 820: 'clo', + 821: 'tclo', + 841: 'tara', + 842: 'taratest', + 859: 'zeethdev', + 868: 'FSCMainnet', + 876: 'BNKEN', + 877: 'DXT', + 880: 'ambros', + 888: 'wan', + 900: 'gar-test-s0', + 901: 'gar-test-s1', + 902: 'gar-test-s2', + 903: 'gar-test-s3', + 909: 'PF', + 910: 'DBONE', + 917: 'tfire', + 919: 'modesep', + 927: 'ydk', + 940: 'tpls', + 941: 't2bpls', + 942: 't3pls', + 943: 't4pls', + 956: 'munode', + 963: 'btc20', + 970: 'ccn', + 971: 'Huygens', + 972: 'Ascraeus', + 977: 'yeti', + 980: 'top_evm', + 985: 'memochain', + 989: 'top', + 990: 'ELm', + 997: '5ire', + 998: 'ln', + 999: 'twan', + 1000: 'gton', + 1001: 'Baobab', + 1002: 'kai', + 1003: 'tet', + 1004: 't-ekta', + 1007: 'tnew', + 1008: 'eun', + 1010: 'EVC', + 1012: 'new', + 1022: 'sku', + 1023: 'tclv', + 1024: 'clv', + 1028: 'tbtt', + 1030: 'cfx', + 1031: 'prx', + 1038: 'bronos-testnet', + 1039: 'bronos-mainnet', + 1071: 'shimmerevm-testnet-deprecated', + 1072: 'shimmerevm-testnet', + 1079: 'mintara-testnet', + 1080: 'mintara', + 1088: 'metis-andromeda', + 1089: 'humans', + 1099: 'moac', + 1101: 'zkevm', + 1107: 'tblxq', + 1108: 'blxq', + 1111: 'wemix', + 1112: 'twemix', + 1115: 'tcore', + 1116: 'core', + 1117: 'DOGSm', + 1130: 'DFI', + 1131: 'DFI-T', + 1133: 'changi', + 1138: 'ASARt', + 1139: 'MATH', + 1140: 'tMATH', + 1149: 'Plexchain', + 1170: 'auoc', + 1177: 'sht', + 1197: 'iora', + 1201: 'avis', + 1202: 'wtt', + 1213: 'popcat', + 1214: 'enter', + 1229: 'xzo', + 1230: 'UltronTestnet', + 1231: 'UtronMainnet', + 1234: 'step', + 1243: 'ARC', + 1244: 'TARC', + 1246: 'om', + 1252: 'CICT', + 1280: 'HO', + 1284: 'mbeam', + 1285: 'mriver', + 1286: 'mrock-old', + 1287: 'mbase', + 1288: 'mrock', + 1291: 'swtr', + 1294: 'Bobabeam', + 1297: 'Bobabase', + 1311: 'TDOS', + 1314: 'alyx', + 1319: 'aia', + 1320: 'aiatestnet', + 1337: 'geth', + 1338: 'ELST', + 1339: 'ELSM', + 1353: 'CIC', + 1369: 'zafic', + 1379: 'KLC', + 1388: 'ASAR', + 1392: 'mun', + 1402: 'zkevmtest', + 1422: 'testnet-zkEVM-mango-pre-audit-upgraded', + 1433: 'RIK', + 1440: 'LAS', + 1442: 'testnet-zkEVM-mango', + 1452: 'gil', + 1455: 'CTEX', + 1501: 'chainx', + 1506: 'Sherpax', + 1507: 'SherpaxTestnet', + 1515: 'beagle', + 1559: 'tenet', + 1618: 'cate', + 1620: 'ath', + 1657: 'bta', + 1662: 'Yuma', + 1663: 'Gobi', + 1688: 'LUDAN', + 1701: 'AnytypeChain', + 1707: 'TBSI', + 1708: 'tTBSI', + 1718: 'PCM', + 1773: 'TeaParty', + 1777: 'gauss', + 1804: 'kerleano', + 1807: 'rAna', + 1818: 'cube', + 1819: 'cubet', + 1856: 'tsf', + 1875: 'wbt', + 1881: 'gitshockchain', + 1890: 'lightlink_phoenix', + 1891: 'lightlink_pegasus', + 1898: 'boya', + 1907: 'bitci', + 1908: 'tbitci', + 1945: 'onus-testnet', + 1951: 'dchain-mainnet', + 1954: 'Dexilla', + 1967: 'mtc', + 1969: 'tscs', + 1970: 'scs', + 1971: 'atlr', + 1975: 'onus-mainnet', + 1984: 'euntest', + 1985: 'satoshie', + 1986: 'satoshie_testnet', + 1987: 'egem', + 1994: 'ekta', + 1995: 'edx', + 2000: 'dc', + 2001: 'milkAda', + 2002: 'milkALGO', + 2008: 'cloudwalk_testnet', + 2009: 'cloudwalk_mainnet', + 2016: 'NetZm', + 2018: 'pmint_dev', + 2019: 'pmint_test', + 2020: 'pmint', + 2021: 'edg', + 2022: 'edgt', + 2023: 'taycan-testnet', + 2025: 'rpg', + 2031: 'cfg', + 2032: 'ncfg', + 2037: 'kiwi', + 2038: 'shraptest', + 2043: 'otp', + 2044: 'Shrapnel', + 2047: 'stos-testnet', + 2048: 'stos-mainnet', + 2049: 'movo', + 2077: 'QKA', + 2088: 'air', + 2089: 'algl', + 2100: 'eco', + 2101: 'esp', + 2109: 'exn', + 2122: 'Metad', + 2124: 'MEU', + 2137: 'bigsb', + 2138: 'dfio-meta-test', + 2151: 'boa', + 2152: 'fra', + 2153: 'findora-testnet', + 2154: 'findora-forge', + 2199: 'msn', + 2202: 'ABNm', + 2203: 'BTC', + 2213: 'evanesco', + 2221: 'tkava', + 2222: 'kava', + 2223: 'VChain', + 2241: 'KRST', + 2300: 'bomb', + 2309: 'arevia', + 2323: 'sma', + 2330: 'alt', + 2332: 'smam', + 2357: 'deprecated-kroma-sepolia', + 2358: 'kroma-sepolia', + 2399: 'bombt', + 2400: 'TCGV', + 2415: 'xodex', + 2484: 'u2u_nebulas', + 2559: 'ktoc', + 2569: 'tpc', + 2606: 'pocrnet', + 2611: 'REDLC', + 2612: 'EZChain', + 2613: 'Fuji-EZChain', + 2625: 'twbt', + 2710: 'tmorph', + 2888: 'BobaGoerli', + 2999: 'bty', + 3000: 'cennz-r', + 3001: 'cennz-n', + 3003: 'cau', + 3011: '3ULL', + 3031: 'ORL', + 3068: 'bfc', + 3141: 'filecoin-hyperspace', + 3269: 'dubx', + 3270: 'testdubx', + 3306: 'debounce-devnet', + 3331: 'zcrbeach', + 3333: 'w3q-t', + 3334: 'w3q-g', + 3400: 'prb', + 3434: 'SCAIt', + 3500: 'prbtestnet', + 3501: 'jfin', + 3601: 'pando-mainnet', + 3602: 'pando-testnet', + 3636: 'BTCt', + 3637: 'BTCm', + 3666: 'jouleverse', + 3690: 'btx', + 3693: 'empire', + 3698: 'SPCt', + 3699: 'SPCm', + 3701: 'xplatest', + 3737: 'csb', + 3797: 'alv', + 3888: 'kalymainnet', + 3889: 'kalytestnet', + 3912: 'drac', + 3939: 'dost', + 3966: 'dyno', + 3967: 'tdyno', + 3999: 'ycc', + 4000: 'ozo', + 4001: 'PERIUM', + 4002: 'tftm', + 4051: 'BobaoperaTestnet', + 4061: 'Nahmii3Mainnet', + 4062: 'Nahmii3Testnet', + 4090: 'Oasis', + 4096: 'BNIt', + 4099: 'BNIm', + 4102: 'aioz-testnet', + 4139: 'humans_testnet', + 4141: 'TPBXt', + 4181: 'PHIv1', + 4201: 'lukso-testnet', + 4242: 'nexi', + 4328: 'BobaFujiTestnet', + 4337: 'beam', + 4444: 'html', + 4460: 'orderlyl2', + 4689: 'iotex-mainnet', + 4690: 'iotex-testnet', + 4759: 'TESTMEV', + 4777: 'TBXN', + 4918: 'txvm', + 4919: 'xvm', + 4999: 'BXN', + 5000: 'mantle', + 5001: 'mantle-testnet', + 5002: 'treasurenet', + 5005: 'tntest', + 5165: 'ftn', + 5177: 'tlc', + 5197: 'es', + 5234: 'hmnd', + 5290: '_old_fire', + 5315: 'UZMI', + 5353: 'ttrn', + 5522: 'VEX', + 5551: 'Nahmii', + 5553: 'NahmiiTestnet', + 5555: 'cverse', + 5611: 'obnbt', + 5616: 'ARCT', + 5678: 'TanssiCC', + 5700: 'tsys', + 5729: 'hik', + 5758: 'satst', + 5777: 'ggui', + 5851: 'OntologyTestnet', + 5869: 'rbd', + 6065: 'TRESTEST', + 6066: 'TRESMAIN', + 6102: 'cascadia', + 6118: 'UPTN-TEST', + 6119: 'UPTN', + 6502: 'Peerpay', + 6552: 'SRC-test', + 6565: 'fox', + 6626: 'pixie-chain', + 6688: 'iris', + 6789: 'STANDm', + 6969: 'tombchain', + 6999: 'psc', + 7000: 'zetachain-mainnet', + 7001: 'zetachain-athens', + 7027: 'ELLA', + 7070: 'planq', + 7171: 'bitrock', + 7331: 'kly', + 7332: 'EON', + 7341: 'shyft', + 7484: 'raba', + 7518: 'MEV', + 7575: 'tadil', + 7576: 'adil', + 7668: 'trn-mainnet', + 7672: 'trn-porcini', + 7700: 'canto', + 7701: 'TestnetCanto', + 7771: 'tbitrock', + 7777: 'RiseOfTheWarbotsTestnet', + 7878: 'tscas', + 7895: 'ard', + 7979: 'dos', + 8000: 'teleport', + 8001: 'teleport-testnet', + 8029: 'mdgl', + 12357: 'rei', + 7363: 'dnd', + 9052: 'acrechain', + 8080: 'Liberty10', + 8081: 'Liberty20', + 8082: 'Sphinx10', + 8086: 'BitEth', + 8098: 'StreamuX', + 8131: 'meertest', + 8132: 'meermix', + 8133: 'meerpriv', + 8134: 'amana', + 8135: 'flana', + 8136: 'mizana', + 8181: 'tBOC', + 8217: 'Cypress', + 8272: 'BTON', + 8285: 'Kortho', + 8387: 'fuck', + 8453: 'base', + 8654: 'toki', + 8655: 'toki-testnet', + 8723: 'olo', + 8724: 'tolo', + 8738: 'alph', + 8768: 'tmy', + 8848: 'maro', + 8880: 'unq', + 8881: 'qtz', + 8882: 'opl', + 8883: 'sph', + 8888: 'XANAChain', + 8889: 'vsc', + 8898: 'mmt', + 8899: 'jbc', + 8989: 'gmmt', + 8995: 'berg', + 9000: 'evmos-testnet', + 9001: 'evmos', + 9012: 'brb', + 9100: 'GENEC', + 9170: '_old_tfire', + 9223: 'COF', + 9339: 'DOGSt', + 9527: 'trpg', + 9528: 'QETTest', + 9559: 'testneon', + 9700: 'MainnetDev', + 9728: 'BobaBnbTestnet', + 9768: 'NetZt', + 9779: 'pn', + 9790: 'carbon', + 9792: 'carbon-testnet', + 9818: 'tIMP', + 9819: 'IMP', + 9977: 'tMIND', + 9990: 'AGNG', + 9996: 'MIND', + 9997: 'alt-testnet', + 9999: 'myn', + 10000: 'smartbch', + 10001: 'smartbchtest', + 10024: 'gon', + 10081: 'joct', + 10086: 'SJ', + 10101: 'GEN', + 10200: 'chi', + 10201: 'PWR', + 10243: 'aa', + 10248: '0xt', + 10395: 'TWLC', + 10507: 'Jade', + 10508: 'Snow', + 10823: 'CCP', + 10946: 'quadrans', + 10947: 'quadranstestnet', + 11110: 'astra', + 11111: 'WAGMI', + 11115: 'astra-testnet', + 11119: 'hbit', + 11235: 'ISLM', + 11437: 'shyftt', + 11612: 'SRDXt', + 11888: 'SAN', + 11891: 'Arianee', + 12009: 'sats', + 12051: 'tZERO', + 12052: 'ZERO', + 12123: 'BRC', + 12306: 'fibo', + 12321: 'blgchain', + 12345: 'steptest', + 12611: 'astrzk', + 12715: 'tRIK', + 12890: 'tqnet', + 13000: 'SPS', + 13308: 'Credit', + 13337: 'beam-testnet', + 13381: 'Phoenix', + 13812: 'sus', + 14000: 'SPS-Test', + 14853: 'hmnd-t5', + 15551: 'loop', + 15555: 'TrustTestnet', + 15557: 'eos-testnet', + 16000: 'mtt', + 16001: 'mtttest', + 16507: 'Genesys', + 16688: 'nyancat', + 16718: 'airdao', + 16888: 'tivar', + 17000: 'holesky', + 17171: 'G8Cm', + 17180: 'PCT', + 17777: 'eos', + 18000: 'ZKST', + 18122: 'STN', + 18159: 'pom', + 18181: 'G8Ct', + 18686: 'MXCzkEVM', + 19011: 'HMV', + 19845: 'btcix', + 20001: 'Camelark', + 20729: 'CLOTestnet', + 20736: 'p12', + 21337: 'cennz-a', + 21816: 'omc', + 22023: 'SFL', + 22040: 'airdao-test', + 22222: 'NAUTCHAIN', + 22776: 'map', + 23006: 'ABNt', + 23118: 'opside', + 23294: 'sapphire', + 23295: 'sapphire-testnet', + 24484: 'web', + 24734: 'mintme', + 25888: 'GOLDT', + 25925: 'bkct', + 26026: 'frm', + 26600: 'HTZ', + 26863: 'OAC', + 28528: 'obgor', + 30067: 'Piece', + 30103: 'ceri', + 31102: 'esn', + 31223: 'CLDTX', + 31224: 'CLD', + 31337: 'got', + 31415: 'filecoin-wallaby', + 32520: 'Brise', + 32659: 'fsn', + 32769: 'zil', + 32990: 'zil-isolated-server', + 33101: 'zil-testnet', + 33333: 'avs', + 33385: 'zil-devnet', + 33469: 'zq2-devnet', + 35011: 'j2o', + 35441: 'q', + 35443: 'q-testnet', + 38400: 'cmrpg', + 38401: 'ttrpg', + 39797: 'nrg', + 39815: 'oho', + 41500: 'ox-beta', + 42069: 'PC', + 42161: 'arb1', + 42170: 'arb-nova', + 42220: 'celo', + 42261: 'emerald-testnet', + 42262: 'emerald', + 42801: 'GST', + 42888: 'keth', + 43110: 'avaeth', + 43113: 'Fuji', + 43114: 'avax', + 43288: 'bobaavax', + 44444: 'FREN', + 44787: 'ALFA', + 45000: 'AutobahnNetwork', + 46688: 'tfsn', + 47805: 'REI', + 49049: 'floripa', + 49088: 'tbfc', + 49797: 'tnrg', + 50001: 'LOE', + 50021: 'tgton', + 51178: 'Opside-Testnet', + 51712: 'SRDXm', + 53935: 'DFK', + 54211: 'ISLMT', + 54321: 'ToronetTestnet', + 55004: 'teth', + 55555: 'reichain', + 55556: 'trei', + 56288: 'BobaBnb', + 56789: 'VELO', + 57000: 'tsys-rollux', + 58008: 'sepPGN', + 59140: 'linea-testnet', + 59144: 'linea', + 60000: 'TKM-test0', + 60001: 'TKM-test1', + 60002: 'TKM-test2', + 60103: 'TKM-test103', + 61800: 'aium-dev', + 61803: 'Etica', + 61916: 'DoKEN', + 62320: 'BKLV', + 62621: 'mtv', + 63000: 'ecs', + 63001: 'ecs-testnet', + 65450: 'SRC', + 67390: 'mcl', + 67588: 'Cosmic', + 69420: 'cndr', + 70000: 'TKM0', + 70001: 'TKM1', + 70002: 'TKM2', + 70103: 'TKM103', + 71111: 'GuapX', + 71393: 'ckb', + 71401: 'gw-testnet-v1', + 71402: 'gw-mainnet-v1', + 73799: 'vt', + 73927: 'mvm', + 75000: 'resin', + 77238: 'fnc', + 77612: 'vscm', + 77777: 'Toronet', + 78110: 'firenze', + 78281: 'dfly', + 78430: 'amplify', + 78431: 'bulletin', + 78432: 'conduit', + 79879: 'STANDt', + 80001: 'maticmum', + 81341: 'amanatest', + 81342: 'amanamix', + 81343: 'amanapriv', + 81351: 'flanatest', + 81352: 'flanamix', + 81353: 'flanapriv', + 81361: 'mizanatest', + 81362: 'mizanamix', + 81363: 'mizanapriv', + 81720: 'qnet', + 84531: 'basegor', + 84886: 'Aerie', + 85449: 'Cyber', + 88002: 'NAUTTest', + 88880: 'chz', + 88888: 'ivar', + 90210: 'bvhl', + 91002: 'NAUT', + 92001: 'lambda-testnet', + 96970: 'mantis', + 97288: 'BobaBnbOld', + 99099: 'ELt', + 99998: 'usctest', + 99999: 'usc', + 100000: 'qkc-r', + 100001: 'qkc-s0', + 100002: 'qkc-s1', + 100003: 'qkc-s2', + 100004: 'qkc-s3', + 100005: 'qkc-s4', + 100006: 'qkc-s5', + 100007: 'qkc-s6', + 100008: 'qkc-s7', + 100009: 'vechain', + 100010: 'vechain-testnet', + 100100: 'chi1', + 101010: 'SVRNt', + 103090: 'CRFI', + 108801: 'bro', + 110000: 'qkc-d-r', + 110001: 'qkc-d-s0', + 110002: 'qkc-d-s1', + 110003: 'qkc-d-s2', + 110004: 'qkc-d-s3', + 110005: 'qkc-d-s4', + 110006: 'qkc-d-s5', + 110007: 'qkc-d-s6', + 110008: 'qkc-d-s7', + 111000: 'testsbr', + 111111: 'sbr', + 112358: 'metao', + 123456: 'dadil', + 131419: 'ETND', + 142857: 'ICPlaza', + 167004: 'taiko-a2', + 167005: 'taiko-l2', + 167006: 'taiko-l3', + 167007: 'tko-jolnir', + 188881: 'condor', + 200101: 'milkTAda', + 200202: 'milkTAlgo', + 200625: 'aka', + 201018: 'alaya', + 201030: 'alayadev', + 201804: 'myth', + 202020: 'tDSC', + 202624: 'twl-jellie', + 210425: 'platon', + 220315: 'mas', + 221230: 'reap', + 221231: 'reap-testnet', + 224168: 'TAFECO', + 230315: 'hsktest', + 234666: 'hym', + 246529: 'ats', + 246785: 'atstau', + 247253: 'saakuru-testnet', + 256256: 'cmp-mainnet', + 266256: 'gz-testnet', + 271271: 'EGONt', + 281121: 'SoChain', + 314159: 'filecoin-calibration', + 330844: 'tc', + 333331: 'avst', + 333666: 'oonetest', + 333777: 'oonedev', + 333888: 'sparta', + 333999: 'olympus', + 355113: 'Bitfinity', + 373737: 'hap-testnet', + 381931: 'metal', + 381932: 'Tahoe', + 404040: 'TPBXm', + 420420: 'KEK', + 420666: 'tKEK', + 420692: 'alterium', + 421611: 'arb-rinkeby', + 421613: 'arb-goerli', + 421614: 'arb-sep', + 424242: 'fastexTestnet', + 431140: 'markr-go', + 432201: 'dexalot-testnet', + 432204: 'dexalot', + 444900: 'wlkt', + 471100: 'psep', + 474142: 'oc', + 512512: 'cmp', + 513100: 'ethf', + 534351: 'scr-sepolia', + 534352: 'scr', + 534353: 'scr-alpha', + 534354: 'scr-prealpha', + 534849: 'shi', + 535037: 'BESC', + 622277: 'rth', + 641230: 'BRNKC', + 651940: 'ALL', + 666666: 'vpioneer', + 751230: 'BRNKCTEST', + 761412: 'Miexs', + 776877: 'mdlrm', + 800001: 'octa', + 827431: 'CURVEm', + 846000: 'bloqs4good', + 888888: 'vision', + 900000: 'psc-s0', + 910000: 'psc-t-s0', + 920000: 'psc-d-s0', + 920001: 'psc-d-s1', + 923018: 'tFNCY', + 955305: 'elv', + 1261120: 'azktn', + 1313114: 'etho', + 1313500: 'xero', + 1337702: 'kintsugi', + 1337802: 'kiln', + 1337803: 'zhejiang', + 2021398: 'dbk', + 2099156: 'plian-mainnet', + 2203181: 'platondev', + 2206132: 'platondev2', + 3141592: 'filecoin-butterfly', + 3441005: 'mantaTestnet', + 4000003: 'alt-zerogas', + 4281033: 'worldscal', + 5167003: 'MXC', + 5555555: 'imversed', + 5555558: 'imversed-testnet', + 7225878: 'saakuru', + 7355310: 'vsl', + 7668378: 'tqom', + 7762959: 'music', + 7777777: 'zora', + 8007736: 'plian-mainnet-l2', + 8794598: 'hap', + 8888881: 'quarix-testnet', + 8888888: 'quarix', + 10067275: 'plian-testnet-l2', + 10101010: 'SVRNm', + 11155111: 'sep', + 13371337: 'tpep', + 14288640: 'anduschain-mainnet', + 16658437: 'plian-testnet', + 18289463: 'ilt', + 20180430: 'spectrum', + 20181205: 'qki', + 20201022: 'pg', + 22052002: 'xlon', + 27082017: 'exlvolta', + 27082022: 'exl', + 28945486: 'auxi', + 29032022: 'fla', + 31415926: 'filecoin-local', + 35855456: 'JOYS', + 43214913: 'mais', + 61717561: 'aqua', + 65010000: 'bakerloo-0', + 65100000: 'piccadilly-0', + 88888888: 'team', + 99415706: 'TOYS', + 192837465: 'GTH', + 222000222: 'kanazawa', + 245022926: 'neonevm-devnet', + 245022934: 'neonevm-mainnet', + 245022940: 'neonevm-testnet', + 278611351: 'razor', + 311752642: 'oneledger', + 333000333: 'meld', + 344106930: 'calypso-testnet', + 356256156: 'tGTH', + 486217935: 'dGTH', + 503129905: 'nebula-staging', + 1122334455: 'ipos', + 1146703430: 'cyb', + 1273227453: 'human-mainnet', + 1313161554: 'aurora', + 1313161555: 'aurora-testnet', + 1313161556: 'aurora-betanet', + 1351057110: 'chaos-tenet', + 1380996178: 'rptr', + 1482601649: 'nebula-mainnet', + 1564830818: 'calypso-mainnet', + 1666600000: 'hmy-s0', + 1666600001: 'hmy-s1', + 1666600002: 'hmy-s2', + 1666600003: 'hmy-s3', + 1666700000: 'hmy-b-s0', + 1666700001: 'hmy-b-s1', + 1666900000: 'hmy-ps-s0', + 1666900001: 'hmy-ps-s1', + 2021121117: 'hop', + 2046399126: 'europa', + 2863311531: 'a8', + 3125659152: 'pirl', + 4216137055: 'frankenstein', + 11297108099: 'tpalm', + 11297108109: 'palm', + 111222333444: 'alphabet', + 197710212030: 'ntt', + 197710212031: 'ntt-haradev', + 383414847825: 'zeniq', + 666301171999: 'ipdc', + 6022140761023: 'mole', + 868455272153094: 'gw-testnet-v1-deprecated' } as const; export const EXPLORER_API_URLS = { @@ -1483,6 +1483,12 @@ export const contractData = [ } ] as const; -export const transactionTypes = ['transferFunds', 'transferNFT', 'contractInteraction', 'raw'] as const +export const transactionTypes = [ + 'transferFunds', + 'transferNFT', + 'contractInteraction', + 'raw' +] as const; -export const solidityZeroHexString = '0x0000000000000000000000000000000000000000000000000000000000000000'; \ No newline at end of file +export const solidityZeroHexString = + '0x0000000000000000000000000000000000000000000000000000000000000000'; diff --git a/src/plugins/oSnap/types.ts b/src/plugins/oSnap/types.ts index fa0c9b33..0818462c 100644 --- a/src/plugins/oSnap/types.ts +++ b/src/plugins/oSnap/types.ts @@ -4,15 +4,14 @@ import networks from '@snapshot-labs/snapshot.js/src/networks.json'; import { safePrefixes, transactionTypes } from './constants'; /** - * Represents details about the chains that snapshot supports as described in the `networks` json file. - * + * Represents details about the chains that snapshot supports as described in the `networks` json file. + * * This corresponds to one of the chain ids that snapshot supports. - * + * * @see `@snapshot-labs/snapshot.js/src/networks.json`. */ type Networks = typeof networks; - /** * One of the supported networks as defined in `@snapshot-labs/snapshot.js/src/networks.json`. * @see Networks @@ -25,7 +24,7 @@ export type Network = keyof Networks; */ export type SafeNetworkPrefixes = typeof safePrefixes; -/** +/** * One of the supported network prefixes as defined in EIP-3770 used by Safe apps. * @see SafeNetworkPrefixes */ @@ -33,7 +32,7 @@ export type SafeNetworkPrefix = SafeNetworkPrefixes[Network]; /** * Represents the four different types of transactions that oSnap supports. - * + * * - Transfer Funds * - Transfer NFT (also called Collectable) * - Contract Interaction @@ -43,7 +42,7 @@ export type TransactionTypes = typeof transactionTypes; /** * One of the four different types of transactions that oSnap supports. - * + * * - Transfer Funds * - Transfer NFT (also called Collectable) * - Contract Interaction @@ -53,29 +52,38 @@ export type TransactionType = TransactionTypes[number]; /** * The Optimistic Governor contract requires transactions that it executes to be formatted like this. - * + * * This corresponds to the values found in the `Transaction` struct in the Optimistic Governor contract. - * + * * @see https://github.com/UMAprotocol/protocol/blob/master/packages/core/contracts/optimistic-governor/implementation/OptimisticGovernor.sol - * + * * NOTE: Since we don't support the contract's `delegatecall` feature in oSnap, the value for `operation` is always 0. */ -export type OptimisticGovernorTransaction = [to: string, operation: 0, value: string, data: string]; +export type OptimisticGovernorTransaction = [ + to: string, + operation: 0, + value: string, + data: string +]; /** * Represents the data associated with the different types of transactions that oSnap supports. - * - * This is a discriminated union of the four object types that represent the data associated with a given transaction. The union discriminates on the `type` property of the objects. - * + * + * This is a discriminated union of the four object types that represent the data associated with a given transaction. The union discriminates on the `type` property of the objects. + * * @see TransactionTypes */ -export type Transaction = RawTransaction | ContractInteractionTransaction | TransferNftTransaction | TransferFundsTransaction; +export type Transaction = + | RawTransaction + | ContractInteractionTransaction + | TransferNftTransaction + | TransferFundsTransaction; /** * Represents the fields that all transactions share. - * + * * All the transaction types inherit from this type, adding their `type` field and any additional fields that they require. - * + * * NOTE: the `formatted` field is what is actually sent to the Optimistic Governor contract. */ export type BaseTransaction = { @@ -83,22 +91,22 @@ export type BaseTransaction = { value: string; data: string; formatted: OptimisticGovernorTransaction; -} +}; /** * Represents a 'raw' transaction that does not have any additional fields. */ export type RawTransaction = BaseTransaction & { type: 'raw'; -} +}; /** * Represents a transaction that interacts with an arbitrary contract. - * + * * @field `abi` field is the ABI of the contract that the transaction interacts with, represented as a JSON string. - * + * * @field `methodName` field is the name of the method on the contract that the transaction calls. - * + * * @field `parameters` field is an array of strings that represent the parameters that the method takes. NOTE: some methods take arrays or tuples as arguments, so some of these strings in the array may be JSON formatted arrays or tuples. */ export type ContractInteractionTransaction = BaseTransaction & { @@ -106,28 +114,28 @@ export type ContractInteractionTransaction = BaseTransaction & { abi?: string; methodName?: string; parameters?: string[]; -} +}; /** * Represents a transaction that transfers an NFT (also called a Collectable). - * + * * @field `recipient` field is the address of the recipient of the NFT. - * + * * @field `collectable` field is the NFT that is being transferred. */ export type TransferNftTransaction = BaseTransaction & { type: 'transferNFT'; recipient?: string; collectable?: NFT; -} +}; /** * Represents a transaction that transfers funds. - * + * * @field `amount` field is the amount of funds that are being transferred. - * + * * @field `recipient` field is the address of the recipient of the funds. - * + * * @field `token` field is the token that is being transferred. */ export type TransferFundsTransaction = BaseTransaction & { @@ -135,30 +143,30 @@ export type TransferFundsTransaction = BaseTransaction & { amount?: string; recipient?: string; token?: Token; -} +}; /** * The base type for assets that can be transferred by a transaction. - * + * * Can represent either an NFT or an ERC20 token. - * + * * @field `name` field is the name of the asset. * @field `address` field is the address of the asset. * @field `logoUri` field is the URI of the logo of the asset, if one exists. * @field `imageUri` field is the URI of the image of the asset, if one exists. - * + * * @see https://miyauchi.dev/posts/typescript-literal-hack/ for details about the `(string & {})` syntax. */ export type Asset = { name: string; - address: "main" | (string & {}); + address: 'main' | (string & {}); logoUri?: string; imageUri?: string; -} +}; /** * Represents an ERC20 token. - * + * * @field `symbol` field is the symbol of the token. * @field `decimals` field is the number of decimals that the token has. * @field `balance` field is the balance of the token that the user has. @@ -171,22 +179,22 @@ export type Token = Asset & { balance?: string; verified?: boolean; chainId?: Network; -} +}; /** * Represents an ERC-721 NFT (also called a Collectable). - * + * * @field `id` field is the id of the NFT, usually used as the mint number. * @field `tokenName` field is the name of the NFT. */ export type NFT = Asset & { id: string; tokenName?: string; -} +}; /** * Represents the response from the Gnosis Safe API when fetching the balances of the tokens that the user has. This is immediately transformed after fetching into the `Token` type, which holds both the token and the balance. - * + * * @field `tokenAddress` field is the address of the token. * @field `token` field is the token that the safe has. * @field `balance` field is the balance of the token that the user has. @@ -200,13 +208,13 @@ export type BalanceResponse = { symbol: string; }; balance: string; -} +}; /** * Represents the data associated with a safe. - * + * * The plugin persists one object with this shape per proposal created. This object holds the `transactions` that the Optimistic Governor contract will execute. - * + * * @field `safeName` field is the name of the safe. * @field `safeAddress` field is the address of the safe. * @field `network` field is the id for network that the safe is on. @@ -219,29 +227,29 @@ export type GnosisSafe = { network: Network; moduleAddress: string; transactions: Transaction[]; -} +}; /** * Represents the data associated with the plugin. - * + * * Holds one object with this shape per proposal created. This is the shape of the data that is persisted by the plugin. - * + * * `safe` is null when first creating a plugin, but is then immediately populated once the user picks a safe. - * + * * @field `safe` field is the safe that the plugin is currently working with. */ export type OsnapPluginData = { - safe: GnosisSafe | null; -} + safe: GnosisSafe | null; +}; /** - * Snapshot has a global store that holds all the data for all the plugins. - * + * Snapshot has a global store that holds all the data for all the plugins. + * * This is the shape of the data that the plugin stores in the global store. */ export type OsnapModelValue = { oSnap: OsnapPluginData; -} +}; /** * Represents the data associated with an assertion as defined in the OO V3 contract. @@ -266,7 +274,7 @@ export type OsnapModelValue = { } */ export type Assertion = { - asserter: string + asserter: string; assertionTime: BigNumber; settled: boolean; currency: string; @@ -277,7 +285,7 @@ export type Assertion = { bond: BigNumber; callbackRecipient: string; disputer: string; -} +}; export type AssertionGql = { assertionId: string; @@ -287,7 +295,7 @@ export type AssertionGql = { disputeHash: string | null; assertionLogIndex: string; settlementResolution: boolean | null; -} +}; export type AssertionEvent = { assertionId: string; @@ -298,7 +306,7 @@ export type AssertionEvent = { isExpired: boolean; isSettled: boolean; rejectedByOracle: boolean; -} +}; export type OGModuleDetails = { moduleAddress: string; @@ -306,85 +314,88 @@ export type OGModuleDetails = { rules: string; minimumBond: BigNumber; challengePeriod: BigNumber; -} - +}; export type CollateralDetails = { erc20Contract: Contract; address: string; symbol: string; decimals: BigNumber; -} +}; export type AssertionMadeEvent = { args: { assertionId: string; // indexed - domainId: string; - claim: string; - asserter: string; // indexed - callbackRecipient: string; - escalationManager: string; - caller: string; - expirationTime: BigNumber; - currency: string; - bond: BigNumber; - identifier: string; // indexed - } -} + domainId: string; + claim: string; + asserter: string; // indexed + callbackRecipient: string; + escalationManager: string; + caller: string; + expirationTime: BigNumber; + currency: string; + bond: BigNumber; + identifier: string; // indexed + }; +}; export type AssertionDisputedEvent = { args: { assertionId: string; // indexed - caller: string; // indexed - disputer: string; // indexed - } -} + caller: string; // indexed + disputer: string; // indexed + }; +}; export type AssertionSettledEvent = { args: { assertionId: string; // indexed - bondRecipient: string; // indexed - disputed: boolean; - settlementResolution: boolean; - settlementCaller: string; - } -} + bondRecipient: string; // indexed + disputed: boolean; + settlementResolution: boolean; + settlementCaller: string; + }; +}; export type TransactionsProposedEvent = { args: { proposer: string; // indexed - proposalTime: BigNumber; // indexed - assertionId: string; // indexed - proposal: { - transactions: OptimisticGovernorTransaction[]; - requestTime: BigNumber; - } - proposalHash: string; - explanation: string; - rules: string; - challengeWindowEvents: BigNumber; - } -} + proposalTime: BigNumber; // indexed + assertionId: string; // indexed + proposal: { + transactions: OptimisticGovernorTransaction[]; + requestTime: BigNumber; + }; + proposalHash: string; + explanation: string; + rules: string; + challengeWindowEvents: BigNumber; + }; +}; export type ProposalExecutedEvent = { args: { proposalHash: string; // indexed - assertionId: string; // indexed - } -} + assertionId: string; // indexed + }; +}; export type AssertionDetails = { assertionHash: string; assertionLogIndex: string; -} -export type OGProposalState = { - status: 'can-propose-to-og'; - isDisputed: boolean; -} | AssertionDetails & { - status: 'in-oo-challenge-period'; - expirationTime: number; -} | AssertionDetails & { - status: 'can-request-tx-execution' -}| AssertionDetails & { - status: 'transactions-executed'; -} \ No newline at end of file +}; +export type OGProposalState = + | { + status: 'can-propose-to-og'; + isDisputed: boolean; + } + | (AssertionDetails & { + status: 'in-oo-challenge-period'; + expirationTime: number; + }) + | (AssertionDetails & { + status: 'can-request-tx-execution'; + }) + | (AssertionDetails & { + status: 'transactions-executed'; + }); diff --git a/src/plugins/oSnap/utils/abi.ts b/src/plugins/oSnap/utils/abi.ts index 8e26f485..57451a27 100644 --- a/src/plugins/oSnap/utils/abi.ts +++ b/src/plugins/oSnap/utils/abi.ts @@ -1,16 +1,15 @@ -import { - FunctionFragment, - Interface, - ParamType -} from '@ethersproject/abi'; +import { FunctionFragment, Interface, ParamType } from '@ethersproject/abi'; import { BigNumberish } from '@ethersproject/bignumber'; import { memoize } from 'lodash'; import { ERC20_ABI, ERC721_ABI, EXPLORER_API_URLS } from '../constants'; -import { mustBeEthereumAddress, mustBeEthereumContractAddress } from './validators'; +import { + mustBeEthereumAddress, + mustBeEthereumContractAddress +} from './validators'; /** * Checks if the `parameter` of a contract method `method` takes an array or tuple as input, based on the `baseType` of the parameter. - * + * * If this is the case, we must parse the value as JSON and verify that it is valid. */ export function isArrayParameter(parameter: string): boolean { @@ -75,7 +74,7 @@ export async function getContractABI( /** * Checks if a method is a write function. - * + * * Only write functions can be executed by the Optimistic Governor. */ export function isWriteFunction(method: FunctionFragment) { @@ -102,7 +101,7 @@ export function getABIWriteFunctions(abi: string) { /** * Handles the extraction of the method's arguments from the `values` array. - * + * * If the parameter is an array or tuple, we parse the value as JSON. */ function extractMethodArgs(values: string[]) { diff --git a/src/plugins/oSnap/utils/getters.ts b/src/plugins/oSnap/utils/getters.ts index db07a33a..78e13f83 100644 --- a/src/plugins/oSnap/utils/getters.ts +++ b/src/plugins/oSnap/utils/getters.ts @@ -18,12 +18,25 @@ import { safePrefixes, solidityZeroHexString } from '../constants'; -import { AssertionGql, AssertionMadeEvent, BalanceResponse, CollateralDetails, NFT, Network, OGModuleDetails, OGProposalState, OptimisticGovernorTransaction, ProposalExecutedEvent, SafeNetworkPrefix, TransactionsProposedEvent } from '../types'; +import { + AssertionGql, + AssertionMadeEvent, + BalanceResponse, + CollateralDetails, + NFT, + Network, + OGModuleDetails, + OGProposalState, + OptimisticGovernorTransaction, + ProposalExecutedEvent, + SafeNetworkPrefix, + TransactionsProposedEvent +} from '../types'; import { pageEvents } from './events'; /** * Calls the Gnosis Safe Transaction API - * + * * Ideal usage is to specify the shape of the response with the generic type parameter, assuming that the shape of the response is known. */ async function callGnosisSafeTransactionApi( @@ -41,7 +54,10 @@ async function callGnosisSafeTransactionApi( export const getGnosisSafeBalances = memoize( (network: Network, safeAddress: string) => { const endpointPath = `/v1/safes/${safeAddress}/balances/`; - return callGnosisSafeTransactionApi[]>(network, endpointPath); + return callGnosisSafeTransactionApi[]>( + network, + endpointPath + ); }, (safeAddress, network) => `${safeAddress}_${network}` ); @@ -58,7 +74,7 @@ export const getGnosisSafeCollectibles = memoize( next: unknown; previous: unknown; results: NFT[]; - } + }; return callGnosisSafeTransactionApi(network, endpointPath); }, (safeAddress, network) => `${safeAddress}_${network}` @@ -67,11 +83,11 @@ export const getGnosisSafeCollectibles = memoize( /** * Fetches the block number of a given contract's deployment. */ -function getDeployBlock(params: { - network: Network, - name: string, -}): number { - const results = contractData.filter(contract => contract.network === params.network && contract.name === params.name) +function getDeployBlock(params: { network: Network; name: string }): number { + const results = contractData.filter( + contract => + contract.network === params.network && contract.name === params.name + ); if (results.length === 1) return results[0].deployBlock ?? 0; return 0; } @@ -79,11 +95,11 @@ function getDeployBlock(params: { /** * Fetches the subgraph url for a given contract on a given network. */ -function getContractSubgraph(params: { - network: Network; - name: string; -}) { - const results = contractData.filter(contract => contract.network === params.network && contract.name === params.name) +function getContractSubgraph(params: { network: Network; name: string }) { + const results = contractData.filter( + contract => + contract.network === params.network && contract.name === params.name + ); if (results.length > 1) throw new Error( `Too many results finding ${params.name} subgraph on network ${params.network}` @@ -115,7 +131,7 @@ function getOracleV3Subgraph(network: Network): string { /** * Executes a graphql query. - * + * * Ideal usage is to specify the shape of the response with the generic type parameter, assuming that the shape of the response is known. */ export const queryGql = async (url: string, query: string) => { @@ -143,14 +159,19 @@ export const queryGql = async (url: string, query: string) => { } return data.data as Result; } catch (error) { - throw new Error(`Network error: ${error instanceof Error ? error.message: error}`); + throw new Error( + `Network error: ${error instanceof Error ? error.message : error}` + ); } }; /** * Returns the address of the Optimistic Governor contract deployment associated with a given treasury (Safe) from the graph. */ -export const getModuleAddressForTreasury = async (network: Network, treasuryAddress: string) => { +export const getModuleAddressForTreasury = async ( + network: Network, + treasuryAddress: string +) => { const subgraph = getOptimisticGovernorSubgraph(network); const query = ` query getModuleAddressForTreasury { @@ -160,15 +181,15 @@ export const getModuleAddressForTreasury = async (network: Network, treasuryAddr } } } - ` + `; type Result = { safe: { optimisticGovernor: { id: string } }; - } + }; const result = await queryGql(subgraph, query); return result?.safe?.optimisticGovernor?.id ?? ''; -} +}; /** * Checks if a given treasury (Safe) has enabled oSnap. @@ -195,14 +216,22 @@ export const getIsOsnapEnabled = async ( /** * Takes an array of treasuries and checks if any of them have oSnap enabled. */ -export const getSpaceHasOsnapEnabledTreasury = async (treasuries: TreasuryWallet[]) => { - const isOsnapEnabledOnTreasuriesResult = await Promise.all(treasuries.map(treasury => getIsOsnapEnabled(treasury.network as Network, treasury.address))) - return isOsnapEnabledOnTreasuriesResult.some(isOsnapEnabled => isOsnapEnabled); -} +export const getSpaceHasOsnapEnabledTreasury = async ( + treasuries: TreasuryWallet[] +) => { + const isOsnapEnabledOnTreasuriesResult = await Promise.all( + treasuries.map(treasury => + getIsOsnapEnabled(treasury.network as Network, treasury.address) + ) + ); + return isOsnapEnabledOnTreasuriesResult.some( + isOsnapEnabled => isOsnapEnabled + ); +}; /** * Creates the url for the Safe app to configure oSnap. - * + * * The data that the Safe app needs is encoded as URL search params. */ export function makeConfigureOsnapUrl(params: { @@ -237,7 +266,10 @@ export function makeConfigureOsnapUrl(params: { /** * Fetches the details of a given assertion from the Optimistic Oracle V3 subgraph. */ -async function getAssertionGql(params: { network: Network, assertionId: string; }) { +async function getAssertionGql(params: { + network: Network; + assertionId: string; +}) { const { assertionId, network } = params; const oracleUrl = getOracleV3Subgraph(network); const request = ` @@ -255,22 +287,27 @@ async function getAssertionGql(params: { network: Network, assertionId: string; `; type Result = { assertion: AssertionGql | undefined; - } + }; const result = await queryGql(oracleUrl, request); return result?.assertion; } /** * Fetches the details of a given proposal from the Optimistic Governor subgraph. */ -async function getOgProposalGql(params: { network: Network, explanation: string; moduleAddress: string; transactions: OptimisticGovernorTransaction[] }) { +async function getOgProposalGql(params: { + network: Network; + explanation: string; + moduleAddress: string; + transactions: OptimisticGovernorTransaction[]; +}) { const { network, transactions, explanation, moduleAddress } = params; const proposalHash = getProposalHashFromTransactions(transactions); const encodedExplanation = pack( ['bytes'], [toUtf8Bytes(explanation.replace(/^0x/, ''))] ); -const subgraph = getOptimisticGovernorSubgraph(network); -const request = ` + const subgraph = getOptimisticGovernorSubgraph(network); + const request = ` { proposals(where:{proposalHash:"${proposalHash}",explanation:"${encodedExplanation}",optimisticGovernor:"${moduleAddress.toLowerCase()}"}){ id @@ -280,16 +317,28 @@ const request = ` } } `; -type Result = { - proposals: { id: string; executed: boolean; assertionId: string; deleted: boolean }[]; -} -const result = await queryGql(subgraph, request); -// we can only use the gql `where` clause when querying a list, but we know that there will only be one result. -return result?.proposals[0]; + type Result = { + proposals: { + id: string; + executed: boolean; + assertionId: string; + deleted: boolean; + }[]; + }; + const result = await queryGql(subgraph, request); + // we can only use the gql `where` clause when querying a list, but we know that there will only be one result. + return result?.proposals[0]; } -export async function getCollateralDetailsForProposal(provider: StaticJsonRpcProvider, moduleAddress: string): Promise { - const moduleContract = new Contract(moduleAddress, OPTIMISTIC_GOVERNOR_ABI, provider); +export async function getCollateralDetailsForProposal( + provider: StaticJsonRpcProvider, + moduleAddress: string +): Promise { + const moduleContract = new Contract( + moduleAddress, + OPTIMISTIC_GOVERNOR_ABI, + provider + ); const erc20Contract = new Contract( await moduleContract.collateral(), @@ -304,11 +353,18 @@ export async function getCollateralDetailsForProposal(provider: StaticJsonRpcPro return { erc20Contract, address, symbol, decimals }; } -export async function getUserCollateralAllowance(erc20Contract: Contract, userAddress: string, moduleAddress: string) { +export async function getUserCollateralAllowance( + erc20Contract: Contract, + userAddress: string, + moduleAddress: string +) { return erc20Contract.allowance(userAddress, moduleAddress); } -export async function getUserCollateralBalance(erc20Contract: Contract, userAddress: string) { +export async function getUserCollateralBalance( + erc20Contract: Contract, + userAddress: string +) { return erc20Contract.balanceOf(userAddress); } @@ -341,7 +397,7 @@ export async function getOGModuleDetails(params: { oracleAddress, rules, minimumBond, - challengePeriod, + challengePeriod }; } @@ -353,28 +409,23 @@ async function getPagedEvents(params: { maxRange: number; }) { const { contract, eventFilter, startBlock, latestBlock, maxRange } = params; - const eventPager = ({ start, end }: { start: number; end: number; }) => { - return contract.queryFilter( - eventFilter, - start, - end - ); - } + const eventPager = ({ start, end }: { start: number; end: number }) => { + return contract.queryFilter(eventFilter, start, end); + }; const pagedEvents = await pageEvents( startBlock, latestBlock, maxRange, - eventPager, + eventPager ); return pagedEvents as (Event & EventType)[]; } - export async function getOgProposalStateFromChain(params: { - moduleDetails: OGModuleDetails, - network: Network, + moduleDetails: OGModuleDetails; + network: Network; explanation: string; - transactions: OptimisticGovernorTransaction[] + transactions: OptimisticGovernorTransaction[]; }): Promise { const { network, moduleDetails, explanation, transactions } = params; const provider = getProvider(network); @@ -385,7 +436,11 @@ export async function getOgProposalStateFromChain(params: { const oOStartBlock = getDeployBlock({ network, name: 'OptimisticOracleV3' }); const maxRange = 3000; const { moduleAddress, oracleAddress, rules } = moduleDetails; - const moduleContract = new Contract(moduleAddress, OPTIMISTIC_GOVERNOR_ABI, provider); + const moduleContract = new Contract( + moduleAddress, + OPTIMISTIC_GOVERNOR_ABI, + provider + ); const oracleContract = new Contract( oracleAddress, OPTIMISTIC_ORACLE_V3_ABI, @@ -403,7 +458,8 @@ export async function getOgProposalStateFromChain(params: { const hasAssertionId = assertionIdIsNotZero(assertionId); if (hasAssertionId) { - const assertionMadeEventForCurrentAssertionIdFilter = oracleContract.filters.AssertionMade(assertionId) + const assertionMadeEventForCurrentAssertionIdFilter = + oracleContract.filters.AssertionMade(assertionId); const assertionMadeEvents = await getPagedEvents({ contract: oracleContract, @@ -417,46 +473,59 @@ export async function getOgProposalStateFromChain(params: { const assertionMadeEvent = assertionMadeEvents[0]; const expirationTime = assertionMadeEvent.args?.expirationTime.toNumber(); - const isInChallengePeriod = (expirationTime * 1000) > Date.now(); + const isInChallengePeriod = expirationTime * 1000 > Date.now(); const assertionHash = assertionMadeEvent.transactionHash; const assertionLogIndex = assertionMadeEvent.logIndex.toString(); if (isInChallengePeriod) { - return { status: 'in-oo-challenge-period', assertionHash, assertionLogIndex, expirationTime}; + return { + status: 'in-oo-challenge-period', + assertionHash, + assertionLogIndex, + expirationTime + }; } return { status: 'can-request-tx-execution', assertionHash, - assertionLogIndex, - } + assertionLogIndex + }; } - const transactionsProposedEventFilter = moduleContract.filters.TransactionsProposed(); + const transactionsProposedEventFilter = + moduleContract.filters.TransactionsProposed(); - const transactionsProposedEvents = await getPagedEvents({ - contract: moduleContract, - eventFilter: transactionsProposedEventFilter, - startBlock: oGstartBlock, - latestBlock, - maxRange - }); + const transactionsProposedEvents = + await getPagedEvents({ + contract: moduleContract, + eventFilter: transactionsProposedEventFilter, + startBlock: oGstartBlock, + latestBlock, + maxRange + }); - const transactionsProposedEventsThatMatch = transactionsProposedEvents.filter(event => event.args?.proposalHash === proposalHash && event.args?.explanation === explanation); + const transactionsProposedEventsThatMatch = transactionsProposedEvents.filter( + event => + event.args?.proposalHash === proposalHash && + event.args?.explanation === explanation + ); - const hasTransactionProposedEvents = transactionsProposedEventsThatMatch.length > 0; + const hasTransactionProposedEvents = + transactionsProposedEventsThatMatch.length > 0; // we can return early and skip querying for execution events if there are no proposal events if (!hasTransactionProposedEvents) { return { status: 'can-propose-to-og', - isDisputed: false, - } + isDisputed: false + }; } - // the proposal hash is not indexed on the transactions proposed event unfortunately, but it is on the proposal executed event. + // the proposal hash is not indexed on the transactions proposed event unfortunately, but it is on the proposal executed event. // so at least we can use it for this one to narrow down the results. - const proposalExecutedEventFilter = moduleContract.filters.ProposalExecuted(proposalHash); + const proposalExecutedEventFilter = + moduleContract.filters.ProposalExecuted(proposalHash); const proposalExecutedEvents = await getPagedEvents({ contract: moduleContract, @@ -470,7 +539,10 @@ export async function getOgProposalStateFromChain(params: { let proposalExecuted = false; for (const proposalExecutedEvent of proposalExecutedEvents) { for (const transactionsProposedEvent of transactionsProposedEventsThatMatch) { - if (proposalExecutedEvent.args?.assertionId === transactionsProposedEvent.args?.assertionId) { + if ( + proposalExecutedEvent.args?.assertionId === + transactionsProposedEvent.args?.assertionId + ) { proposalExecuted = true; break; } @@ -478,7 +550,8 @@ export async function getOgProposalStateFromChain(params: { } if (proposalExecuted) { - const assertionMadeEventForExecutedAssertionIdFilter = oracleContract.filters.AssertionMade(assertionId) + const assertionMadeEventForExecutedAssertionIdFilter = + oracleContract.filters.AssertionMade(assertionId); const assertionMadeEvents = await getPagedEvents({ contract: oracleContract, @@ -491,14 +564,17 @@ export async function getOgProposalStateFromChain(params: { // assertion ids are unique, so this will have only one result const assertionMadeEvent = assertionMadeEvents[0]; - - return { status: 'transactions-executed', assertionHash: assertionMadeEvent.transactionHash, assertionLogIndex: assertionMadeEvent.logIndex.toString() }; + return { + status: 'transactions-executed', + assertionHash: assertionMadeEvent.transactionHash, + assertionLogIndex: assertionMadeEvent.logIndex.toString() + }; } return { status: 'can-propose-to-og', - isDisputed: false, - } + isDisputed: false + }; } export async function getOGProposalStateGql(params: { @@ -510,13 +586,13 @@ export async function getOGProposalStateGql(params: { }): Promise { const { network } = params; const oGproposal = await getOgProposalGql(params); - + if (!oGproposal) { return { status: 'can-propose-to-og', isDisputed: false }; } const { executed, assertionId, deleted } = oGproposal; - + if (deleted) { return { status: 'can-propose-to-og', isDisputed: true }; } @@ -527,21 +603,26 @@ export async function getOGProposalStateGql(params: { return { status: 'can-propose-to-og', isDisputed: false }; } - const assertion = await getAssertionGql({ network, assertionId }) + const assertion = await getAssertionGql({ network, assertionId }); if (!assertion) { return { status: 'can-propose-to-og', isDisputed: false }; } - const { assertionHash, settlementHash, assertionLogIndex, settlementResolution } = assertion; + const { + assertionHash, + settlementHash, + assertionLogIndex, + settlementResolution + } = assertion; // if the assertion is settled and the graph says the transactions have been executed, then we know the assertion passed and we can return early if (executed && settlementHash) { return { status: 'transactions-executed', assertionHash, - assertionLogIndex, - } + assertionLogIndex + }; } // if the settlement hash exists and the settlement resolution is true, then we know that the assertion passed. @@ -550,12 +631,12 @@ export async function getOGProposalStateGql(params: { return { status: 'can-request-tx-execution', assertionHash, - assertionLogIndex, - } + assertionLogIndex + }; } const expirationTime = Number(assertion.expirationTime); - const isExpired = Math.floor(Date.now() / 1000) >= expirationTime + const isExpired = Math.floor(Date.now() / 1000) >= expirationTime; // from the above checks, we know that the transactions have not been executed, the assertion has not been disputed, and the assertion has not been settled. // if the assertion challenge period has not yet expired, then we know we are still in the challenge period. @@ -564,8 +645,8 @@ export async function getOGProposalStateGql(params: { status: 'in-oo-challenge-period', assertionHash, assertionLogIndex, - expirationTime, - } + expirationTime + }; } // if all the above fails, fall back to the no assertion state @@ -578,10 +659,10 @@ function assertionIdIsNotZero(assertionId: string) { } export async function getOGProposalState(params: { - moduleDetails: OGModuleDetails, - network: Network, + moduleDetails: OGModuleDetails; + network: Network; explanation: string; - transactions: OptimisticGovernorTransaction[] + transactions: OptimisticGovernorTransaction[]; }): Promise { const { network, moduleDetails, explanation, transactions } = params; const { moduleAddress } = moduleDetails; @@ -589,23 +670,28 @@ export async function getOGProposalState(params: { try { return await getOGProposalStateGql({ network, - moduleAddress, - proposalHash, - explanation, - transactions + moduleAddress, + proposalHash, + explanation, + transactions }); } catch (error) { - console.warn('Error fetching OG proposal state from subgraph, falling back to chain', error); + console.warn( + 'Error fetching OG proposal state from subgraph, falling back to chain', + error + ); return getOgProposalStateFromChain({ network, moduleDetails, explanation, transactions - }) + }); } } -export function getProposalHashFromTransactions(transactions: OptimisticGovernorTransaction[]) { +export function getProposalHashFromTransactions( + transactions: OptimisticGovernorTransaction[] +) { return keccak256( defaultAbiCoder.encode( ['(address to, uint8 operation, uint256 value, bytes data)[]'], @@ -644,7 +730,7 @@ export function getClaimHash(params: { /** * Returns the EIP-3770 prefix for a given network. - * + * * @see SafeNetworkPrefix */ export function getSafeNetworkPrefix(network: Network): SafeNetworkPrefix { @@ -654,14 +740,22 @@ export function getSafeNetworkPrefix(network: Network): SafeNetworkPrefix { /** * Returns the url for a given Safe app on a given network. */ -export function getSafeAppLink(network: Network, safeAddress: string, appUrl = "https://gnosis-safe.io/app/") { +export function getSafeAppLink( + network: Network, + safeAddress: string, + appUrl = 'https://gnosis-safe.io/app/' +) { const prefix = getSafeNetworkPrefix(network); return `${appUrl}${prefix}:${safeAddress}`; } -export function getOracleUiLink(chain: string, txHash: string, logIndex: number) { +export function getOracleUiLink( + chain: string, + txHash: string, + logIndex: number +) { if (Number(chain) !== 5 && Number(chain) !== 80001) { return `https://oracle.uma.xyz?transactionHash=${txHash}&eventIndex=${logIndex}`; } return `https://testnet.oracle.uma.xyz?transactionHash=${txHash}&eventIndex=${logIndex}`; -} \ No newline at end of file +} diff --git a/src/plugins/oSnap/utils/index.ts b/src/plugins/oSnap/utils/index.ts index aafa549f..b903e6f3 100644 --- a/src/plugins/oSnap/utils/index.ts +++ b/src/plugins/oSnap/utils/index.ts @@ -1,7 +1,7 @@ -export * from "./abi"; -export * from "./coins"; -export * from "./events"; -export * from "./getters"; -export * from "./proposal"; -export * from "./transactions"; -export * from "./validators"; +export * from './abi'; +export * from './coins'; +export * from './events'; +export * from './getters'; +export * from './proposal'; +export * from './transactions'; +export * from './validators'; diff --git a/src/plugins/oSnap/utils/proposal.ts b/src/plugins/oSnap/utils/proposal.ts index 67179086..a66c472c 100644 --- a/src/plugins/oSnap/utils/proposal.ts +++ b/src/plugins/oSnap/utils/proposal.ts @@ -1,15 +1,15 @@ -import { toUtf8Bytes } from "@ethersproject/strings"; -import { sendTransaction } from "@snapshot-labs/snapshot.js/src/utils"; -import { ERC20_ABI, OPTIMISTIC_GOVERNOR_ABI } from "../constants"; -import { Network, OptimisticGovernorTransaction } from "../types"; -import { getOGProposalState } from "./getters"; +import { toUtf8Bytes } from '@ethersproject/strings'; +import { sendTransaction } from '@snapshot-labs/snapshot.js/src/utils'; +import { ERC20_ABI, OPTIMISTIC_GOVERNOR_ABI } from '../constants'; +import { Network, OptimisticGovernorTransaction } from '../types'; +import { getOGProposalState } from './getters'; /** * The user must approve the spend of the collateral token before they can submit a proposal. - * + * * If the proposal is disputed and fails a vote, the user will lose their bond. */ -export async function *approveBond( +export async function* approveBond( network: Network, web3: any, moduleAddress: string, @@ -28,7 +28,7 @@ export async function *approveBond( ERC20_ABI as any, 'approve', [moduleAddress, moduleDetails.minimumBond], - {} + {} ); yield approveTx; const approvalReceipt = await approveTx.wait(); @@ -39,12 +39,12 @@ export async function *approveBond( /** * Submits a proposal to the Optimistic Governor. */ -export async function *submitProposal( +export async function* submitProposal( web3: any, moduleAddress: string, explanation: string, transactions: OptimisticGovernorTransaction[] -) { +) { const explanationBytes = toUtf8Bytes(explanation); const tx = await sendTransaction( web3, @@ -61,10 +61,10 @@ export async function *submitProposal( /** * Executes a proposal on the Optimistic Governor. - * + * * This can only be done after the dispute window has ended. */ -export async function *executeProposal( +export async function* executeProposal( web3: any, moduleAddress: string, transactions: OptimisticGovernorTransaction[] @@ -79,4 +79,4 @@ export async function *executeProposal( yield tx; const receipt = await tx.wait(); console.log('[DAO module] executed proposal:', receipt); -} \ No newline at end of file +} diff --git a/src/plugins/oSnap/utils/transactions.ts b/src/plugins/oSnap/utils/transactions.ts index 0c9a795c..00eaec9e 100644 --- a/src/plugins/oSnap/utils/transactions.ts +++ b/src/plugins/oSnap/utils/transactions.ts @@ -1,35 +1,38 @@ import { FunctionFragment } from '@ethersproject/abi'; import { BigNumber } from '@ethersproject/bignumber'; -import { ContractInteractionTransaction, NFT, OptimisticGovernorTransaction, RawTransaction, Token, TransferFundsTransaction, TransferNftTransaction } from '../types'; +import { + ContractInteractionTransaction, + NFT, + OptimisticGovernorTransaction, + RawTransaction, + Token, + TransferFundsTransaction, + TransferNftTransaction +} from '../types'; import { encodeMethodAndParams } from './abi'; /** * Creates a formatted transaction for the Optimistic Governor to execute - * + * * note: the value for `operation` is always zero because we do not support delegatecall. - * + * * @see OptimisticGovernorTransaction */ export function createFormattedOptimisticGovernorTransaction({ to, value, - data, + data }: { to: string; value: string; data: string; }): OptimisticGovernorTransaction { - return [ - to, - 0, - value, - data, - ] + return [to, 0, value, data]; } /** * Creates a raw transaction for the Optimistic Governor to execute - * + * * @see RawTransaction */ export function createRawTransaction(params: { @@ -42,19 +45,19 @@ export function createRawTransaction(params: { return { ...params, type, - formatted, - } + formatted + }; } /** * Creates a transaction to transfer an NFT - * + * * @see TransferNftTransaction */ export function createTransferNftTransaction(params: { - recipient: string, - collectable: NFT, - data: string, + recipient: string; + collectable: NFT; + data: string; }): TransferNftTransaction { const type = 'transferNFT'; const to = params.collectable.address; @@ -72,13 +75,13 @@ export function createTransferNftTransaction(params: { to, value, data, - formatted, - } + formatted + }; } /** * Creates a transaction to transfer funds - * + * * @see TransferFundsTransaction */ export function createTransferFundsTransaction(params: { @@ -96,8 +99,8 @@ export function createTransferFundsTransaction(params: { const formatted = createFormattedOptimisticGovernorTransaction({ to, value, - data, - }) + data + }); return { ...params, type, @@ -105,15 +108,15 @@ export function createTransferFundsTransaction(params: { to, value, amount, - formatted, - } + formatted + }; } /** * Creates a transaction to interact with a contract. - * + * * the `method` is executed with the given `parameters`. - * + * * @see ContractInteractionTransaction */ export function createContractInteractionTransaction(params: { @@ -129,16 +132,18 @@ export function createContractInteractionTransaction(params: { params.method, params.parameters ); - const formatted = createFormattedOptimisticGovernorTransaction({...params, data }); + const formatted = createFormattedOptimisticGovernorTransaction({ + ...params, + data + }); return { ...params, data, type, - formatted, - } + formatted + }; } - export function parseAmount(input: string) { return BigNumber.from(input).toString(); } diff --git a/src/plugins/oSnap/utils/validators.ts b/src/plugins/oSnap/utils/validators.ts index 22f6f792..5c1ecacc 100644 --- a/src/plugins/oSnap/utils/validators.ts +++ b/src/plugins/oSnap/utils/validators.ts @@ -1,5 +1,8 @@ import { isAddress } from '@ethersproject/address'; -import { JsonRpcProvider, StaticJsonRpcProvider } from '@ethersproject/providers'; +import { + JsonRpcProvider, + StaticJsonRpcProvider +} from '@ethersproject/providers'; import memoize from 'lodash/memoize'; import { Contract } from '@ethersproject/contracts'; import { isBigNumberish } from '@ethersproject/bignumber/lib/bignumber'; @@ -48,13 +51,20 @@ export function validateTransaction(transaction: BaseTransaction) { /** * Validates a module address. */ -export async function validateModuleAddress(network: string, moduleAddress: string): Promise { +export async function validateModuleAddress( + network: string, + moduleAddress: string +): Promise { if (!isAddress(moduleAddress)) return false; const provider: StaticJsonRpcProvider = getProvider(network); - const moduleContract = new Contract(moduleAddress, OPTIMISTIC_GOVERNOR_ABI, provider); + const moduleContract = new Contract( + moduleAddress, + OPTIMISTIC_GOVERNOR_ABI, + provider + ); return moduleContract .rules() .then(() => true) .catch(() => false); -} \ No newline at end of file +}