@across-protocol/sdk 4.3.127 → 4.3.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/cjs/test/constants.d.ts +58 -8
  2. package/dist/cjs/test/constants.js +70 -13
  3. package/dist/cjs/test/constants.js.map +1 -1
  4. package/dist/cjs/test/fixtures/MerkleLib.Fixture.d.ts +4 -0
  5. package/dist/cjs/test/fixtures/MerkleLib.Fixture.js +22 -0
  6. package/dist/cjs/test/fixtures/MerkleLib.Fixture.js.map +1 -0
  7. package/dist/cjs/test/fixtures/SpokePool.Fixture.d.ts +91 -1
  8. package/dist/cjs/test/fixtures/SpokePool.Fixture.js +196 -1
  9. package/dist/cjs/test/fixtures/SpokePool.Fixture.js.map +1 -1
  10. package/dist/cjs/test/types/index.d.ts +10 -11
  11. package/dist/cjs/test/utils/MerkleLib.utils.d.ts +26 -1
  12. package/dist/cjs/test/utils/MerkleLib.utils.js +40 -0
  13. package/dist/cjs/test/utils/MerkleLib.utils.js.map +1 -1
  14. package/dist/cjs/test/utils/index.d.ts +0 -1
  15. package/dist/cjs/test/utils/index.js +1 -2
  16. package/dist/cjs/test/utils/index.js.map +1 -1
  17. package/dist/cjs/test/utils/utils.d.ts +44 -17
  18. package/dist/cjs/test/utils/utils.js +223 -37
  19. package/dist/cjs/test/utils/utils.js.map +1 -1
  20. package/dist/cjs/test-utils.d.ts +1 -1
  21. package/dist/cjs/test-utils.js +47 -12
  22. package/dist/cjs/test-utils.js.map +1 -1
  23. package/dist/esm/test/constants.d.ts +58 -8
  24. package/dist/esm/test/constants.js +87 -13
  25. package/dist/esm/test/constants.js.map +1 -1
  26. package/dist/esm/test/fixtures/MerkleLib.Fixture.d.ts +4 -0
  27. package/dist/esm/test/fixtures/MerkleLib.Fixture.js +19 -0
  28. package/dist/esm/test/fixtures/MerkleLib.Fixture.js.map +1 -0
  29. package/dist/esm/test/fixtures/SpokePool.Fixture.d.ts +92 -1
  30. package/dist/esm/test/fixtures/SpokePool.Fixture.js +201 -1
  31. package/dist/esm/test/fixtures/SpokePool.Fixture.js.map +1 -1
  32. package/dist/esm/test/types/index.d.ts +10 -11
  33. package/dist/esm/test/utils/MerkleLib.utils.d.ts +32 -1
  34. package/dist/esm/test/utils/MerkleLib.utils.js +44 -0
  35. package/dist/esm/test/utils/MerkleLib.utils.js.map +1 -1
  36. package/dist/esm/test/utils/index.d.ts +0 -1
  37. package/dist/esm/test/utils/index.js +0 -2
  38. package/dist/esm/test/utils/index.js.map +1 -1
  39. package/dist/esm/test/utils/utils.d.ts +44 -17
  40. package/dist/esm/test/utils/utils.js +205 -29
  41. package/dist/esm/test/utils/utils.js.map +1 -1
  42. package/dist/esm/test-utils.d.ts +1 -1
  43. package/dist/esm/test-utils.js +1 -1
  44. package/dist/esm/test-utils.js.map +1 -1
  45. package/dist/types/test/constants.d.ts +58 -8
  46. package/dist/types/test/constants.d.ts.map +1 -1
  47. package/dist/types/test/fixtures/MerkleLib.Fixture.d.ts +5 -0
  48. package/dist/types/test/fixtures/MerkleLib.Fixture.d.ts.map +1 -0
  49. package/dist/types/test/fixtures/SpokePool.Fixture.d.ts +92 -1
  50. package/dist/types/test/fixtures/SpokePool.Fixture.d.ts.map +1 -1
  51. package/dist/types/test/types/index.d.ts +10 -11
  52. package/dist/types/test/types/index.d.ts.map +1 -1
  53. package/dist/types/test/utils/MerkleLib.utils.d.ts +32 -1
  54. package/dist/types/test/utils/MerkleLib.utils.d.ts.map +1 -1
  55. package/dist/types/test/utils/index.d.ts +0 -1
  56. package/dist/types/test/utils/index.d.ts.map +1 -1
  57. package/dist/types/test/utils/utils.d.ts +44 -17
  58. package/dist/types/test/utils/utils.d.ts.map +1 -1
  59. package/dist/types/test-utils.d.ts +1 -1
  60. package/dist/types/test-utils.d.ts.map +1 -1
  61. package/package.json +1 -1
