diff --git a/package.json b/package.json index 3f60ab43..6b4339e4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@across-protocol/sdk", "author": "UMA Team", - "version": "3.1.17", + "version": "3.1.18", "license": "AGPL-3.0", "homepage": "https://docs.across.to/reference/sdk", "files": [ @@ -100,7 +100,7 @@ "dependencies": { "@across-protocol/across-token": "^1.0.0", "@across-protocol/constants": "^3.1.13", - "@across-protocol/contracts": "^3.0.8", + "@across-protocol/contracts": "^3.0.9", "@eth-optimism/sdk": "^3.3.1", "@pinata/sdk": "^2.1.0", "@types/mocha": "^10.0.1", diff --git a/src/relayFeeCalculator/chain-queries/factory.ts b/src/relayFeeCalculator/chain-queries/factory.ts index 9b0ed7d8..f3bd2e9a 100644 --- a/src/relayFeeCalculator/chain-queries/factory.ts +++ b/src/relayFeeCalculator/chain-queries/factory.ts @@ -1,9 +1,10 @@ +import assert from "assert"; import { CHAIN_IDs, TOKEN_SYMBOLS_MAP } from "@across-protocol/constants"; import { getDeployedAddress } from "@across-protocol/contracts"; import { asL2Provider } from "@eth-optimism/sdk"; import { providers } from "ethers"; import { DEFAULT_SIMULATED_RELAYER_ADDRESS } from "../../constants"; -import { chainIsMatic, chainIsOPStack } from "../../utils"; +import { chainIsMatic, chainIsOPStack, isDefined } from "../../utils"; import { QueryBase } from "./baseQuery"; import { PolygonQueries } from "./polygon"; import { DEFAULT_LOGGER, Logger } from "../relayFeeCalculator"; @@ -28,6 +29,8 @@ export class QueryBase__factory { gasMarkup = 0, coingeckoBaseCurrency = "eth" ): QueryBase { + assert(isDefined(spokePoolAddress)); + // Currently the only chain that has a custom query class is Polygon if (chainIsMatic(chainId)) { return new PolygonQueries( diff --git a/src/relayFeeCalculator/chain-queries/polygon.ts b/src/relayFeeCalculator/chain-queries/polygon.ts index d07276cb..10e29b38 100644 --- a/src/relayFeeCalculator/chain-queries/polygon.ts +++ b/src/relayFeeCalculator/chain-queries/polygon.ts @@ -1,8 +1,10 @@ +import assert from "assert"; import { getDeployedAddress } from "../../utils/DeploymentUtils"; import { DEFAULT_LOGGER, Logger } from "../relayFeeCalculator"; import { providers } from "ethers"; import { CHAIN_IDs, DEFAULT_SIMULATED_RELAYER_ADDRESS, TOKEN_SYMBOLS_MAP } from "../../constants"; import { Coingecko } from "../../coingecko/Coingecko"; +import { isDefined } from "../../utils"; import { QueryBase } from "./baseQuery"; export class PolygonQueries extends QueryBase { @@ -15,6 +17,7 @@ export class PolygonQueries extends QueryBase { logger: Logger = DEFAULT_LOGGER, gasMarkup = 0 ) { + assert(isDefined(spokePoolAddress)); super( provider, symbolMapping, diff --git a/yarn.lock b/yarn.lock index 63bac8a1..f5875ae7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,10 +30,10 @@ "@openzeppelin/contracts" "4.1.0" "@uma/core" "^2.18.0" -"@across-protocol/contracts@^3.0.8": - version "3.0.8" - resolved "https://registry.yarnpkg.com/@across-protocol/contracts/-/contracts-3.0.8.tgz#ec9f72584048e5db3ee3a4dc5e214561101a5ffb" - integrity sha512-JG3Jt+itG+f9ZcUK1K/SFy6xlmCjCxsf99+Ffp11rPN6FUvDNgscRCoizLlBmibzRbXkR6r6r5F2iPbIPX/gxw== +"@across-protocol/contracts@^3.0.9": + version "3.0.9" + resolved "https://registry.yarnpkg.com/@across-protocol/contracts/-/contracts-3.0.9.tgz#26a738e95ddcc433bc1beeb7367f379886d0f037" + integrity sha512-8eoq2/+2GTVSg4t8mEjFtX7OqG92v5JMGKbwGp47/ucQZt1Hat5OocdqcGbpz3QUOPXmF7RU+1RP5TIei28ohA== dependencies: "@across-protocol/constants" "^3.1.13" "@defi-wonderland/smock" "^2.3.4"