diff --git a/typescript/optics-deploy/scripts/mainnet-community/update-optics-provider.ts b/typescript/optics-deploy/scripts/mainnet-community/update-optics-provider.ts new file mode 100644 index 000000000..cfe42b4a2 --- /dev/null +++ b/typescript/optics-deploy/scripts/mainnet-community/update-optics-provider.ts @@ -0,0 +1,16 @@ +import * as celo from '../../config/mainnets/celo'; +import * as ethereum from '../../config/mainnets/ethereum'; +import * as avalanche from '../../config/mainnets/avalanche'; +import * as polygon from '../../config/mainnets/polygon'; +import { updateProviderDomain } from '../../src/provider'; +import { makeAllConfigs } from '../../src/config'; + + +const configPath = '../../rust/config/production-community'; +updateProviderDomain('mainnetCommunity', configPath, [ + makeAllConfigs(celo, (_) => _.config), + makeAllConfigs(ethereum, (_) => _.config), + makeAllConfigs(avalanche, (_) => _.config), + makeAllConfigs(polygon, (_) => _.config), +]); + diff --git a/typescript/optics-deploy/scripts/mainnet/update-optics-provider.ts b/typescript/optics-deploy/scripts/mainnet/update-optics-provider.ts new file mode 100644 index 000000000..446ec950d --- /dev/null +++ b/typescript/optics-deploy/scripts/mainnet/update-optics-provider.ts @@ -0,0 +1,14 @@ +import * as celo from '../../config/mainnets/celo'; +import * as ethereum from '../../config/mainnets/ethereum'; +import * as polygon from '../../config/mainnets/polygon'; +import { updateProviderDomain } from '../../src/provider'; +import { makeAllConfigs } from '../../src/config'; + + +const configPath = '../../rust/config/mainnet'; +updateProviderDomain('mainnet', configPath, [ + makeAllConfigs(ethereum, (_) => _.config), + makeAllConfigs(polygon, (_) => _.config), + makeAllConfigs(celo, (_) => _.config), +]); + diff --git a/typescript/optics-deploy/scripts/staging-community/update-optics-provider.ts b/typescript/optics-deploy/scripts/staging-community/update-optics-provider.ts new file mode 100644 index 000000000..42fffc2dc --- /dev/null +++ b/typescript/optics-deploy/scripts/staging-community/update-optics-provider.ts @@ -0,0 +1,16 @@ +import * as alfajores from '../../config/testnets/alfajores'; +import * as kovan from '../../config/testnets/kovan'; +import * as gorli from '../../config/testnets/gorli'; +import * as ropsten from '../../config/testnets/ropsten'; +import { updateProviderDomain } from '../../src/provider'; +import { makeAllConfigs } from '../../src/config'; + + +const configPath = '../../rust/config/staging-community'; +updateProviderDomain('stagingCommunity', configPath, [ + makeAllConfigs(alfajores, (_) => _.devConfig), + makeAllConfigs(ropsten, (_) => _.devConfig), + makeAllConfigs(kovan, (_) => _.devConfig), + makeAllConfigs(gorli, (_) => _.devConfig), +]); + diff --git a/typescript/optics-deploy/scripts/staging/update-optics-provider.ts b/typescript/optics-deploy/scripts/staging/update-optics-provider.ts new file mode 100644 index 000000000..323a4bc77 --- /dev/null +++ b/typescript/optics-deploy/scripts/staging/update-optics-provider.ts @@ -0,0 +1,14 @@ +import * as alfajores from '../../config/testnets/alfajores'; +import * as kovan from '../../config/testnets/kovan'; +import * as rinkeby from '../../config/testnets/rinkeby'; +import { updateProviderDomain } from '../../src/provider'; +import { makeAllConfigs } from '../../src/config'; + + +const configPath = '../../rust/config/staging'; +updateProviderDomain('staging', configPath, [ + makeAllConfigs(alfajores, (_) => _.devConfig), + makeAllConfigs(kovan, (_) => _.devConfig), + makeAllConfigs(rinkeby, (_) => _.devConfig), +]); + diff --git a/typescript/optics-deploy/src/provider.ts b/typescript/optics-deploy/src/provider.ts index 182e67ef1..ba9df3955 100644 --- a/typescript/optics-deploy/src/provider.ts +++ b/typescript/optics-deploy/src/provider.ts @@ -27,6 +27,8 @@ export const ${config.chain.name}: OpticsDomain = { id: ${config.chain.domain}, bridgeRouter: '${bridgeDeploy.contracts.bridgeRouter!.proxy.address}',${!!bridgeDeploy.contracts.ethHelper ? `\n ethHelper: '${bridgeDeploy.contracts.ethHelper?.address}',` : ''} home: '${coreDeploy.contracts.home!.proxy.address}', + governanceRouter: '${coreDeploy.contracts.governance!.proxy.address}', + xAppConnectionManager: '${coreDeploy.contracts.xAppConnectionManager!.address}', replicas: [ ${Object.keys(coreDeploy.contracts.replicas) .map(Number) diff --git a/typescript/optics-provider/package-lock.json b/typescript/optics-provider/package-lock.json index 2b1b620c4..39c1f15cc 100644 --- a/typescript/optics-provider/package-lock.json +++ b/typescript/optics-provider/package-lock.json @@ -1,6 +1,6 @@ { "name": "optics-multi-provider-community", - "version": "0.1.19", + "version": "0.1.24", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -114,57 +114,237 @@ } }, "@ethersproject/abi": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.4.1.tgz", - "integrity": "sha512-9mhbjUk76BiSluiiW4BaYyI58KSbDMMQpCLdsAR+RsT2GyATiNYxVv+pGWRrekmsIdY3I+hOqsYQSTkc8L/mcg==", - "requires": { - "@ethersproject/address": "^5.4.0", - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/constants": "^5.4.0", - "@ethersproject/hash": "^5.4.0", - "@ethersproject/keccak256": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/properties": "^5.4.0", - "@ethersproject/strings": "^5.4.0" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz", + "integrity": "sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w==", + "requires": { + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/hash": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/strings": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/abstract-provider": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.4.1.tgz", - "integrity": "sha512-3EedfKI3LVpjSKgAxoUaI+gB27frKsxzm+r21w9G60Ugk+3wVLQwhi1LsEJAKNV7WoZc8CIpNrATlL1QFABjtQ==", - "requires": { - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/networks": "^5.4.0", - "@ethersproject/properties": "^5.4.0", - "@ethersproject/transactions": "^5.4.0", - "@ethersproject/web": "^5.4.0" + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz", + "integrity": "sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg==", + "requires": { + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/networks": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/transactions": "^5.5.0", + "@ethersproject/web": "^5.5.0" + }, + "dependencies": { + "@ethersproject/base64": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz", + "integrity": "sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA==", + "requires": { + "@ethersproject/bytes": "^5.5.0" + } + }, + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/strings": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/web": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.1.tgz", + "integrity": "sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg==", + "requires": { + "@ethersproject/base64": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" + } + } } }, "@ethersproject/abstract-signer": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.4.1.tgz", - "integrity": "sha512-SkkFL5HVq1k4/25dM+NWP9MILgohJCgGv5xT5AcRruGz4ILpfHeBtO/y6j+Z3UN/PAjDeb4P7E51Yh8wcGNLGA==", - "requires": { - "@ethersproject/abstract-provider": "^5.4.0", - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/properties": "^5.4.0" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz", + "integrity": "sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA==", + "requires": { + "@ethersproject/abstract-provider": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/address": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.4.0.tgz", - "integrity": "sha512-SD0VgOEkcACEG/C6xavlU1Hy3m5DGSXW3CUHkaaEHbAPPsgi0coP5oNPsxau8eTlZOk/bpa/hKeCNoK5IzVI2Q==", - "requires": { - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/keccak256": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/rlp": "^5.4.0" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.5.0.tgz", + "integrity": "sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw==", + "requires": { + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/rlp": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + } } }, "@ethersproject/base64": { @@ -176,12 +356,35 @@ } }, "@ethersproject/basex": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.4.0.tgz", - "integrity": "sha512-J07+QCVJ7np2bcpxydFVf/CuYo9mZ7T73Pe7KQY4c1lRlrixMeblauMxHXD0MPwFmUHZIILDNViVkykFBZylbg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.5.0.tgz", + "integrity": "sha512-ZIodwhHpVJ0Y3hUCfUucmxKsWQA5TMnavp5j/UOuDdzZWzJlRmuOjcTMIGgHCYuZmHt36BfiSyQPSRskPxbfaQ==", "requires": { - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/properties": "^5.4.0" + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/properties": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/bignumber": { @@ -211,20 +414,61 @@ } }, "@ethersproject/contracts": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.4.1.tgz", - "integrity": "sha512-m+z2ZgPy4pyR15Je//dUaymRUZq5MtDajF6GwFbGAVmKz/RF+DNIPwF0k5qEcL3wPGVqUjFg2/krlCRVTU4T5w==", - "requires": { - "@ethersproject/abi": "^5.4.0", - "@ethersproject/abstract-provider": "^5.4.0", - "@ethersproject/abstract-signer": "^5.4.0", - "@ethersproject/address": "^5.4.0", - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/constants": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/properties": "^5.4.0", - "@ethersproject/transactions": "^5.4.0" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.5.0.tgz", + "integrity": "sha512-2viY7NzyvJkh+Ug17v7g3/IJC8HqZBDcOjYARZLdzRxrfGlRgmYgl6xPRKVbEzy1dWKw/iv7chDcS83pg6cLxg==", + "requires": { + "@ethersproject/abi": "^5.5.0", + "@ethersproject/abstract-provider": "^5.5.0", + "@ethersproject/abstract-signer": "^5.5.0", + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/transactions": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/experimental": { @@ -238,66 +482,234 @@ } }, "@ethersproject/hash": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.4.0.tgz", - "integrity": "sha512-xymAM9tmikKgbktOCjW60Z5sdouiIIurkZUr9oW5NOex5uwxrbsYG09kb5bMcNjlVeJD3yPivTNzViIs1GCbqA==", - "requires": { - "@ethersproject/abstract-signer": "^5.4.0", - "@ethersproject/address": "^5.4.0", - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/keccak256": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/properties": "^5.4.0", - "@ethersproject/strings": "^5.4.0" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.5.0.tgz", + "integrity": "sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg==", + "requires": { + "@ethersproject/abstract-signer": "^5.5.0", + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/strings": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/hdnode": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.4.0.tgz", - "integrity": "sha512-pKxdS0KAaeVGfZPp1KOiDLB0jba11tG6OP1u11QnYfb7pXn6IZx0xceqWRr6ygke8+Kw74IpOoSi7/DwANhy8Q==", - "requires": { - "@ethersproject/abstract-signer": "^5.4.0", - "@ethersproject/basex": "^5.4.0", - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/pbkdf2": "^5.4.0", - "@ethersproject/properties": "^5.4.0", - "@ethersproject/sha2": "^5.4.0", - "@ethersproject/signing-key": "^5.4.0", - "@ethersproject/strings": "^5.4.0", - "@ethersproject/transactions": "^5.4.0", - "@ethersproject/wordlists": "^5.4.0" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.5.0.tgz", + "integrity": "sha512-mcSOo9zeUg1L0CoJH7zmxwUG5ggQHU1UrRf8jyTYy6HxdZV+r0PBoL1bxr+JHIPXRzS6u/UW4mEn43y0tmyF8Q==", + "requires": { + "@ethersproject/abstract-signer": "^5.5.0", + "@ethersproject/basex": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/pbkdf2": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/sha2": "^5.5.0", + "@ethersproject/signing-key": "^5.5.0", + "@ethersproject/strings": "^5.5.0", + "@ethersproject/transactions": "^5.5.0", + "@ethersproject/wordlists": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/strings": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/json-wallets": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz", - "integrity": "sha512-igWcu3fx4aiczrzEHwG1xJZo9l1cFfQOWzTqwRw/xcvxTk58q4f9M7cjh51EKphMHvrJtcezJ1gf1q1AUOfEQQ==", - "requires": { - "@ethersproject/abstract-signer": "^5.4.0", - "@ethersproject/address": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/hdnode": "^5.4.0", - "@ethersproject/keccak256": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/pbkdf2": "^5.4.0", - "@ethersproject/properties": "^5.4.0", - "@ethersproject/random": "^5.4.0", - "@ethersproject/strings": "^5.4.0", - "@ethersproject/transactions": "^5.4.0", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.5.0.tgz", + "integrity": "sha512-9lA21XQnCdcS72xlBn1jfQdj2A1VUxZzOzi9UkNdnokNKke/9Ya2xA9aIK1SC3PQyBDLt4C+dfps7ULpkvKikQ==", + "requires": { + "@ethersproject/abstract-signer": "^5.5.0", + "@ethersproject/address": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/hdnode": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/pbkdf2": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/random": "^5.5.0", + "@ethersproject/strings": "^5.5.0", + "@ethersproject/transactions": "^5.5.0", "aes-js": "3.0.0", "scrypt-js": "3.0.1" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/strings": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/keccak256": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.4.0.tgz", - "integrity": "sha512-FBI1plWet+dPUvAzPAeHzRKiPpETQzqSUWR1wXJGHVWi4i8bOSrpC3NwpkPjgeXG7MnugVc1B42VbfnQikyC/A==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.5.0.tgz", + "integrity": "sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg==", "requires": { - "@ethersproject/bytes": "^5.4.0", - "js-sha3": "0.5.7" + "@ethersproject/bytes": "^5.5.0", + "js-sha3": "0.8.0" + }, + "dependencies": { + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + } } }, "@ethersproject/logger": { @@ -306,20 +718,42 @@ "integrity": "sha512-DZ+bRinnYLPw1yAC64oRl0QyVZj43QeHIhVKfD/+YwSz4wsv1pfwb5SOFjz+r710YEWzU6LrhuSjpSO+6PeE4A==" }, "@ethersproject/networks": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.4.2.tgz", - "integrity": "sha512-eekOhvJyBnuibfJnhtK46b8HimBc5+4gqpvd1/H9LEl7Q7/qhsIhM81dI9Fcnjpk3jB1aTy6bj0hz3cifhNeYw==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.5.2.tgz", + "integrity": "sha512-NEqPxbGBfy6O3x4ZTISb90SjEDkWYDUbEeIFhJly0F7sZjoQMnj5KYzMSkMkLKZ+1fGpx00EDpHQCy6PrDupkQ==", "requires": { - "@ethersproject/logger": "^5.4.0" + "@ethersproject/logger": "^5.5.0" + }, + "dependencies": { + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + } } }, "@ethersproject/pbkdf2": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz", - "integrity": "sha512-x94aIv6tiA04g6BnazZSLoRXqyusawRyZWlUhKip2jvoLpzJuLb//KtMM6PEovE47pMbW+Qe1uw+68ameJjB7g==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.5.0.tgz", + "integrity": "sha512-SaDvQFvXPnz1QGpzr6/HToLifftSXGoXrbpZ6BvoZhmx4bNLHrxDe8MZisuecyOziP1aVEwzC2Hasj+86TgWVg==", "requires": { - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/sha2": "^5.4.0" + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/sha2": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + } } }, "@ethersproject/properties": { @@ -331,82 +765,265 @@ } }, "@ethersproject/providers": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.4.5.tgz", - "integrity": "sha512-1GkrvkiAw3Fj28cwi1Sqm8ED1RtERtpdXmRfwIBGmqBSN5MoeRUHuwHPppMtbPayPgpFcvD7/Gdc9doO5fGYgw==", - "requires": { - "@ethersproject/abstract-provider": "^5.4.0", - "@ethersproject/abstract-signer": "^5.4.0", - "@ethersproject/address": "^5.4.0", - "@ethersproject/basex": "^5.4.0", - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/constants": "^5.4.0", - "@ethersproject/hash": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/networks": "^5.4.0", - "@ethersproject/properties": "^5.4.0", - "@ethersproject/random": "^5.4.0", - "@ethersproject/rlp": "^5.4.0", - "@ethersproject/sha2": "^5.4.0", - "@ethersproject/strings": "^5.4.0", - "@ethersproject/transactions": "^5.4.0", - "@ethersproject/web": "^5.4.0", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.5.2.tgz", + "integrity": "sha512-hkbx7x/MKcRjyrO4StKXCzCpWer6s97xnm34xkfPiarhtEUVAN4TBBpamM+z66WcTt7H5B53YwbRj1n7i8pZoQ==", + "requires": { + "@ethersproject/abstract-provider": "^5.5.0", + "@ethersproject/abstract-signer": "^5.5.0", + "@ethersproject/address": "^5.5.0", + "@ethersproject/basex": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/hash": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/networks": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/random": "^5.5.0", + "@ethersproject/rlp": "^5.5.0", + "@ethersproject/sha2": "^5.5.0", + "@ethersproject/strings": "^5.5.0", + "@ethersproject/transactions": "^5.5.0", + "@ethersproject/web": "^5.5.0", "bech32": "1.1.4", "ws": "7.4.6" + }, + "dependencies": { + "@ethersproject/base64": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz", + "integrity": "sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA==", + "requires": { + "@ethersproject/bytes": "^5.5.0" + } + }, + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/strings": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/web": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.1.tgz", + "integrity": "sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg==", + "requires": { + "@ethersproject/base64": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" + } + } } }, "@ethersproject/random": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.4.0.tgz", - "integrity": "sha512-pnpWNQlf0VAZDEOVp1rsYQosmv2o0ITS/PecNw+mS2/btF8eYdspkN0vIXrCMtkX09EAh9bdk8GoXmFXM1eAKw==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.5.1.tgz", + "integrity": "sha512-YaU2dQ7DuhL5Au7KbcQLHxcRHfgyNgvFV4sQOo0HrtW3Zkrc9ctWNz8wXQ4uCSfSDsqX2vcjhroxU5RQRV0nqA==", "requires": { - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0" + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + } } }, "@ethersproject/rlp": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.4.0.tgz", - "integrity": "sha512-0I7MZKfi+T5+G8atId9QaQKHRvvasM/kqLyAH4XxBCBchAooH2EX5rL9kYZWwcm3awYV+XC7VF6nLhfeQFKVPg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.5.0.tgz", + "integrity": "sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA==", "requires": { - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0" + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + } } }, "@ethersproject/sha2": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.4.0.tgz", - "integrity": "sha512-siheo36r1WD7Cy+bDdE1BJ8y0bDtqXCOxRMzPa4bV1TGt/eTUUt03BHoJNB6reWJD8A30E/pdJ8WFkq+/uz4Gg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.5.0.tgz", + "integrity": "sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA==", "requires": { - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", "hash.js": "1.1.7" + }, + "dependencies": { + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + } } }, "@ethersproject/signing-key": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.4.0.tgz", - "integrity": "sha512-q8POUeywx6AKg2/jX9qBYZIAmKSB4ubGXdQ88l40hmATj29JnG5pp331nAWwwxPn2Qao4JpWHNZsQN+bPiSW9A==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.5.0.tgz", + "integrity": "sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng==", "requires": { - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/properties": "^5.4.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", "bn.js": "^4.11.9", "elliptic": "6.5.4", "hash.js": "1.1.7" + }, + "dependencies": { + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/solidity": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.4.0.tgz", - "integrity": "sha512-XFQTZ7wFSHOhHcV1DpcWj7VXECEiSrBuv7JErJvB9Uo+KfCdc3QtUZV+Vjh/AAaYgezUEKbCtE6Khjm44seevQ==", - "requires": { - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/keccak256": "^5.4.0", - "@ethersproject/sha2": "^5.4.0", - "@ethersproject/strings": "^5.4.0" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.5.0.tgz", + "integrity": "sha512-9NgZs9LhGMj6aCtHXhtmFQ4AN4sth5HuFXVvAQtzmm0jpSCNOTGtrHZJAeYTh7MBjRR8brylWZxBZR9zDStXbw==", + "requires": { + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/sha2": "^5.5.0", + "@ethersproject/strings": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/strings": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/strings": { @@ -420,51 +1037,158 @@ } }, "@ethersproject/transactions": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.4.0.tgz", - "integrity": "sha512-s3EjZZt7xa4BkLknJZ98QGoIza94rVjaEed0rzZ/jB9WrIuu/1+tjvYCWzVrystXtDswy7TPBeIepyXwSYa4WQ==", - "requires": { - "@ethersproject/address": "^5.4.0", - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/constants": "^5.4.0", - "@ethersproject/keccak256": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/properties": "^5.4.0", - "@ethersproject/rlp": "^5.4.0", - "@ethersproject/signing-key": "^5.4.0" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.5.0.tgz", + "integrity": "sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA==", + "requires": { + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/rlp": "^5.5.0", + "@ethersproject/signing-key": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/units": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.4.0.tgz", - "integrity": "sha512-Z88krX40KCp+JqPCP5oPv5p750g+uU6gopDYRTBGcDvOASh6qhiEYCRatuM/suC4S2XW9Zz90QI35MfSrTIaFg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.5.0.tgz", + "integrity": "sha512-7+DpjiZk4v6wrikj+TCyWWa9dXLNU73tSTa7n0TSJDxkYbV3Yf1eRh9ToMLlZtuctNYu9RDNNy2USq3AdqSbag==", "requires": { - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/constants": "^5.4.0", - "@ethersproject/logger": "^5.4.0" + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + } } }, "@ethersproject/wallet": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.4.0.tgz", - "integrity": "sha512-wU29majLjM6AjCjpat21mPPviG+EpK7wY1+jzKD0fg3ui5fgedf2zEu1RDgpfIMsfn8fJHJuzM4zXZ2+hSHaSQ==", - "requires": { - "@ethersproject/abstract-provider": "^5.4.0", - "@ethersproject/abstract-signer": "^5.4.0", - "@ethersproject/address": "^5.4.0", - "@ethersproject/bignumber": "^5.4.0", - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/hash": "^5.4.0", - "@ethersproject/hdnode": "^5.4.0", - "@ethersproject/json-wallets": "^5.4.0", - "@ethersproject/keccak256": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/properties": "^5.4.0", - "@ethersproject/random": "^5.4.0", - "@ethersproject/signing-key": "^5.4.0", - "@ethersproject/transactions": "^5.4.0", - "@ethersproject/wordlists": "^5.4.0" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.5.0.tgz", + "integrity": "sha512-Mlu13hIctSYaZmUOo7r2PhNSd8eaMPVXe1wxrz4w4FCE4tDYBywDH+bAR1Xz2ADyXGwqYMwstzTrtUVIsKDO0Q==", + "requires": { + "@ethersproject/abstract-provider": "^5.5.0", + "@ethersproject/abstract-signer": "^5.5.0", + "@ethersproject/address": "^5.5.0", + "@ethersproject/bignumber": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/hash": "^5.5.0", + "@ethersproject/hdnode": "^5.5.0", + "@ethersproject/json-wallets": "^5.5.0", + "@ethersproject/keccak256": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/random": "^5.5.0", + "@ethersproject/signing-key": "^5.5.0", + "@ethersproject/transactions": "^5.5.0", + "@ethersproject/wordlists": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + } } }, "@ethersproject/web": { @@ -480,15 +1204,66 @@ } }, "@ethersproject/wordlists": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.4.0.tgz", - "integrity": "sha512-FemEkf6a+EBKEPxlzeVgUaVSodU7G0Na89jqKjmWMlDB0tomoU8RlEMgUvXyqtrg8N4cwpLh8nyRnm1Nay1isA==", - "requires": { - "@ethersproject/bytes": "^5.4.0", - "@ethersproject/hash": "^5.4.0", - "@ethersproject/logger": "^5.4.0", - "@ethersproject/properties": "^5.4.0", - "@ethersproject/strings": "^5.4.0" + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.5.0.tgz", + "integrity": "sha512-bL0UTReWDiaQJJYOC9sh/XcRu/9i2jMrzf8VLRmPKx58ckSlOJiohODkECCO50dtLZHcGU6MLXQ4OOrgBwP77Q==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/hash": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" + }, + "dependencies": { + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/strings": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + } + } } }, "@humanwhocodes/config-array": { @@ -755,6 +1530,14 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, + "celo-ethers-provider": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/celo-ethers-provider/-/celo-ethers-provider-0.0.0.tgz", + "integrity": "sha512-fKm4DXyngvjafyFCwjh8WKDrWsC+fJTDDRZEIduC/IiZcp8W5KrrwNoIbi3arv1B8Yd4D4E3nxhmIudfOczVEw==", + "requires": { + "ethers": "^5.4.7" + } + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -1047,40 +1830,111 @@ "dev": true }, "ethers": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.6.tgz", - "integrity": "sha512-F7LXARyB/Px3AQC6/QKedWZ8eqCkgOLORqL4B/F0Mag/K+qJSFGqsR36EaOZ6fKg3ZonI+pdbhb4A8Knt/43jQ==", - "requires": { - "@ethersproject/abi": "5.4.1", - "@ethersproject/abstract-provider": "5.4.1", - "@ethersproject/abstract-signer": "5.4.1", - "@ethersproject/address": "5.4.0", - "@ethersproject/base64": "5.4.0", - "@ethersproject/basex": "5.4.0", - "@ethersproject/bignumber": "5.4.1", - "@ethersproject/bytes": "5.4.0", - "@ethersproject/constants": "5.4.0", - "@ethersproject/contracts": "5.4.1", - "@ethersproject/hash": "5.4.0", - "@ethersproject/hdnode": "5.4.0", - "@ethersproject/json-wallets": "5.4.0", - "@ethersproject/keccak256": "5.4.0", - "@ethersproject/logger": "5.4.1", - "@ethersproject/networks": "5.4.2", - "@ethersproject/pbkdf2": "5.4.0", - "@ethersproject/properties": "5.4.1", - "@ethersproject/providers": "5.4.5", - "@ethersproject/random": "5.4.0", - "@ethersproject/rlp": "5.4.0", - "@ethersproject/sha2": "5.4.0", - "@ethersproject/signing-key": "5.4.0", - "@ethersproject/solidity": "5.4.0", - "@ethersproject/strings": "5.4.0", - "@ethersproject/transactions": "5.4.0", - "@ethersproject/units": "5.4.0", - "@ethersproject/wallet": "5.4.0", - "@ethersproject/web": "5.4.0", - "@ethersproject/wordlists": "5.4.0" + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.5.3.tgz", + "integrity": "sha512-fTT4WT8/hTe/BLwRUtl7I5zlpF3XC3P/Xwqxc5AIP2HGlH15qpmjs0Ou78az93b1rLITzXLFxoNX63B8ZbUd7g==", + "requires": { + "@ethersproject/abi": "5.5.0", + "@ethersproject/abstract-provider": "5.5.1", + "@ethersproject/abstract-signer": "5.5.0", + "@ethersproject/address": "5.5.0", + "@ethersproject/base64": "5.5.0", + "@ethersproject/basex": "5.5.0", + "@ethersproject/bignumber": "5.5.0", + "@ethersproject/bytes": "5.5.0", + "@ethersproject/constants": "5.5.0", + "@ethersproject/contracts": "5.5.0", + "@ethersproject/hash": "5.5.0", + "@ethersproject/hdnode": "5.5.0", + "@ethersproject/json-wallets": "5.5.0", + "@ethersproject/keccak256": "5.5.0", + "@ethersproject/logger": "5.5.0", + "@ethersproject/networks": "5.5.2", + "@ethersproject/pbkdf2": "5.5.0", + "@ethersproject/properties": "5.5.0", + "@ethersproject/providers": "5.5.2", + "@ethersproject/random": "5.5.1", + "@ethersproject/rlp": "5.5.0", + "@ethersproject/sha2": "5.5.0", + "@ethersproject/signing-key": "5.5.0", + "@ethersproject/solidity": "5.5.0", + "@ethersproject/strings": "5.5.0", + "@ethersproject/transactions": "5.5.0", + "@ethersproject/units": "5.5.0", + "@ethersproject/wallet": "5.5.0", + "@ethersproject/web": "5.5.1", + "@ethersproject/wordlists": "5.5.0" + }, + "dependencies": { + "@ethersproject/base64": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz", + "integrity": "sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA==", + "requires": { + "@ethersproject/bytes": "^5.5.0" + } + }, + "@ethersproject/bignumber": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz", + "integrity": "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "bn.js": "^4.11.9" + } + }, + "@ethersproject/bytes": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", + "integrity": "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/constants": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz", + "integrity": "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==", + "requires": { + "@ethersproject/bignumber": "^5.5.0" + } + }, + "@ethersproject/logger": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz", + "integrity": "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + }, + "@ethersproject/properties": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz", + "integrity": "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==", + "requires": { + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/strings": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", + "integrity": "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==", + "requires": { + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/constants": "^5.5.0", + "@ethersproject/logger": "^5.5.0" + } + }, + "@ethersproject/web": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.1.tgz", + "integrity": "sha512-olvLvc1CB12sREc1ROPSHTdFCdvMh0J5GSJYiQg2D0hdD4QmJDy8QYDb1CvoqD/bF1c++aeKv2sR5uduuG9dQg==", + "requires": { + "@ethersproject/base64": "^5.5.0", + "@ethersproject/bytes": "^5.5.0", + "@ethersproject/logger": "^5.5.0", + "@ethersproject/properties": "^5.5.0", + "@ethersproject/strings": "^5.5.0" + } + } } }, "fast-deep-equal": { @@ -1317,9 +2171,9 @@ "dev": true }, "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" }, "js-tokens": { "version": "4.0.0", diff --git a/typescript/optics-provider/package.json b/typescript/optics-provider/package.json index ef15949bc..1369c3e93 100644 --- a/typescript/optics-provider/package.json +++ b/typescript/optics-provider/package.json @@ -27,6 +27,7 @@ }, "dependencies": { "@optics-xyz/ts-interface": "^1.1.0", - "ethers": "^5.4.6" + "celo-ethers-provider": "0.0.0", + "ethers": "^5.4.7" } } diff --git a/typescript/optics-provider/src/optics/OpticsContext.ts b/typescript/optics-provider/src/optics/OpticsContext.ts index 34ca03355..b09e1f8c7 100644 --- a/typescript/optics-provider/src/optics/OpticsContext.ts +++ b/typescript/optics-provider/src/optics/OpticsContext.ts @@ -33,6 +33,7 @@ type Address = string; export class OpticsContext extends MultiProvider { private cores: Map; private bridges: Map; + private _governorDomain?: number; constructor( domains: OpticsDomain[], @@ -199,8 +200,7 @@ export class OpticsContext extends MultiProvider { home: string | number, remote: string | number, ): core.Replica | undefined { - return this.getCore(remote)?.replicas.get(this.resolveDomain(home)) - ?.contract; + return this.getCore(remote)?.getReplica(this.resolveDomain(home)); } /** @@ -225,6 +225,34 @@ export class OpticsContext extends MultiProvider { return replica; } + /** + * Discovers the governor domain of this optics deployment and caches it. + * + * @returns The identifier of the governing domain + */ + async governorDomain(): Promise { + if (this._governorDomain) { + return this._governorDomain; + } + + const core: CoreContracts = this.cores.values().next().value; + if (!core) throw new Error('empty core map'); + + const governorDomain = await core.governanceRouter.governorDomain(); + this._governorDomain = governorDomain !== 0 ? governorDomain : core.domain; + return this._governorDomain; + } + + /** + * Discovers the governor domain of this optics deployment and returns the + * associated Core. + * + * @returns The identifier of the governing domain + */ + async governorCore(): Promise { + return this.mustGetCore(await this.governorDomain()); + } + /** * Resolve the local representation of a token on some domain. E.g. find the * deployed Celo address of Ethereum's Sushi Token. diff --git a/typescript/optics-provider/src/optics/contracts/CoreContracts.ts b/typescript/optics-provider/src/optics/contracts/CoreContracts.ts index a2c7f7c4e..1dbfe4126 100644 --- a/typescript/optics-provider/src/optics/contracts/CoreContracts.ts +++ b/typescript/optics-provider/src/optics/contracts/CoreContracts.ts @@ -2,74 +2,133 @@ import { ethers } from 'ethers'; import { core } from '@optics-xyz/ts-interface'; import { Contracts } from '../../contracts'; import { ReplicaInfo } from '../domains/domain'; +import { CallBatch } from '../govern'; type Address = string; -type InternalReplica = { - domain: number; - contract: core.Replica; -}; - interface Core { id: number; home: Address; replicas: ReplicaInfo[]; + governanceRouter: Address; + xAppConnectionManager: Address; } +export type Governor = { + local: boolean; + domain: number; + identifier: string; +}; + export class CoreContracts extends Contracts { - readonly domain; - home: core.Home; - replicas: Map; + readonly domain: number; + readonly _home: Address; + readonly _replicas: Map; + readonly _governanceRouter: Address; + readonly _xAppConnectionManager: Address; + private providerOrSigner?: ethers.providers.Provider | ethers.Signer; + private _governor?: Governor; constructor( domain: number, home: Address, replicas: ReplicaInfo[], - signer?: ethers.Signer, + governanceRouter: Address, + xAppConnectionManager: Address, + providerOrSigner?: ethers.providers.Provider | ethers.Signer, ) { - super(domain, home, replicas, signer); + super(domain, home, replicas, providerOrSigner); + this.providerOrSigner = providerOrSigner; this.domain = domain; - this.home = new core.Home__factory(signer).attach(home); + this._home = home; + this._governanceRouter = governanceRouter; + this._xAppConnectionManager = xAppConnectionManager; - this.replicas = new Map(); + this._replicas = new Map(); replicas.forEach((replica) => { - this.replicas.set(replica.domain, { - contract: new core.Replica__factory(signer).attach(replica.address), + this._replicas.set(replica.domain, { + address: replica.address, domain: replica.domain, }); }); } - connect(providerOrSigner: ethers.providers.Provider | ethers.Signer): void { - this.home = this.home.connect(providerOrSigner); + getReplica(domain: number): core.Replica | undefined { + if (!this.providerOrSigner) { + throw new Error('No provider or signer. Call `connect` first.'); + } + const replica = this._replicas.get(domain); + if (!replica) return; + return core.Replica__factory.connect( + replica.address, + this.providerOrSigner, + ); + } - Array.from(this.replicas.values()).forEach((replica: InternalReplica) => { - replica.contract = replica.contract.connect(providerOrSigner); - }); + get home(): core.Home { + if (!this.providerOrSigner) { + throw new Error('No provider or signer. Call `connect` first.'); + } + return core.Home__factory.connect(this._home, this.providerOrSigner); } - toObject(): Core { - const replicas: ReplicaInfo[] = Array.from(this.replicas.values()).map( - (replica) => { - return { - domain: replica.domain, - address: replica.contract.address, - }; - }, + get governanceRouter(): core.GovernanceRouter { + if (!this.providerOrSigner) { + throw new Error('No provider or signer. Call `connect` first.'); + } + return core.GovernanceRouter__factory.connect( + this._governanceRouter, + this.providerOrSigner, ); + } + + get xAppConnectionManager(): core.XAppConnectionManager { + if (!this.providerOrSigner) { + throw new Error('No provider or signer. Call `connect` first.'); + } + return core.XAppConnectionManager__factory.connect( + this._xAppConnectionManager, + this.providerOrSigner, + ); + } + + async governor(): Promise { + if (this._governor) { + return this._governor; + } + const [domain, identifier] = await Promise.all([ + this.governanceRouter.governorDomain(), + this.governanceRouter.governor(), + ]); + const local = identifier !== ethers.constants.AddressZero; + this._governor = { local, domain, identifier }; + return this._governor; + } + + async newGovernanceBatch(): Promise { + return CallBatch.fromCore(this); + } + connect(providerOrSigner: ethers.providers.Provider | ethers.Signer): void { + this.providerOrSigner = providerOrSigner; + } + + toObject(): Core { + const replicas: ReplicaInfo[] = Array.from(this._replicas.values()); return { id: this.domain, - home: this.home.address, + home: this._home, replicas: replicas, + governanceRouter: this._governanceRouter, + xAppConnectionManager: this._xAppConnectionManager, }; } static fromObject(data: Core, signer?: ethers.Signer): CoreContracts { - const { id, home, replicas } = data; - if (!id || !home || !replicas) { + const { id, home, replicas, governanceRouter, xAppConnectionManager } = data; + if (!id || !home || !replicas || !governanceRouter || !xAppConnectionManager) { throw new Error('Missing key'); } - return new CoreContracts(id, home, replicas, signer); + return new CoreContracts(id, home, replicas, governanceRouter, xAppConnectionManager, signer); } } diff --git a/typescript/optics-provider/src/optics/domains/devCommunity.ts b/typescript/optics-provider/src/optics/domains/devCommunity.ts index 8f18ffd2a..bb8df03da 100644 --- a/typescript/optics-provider/src/optics/domains/devCommunity.ts +++ b/typescript/optics-provider/src/optics/domains/devCommunity.ts @@ -11,6 +11,8 @@ export const alfajores: OpticsDomain = { { domain: 43113, address: '0x570EDeF0c271E3f1ba6B5C66D040195750a79762' }, { domain: 80001, address: '0xbA00eF80A55d4EefcF3d7971270D2c233F9d315e' }, ], + governanceRouter: '0xBF79333049D140fCa12355f1F896c8ebedAf8707', + xAppConnectionManager: '0x2d230eB17F3AFe032809EC13A0E516E297b17AA3', }; export const kovan: OpticsDomain = { @@ -25,6 +27,8 @@ export const kovan: OpticsDomain = { { domain: 43113, address: '0xf3855B99b7cEfa56C66f0C2d0550b545df11d54A' }, { domain: 80001, address: '0xeAc82476aF67dca63B04a66EA8D7230EfB4028DB' }, ], + governanceRouter: '0x11E94700D9E5Ab1F8Bd0b3bd13e331CEFe3acEB7', + xAppConnectionManager: '0xf9db87020527A5A5aeFd95099051Fb14058916C9', }; export const gorli: OpticsDomain = { @@ -39,6 +43,8 @@ export const gorli: OpticsDomain = { { domain: 43113, address: '0xf3855B99b7cEfa56C66f0C2d0550b545df11d54A' }, { domain: 80001, address: '0xeAc82476aF67dca63B04a66EA8D7230EfB4028DB' }, ], + governanceRouter: '0x11E94700D9E5Ab1F8Bd0b3bd13e331CEFe3acEB7', + xAppConnectionManager: '0xf9db87020527A5A5aeFd95099051Fb14058916C9', }; export const fuji: OpticsDomain = { @@ -53,6 +59,8 @@ export const fuji: OpticsDomain = { { domain: 3000, address: '0xc501ad2163Ebd9921B4a6E46B344Ef7bA76A2cBa' }, { domain: 80001, address: '0xeAc82476aF67dca63B04a66EA8D7230EfB4028DB' }, ], + governanceRouter: '0x11E94700D9E5Ab1F8Bd0b3bd13e331CEFe3acEB7', + xAppConnectionManager: '0xf9db87020527A5A5aeFd95099051Fb14058916C9', }; export const mumbai: OpticsDomain = { @@ -67,6 +75,8 @@ export const mumbai: OpticsDomain = { { domain: 3000, address: '0xc501ad2163Ebd9921B4a6E46B344Ef7bA76A2cBa' }, { domain: 43113, address: '0xeAc82476aF67dca63B04a66EA8D7230EfB4028DB' }, ], + governanceRouter: '0x11E94700D9E5Ab1F8Bd0b3bd13e331CEFe3acEB7', + xAppConnectionManager: '0xf9db87020527A5A5aeFd95099051Fb14058916C9', }; -export const devCommunityDomains = [alfajores, kovan, gorli, fuji, mumbai]; \ No newline at end of file +export const devCommunityDomains = [alfajores, kovan, gorli, fuji, mumbai]; diff --git a/typescript/optics-provider/src/optics/domains/domain.ts b/typescript/optics-provider/src/optics/domains/domain.ts index 01409eabe..35368a3c8 100644 --- a/typescript/optics-provider/src/optics/domains/domain.ts +++ b/typescript/optics-provider/src/optics/domains/domain.ts @@ -6,6 +6,8 @@ export interface OpticsDomain extends Domain { ethHelper?: Address; home: Address; replicas: ReplicaInfo[]; + governanceRouter: Address; + xAppConnectionManager: Address; } export interface ReplicaInfo { diff --git a/typescript/optics-provider/src/optics/domains/mainnet.ts b/typescript/optics-provider/src/optics/domains/mainnet.ts index 1a7021786..e7833d973 100644 --- a/typescript/optics-provider/src/optics/domains/mainnet.ts +++ b/typescript/optics-provider/src/optics/domains/mainnet.ts @@ -6,15 +6,11 @@ export const ethereum: OpticsDomain = { bridgeRouter: '0x6a39909e805A3eaDd2b61fFf61147796ca6aBB47', ethHelper: '0xf1c1413096ff2278C3Df198a28F8D54e0369cF3A', home: '0xf25C5932bb6EFc7afA4895D9916F2abD7151BF97', + governanceRouter: '0x42303634F37956687fB7ff2c6146AC842481A052', + xAppConnectionManager: '0xcEc158A719d11005Bd9339865965bed938BEafA3', replicas: [ - { - domain: 1667591279, - address: '0x07b5B57b08202294E657D51Eb453A189290f6385', - }, - { - domain: 1886350457, - address: '0x7725EadaC5Ee986CAc8317a1d2fB16e59e079E8b', - }, + { domain: 1667591279, address: '0x07b5B57b08202294E657D51Eb453A189290f6385' }, + { domain: 1886350457, address: '0x7725EadaC5Ee986CAc8317a1d2fB16e59e079E8b' }, ], }; @@ -29,12 +25,11 @@ export const polygon: OpticsDomain = { bridgeRouter: '0xf244eA81F715F343040569398A4E7978De656bf6', ethHelper: '0xc494bFEE14b5E1E118F93CfedF831f40dFA720fA', home: '0x97bbda9A1D45D86631b243521380Bc070D6A4cBD', + governanceRouter: '0xcEc158A719d11005Bd9339865965bed938BEafA3', + xAppConnectionManager: '0x3BAD272559949B455f14ee394798E4D744342661', replicas: [ { domain: 6648936, address: '0xf25C5932bb6EFc7afA4895D9916F2abD7151BF97' }, - { - domain: 1667591279, - address: '0x681Edb6d52138cEa8210060C309230244BcEa61b', - }, + { domain: 1667591279, address: '0x681Edb6d52138cEa8210060C309230244BcEa61b' }, ], }; @@ -43,13 +38,12 @@ export const celo: OpticsDomain = { id: 1667591279, bridgeRouter: '0xf244eA81F715F343040569398A4E7978De656bf6', home: '0x97bbda9A1D45D86631b243521380Bc070D6A4cBD', + governanceRouter: '0xcEc158A719d11005Bd9339865965bed938BEafA3', + xAppConnectionManager: '0x3BAD272559949B455f14ee394798E4D744342661', replicas: [ - { domain: 6648936, address: '0xf25c5932bb6efc7afa4895d9916f2abd7151bf97' }, - { - domain: 1886350457, - address: '0x681Edb6d52138cEa8210060C309230244BcEa61b', - }, + { domain: 6648936, address: '0xf25C5932bb6EFc7afA4895D9916F2abD7151BF97' }, + { domain: 1886350457, address: '0x681Edb6d52138cEa8210060C309230244BcEa61b' }, ], }; -export const mainnetDomains = [ethereum, celo, polygon]; +export const mainnetDomains = [ethereum, polygon, celo]; diff --git a/typescript/optics-provider/src/optics/domains/mainnetCommunity.ts b/typescript/optics-provider/src/optics/domains/mainnetCommunity.ts index 9802a0837..c47c7301f 100644 --- a/typescript/optics-provider/src/optics/domains/mainnetCommunity.ts +++ b/typescript/optics-provider/src/optics/domains/mainnetCommunity.ts @@ -2,50 +2,55 @@ import { OpticsDomain } from './domain'; export const celo: OpticsDomain = { name: 'celo', - id: 1667591279, // b'celo' as an int + id: 1667591279, bridgeRouter: '0x1548cf5cf7dBd93f4dA11f45fCce315573d21B60', home: '0x913EE05036f3cbc94Ee4afDea87ceb430524648a', + governanceRouter: '0xd13aC1024d266B73180cA7445Ca0E78b3Acfe8CE', + xAppConnectionManager: '0xaa099aF87ACE9E437b9B410a687F263eeaeC4321', replicas: [ - { - domain: 6648936, // ethereum - address: '0xcDE146d1C673fE13f4fF1569d3F0d9f4d0b9c837' - }, - { - domain: 1886350457, // polygon - address: '0xfde0a96468ae91B4E13794E1B8e5B222E7Db6a23', - }, - { - domain: 1635148152, // avalanche - address: '0x2784a755690453035f32Ac5e28c52524d127AfE2', - }, + { domain: 6648936, address: '0xcDE146d1C673fE13f4fF1569d3F0d9f4d0b9c837' }, + { domain: 1635148152, address: '0x2784a755690453035f32Ac5e28c52524d127AfE2' }, + { domain: 1886350457, address: '0xfde0a96468ae91B4E13794E1B8e5B222E7Db6a23' }, ], }; export const ethereum: OpticsDomain = { name: 'ethereum', - id: 6648936, // b'eth' as an int + id: 6648936, bridgeRouter: '0x4fc16De11deAc71E8b2Db539d82d93BE4b486892', ethHelper: '0x2784a755690453035f32Ac5e28c52524d127AfE2', home: '0xa73a3a74C7044B5411bD61E1990618A1400DA379', + governanceRouter: '0xcbcF180dbd02460dCFCdD282A0985DdC049a4c94', + xAppConnectionManager: '0x8A926cE79f83A5A4C234BeE93feAFCC85b1E40cD', replicas: [ - { - domain: 1667591279, // celo - address: '0x27658c5556A9a57f96E69Bbf6d3B8016f001a785' - }, - { - domain: 1886350457, // polygon - address: '0x4eA75c12eD058F0e6651475688a941555FA62395', - }, - { - domain: 1635148152, // avalanche - address: '0xaa099aF87ACE9E437b9B410a687F263eeaeC4321', - }, + { domain: 1635148152, address: '0xaa099aF87ACE9E437b9B410a687F263eeaeC4321' }, + { domain: 1667591279, address: '0x27658c5556A9a57f96E69Bbf6d3B8016f001a785' }, + { domain: 1886350457, address: '0x4eA75c12eD058F0e6651475688a941555FA62395' }, + ], +}; + +export const avalanche: OpticsDomain = { + name: 'avalanche', + id: 1635148152, + paginate: { + blocks: 1000000, + from: 6765067, + }, + bridgeRouter: '0xB6bB41B1fb8c381b002C405B8abB5D1De0C0abFE', + ethHelper: '0x4fc16De11deAc71E8b2Db539d82d93BE4b486892', + home: '0x101a39eA1143cb252fc8093847399046fc35Db89', + governanceRouter: '0x4d89F34dB307015F8002F97c1d100d84e3AFb76c', + xAppConnectionManager: '0x81B97dfBB743c343983e9bE7B863dB636DbD7373', + replicas: [ + { domain: 6648936, address: '0xCf9066ee2fF063dD09862B745414c8dEa4Cc0497' }, + { domain: 1667591279, address: '0xA734EDE8229970776e1B68085D579b6b6E97dAd4' }, + { domain: 1886350457, address: '0x706DC810c79dAAFb82D304D7C9ff9518D8B43Fae' }, ], }; export const polygon: OpticsDomain = { name: 'polygon', - id: 1886350457, // b'poly' as an int + id: 1886350457, paginate: { // This needs to be stupidly low to avoid RPC timeouts blocks: 10000, @@ -54,46 +59,13 @@ export const polygon: OpticsDomain = { bridgeRouter: '0x3a5846882C0d5F8B0FA4bB04dc90C013104d125d', ethHelper: '0xa489b8981ae5652C9Dd6515848cB8Dbecae5E1B0', home: '0xCf9066ee2fF063dD09862B745414c8dEa4Cc0497', + governanceRouter: '0xf1dd0edC8f8C9a881F350e8010e06bE9eaf7DafA', + xAppConnectionManager: '0x4eA75c12eD058F0e6651475688a941555FA62395', replicas: [ - { - domain: 1667591279, // celo - address: '0x45D35F60Ccf8F7031FB5A09954Cd923A9E84F89d' - }, - { - domain: 6648936, // ethereum - address: '0x2784a755690453035f32Ac5e28c52524d127AfE2', - }, - { - domain: 1635148152, // avalanche - address: '0xfde0a96468ae91B4E13794E1B8e5B222E7Db6a23', - }, - ], -}; - -export const avalanche: OpticsDomain = { - name: 'avalanche', - id: 1635148152, // b'avax' as an int - paginate: { - blocks: 1000000, - from: 6765067, - }, - bridgeRouter: '0xB6bB41B1fb8c381b002C405B8abB5D1De0C0abFE', - ethHelper: '0x4fc16De11deAc71E8b2Db539d82d93BE4b486892', - home: '0x101a39eA1143cb252fc8093847399046fc35Db89', - replicas: [ - { - domain: 1667591279, // celo - address: '0xA734EDE8229970776e1B68085D579b6b6E97dAd4' - }, - { - domain: 6648936, // ethereum - address: '0xCf9066ee2fF063dD09862B745414c8dEa4Cc0497', - }, - { - domain: 1886350457, // polygon - address: '0x706DC810c79dAAFb82D304D7C9ff9518D8B43Fae', - }, + { domain: 6648936, address: '0x2784a755690453035f32Ac5e28c52524d127AfE2' }, + { domain: 1635148152, address: '0xfde0a96468ae91B4E13794E1B8e5B222E7Db6a23' }, + { domain: 1667591279, address: '0x45D35F60Ccf8F7031FB5A09954Cd923A9E84F89d' }, ], }; -export const mainnetCommunityDomains = [celo, ethereum, polygon, avalanche]; +export const mainnetCommunityDomains = [celo, ethereum, avalanche, polygon]; diff --git a/typescript/optics-provider/src/optics/domains/staging.ts b/typescript/optics-provider/src/optics/domains/staging.ts index af066b2a3..c59eeaf88 100644 --- a/typescript/optics-provider/src/optics/domains/staging.ts +++ b/typescript/optics-provider/src/optics/domains/staging.ts @@ -4,13 +4,12 @@ export const alfajores: OpticsDomain = { name: 'alfajores', id: 1000, bridgeRouter: '0xd6930Ee55C141E5Bb4079d5963cF64320956bb3E', - home: '0x47AaF05B1C36015eC186892C43ba4BaF91246aaA', + home: '0xc8abA9c65A292C84EA00441B81124d9507fB22A8', + governanceRouter: '0x760AbbE9496BD9cEe159402E2B4d96E3d76dbE6a', + xAppConnectionManager: '0x02c144AeBA550634c8EE185F78657fd3C4a3F9B5', replicas: [ - { domain: 2000, address: '0x7804079cF55110dE7Db5aA67eB1Be00cBE9CA526' }, - { - domain: 3000, - address: '0x6B8D6947B9b70f3ff1b547a15B969F625d28104a', - }, + { domain: 2000, address: '0x7149bF9f804F27e7259d0Ce328Dd5f6D5639ef19' }, + { domain: 3000, address: '0xE469D8587D45BF85297BD924b159E726E7CA5408' }, ], }; @@ -19,13 +18,12 @@ export const kovan: OpticsDomain = { id: 3000, bridgeRouter: '0x359089D34687bDbFD019fCC5093fFC21bE9905f5', ethHelper: '0x411ABcFD947212a0D64b97C9882556367b61704a', - home: '0x5B55C29A10aEe6D5750F128C6a8f490de763ccc7', + home: '0xB6Ee3e8fE5b577Bd6aB9a06FA169F97303586E7C', + governanceRouter: '0xa95868Ffaed7489e9059d4a08A0C1B0F78041b33', + xAppConnectionManager: '0x1d9Af80594930574201d919Af0fBfe6bb89800E2', replicas: [ - { domain: 2000, address: '0xC1AB4d72548Cc1C248EAdcD340035C3b213a47C3' }, - { - domain: 1000, - address: '0xE63E73339501EE3A8d2928d6C88cf30aC8556Ee0', - }, + { domain: 1000, address: '0xF76995174f3C02e2900d0F6261e8cbeC04078E1f' }, + { domain: 2000, address: '0xFF47138c42119Fe0B1f267e2fa254321DE287Fc6' }, ], }; @@ -34,14 +32,13 @@ export const rinkeby: OpticsDomain = { id: 2000, bridgeRouter: '0x8FbEA25D0bFDbff68F2B920df180e9498E9c856A', ethHelper: '0x1BEBC8F1260d16EE5d1CFEE9366bB474bD13DC5f', - home: '0x6E6010E6bd43a9d2F7AE3b7eA9f61760e58758f3', + home: '0x8459EDe1ed4dADD6D5B142d845240088A6530Cf8', + governanceRouter: '0x8f8424DC94b4c302984Ab5a03fc4c2d1Ec95DC92', + xAppConnectionManager: '0x53B94f2D4a3159b66fcCC4f406Ea388426A3f3cB', replicas: [ - { domain: 1000, address: '0x6A5F9531D1877ebE96Bc0631DbF64BBCf1f7421c' }, - { - domain: 3000, - address: '0x6554bc7a5C35bA64Bf48FA8a9e662d8808aaa890', - }, + { domain: 1000, address: '0xb473F5e0AAf47Ba54dac048633e7b578c1eBde01' }, + { domain: 3000, address: '0x7EB8450a5397b795F2d89BC48EA20c24fa147F11' }, ], }; -export const stagingDomains = [alfajores, kovan, rinkeby]; +export const stagingDomains = [alfajores, kovan, rinkeby]; \ No newline at end of file diff --git a/typescript/optics-provider/src/optics/domains/stagingCommunity.ts b/typescript/optics-provider/src/optics/domains/stagingCommunity.ts index 4bc0edeb6..551515259 100644 --- a/typescript/optics-provider/src/optics/domains/stagingCommunity.ts +++ b/typescript/optics-provider/src/optics/domains/stagingCommunity.ts @@ -5,19 +5,12 @@ export const alfajores: OpticsDomain = { id: 1000, bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C', home: '0xDf89d5d4039ada018BCDb992Bb6C2e05fEf86328', + governanceRouter: '0x1E2DE9CD3f64c4e9AadE11a60C7b3620dD026888', + xAppConnectionManager: '0x56Bf96be9ab395aa2861E7Ae4aCEFc11D8C2Ec49', replicas: [ - { - domain: 3, // ropsten - address: '0xC9e581Cd4fF6533f5ccBA4Dc5d5f642B8b658B93' - }, - { - domain: 3000, // kovan - address: '0x15fA9169F7495162ac52b4A7957c9054097Ab0FF', - }, - { - domain: 5, // gorli - address: '0x4eAD31e37b950B32b9EBbE747f0ef4BffAc336a5', - }, + { domain: 3, address: '0xC9e581Cd4fF6533f5ccBA4Dc5d5f642B8b658B93' }, + { domain: 5, address: '0x4eAD31e37b950B32b9EBbE747f0ef4BffAc336a5' }, + { domain: 3000, address: '0x15fA9169F7495162ac52b4A7957c9054097Ab0FF' }, ], }; @@ -27,19 +20,12 @@ export const ropsten: OpticsDomain = { bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C', ethHelper: '0x9A0e88a3D8CF09F3dc5Ba65640299DE3D87f926C', home: '0x7E26E170dB94E81979927d2D39CB703048Ad599D', + governanceRouter: '0xa8C889D257d9eE02cb957941cd785CfffDe5a453', + xAppConnectionManager: '0xe5C92bC2a443016c00b3908dFA63f55bEe1a7a16', replicas: [ - { - domain: 1000, // alfajores - address: '0x30dAE25E9eBd644841d1A1fF25e303331B1CdEb3' - }, - { - domain: 3000, // kovan - address: '0xF782C67AA111a9D75f6ccEf3d7aDB54620D5A8e9', - }, - { - domain: 5, // gorli - address: '0x15C1edbf6E6161d50d58682dF7587F0d61db5C38', - }, + { domain: 5, address: '0x15C1edbf6E6161d50d58682dF7587F0d61db5C38' }, + { domain: 1000, address: '0x30dAE25E9eBd644841d1A1fF25e303331B1CdEb3' }, + { domain: 3000, address: '0xF782C67AA111a9D75f6ccEf3d7aDB54620D5A8e9' }, ], }; @@ -49,42 +35,28 @@ export const kovan: OpticsDomain = { bridgeRouter: '0x9A0e88a3D8CF09F3dc5Ba65640299DE3D87f926C', ethHelper: '0x8c7510966c0312dEb2305A5E1C923CE48bbf55Ce', home: '0x7E26E170dB94E81979927d2D39CB703048Ad599D', + governanceRouter: '0xa8C889D257d9eE02cb957941cd785CfffDe5a453', + xAppConnectionManager: '0xe5C92bC2a443016c00b3908dFA63f55bEe1a7a16', replicas: [ - { - domain: 1000, // alfajores - address: '0x30dAE25E9eBd644841d1A1fF25e303331B1CdEb3' - }, - { - domain: 3, // ropsten - address: '0x15C1edbf6E6161d50d58682dF7587F0d61db5C38', - }, - { - domain: 5, // gorli - address: '0xF782C67AA111a9D75f6ccEf3d7aDB54620D5A8e9', - }, + { domain: 3, address: '0x15C1edbf6E6161d50d58682dF7587F0d61db5C38' }, + { domain: 5, address: '0xF782C67AA111a9D75f6ccEf3d7aDB54620D5A8e9' }, + { domain: 1000, address: '0x30dAE25E9eBd644841d1A1fF25e303331B1CdEb3' }, ], }; export const gorli: OpticsDomain = { - name: 'gorli', - id: 5, - bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C', - ethHelper: '0x9A0e88a3D8CF09F3dc5Ba65640299DE3D87f926C', - home: '0xDf89d5d4039ada018BCDb992Bb6C2e05fEf86328', - replicas: [ - { - domain: 1000, // alfajores - address: '0x15fA9169F7495162ac52b4A7957c9054097Ab0FF' - }, - { - domain: 3, // ropsten - address: '0xC9e581Cd4fF6533f5ccBA4Dc5d5f642B8b658B93', - }, - { - domain: 3000, // kovan - address: '0x4eAD31e37b950B32b9EBbE747f0ef4BffAc336a5', - }, - ], + name: 'gorli', + id: 5, + bridgeRouter: '0xe29Abbc3669064d8aF9F6BE378179a133664a92C', + ethHelper: '0x9A0e88a3D8CF09F3dc5Ba65640299DE3D87f926C', + home: '0xDf89d5d4039ada018BCDb992Bb6C2e05fEf86328', + governanceRouter: '0x1E2DE9CD3f64c4e9AadE11a60C7b3620dD026888', + xAppConnectionManager: '0x56Bf96be9ab395aa2861E7Ae4aCEFc11D8C2Ec49', + replicas: [ + { domain: 3, address: '0xC9e581Cd4fF6533f5ccBA4Dc5d5f642B8b658B93' }, + { domain: 1000, address: '0x15fA9169F7495162ac52b4A7957c9054097Ab0FF' }, + { domain: 3000, address: '0x4eAD31e37b950B32b9EBbE747f0ef4BffAc336a5' }, + ], }; -export const stagingCommunityDomains = [alfajores, kovan, ropsten, gorli]; +export const stagingCommunityDomains = [alfajores, ropsten, kovan, gorli]; \ No newline at end of file diff --git a/typescript/optics-provider/src/optics/govern/index.ts b/typescript/optics-provider/src/optics/govern/index.ts new file mode 100644 index 000000000..9ff5592a4 --- /dev/null +++ b/typescript/optics-provider/src/optics/govern/index.ts @@ -0,0 +1,105 @@ +import { ethers } from 'ethers'; +import { CoreContracts } from '../contracts'; + + +import * as utils from './utils'; + +export type Address = string; + +export interface Call { + to: Address; + data: ethers.utils.BytesLike; +} + +export class CallBatch { + readonly local: Readonly[]; + readonly remote: Map[]>; + private core: CoreContracts; + private built?: ethers.PopulatedTransaction[]; + + constructor(core: CoreContracts) { + this.core = core; + this.remote = new Map(); + this.local = []; + } + + static async fromCore(core: CoreContracts): Promise { + const governor = await core.governor(); + if (!governor.local) + throw new Error( + 'Cannot create call batch on a chain without governance rights. Use the governing chain.', + ); + return new CallBatch(core); + } + + pushLocal(call: Call): void { + if (this.built) + throw new Error('Batch has been built. Cannot push more calls'); + this.local.push(utils.normalizeCall(call)); + } + + pushRemote(domain: number, call: Call): void { + if (this.built) + throw new Error('Batch has been built. Cannot push more calls'); + const calls = this.remote.get(domain); + const normalized = utils.normalizeCall(call); + if (!calls) { + this.remote.set(domain, [normalized]); + } else { + calls.push(normalized); + } + } + + // Build governance transactions from this callbatch + async build( + overrides?: ethers.Overrides, + ): Promise { + if (this.built && overrides) + throw new Error('Cannot rebuild batch with new overrides') + if (this.built) return this.built; + const [domains, remoteCalls] = utils.associateRemotes(this.remote); + const local = await this.core.governanceRouter.populateTransaction.callLocal(this.local) + const remotes = await Promise.all( + domains.map((domain: number, i: number) => this.core.governanceRouter.populateTransaction.callRemote(domain, remoteCalls[i], overrides)) + ) + this.built = remotes.concat(local) + return this.built; + } + + // Sign each governance transaction and dispatch them to the chain + async execute( + overrides?: ethers.Overrides, + ): Promise { + const transactions = await this.build(overrides); + const signer = await this.governorSigner() + const receipts = [] + for (const tx of transactions) { + const response = await signer.sendTransaction(tx) + receipts.push(await response.wait()) + } + return receipts + } + + async estimateGas( + overrides?: ethers.Overrides, + ): Promise { + const transactions = await this.build(overrides); + const signer = await this.governorSigner() + const responses = [] + for (const tx of transactions) { + responses.push(await signer.estimateGas(tx)) + } + return responses + } + + async governorSigner(): Promise { + const signer = this.core.governanceRouter.signer; + const governor = await this.core.governor() + const signerAddress = await signer.getAddress() + if (!governor.local) + throw new Error('Governor is not local'); + if (signerAddress !== governor.identifier) + throw new Error('Signer is not Governor'); + return signer + } +} diff --git a/typescript/optics-provider/src/optics/govern/utils.ts b/typescript/optics-provider/src/optics/govern/utils.ts new file mode 100644 index 000000000..142c9d543 --- /dev/null +++ b/typescript/optics-provider/src/optics/govern/utils.ts @@ -0,0 +1,49 @@ +import { ethers } from 'ethers'; +import { Call } from '.'; +import { canonizeId } from '../../utils'; + +// Returns the length (in bytes) of a BytesLike. +export function byteLength(bytesLike: ethers.utils.BytesLike): number { + return ethers.utils.arrayify(bytesLike).length; +} + +/** + * Serialize a call to its packed Optics governance representation + * @param call The function call to serialize + * @returns The serialized function call, as a '0x'-prepended hex string + */ +export function serializeCall(call: Call): string { + const { to, data } = call; + const dataLen = byteLength(data); + + if (!to || !data) { + throw new Error(`Missing data in Call: \n ${call}`); + } + + return ethers.utils.solidityPack( + ['bytes32', 'uint32', 'bytes'], + [to, dataLen, data], + ); +} + +export function associateRemotes( + remoteCalls: Map, +): [number[], Call[][]] { + const domains = []; + const calls = []; + for (const [key, value] of remoteCalls) { + domains.push(key); + calls.push(value); + } + return [domains, calls]; +} + +export function normalizeCall(partial: Partial): Readonly { + const to = ethers.utils.hexlify(canonizeId(partial.to!)); + const data = partial.data ?? '0x'; + + return Object.freeze({ + to, + data, + }); +} diff --git a/typescript/optics-provider/src/provider.ts b/typescript/optics-provider/src/provider.ts index 43a79bf87..754fd6a72 100644 --- a/typescript/optics-provider/src/provider.ts +++ b/typescript/optics-provider/src/provider.ts @@ -1,5 +1,6 @@ import { ethers } from 'ethers'; import { Domain } from './domains'; +import { StaticCeloJsonRpcProvider } from 'celo-ethers-provider'; type Provider = ethers.providers.Provider; @@ -151,7 +152,14 @@ export class MultiProvider { */ registerRpcProvider(nameOrDomain: string | number, rpc: string): void { const domain = this.resolveDomain(nameOrDomain); - + const celoNames = ['alfajores', 'celo'] + for (const name of celoNames) { + if (nameOrDomain === name) { + const provider = new StaticCeloJsonRpcProvider(rpc); + this.registerProvider(domain, provider); + return + } + } const provider = new ethers.providers.StaticJsonRpcProvider(rpc); this.registerProvider(domain, provider); } diff --git a/typescript/optics-provider/src/utils.ts b/typescript/optics-provider/src/utils.ts index 407a6ccf0..b65068a3d 100644 --- a/typescript/optics-provider/src/utils.ts +++ b/typescript/optics-provider/src/utils.ts @@ -11,6 +11,7 @@ export type Address = string; * @returns A Uint8Array of length 32 */ export function canonizeId(data: BytesLike): Uint8Array { + if (!data) throw new Error('Bad input. Undefined'); const buf = ethers.utils.arrayify(data); if (buf.length > 32) { throw new Error('Too long'); diff --git a/typescript/optics-provider/tsconfig.json b/typescript/optics-provider/tsconfig.json index aeb309c62..9c54d1e26 100644 --- a/typescript/optics-provider/tsconfig.json +++ b/typescript/optics-provider/tsconfig.json @@ -11,6 +11,7 @@ "./src/optics/contracts/*.ts", "./src/optics/domains/*.ts", "./src/optics/events/*.ts", + "./src/optics/govern/*.ts", "./src/optics/messages/*.ts", "./src/optics/tokens/*.ts" ]