@@ -1,32 +1,67 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getParamType = exports.buildV3SlowRelayTree = exports.buildSlowRelayTree = exports.buildRelayerRefundLeaves = exports.buildRelayerRefundTree = exports.buildPoolRebalanceLeaves = exports.buildPoolRebalanceLeafTree = exports.hubPoolFixture = exports.deployHubPool = exports.spokePoolFixture = exports.deploySpokePool = exports.CHAIN_ID_TEST_LIST = exports.sampleRateModel = exports.MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF = exports.MAX_REFUNDS_PER_RELAYER_REFUND_LEAF = exports.randomDestinationToken2 = exports.randomDestinationToken = exports.randomOriginToken = exports.randomL1Token = exports.CONFIG_STORE_VERSION = exports.identifier = exports.finalFeeUsdt = exports.finalFeeUsdc = exports.finalFee = exports.bondAmount = exports.TokenRolesEnum = exports.totalBond = exports.refundProposalLiveness = exports.mockTreeRoot = exports.repaymentChainId = exports.destinationChainId = exports.originChainId = exports.depositRelayerFeePct = exports.amountToLp = exports.amountToDeposit = void 0;
3
+ exports.MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF = exports.MAX_REFUNDS_PER_RELAYER_REFUND_LEAF = exports.l1TokenTransferThreshold = exports.maxL1TokensPerPoolRebalanceLeaf = exports.maxRefundsPerRelayerRefundLeaf = exports.sampleL2GasPrice = exports.sampleL2MaxSubmissionCost = exports.sampleL2GasSendTokens = exports.sampleL2Gas = exports.amountToReturn = exports.amountHeldByPool = exports.mockTreeRoot = exports.mockSlowRelayRoot = exports.mockRelayerRefundRoot = exports.mockPoolRebalanceRoot = exports.mockPoolRebalanceLeafCount = exports.mockBundleEvaluationBlockNumbers = exports.zeroRawValue = exports.identifier = exports.zeroBytes32 = exports.zeroAddress = exports.refundProposalLiveness = exports.totalBond = exports.finalFeeUsdt = exports.finalFeeUsdc = exports.finalFee = exports.bondAmount = exports.firstDepositId = exports.amountToRelayPreLPFee = exports.amountToRelayPreModifiedFees = exports.amountReceived = exports.amountToRelayPreFees = exports.totalPostModifiedFeesPct = exports.totalPostFeesPct = exports.oneHundredPct = exports.realizedLpFeePct = exports.incorrectModifiedRelayerFeePct = exports.modifiedRelayerFeePct = exports.depositRelayerFeePct = exports.amountToRelay = exports.amountToDeposit = exports.amountToLp = exports.amountToSeedWallets = exports.MAX_EXCLUSIVITY_OFFSET_SECONDS = exports.MAX_UINT32 = exports.maxUint256 = exports.repaymentChainId = exports.originChainId = exports.destinationChainId = exports.TokenRolesEnum = void 0;
4
+ exports.getParamType = exports.buildV3SlowRelayTree = exports.buildSlowRelayTree = exports.buildRelayerRefundLeaves = exports.buildRelayerRefundTree = exports.buildPoolRebalanceLeaves = exports.buildPoolRebalanceLeafTree = exports.hubPoolFixture = exports.deployHubPool = exports.spokePoolFixture = exports.deploySpokePool = exports.CHAIN_ID_TEST_LIST = exports.randomDestinationToken2 = exports.randomDestinationToken = exports.randomOriginToken = exports.randomL1Token = exports.randomAddress = exports.CONFIG_STORE_VERSION = exports.sampleRateModel = void 0;
4
5
  var tslib_1 = require("tslib");
5
6
  tslib_1.__exportStar(require("./test/utils/utils"), exports);
6
7
  var constants_1 = require("./test/constants");
7
- Object.defineProperty(exports, "amountToDeposit", { enumerable: true, get: function () { return constants_1.amountToDeposit; } });
8
- Object.defineProperty(exports, "amountToLp", { enumerable: true, get: function () { return constants_1.amountToLp; } });
9
- Object.defineProperty(exports, "depositRelayerFeePct", { enumerable: true, get: function () { return constants_1.depositRelayerFeePct; } });
10
- Object.defineProperty(exports, "originChainId", { enumerable: true, get: function () { return constants_1.originChainId; } });
8
+ Object.defineProperty(exports, "TokenRolesEnum", { enumerable: true, get: function () { return constants_1.TokenRolesEnum; } });
11
9
  Object.defineProperty(exports, "destinationChainId", { enumerable: true, get: function () { return constants_1.destinationChainId; } });
10
+ Object.defineProperty(exports, "originChainId", { enumerable: true, get: function () { return constants_1.originChainId; } });
12
11
  Object.defineProperty(exports, "repaymentChainId", { enumerable: true, get: function () { return constants_1.repaymentChainId; } });
13
- Object.defineProperty(exports, "mockTreeRoot", { enumerable: true, get: function () { return constants_1.mockTreeRoot; } });
14
- Object.defineProperty(exports, "refundProposalLiveness", { enumerable: true, get: function () { return constants_1.refundProposalLiveness; } });
15
- Object.defineProperty(exports, "totalBond", { enumerable: true, get: function () { return constants_1.totalBond; } });
16
- Object.defineProperty(exports, "TokenRolesEnum", { enumerable: true, get: function () { return constants_1.TokenRolesEnum; } });
12
+ Object.defineProperty(exports, "maxUint256", { enumerable: true, get: function () { return constants_1.maxUint256; } });
13
+ Object.defineProperty(exports, "MAX_UINT32", { enumerable: true, get: function () { return constants_1.MAX_UINT32; } });
14
+ Object.defineProperty(exports, "MAX_EXCLUSIVITY_OFFSET_SECONDS", { enumerable: true, get: function () { return constants_1.MAX_EXCLUSIVITY_OFFSET_SECONDS; } });
15
+ Object.defineProperty(exports, "amountToSeedWallets", { enumerable: true, get: function () { return constants_1.amountToSeedWallets; } });
16
+ Object.defineProperty(exports, "amountToLp", { enumerable: true, get: function () { return constants_1.amountToLp; } });
17
+ Object.defineProperty(exports, "amountToDeposit", { enumerable: true, get: function () { return constants_1.amountToDeposit; } });
18
+ Object.defineProperty(exports, "amountToRelay", { enumerable: true, get: function () { return constants_1.amountToRelay; } });
19
+ Object.defineProperty(exports, "depositRelayerFeePct", { enumerable: true, get: function () { return constants_1.depositRelayerFeePct; } });
20
+ Object.defineProperty(exports, "modifiedRelayerFeePct", { enumerable: true, get: function () { return constants_1.modifiedRelayerFeePct; } });
21
+ Object.defineProperty(exports, "incorrectModifiedRelayerFeePct", { enumerable: true, get: function () { return constants_1.incorrectModifiedRelayerFeePct; } });
22
+ Object.defineProperty(exports, "realizedLpFeePct", { enumerable: true, get: function () { return constants_1.realizedLpFeePct; } });
23
+ Object.defineProperty(exports, "oneHundredPct", { enumerable: true, get: function () { return constants_1.oneHundredPct; } });
24
+ Object.defineProperty(exports, "totalPostFeesPct", { enumerable: true, get: function () { return constants_1.totalPostFeesPct; } });
25
+ Object.defineProperty(exports, "totalPostModifiedFeesPct", { enumerable: true, get: function () { return constants_1.totalPostModifiedFeesPct; } });
26
+ Object.defineProperty(exports, "amountToRelayPreFees", { enumerable: true, get: function () { return constants_1.amountToRelayPreFees; } });
27
+ Object.defineProperty(exports, "amountReceived", { enumerable: true, get: function () { return constants_1.amountReceived; } });
28
+ Object.defineProperty(exports, "amountToRelayPreModifiedFees", { enumerable: true, get: function () { return constants_1.amountToRelayPreModifiedFees; } });
29
+ Object.defineProperty(exports, "amountToRelayPreLPFee", { enumerable: true, get: function () { return constants_1.amountToRelayPreLPFee; } });
30
+ Object.defineProperty(exports, "firstDepositId", { enumerable: true, get: function () { return constants_1.firstDepositId; } });
17
31
  Object.defineProperty(exports, "bondAmount", { enumerable: true, get: function () { return constants_1.bondAmount; } });
18
32
  Object.defineProperty(exports, "finalFee", { enumerable: true, get: function () { return constants_1.finalFee; } });
19
33
  Object.defineProperty(exports, "finalFeeUsdc", { enumerable: true, get: function () { return constants_1.finalFeeUsdc; } });
20
34
  Object.defineProperty(exports, "finalFeeUsdt", { enumerable: true, get: function () { return constants_1.finalFeeUsdt; } });
35
+ Object.defineProperty(exports, "totalBond", { enumerable: true, get: function () { return constants_1.totalBond; } });
36
+ Object.defineProperty(exports, "refundProposalLiveness", { enumerable: true, get: function () { return constants_1.refundProposalLiveness; } });
37
+ Object.defineProperty(exports, "zeroAddress", { enumerable: true, get: function () { return constants_1.zeroAddress; } });
38
+ Object.defineProperty(exports, "zeroBytes32", { enumerable: true, get: function () { return constants_1.zeroBytes32; } });
21
39
  Object.defineProperty(exports, "identifier", { enumerable: true, get: function () { return constants_1.identifier; } });
40
+ Object.defineProperty(exports, "zeroRawValue", { enumerable: true, get: function () { return constants_1.zeroRawValue; } });
41
+ Object.defineProperty(exports, "mockBundleEvaluationBlockNumbers", { enumerable: true, get: function () { return constants_1.mockBundleEvaluationBlockNumbers; } });
42
+ Object.defineProperty(exports, "mockPoolRebalanceLeafCount", { enumerable: true, get: function () { return constants_1.mockPoolRebalanceLeafCount; } });
43
+ Object.defineProperty(exports, "mockPoolRebalanceRoot", { enumerable: true, get: function () { return constants_1.mockPoolRebalanceRoot; } });
44
+ Object.defineProperty(exports, "mockRelayerRefundRoot", { enumerable: true, get: function () { return constants_1.mockRelayerRefundRoot; } });
45
+ Object.defineProperty(exports, "mockSlowRelayRoot", { enumerable: true, get: function () { return constants_1.mockSlowRelayRoot; } });
46
+ Object.defineProperty(exports, "mockTreeRoot", { enumerable: true, get: function () { return constants_1.mockTreeRoot; } });
47
+ Object.defineProperty(exports, "amountHeldByPool", { enumerable: true, get: function () { return constants_1.amountHeldByPool; } });
48
+ Object.defineProperty(exports, "amountToReturn", { enumerable: true, get: function () { return constants_1.amountToReturn; } });
49
+ Object.defineProperty(exports, "sampleL2Gas", { enumerable: true, get: function () { return constants_1.sampleL2Gas; } });
50
+ Object.defineProperty(exports, "sampleL2GasSendTokens", { enumerable: true, get: function () { return constants_1.sampleL2GasSendTokens; } });
51
+ Object.defineProperty(exports, "sampleL2MaxSubmissionCost", { enumerable: true, get: function () { return constants_1.sampleL2MaxSubmissionCost; } });
52
+ Object.defineProperty(exports, "sampleL2GasPrice", { enumerable: true, get: function () { return constants_1.sampleL2GasPrice; } });
53
+ Object.defineProperty(exports, "maxRefundsPerRelayerRefundLeaf", { enumerable: true, get: function () { return constants_1.maxRefundsPerRelayerRefundLeaf; } });
54
+ Object.defineProperty(exports, "maxL1TokensPerPoolRebalanceLeaf", { enumerable: true, get: function () { return constants_1.maxL1TokensPerPoolRebalanceLeaf; } });
55
+ Object.defineProperty(exports, "l1TokenTransferThreshold", { enumerable: true, get: function () { return constants_1.l1TokenTransferThreshold; } });
56
+ Object.defineProperty(exports, "MAX_REFUNDS_PER_RELAYER_REFUND_LEAF", { enumerable: true, get: function () { return constants_1.MAX_REFUNDS_PER_RELAYER_REFUND_LEAF; } });
57
+ Object.defineProperty(exports, "MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF", { enumerable: true, get: function () { return constants_1.MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF; } });
58
+ Object.defineProperty(exports, "sampleRateModel", { enumerable: true, get: function () { return constants_1.sampleRateModel; } });
22
59
  Object.defineProperty(exports, "CONFIG_STORE_VERSION", { enumerable: true, get: function () { return constants_1.CONFIG_STORE_VERSION; } });
60
+ Object.defineProperty(exports, "randomAddress", { enumerable: true, get: function () { return constants_1.randomAddress; } });
23
61
  Object.defineProperty(exports, "randomL1Token", { enumerable: true, get: function () { return constants_1.randomL1Token; } });
24
62
  Object.defineProperty(exports, "randomOriginToken", { enumerable: true, get: function () { return constants_1.randomOriginToken; } });
25
63
  Object.defineProperty(exports, "randomDestinationToken", { enumerable: true, get: function () { return constants_1.randomDestinationToken; } });
26
64
  Object.defineProperty(exports, "randomDestinationToken2", { enumerable: true, get: function () { return constants_1.randomDestinationToken2; } });
27
- Object.defineProperty(exports, "MAX_REFUNDS_PER_RELAYER_REFUND_LEAF", { enumerable: true, get: function () { return constants_1.MAX_REFUNDS_PER_RELAYER_REFUND_LEAF; } });
28
- Object.defineProperty(exports, "MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF", { enumerable: true, get: function () { return constants_1.MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF; } });
29
- Object.defineProperty(exports, "sampleRateModel", { enumerable: true, get: function () { return constants_1.sampleRateModel; } });
30
65
  Object.defineProperty(exports, "CHAIN_ID_TEST_LIST", { enumerable: true, get: function () { return constants_1.CHAIN_ID_TEST_LIST; } });
31
66
  var SpokePool_Fixture_1 = require("./test/fixtures/SpokePool.Fixture");
32
67
  Object.defineProperty(exports, "deploySpokePool", { enumerable: true, get: function () { return SpokePool_Fixture_1.deploySpokePool; } });
@@ -1 +1 @@
1
- {"version":3,"file":"test-utils.js","sourceRoot":"","sources":["../../test-utils.ts"],"names":[],"mappings":";;;;AAOA,6DAAmC;AAGnC,8CAyB0B;AAxBxB,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AACV,iHAAA,oBAAoB,OAAA;AACpB,0GAAA,aAAa,OAAA;AACb,+GAAA,kBAAkB,OAAA;AAClB,6GAAA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kBAAkB,OAAA;AAIpB,uEAAsF;AAA7E,oHAAA,eAAe,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAC1C,mEAAgF;AAAvE,gHAAA,aAAa,OAAA;AAAE,iHAAA,cAAc,OAAA;AAGtC,gEAQsC;AAPpC,6HAAA,0BAA0B,OAAA;AAC1B,2HAAA,wBAAwB,OAAA;AACxB,yHAAA,sBAAsB,OAAA;AACtB,2HAAA,wBAAwB,OAAA;AACxB,qHAAA,kBAAkB,OAAA;AAClB,uHAAA,oBAAoB,OAAA;AACpB,+GAAA,YAAY,OAAA;AAId,uDAA6B"}
@@ -1,14 +1,58 @@
1
- import * as contracts from "@across-protocol/contracts/dist/test-utils";
2
- export declare const amountToDeposit: contracts.BigNumber, amountToLp: contracts.BigNumber, depositRelayerFeePct: contracts.BigNumber, originChainId: number, destinationChainId: number, repaymentChainId: number, mockTreeRoot: string, refundProposalLiveness: number, totalBond: contracts.BigNumber, TokenRolesEnum: {
1
+ import { BigNumber } from "ethers";
2
+ export declare const TokenRolesEnum: {
3
3
  OWNER: string;
4
4
  MINTER: string;
5
5
  BURNER: string;
6
- }, bondAmount: contracts.BigNumber, finalFee: contracts.BigNumber, finalFeeUsdc: contracts.BigNumber, finalFeeUsdt: contracts.BigNumber, randomAddress: typeof contracts.randomAddress, zeroAddress: string, identifier: string;
7
- export declare const CONFIG_STORE_VERSION = 0;
8
- export declare const randomL1Token: string;
9
- export declare const randomOriginToken: string;
10
- export declare const randomDestinationToken: string;
11
- export declare const randomDestinationToken2: string;
6
+ };
7
+ export declare const destinationChainId = 1342;
8
+ export declare const originChainId = 666;
9
+ export declare const repaymentChainId = 777;
10
+ export declare const maxUint256: BigNumber;
11
+ export declare const MAX_UINT32: BigNumber;
12
+ export declare const MAX_EXCLUSIVITY_OFFSET_SECONDS: number;
13
+ export declare const amountToSeedWallets: BigNumber;
14
+ export declare const amountToLp: BigNumber;
15
+ export declare const amountToDeposit: BigNumber;
16
+ export declare const amountToRelay: BigNumber;
17
+ export declare const depositRelayerFeePct: BigNumber;
18
+ export declare const modifiedRelayerFeePct: BigNumber;
19
+ export declare const incorrectModifiedRelayerFeePct: BigNumber;
20
+ export declare const realizedLpFeePct: BigNumber;
21
+ export declare const oneHundredPct: BigNumber;
22
+ export declare const totalPostFeesPct: BigNumber;
23
+ export declare const totalPostModifiedFeesPct: BigNumber;
24
+ export declare const amountToRelayPreFees: BigNumber;
25
+ export declare const amountReceived: BigNumber;
26
+ export declare const amountToRelayPreModifiedFees: BigNumber;
27
+ export declare const amountToRelayPreLPFee: BigNumber;
28
+ export declare const firstDepositId: BigNumber;
29
+ export declare const bondAmount: BigNumber;
30
+ export declare const finalFee: BigNumber;
31
+ export declare const finalFeeUsdc: BigNumber;
32
+ export declare const finalFeeUsdt: BigNumber;
33
+ export declare const totalBond: BigNumber;
34
+ export declare const refundProposalLiveness = 7200;
35
+ export declare const zeroAddress = "0x0000000000000000000000000000000000000000";
36
+ export declare const zeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
37
+ export declare const identifier: string;
38
+ export declare const zeroRawValue: {
39
+ rawValue: string;
40
+ };
41
+ export declare const mockBundleEvaluationBlockNumbers: number[];
42
+ export declare const mockPoolRebalanceLeafCount = 5;
43
+ export declare const mockPoolRebalanceRoot: string;
44
+ export declare const mockRelayerRefundRoot: string;
45
+ export declare const mockSlowRelayRoot: string;
46
+ export declare const mockTreeRoot: string;
47
+ export declare const amountHeldByPool: BigNumber;
48
+ export declare const amountToReturn: BigNumber;
49
+ export declare const sampleL2Gas = 2000000;
50
+ export declare const sampleL2GasSendTokens = 300000;
51
+ export declare const sampleL2MaxSubmissionCost: BigNumber;
52
+ export declare const sampleL2GasPrice = 5000000000;
53
+ export declare const maxRefundsPerRelayerRefundLeaf = 3;
54
+ export declare const maxL1TokensPerPoolRebalanceLeaf = 3;
55
+ export declare const l1TokenTransferThreshold: BigNumber;
12
56
  export declare const MAX_REFUNDS_PER_RELAYER_REFUND_LEAF = 3;
13
57
  export declare const MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF = 3;
14
58
  export declare const sampleRateModel: {
@@ -17,4 +61,10 @@ export declare const sampleRateModel: {
17
61
  R1: string;
18
62
  R2: string;
19
63
  };
64
+ export declare const CONFIG_STORE_VERSION = 0;
65
+ export declare function randomAddress(): string;
66
+ export declare const randomL1Token: string;
67
+ export declare const randomOriginToken: string;
68
+ export declare const randomDestinationToken: string;
69
+ export declare const randomDestinationToken2: string;
20
70
  export declare const CHAIN_ID_TEST_LIST: number[];
@@ -1,22 +1,96 @@
1
- import * as contracts from "@across-protocol/contracts/dist/test-utils"; // Contains all the Across contract constants.
1
+ import { BigNumber, ethers } from "ethers";
2
+ import { toWei, toBN, utf8ToHex } from "../src/utils";
3
+ import { ZERO_ADDRESS } from "../src/constants";
2
4
  import { DEFAULT_CONFIG_STORE_VERSION } from "./mocks";
3
- export var amountToDeposit = contracts.amountToDeposit, amountToLp = contracts.amountToLp, depositRelayerFeePct = contracts.depositRelayerFeePct, originChainId = contracts.originChainId, destinationChainId = contracts.destinationChainId, repaymentChainId = contracts.repaymentChainId, mockTreeRoot = contracts.mockTreeRoot, refundProposalLiveness = contracts.refundProposalLiveness, totalBond = contracts.totalBond, TokenRolesEnum = contracts.TokenRolesEnum, bondAmount = contracts.bondAmount, finalFee = contracts.finalFee, finalFeeUsdc = contracts.finalFeeUsdc, finalFeeUsdt = contracts.finalFeeUsdt, randomAddress = contracts.randomAddress, zeroAddress = contracts.zeroAddress, identifier = contracts.identifier;
4
- export var CONFIG_STORE_VERSION = DEFAULT_CONFIG_STORE_VERSION;
5
- export var randomL1Token = contracts.randomAddress();
6
- export var randomOriginToken = contracts.randomAddress();
7
- export var randomDestinationToken = contracts.randomAddress();
8
- export var randomDestinationToken2 = contracts.randomAddress();
9
- // Max number of refunds in relayer refund leaf for a { repaymentChainId, L2TokenAddress }.
5
+ // Re-export TokenRolesEnum locally instead of from @uma/common
6
+ export var TokenRolesEnum = {
7
+ OWNER: "0",
8
+ MINTER: "1",
9
+ BURNER: "3",
10
+ };
11
+ // Chain IDs
12
+ export var destinationChainId = 1342; // Should be equal to MockSpokePool.chainId() return value.
13
+ export var originChainId = 666;
14
+ export var repaymentChainId = 777;
15
+ // Max values
16
+ export var maxUint256 = ethers.constants.MaxInt256;
17
+ export var MAX_UINT32 = BigNumber.from("0xFFFFFFFF");
18
+ export var MAX_EXCLUSIVITY_OFFSET_SECONDS = 24 * 60 * 60 * 365;
19
+ // Seed / LP / deposit / relay amounts
20
+ export var amountToSeedWallets = toWei("1500");
21
+ export var amountToLp = toWei("1000");
22
+ export var amountToDeposit = toWei("100");
23
+ export var amountToRelay = toWei("25");
24
+ // Fee percentages (wei-scaled)
25
+ export var depositRelayerFeePct = toWei("0.1");
26
+ export var modifiedRelayerFeePct = toBN(depositRelayerFeePct).add(toBN(toWei("0.1")));
27
+ export var incorrectModifiedRelayerFeePct = toBN(modifiedRelayerFeePct).add(toBN(toWei("0.01")));
28
+ export var realizedLpFeePct = toWei("0.1");
29
+ export var oneHundredPct = toWei("1");
30
+ // Computed fee percentages
31
+ export var totalPostFeesPct = toBN(oneHundredPct).sub(toBN(depositRelayerFeePct).add(realizedLpFeePct));
32
+ export var totalPostModifiedFeesPct = toBN(oneHundredPct).sub(toBN(modifiedRelayerFeePct).add(realizedLpFeePct));
33
+ // Computed relay amounts
34
+ export var amountToRelayPreFees = toBN(amountToRelay).mul(toBN(oneHundredPct)).div(totalPostFeesPct);
35
+ export var amountReceived = toBN(amountToDeposit).mul(toBN(totalPostFeesPct)).div(toBN(oneHundredPct));
36
+ export var amountToRelayPreModifiedFees = toBN(amountToRelay).mul(toBN(oneHundredPct)).div(totalPostModifiedFeesPct);
37
+ export var amountToRelayPreLPFee = amountToRelayPreFees.mul(oneHundredPct.sub(realizedLpFeePct)).div(oneHundredPct);
38
+ // Deposit ID
39
+ export var firstDepositId = toBN(0);
40
+ // Bond and fee values
41
+ export var bondAmount = toWei("5");
42
+ export var finalFee = toWei("1");
43
+ export var finalFeeUsdc = ethers.utils.parseUnits("1", 6);
44
+ export var finalFeeUsdt = ethers.utils.parseUnits("1", 6);
45
+ export var totalBond = bondAmount.add(finalFee);
46
+ // Liveness
47
+ export var refundProposalLiveness = 7200;
48
+ // Addresses
49
+ export var zeroAddress = ZERO_ADDRESS;
50
+ export var zeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
51
+ // Identifier
52
+ export var identifier = utf8ToHex("ACROSS-V2");
53
+ // Raw value
54
+ export var zeroRawValue = { rawValue: "0" };
55
+ // Merkle tree / bundle mock data
56
+ export var mockBundleEvaluationBlockNumbers = [1, 2, 3];
57
+ export var mockPoolRebalanceLeafCount = 5;
58
+ export var mockPoolRebalanceRoot = ethers.utils.hexlify(ethers.utils.randomBytes(32));
59
+ export var mockRelayerRefundRoot = ethers.utils.hexlify(ethers.utils.randomBytes(32));
60
+ export var mockSlowRelayRoot = ethers.utils.hexlify(ethers.utils.randomBytes(32));
61
+ export var mockTreeRoot = ethers.utils.hexlify(ethers.utils.randomBytes(32));
62
+ // Pool amounts
63
+ export var amountHeldByPool = amountToRelay.mul(4);
64
+ export var amountToReturn = toWei("1");
65
+ // L2 gas parameters
66
+ export var sampleL2Gas = 2000000;
67
+ export var sampleL2GasSendTokens = 300000;
68
+ export var sampleL2MaxSubmissionCost = toWei("0.01");
69
+ export var sampleL2GasPrice = 5e9;
70
+ // Leaf size limits (lowercase versions matching contracts repo)
71
+ export var maxRefundsPerRelayerRefundLeaf = 3;
72
+ export var maxL1TokensPerPoolRebalanceLeaf = 3;
73
+ // L1 token transfer threshold
74
+ export var l1TokenTransferThreshold = toWei(100);
75
+ // Uppercase versions used by SDK tests
10
76
  export var MAX_REFUNDS_PER_RELAYER_REFUND_LEAF = 3;
11
- // Max number of L1 tokens for a chain ID in a pool rebalance leaf.
12
77
  export var MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF = 3;
13
78
  // DAI's Rate model.
14
79
  export var sampleRateModel = {
15
- UBar: contracts.toWei(0.8).toString(),
16
- R0: contracts.toWei(0.04).toString(),
17
- R1: contracts.toWei(0.07).toString(),
18
- R2: contracts.toWei(0.75).toString(),
80
+ UBar: toWei(0.8).toString(),
81
+ R0: toWei(0.04).toString(),
82
+ R1: toWei(0.07).toString(),
83
+ R2: toWei(0.75).toString(),
19
84
  };
85
+ export var CONFIG_STORE_VERSION = DEFAULT_CONFIG_STORE_VERSION;
86
+ // Random address helper (uses ethers directly to avoid circular deps)
87
+ export function randomAddress() {
88
+ return ethers.utils.getAddress(ethers.utils.hexlify(ethers.utils.randomBytes(20)));
89
+ }
90
+ export var randomL1Token = randomAddress();
91
+ export var randomOriginToken = randomAddress();
92
+ export var randomDestinationToken = randomAddress();
93
+ export var randomDestinationToken2 = randomAddress();
20
94
  // Add Mainnet chain ID 1 to the chain ID list because the dataworker uses this chain to look up latest GlobalConfig
21
95
  // updates for config variables like MAX_REFUND_COUNT_FOR_RELAYER_REPAYMENT_LEAF.
22
96
  export var CHAIN_ID_TEST_LIST = [originChainId, destinationChainId, repaymentChainId, 1];
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../test/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,4CAA4C,CAAC,CAAC,8CAA8C;AACvH,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,CACJ,IAAA,eAAe,GAiBb,SAAS,gBAjBI,EACf,UAAU,GAgBR,SAAS,WAhBD,EACV,oBAAoB,GAelB,SAAS,qBAfS,EACpB,aAAa,GAcX,SAAS,cAdE,EACb,kBAAkB,GAahB,SAAS,mBAbO,EAClB,gBAAgB,GAYd,SAAS,iBAZK,EAChB,YAAY,GAWV,SAAS,aAXC,EACZ,sBAAsB,GAUpB,SAAS,uBAVW,EACtB,SAAS,GASP,SAAS,UATF,EACT,cAAc,GAQZ,SAAS,eARG,EACd,UAAU,GAOR,SAAS,WAPD,EACV,QAAQ,GAMN,SAAS,S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AC,CAAC,QAAQ,EAAE;IAC1B,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CAC3B,CAAC;AAEF,MAAM,CAAC,IAAM,oBAAoB,GAAG,4BAA4B,CAAC;AAEjE,sEAAsE;AACtE,MAAM,UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,MAAM,CAAC,IAAM,aAAa,GAAG,aAAa,EAAE,CAAC;AAC7C,MAAM,CAAC,IAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AACjD,MAAM,CAAC,IAAM,sBAAsB,GAAG,aAAa,EAAE,CAAC;AACtD,MAAM,CAAC,IAAM,uBAAuB,GAAG,aAAa,EAAE,CAAC;AAEvD,oHAAoH;AACpH,iFAAiF;AACjF,MAAM,CAAC,IAAM,kBAAkB,GAAG,CAAC,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Contract } from "ethers";
2
+ export declare const merkleLibFixture: (options?: unknown) => Promise<{
3
+ merkleLibTest: Contract;
4
+ }>;
@@ -0,0 +1,19 @@
1
+ import { __awaiter, __generator } from "tslib";
2
+ import hre from "hardhat";
3
+ import { getContractFactory } from "../utils/getContractFactory";
4
+ export var merkleLibFixture = hre.deployments.createFixture(function () { return __awaiter(void 0, void 0, void 0, function () {
5
+ var signer, merkleLibTest;
6
+ return __generator(this, function (_a) {
7
+ switch (_a.label) {
8
+ case 0: return [4 /*yield*/, hre.ethers.getSigners()];
9
+ case 1:
10
+ signer = (_a.sent())[0];
11
+ return [4 /*yield*/, getContractFactory("MerkleLibTest", signer)];
12
+ case 2: return [4 /*yield*/, (_a.sent()).deploy()];
13
+ case 3:
14
+ merkleLibTest = _a.sent();
15
+ return [2 /*return*/, { merkleLibTest: merkleLibTest }];
16
+ }
17
+ });
18
+ }); });
19
+ //# sourceMappingURL=MerkleLib.Fixture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MerkleLib.Fixture.js","sourceRoot":"","sources":["../../../../test/fixtures/MerkleLib.Fixture.ts"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,SAAS,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,MAAM,CAAC,IAAM,gBAAgB,GAAG,GAAG,CAAC,WAAW,CAAC,aAAa,CAAC;;;;oBAC3C,qBAAM,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,EAAA;;gBAAvC,MAAM,GAAI,CAAA,SAA6B,CAAA,GAAjC;gBACgB,qBAAM,kBAAkB,CAAC,eAAe,EAAE,MAAM,CAAC,EAAA;oBAAxD,qBAAM,CAAC,SAAiD,CAAC,CAAC,MAAM,EAAE,EAAA;;gBAAlF,aAAa,GAAG,SAAkE;gBACxF,sBAAO,EAAE,aAAa,eAAA,EAAE,EAAC;;;KAC1B,CAAC,CAAC"}
@@ -2,9 +2,100 @@ import "@nomiclabs/hardhat-ethers";
2
2
  import "@openzeppelin/hardhat-upgrades";
3
3
  import "hardhat-deploy";
4
4
  import hre from "hardhat";
5
- import { Contract } from "ethers";
5
+ import { BigNumber, Contract } from "ethers";
6
+ import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
6
7
  import { zeroAddress } from "../constants";
7
8
  export { zeroAddress };
9
+ /** V2-era relay data with string chain IDs / deposit IDs */
10
+ export interface ContractRelayData {
11
+ depositor: string;
12
+ recipient: string;
13
+ destinationToken: string;
14
+ amount: BigNumber;
15
+ realizedLpFeePct: BigNumber;
16
+ relayerFeePct: BigNumber;
17
+ depositId: string;
18
+ originChainId: string;
19
+ destinationChainId: string;
20
+ message: string;
21
+ }
22
+ export interface V3RelayData {
23
+ depositor: string;
24
+ recipient: string;
25
+ exclusiveRelayer: string;
26
+ inputToken: string;
27
+ outputToken: string;
28
+ inputAmount: BigNumber;
29
+ outputAmount: BigNumber;
30
+ originChainId: number;
31
+ depositId: BigNumber;
32
+ fillDeadline: number;
33
+ exclusivityDeadline: number;
34
+ message: string;
35
+ }
36
+ export interface V3RelayExecutionParams {
37
+ relay: V3RelayData;
38
+ relayHash: string;
39
+ updatedOutputAmount: BigNumber;
40
+ updatedRecipient: string;
41
+ updatedMessage: string;
42
+ repaymentChainId: number;
43
+ }
44
+ export interface SlowFill {
45
+ relayData: ContractRelayData;
46
+ payoutAdjustmentPct: BigNumber;
47
+ }
48
+ export interface V3SlowFill {
49
+ relayData: V3RelayData;
50
+ chainId: number;
51
+ updatedOutputAmount: BigNumber;
52
+ }
53
+ export interface UpdatedRelayerFeeData {
54
+ newRelayerFeePct: string;
55
+ depositorMessageHash: string;
56
+ depositorSignature: string;
57
+ }
58
+ export declare const enum FillType {
59
+ FastFill = 0,
60
+ ReplacedSlowFill = 1,
61
+ SlowFill = 2
62
+ }
63
+ export declare const enum FillStatus {
64
+ Unfilled = 0,
65
+ RequestedSlowFill = 1,
66
+ Filled = 2
67
+ }
68
+ export declare function getRelayHash(_depositor: string, _recipient: string, _depositId: number, _originChainId: number, _destinationChainId: number, _destinationToken: string, _amount?: BigNumber, _realizedLpFeePct?: BigNumber, _relayerFeePct?: BigNumber, _message?: string): {
69
+ relayHash: string;
70
+ relayData: ContractRelayData;
71
+ };
72
+ export declare function getV3RelayHash(relayData: V3RelayData, destChainId: number): string;
73
+ export declare function getLegacyV3RelayHash(relayData: V3RelayData, destChainId: number): string;
74
+ export declare function getDepositParams(args: {
75
+ recipient?: string;
76
+ originToken: string;
77
+ amount: BigNumber;
78
+ destinationChainId: number;
79
+ relayerFeePct: BigNumber;
80
+ quoteTimestamp: number;
81
+ message?: string;
82
+ maxCount?: BigNumber;
83
+ }): string[];
84
+ export declare function getFillRelayParams(_relayData: ContractRelayData, _maxTokensToSend: BigNumber, _repaymentChain?: number, _maxCount?: BigNumber): string[];
85
+ export declare function getFillRelayUpdatedFeeParams(_relayData: ContractRelayData, _maxTokensToSend: BigNumber, _updatedFee: BigNumber, _signature: string, _repaymentChain?: number, _updatedRecipient?: string, _updatedMessage?: string, _maxCount?: BigNumber): string[];
86
+ export declare function getExecuteSlowRelayParams(_depositor: string, _recipient: string, _destToken: string, _amount: BigNumber, _originChainId: number, _realizedLpFeePct: BigNumber, _relayerFeePct: BigNumber, _depositId: number, _relayerRefundId: number, _message: string, _payoutAdjustment: BigNumber, _proof: string[]): (string | string[])[];
87
+ export declare function modifyRelayHelper(modifiedRelayerFeePct: BigNumber, depositId: string, originChainId: string, depositor: SignerWithAddress, updatedRecipient: string, updatedMessage: string): Promise<{
88
+ signature: string;
89
+ }>;
90
+ export declare function getUpdatedV3DepositSignature(depositor: SignerWithAddress, depositId: BigNumber, originChainId: number, updatedOutputAmount: BigNumber, updatedRecipient: string, updatedMessage: string): Promise<string>;
91
+ export declare function deployMockSpokePoolCaller(spokePool: Contract, rootBundleId: number, leaf: {
92
+ amountToReturn: BigNumber;
93
+ chainId: BigNumber;
94
+ refundAmounts: BigNumber[];
95
+ leafId: BigNumber;
96
+ l2TokenAddress: string;
97
+ refundAddresses: string[];
98
+ }, proof: string[]): Promise<Contract>;
8
99
  /**
9
100
  * Deploys a SpokePool with associated tokens for testing.
10
101
  * This is a local implementation that uses our local getContractFactory