@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.
- package/dist/cjs/test/constants.d.ts +58 -8
- package/dist/cjs/test/constants.js +70 -13
- package/dist/cjs/test/constants.js.map +1 -1
- package/dist/cjs/test/fixtures/MerkleLib.Fixture.d.ts +4 -0
- package/dist/cjs/test/fixtures/MerkleLib.Fixture.js +22 -0
- package/dist/cjs/test/fixtures/MerkleLib.Fixture.js.map +1 -0
- package/dist/cjs/test/fixtures/SpokePool.Fixture.d.ts +91 -1
- package/dist/cjs/test/fixtures/SpokePool.Fixture.js +196 -1
- package/dist/cjs/test/fixtures/SpokePool.Fixture.js.map +1 -1
- package/dist/cjs/test/types/index.d.ts +10 -11
- package/dist/cjs/test/utils/MerkleLib.utils.d.ts +26 -1
- package/dist/cjs/test/utils/MerkleLib.utils.js +40 -0
- package/dist/cjs/test/utils/MerkleLib.utils.js.map +1 -1
- package/dist/cjs/test/utils/index.d.ts +0 -1
- package/dist/cjs/test/utils/index.js +1 -2
- package/dist/cjs/test/utils/index.js.map +1 -1
- package/dist/cjs/test/utils/utils.d.ts +44 -17
- package/dist/cjs/test/utils/utils.js +223 -37
- package/dist/cjs/test/utils/utils.js.map +1 -1
- package/dist/cjs/test-utils.d.ts +1 -1
- package/dist/cjs/test-utils.js +47 -12
- package/dist/cjs/test-utils.js.map +1 -1
- package/dist/esm/test/constants.d.ts +58 -8
- package/dist/esm/test/constants.js +87 -13
- package/dist/esm/test/constants.js.map +1 -1
- package/dist/esm/test/fixtures/MerkleLib.Fixture.d.ts +4 -0
- package/dist/esm/test/fixtures/MerkleLib.Fixture.js +19 -0
- package/dist/esm/test/fixtures/MerkleLib.Fixture.js.map +1 -0
- package/dist/esm/test/fixtures/SpokePool.Fixture.d.ts +92 -1
- package/dist/esm/test/fixtures/SpokePool.Fixture.js +201 -1
- package/dist/esm/test/fixtures/SpokePool.Fixture.js.map +1 -1
- package/dist/esm/test/types/index.d.ts +10 -11
- package/dist/esm/test/utils/MerkleLib.utils.d.ts +32 -1
- package/dist/esm/test/utils/MerkleLib.utils.js +44 -0
- package/dist/esm/test/utils/MerkleLib.utils.js.map +1 -1
- package/dist/esm/test/utils/index.d.ts +0 -1
- package/dist/esm/test/utils/index.js +0 -2
- package/dist/esm/test/utils/index.js.map +1 -1
- package/dist/esm/test/utils/utils.d.ts +44 -17
- package/dist/esm/test/utils/utils.js +205 -29
- package/dist/esm/test/utils/utils.js.map +1 -1
- package/dist/esm/test-utils.d.ts +1 -1
- package/dist/esm/test-utils.js +1 -1
- package/dist/esm/test-utils.js.map +1 -1
- package/dist/types/test/constants.d.ts +58 -8
- package/dist/types/test/constants.d.ts.map +1 -1
- package/dist/types/test/fixtures/MerkleLib.Fixture.d.ts +5 -0
- package/dist/types/test/fixtures/MerkleLib.Fixture.d.ts.map +1 -0
- package/dist/types/test/fixtures/SpokePool.Fixture.d.ts +92 -1
- package/dist/types/test/fixtures/SpokePool.Fixture.d.ts.map +1 -1
- package/dist/types/test/types/index.d.ts +10 -11
- package/dist/types/test/types/index.d.ts.map +1 -1
- package/dist/types/test/utils/MerkleLib.utils.d.ts +32 -1
- package/dist/types/test/utils/MerkleLib.utils.d.ts.map +1 -1
- package/dist/types/test/utils/index.d.ts +0 -1
- package/dist/types/test/utils/index.d.ts.map +1 -1
- package/dist/types/test/utils/utils.d.ts +44 -17
- package/dist/types/test/utils/utils.d.ts.map +1 -1
- package/dist/types/test-utils.d.ts +1 -1
- package/dist/types/test-utils.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const
|
|
1
|
+
import { BigNumber } from "ethers";
|
|
2
|
+
export declare const TokenRolesEnum: {
|
|
3
3
|
OWNER: string;
|
|
4
4
|
MINTER: string;
|
|
5
5
|
BURNER: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
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,79 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
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.CHAIN_ID_TEST_LIST = exports.randomDestinationToken2 = exports.randomDestinationToken = exports.randomOriginToken = exports.randomL1Token = exports.CONFIG_STORE_VERSION = exports.sampleRateModel = void 0;
|
|
5
|
+
exports.randomAddress = randomAddress;
|
|
6
|
+
var ethers_1 = require("ethers");
|
|
7
|
+
var utils_1 = require("../src/utils");
|
|
8
|
+
var constants_1 = require("../src/constants");
|
|
6
9
|
var mocks_1 = require("./mocks");
|
|
7
|
-
exports.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.
|
|
10
|
+
exports.TokenRolesEnum = {
|
|
11
|
+
OWNER: "0",
|
|
12
|
+
MINTER: "1",
|
|
13
|
+
BURNER: "3",
|
|
14
|
+
};
|
|
15
|
+
exports.destinationChainId = 1342;
|
|
16
|
+
exports.originChainId = 666;
|
|
17
|
+
exports.repaymentChainId = 777;
|
|
18
|
+
exports.maxUint256 = ethers_1.ethers.constants.MaxInt256;
|
|
19
|
+
exports.MAX_UINT32 = ethers_1.BigNumber.from("0xFFFFFFFF");
|
|
20
|
+
exports.MAX_EXCLUSIVITY_OFFSET_SECONDS = 24 * 60 * 60 * 365;
|
|
21
|
+
exports.amountToSeedWallets = (0, utils_1.toWei)("1500");
|
|
22
|
+
exports.amountToLp = (0, utils_1.toWei)("1000");
|
|
23
|
+
exports.amountToDeposit = (0, utils_1.toWei)("100");
|
|
24
|
+
exports.amountToRelay = (0, utils_1.toWei)("25");
|
|
25
|
+
exports.depositRelayerFeePct = (0, utils_1.toWei)("0.1");
|
|
26
|
+
exports.modifiedRelayerFeePct = (0, utils_1.toBN)(exports.depositRelayerFeePct).add((0, utils_1.toBN)((0, utils_1.toWei)("0.1")));
|
|
27
|
+
exports.incorrectModifiedRelayerFeePct = (0, utils_1.toBN)(exports.modifiedRelayerFeePct).add((0, utils_1.toBN)((0, utils_1.toWei)("0.01")));
|
|
28
|
+
exports.realizedLpFeePct = (0, utils_1.toWei)("0.1");
|
|
29
|
+
exports.oneHundredPct = (0, utils_1.toWei)("1");
|
|
30
|
+
exports.totalPostFeesPct = (0, utils_1.toBN)(exports.oneHundredPct).sub((0, utils_1.toBN)(exports.depositRelayerFeePct).add(exports.realizedLpFeePct));
|
|
31
|
+
exports.totalPostModifiedFeesPct = (0, utils_1.toBN)(exports.oneHundredPct).sub((0, utils_1.toBN)(exports.modifiedRelayerFeePct).add(exports.realizedLpFeePct));
|
|
32
|
+
exports.amountToRelayPreFees = (0, utils_1.toBN)(exports.amountToRelay).mul((0, utils_1.toBN)(exports.oneHundredPct)).div(exports.totalPostFeesPct);
|
|
33
|
+
exports.amountReceived = (0, utils_1.toBN)(exports.amountToDeposit).mul((0, utils_1.toBN)(exports.totalPostFeesPct)).div((0, utils_1.toBN)(exports.oneHundredPct));
|
|
34
|
+
exports.amountToRelayPreModifiedFees = (0, utils_1.toBN)(exports.amountToRelay).mul((0, utils_1.toBN)(exports.oneHundredPct)).div(exports.totalPostModifiedFeesPct);
|
|
35
|
+
exports.amountToRelayPreLPFee = exports.amountToRelayPreFees.mul(exports.oneHundredPct.sub(exports.realizedLpFeePct)).div(exports.oneHundredPct);
|
|
36
|
+
exports.firstDepositId = (0, utils_1.toBN)(0);
|
|
37
|
+
exports.bondAmount = (0, utils_1.toWei)("5");
|
|
38
|
+
exports.finalFee = (0, utils_1.toWei)("1");
|
|
39
|
+
exports.finalFeeUsdc = ethers_1.ethers.utils.parseUnits("1", 6);
|
|
40
|
+
exports.finalFeeUsdt = ethers_1.ethers.utils.parseUnits("1", 6);
|
|
41
|
+
exports.totalBond = exports.bondAmount.add(exports.finalFee);
|
|
42
|
+
exports.refundProposalLiveness = 7200;
|
|
43
|
+
exports.zeroAddress = constants_1.ZERO_ADDRESS;
|
|
44
|
+
exports.zeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
45
|
+
exports.identifier = (0, utils_1.utf8ToHex)("ACROSS-V2");
|
|
46
|
+
exports.zeroRawValue = { rawValue: "0" };
|
|
47
|
+
exports.mockBundleEvaluationBlockNumbers = [1, 2, 3];
|
|
48
|
+
exports.mockPoolRebalanceLeafCount = 5;
|
|
49
|
+
exports.mockPoolRebalanceRoot = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.randomBytes(32));
|
|
50
|
+
exports.mockRelayerRefundRoot = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.randomBytes(32));
|
|
51
|
+
exports.mockSlowRelayRoot = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.randomBytes(32));
|
|
52
|
+
exports.mockTreeRoot = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.randomBytes(32));
|
|
53
|
+
exports.amountHeldByPool = exports.amountToRelay.mul(4);
|
|
54
|
+
exports.amountToReturn = (0, utils_1.toWei)("1");
|
|
55
|
+
exports.sampleL2Gas = 2000000;
|
|
56
|
+
exports.sampleL2GasSendTokens = 300000;
|
|
57
|
+
exports.sampleL2MaxSubmissionCost = (0, utils_1.toWei)("0.01");
|
|
58
|
+
exports.sampleL2GasPrice = 5e9;
|
|
59
|
+
exports.maxRefundsPerRelayerRefundLeaf = 3;
|
|
60
|
+
exports.maxL1TokensPerPoolRebalanceLeaf = 3;
|
|
61
|
+
exports.l1TokenTransferThreshold = (0, utils_1.toWei)(100);
|
|
13
62
|
exports.MAX_REFUNDS_PER_RELAYER_REFUND_LEAF = 3;
|
|
14
63
|
exports.MAX_L1_TOKENS_PER_POOL_REBALANCE_LEAF = 3;
|
|
15
64
|
exports.sampleRateModel = {
|
|
16
|
-
UBar:
|
|
17
|
-
R0:
|
|
18
|
-
R1:
|
|
19
|
-
R2:
|
|
65
|
+
UBar: (0, utils_1.toWei)(0.8).toString(),
|
|
66
|
+
R0: (0, utils_1.toWei)(0.04).toString(),
|
|
67
|
+
R1: (0, utils_1.toWei)(0.07).toString(),
|
|
68
|
+
R2: (0, utils_1.toWei)(0.75).toString(),
|
|
20
69
|
};
|
|
70
|
+
exports.CONFIG_STORE_VERSION = mocks_1.DEFAULT_CONFIG_STORE_VERSION;
|
|
71
|
+
function randomAddress() {
|
|
72
|
+
return ethers_1.ethers.utils.getAddress(ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.randomBytes(20)));
|
|
73
|
+
}
|
|
74
|
+
exports.randomL1Token = randomAddress();
|
|
75
|
+
exports.randomOriginToken = randomAddress();
|
|
76
|
+
exports.randomDestinationToken = randomAddress();
|
|
77
|
+
exports.randomDestinationToken2 = randomAddress();
|
|
21
78
|
exports.CHAIN_ID_TEST_LIST = [exports.originChainId, exports.destinationChainId, exports.repaymentChainId, 1];
|
|
22
79
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../test/constants.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../test/constants.ts"],"names":[],"mappings":";;;;AA4GA,sCAEC;AA9GD,iCAA2C;AAC3C,sCAAsD;AACtD,8CAAgD;AAChD,iCAAuD;AAG1C,QAAA,cAAc,GAAG;IAC5B,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;CACZ,CAAC;AAGW,QAAA,kBAAkB,GAAG,IAAI,CAAC;AAC1B,QAAA,aAAa,GAAG,GAAG,CAAC;AACpB,QAAA,gBAAgB,GAAG,GAAG,CAAC;AAGvB,QAAA,UAAU,GAAG,eAAM,CAAC,SAAS,CAAC,SAAS,CAAC;AACxC,QAAA,UAAU,GAAG,kBAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAC1C,QAAA,8BAA8B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;AAGpD,QAAA,mBAAmB,GAAG,IAAA,aAAK,EAAC,MAAM,CAAC,CAAC;AACpC,QAAA,UAAU,GAAG,IAAA,aAAK,EAAC,MAAM,CAAC,CAAC;AAC3B,QAAA,eAAe,GAAG,IAAA,aAAK,EAAC,KAAK,CAAC,CAAC;AAC/B,QAAA,aAAa,GAAG,IAAA,aAAK,EAAC,IAAI,CAAC,CAAC;AAG5B,QAAA,oBAAoB,GAAG,IAAA,aAAK,EAAC,KAAK,CAAC,CAAC;AACpC,QAAA,qBAAqB,GAAG,IAAA,YAAI,EAAC,4BAAoB,CAAC,CAAC,GAAG,CAAC,IAAA,YAAI,EAAC,IAAA,aAAK,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3E,QAAA,8BAA8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E,CAAC;AAI1C,QAAA,kBAAkB,GAAG,CAAC,qBAAa,EAAE,0BAAkB,EAAE,wBAAgB,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.merkleLibFixture = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var hardhat_1 = tslib_1.__importDefault(require("hardhat"));
|
|
6
|
+
var getContractFactory_1 = require("../utils/getContractFactory");
|
|
7
|
+
exports.merkleLibFixture = hardhat_1.default.deployments.createFixture(function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
8
|
+
var signer, merkleLibTest;
|
|
9
|
+
return tslib_1.__generator(this, function (_a) {
|
|
10
|
+
switch (_a.label) {
|
|
11
|
+
case 0: return [4, hardhat_1.default.ethers.getSigners()];
|
|
12
|
+
case 1:
|
|
13
|
+
signer = (_a.sent())[0];
|
|
14
|
+
return [4, (0, getContractFactory_1.getContractFactory)("MerkleLibTest", signer)];
|
|
15
|
+
case 2: return [4, (_a.sent()).deploy()];
|
|
16
|
+
case 3:
|
|
17
|
+
merkleLibTest = _a.sent();
|
|
18
|
+
return [2, { merkleLibTest: merkleLibTest }];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}); });
|
|
22
|
+
//# 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,4DAA0B;AAE1B,kEAAiE;AAEpD,QAAA,gBAAgB,GAAG,iBAAG,CAAC,WAAW,CAAC,aAAa,CAAC;;;;oBAC3C,WAAM,iBAAG,CAAC,MAAM,CAAC,UAAU,EAAE,EAAA;;gBAAvC,MAAM,GAAI,CAAA,SAA6B,CAAA,GAAjC;gBACgB,WAAM,IAAA,uCAAkB,EAAC,eAAe,EAAE,MAAM,CAAC,EAAA;oBAAxD,WAAM,CAAC,SAAiD,CAAC,CAAC,MAAM,EAAE,EAAA;;gBAAlF,aAAa,GAAG,SAAkE;gBACxF,WAAO,EAAE,aAAa,eAAA,EAAE,EAAC;;;KAC1B,CAAC,CAAC"}
|
|
@@ -2,9 +2,99 @@ 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
|
+
export interface ContractRelayData {
|
|
10
|
+
depositor: string;
|
|
11
|
+
recipient: string;
|
|
12
|
+
destinationToken: string;
|
|
13
|
+
amount: BigNumber;
|
|
14
|
+
realizedLpFeePct: BigNumber;
|
|
15
|
+
relayerFeePct: BigNumber;
|
|
16
|
+
depositId: string;
|
|
17
|
+
originChainId: string;
|
|
18
|
+
destinationChainId: string;
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
export interface V3RelayData {
|
|
22
|
+
depositor: string;
|
|
23
|
+
recipient: string;
|
|
24
|
+
exclusiveRelayer: string;
|
|
25
|
+
inputToken: string;
|
|
26
|
+
outputToken: string;
|
|
27
|
+
inputAmount: BigNumber;
|
|
28
|
+
outputAmount: BigNumber;
|
|
29
|
+
originChainId: number;
|
|
30
|
+
depositId: BigNumber;
|
|
31
|
+
fillDeadline: number;
|
|
32
|
+
exclusivityDeadline: number;
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
export interface V3RelayExecutionParams {
|
|
36
|
+
relay: V3RelayData;
|
|
37
|
+
relayHash: string;
|
|
38
|
+
updatedOutputAmount: BigNumber;
|
|
39
|
+
updatedRecipient: string;
|
|
40
|
+
updatedMessage: string;
|
|
41
|
+
repaymentChainId: number;
|
|
42
|
+
}
|
|
43
|
+
export interface SlowFill {
|
|
44
|
+
relayData: ContractRelayData;
|
|
45
|
+
payoutAdjustmentPct: BigNumber;
|
|
46
|
+
}
|
|
47
|
+
export interface V3SlowFill {
|
|
48
|
+
relayData: V3RelayData;
|
|
49
|
+
chainId: number;
|
|
50
|
+
updatedOutputAmount: BigNumber;
|
|
51
|
+
}
|
|
52
|
+
export interface UpdatedRelayerFeeData {
|
|
53
|
+
newRelayerFeePct: string;
|
|
54
|
+
depositorMessageHash: string;
|
|
55
|
+
depositorSignature: string;
|
|
56
|
+
}
|
|
57
|
+
export declare const enum FillType {
|
|
58
|
+
FastFill = 0,
|
|
59
|
+
ReplacedSlowFill = 1,
|
|
60
|
+
SlowFill = 2
|
|
61
|
+
}
|
|
62
|
+
export declare const enum FillStatus {
|
|
63
|
+
Unfilled = 0,
|
|
64
|
+
RequestedSlowFill = 1,
|
|
65
|
+
Filled = 2
|
|
66
|
+
}
|
|
67
|
+
export declare function getRelayHash(_depositor: string, _recipient: string, _depositId: number, _originChainId: number, _destinationChainId: number, _destinationToken: string, _amount?: BigNumber, _realizedLpFeePct?: BigNumber, _relayerFeePct?: BigNumber, _message?: string): {
|
|
68
|
+
relayHash: string;
|
|
69
|
+
relayData: ContractRelayData;
|
|
70
|
+
};
|
|
71
|
+
export declare function getV3RelayHash(relayData: V3RelayData, destChainId: number): string;
|
|
72
|
+
export declare function getLegacyV3RelayHash(relayData: V3RelayData, destChainId: number): string;
|
|
73
|
+
export declare function getDepositParams(args: {
|
|
74
|
+
recipient?: string;
|
|
75
|
+
originToken: string;
|
|
76
|
+
amount: BigNumber;
|
|
77
|
+
destinationChainId: number;
|
|
78
|
+
relayerFeePct: BigNumber;
|
|
79
|
+
quoteTimestamp: number;
|
|
80
|
+
message?: string;
|
|
81
|
+
maxCount?: BigNumber;
|
|
82
|
+
}): string[];
|
|
83
|
+
export declare function getFillRelayParams(_relayData: ContractRelayData, _maxTokensToSend: BigNumber, _repaymentChain?: number, _maxCount?: BigNumber): string[];
|
|
84
|
+
export declare function getFillRelayUpdatedFeeParams(_relayData: ContractRelayData, _maxTokensToSend: BigNumber, _updatedFee: BigNumber, _signature: string, _repaymentChain?: number, _updatedRecipient?: string, _updatedMessage?: string, _maxCount?: BigNumber): string[];
|
|
85
|
+
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[])[];
|
|
86
|
+
export declare function modifyRelayHelper(modifiedRelayerFeePct: BigNumber, depositId: string, originChainId: string, depositor: SignerWithAddress, updatedRecipient: string, updatedMessage: string): Promise<{
|
|
87
|
+
signature: string;
|
|
88
|
+
}>;
|
|
89
|
+
export declare function getUpdatedV3DepositSignature(depositor: SignerWithAddress, depositId: BigNumber, originChainId: number, updatedOutputAmount: BigNumber, updatedRecipient: string, updatedMessage: string): Promise<string>;
|
|
90
|
+
export declare function deployMockSpokePoolCaller(spokePool: Contract, rootBundleId: number, leaf: {
|
|
91
|
+
amountToReturn: BigNumber;
|
|
92
|
+
chainId: BigNumber;
|
|
93
|
+
refundAmounts: BigNumber[];
|
|
94
|
+
leafId: BigNumber;
|
|
95
|
+
l2TokenAddress: string;
|
|
96
|
+
refundAddresses: string[];
|
|
97
|
+
}, proof: string[]): Promise<Contract>;
|
|
8
98
|
export declare function deploySpokePool(ethers: typeof hre.ethers, spokePoolName?: string): Promise<{
|
|
9
99
|
weth: Contract;
|
|
10
100
|
erc20: Contract;
|
|
@@ -1,16 +1,211 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.spokePoolFixture = exports.zeroAddress = void 0;
|
|
4
|
+
exports.getRelayHash = getRelayHash;
|
|
5
|
+
exports.getV3RelayHash = getV3RelayHash;
|
|
6
|
+
exports.getLegacyV3RelayHash = getLegacyV3RelayHash;
|
|
7
|
+
exports.getDepositParams = getDepositParams;
|
|
8
|
+
exports.getFillRelayParams = getFillRelayParams;
|
|
9
|
+
exports.getFillRelayUpdatedFeeParams = getFillRelayUpdatedFeeParams;
|
|
10
|
+
exports.getExecuteSlowRelayParams = getExecuteSlowRelayParams;
|
|
11
|
+
exports.modifyRelayHelper = modifyRelayHelper;
|
|
12
|
+
exports.getUpdatedV3DepositSignature = getUpdatedV3DepositSignature;
|
|
13
|
+
exports.deployMockSpokePoolCaller = deployMockSpokePoolCaller;
|
|
4
14
|
exports.deploySpokePool = deploySpokePool;
|
|
5
15
|
var tslib_1 = require("tslib");
|
|
6
16
|
require("@nomiclabs/hardhat-ethers");
|
|
7
17
|
require("@openzeppelin/hardhat-upgrades");
|
|
8
18
|
require("hardhat-deploy");
|
|
9
19
|
var hardhat_1 = tslib_1.__importDefault(require("hardhat"));
|
|
20
|
+
var ethers_1 = require("ethers");
|
|
10
21
|
var getContractFactory_1 = require("../utils/getContractFactory");
|
|
11
22
|
var constants_1 = require("../constants");
|
|
12
23
|
Object.defineProperty(exports, "zeroAddress", { enumerable: true, get: function () { return constants_1.zeroAddress; } });
|
|
13
|
-
|
|
24
|
+
var _a = ethers_1.ethers.utils, defaultAbiCoder = _a.defaultAbiCoder, keccak256 = _a.keccak256;
|
|
25
|
+
function getRelayHash(_depositor, _recipient, _depositId, _originChainId, _destinationChainId, _destinationToken, _amount, _realizedLpFeePct, _relayerFeePct, _message) {
|
|
26
|
+
var relayData = {
|
|
27
|
+
depositor: _depositor,
|
|
28
|
+
recipient: _recipient,
|
|
29
|
+
destinationToken: _destinationToken,
|
|
30
|
+
amount: _amount || constants_1.amountToDeposit,
|
|
31
|
+
originChainId: _originChainId.toString(),
|
|
32
|
+
destinationChainId: _destinationChainId.toString(),
|
|
33
|
+
realizedLpFeePct: _realizedLpFeePct || constants_1.realizedLpFeePct,
|
|
34
|
+
relayerFeePct: _relayerFeePct || constants_1.depositRelayerFeePct,
|
|
35
|
+
depositId: _depositId.toString(),
|
|
36
|
+
message: _message || "0x",
|
|
37
|
+
};
|
|
38
|
+
var relayHash = keccak256(defaultAbiCoder.encode([
|
|
39
|
+
"tuple(address depositor, address recipient, address destinationToken, uint256 amount, uint256 originChainId, uint256 destinationChainId, int64 realizedLpFeePct, int64 relayerFeePct, uint32 depositId, bytes message)",
|
|
40
|
+
], [relayData]));
|
|
41
|
+
return { relayHash: relayHash, relayData: relayData };
|
|
42
|
+
}
|
|
43
|
+
function getV3RelayHash(relayData, destChainId) {
|
|
44
|
+
return keccak256(defaultAbiCoder.encode([
|
|
45
|
+
"tuple(bytes32 depositor, bytes32 recipient, bytes32 exclusiveRelayer, bytes32 inputToken, bytes32 outputToken, uint256 inputAmount, uint256 outputAmount, uint256 originChainId, uint256 depositId, uint32 fillDeadline, uint32 exclusivityDeadline, bytes message)",
|
|
46
|
+
"uint256 destinationChainId",
|
|
47
|
+
], [relayData, destChainId]));
|
|
48
|
+
}
|
|
49
|
+
function getLegacyV3RelayHash(relayData, destChainId) {
|
|
50
|
+
return keccak256(defaultAbiCoder.encode([
|
|
51
|
+
"tuple(address depositor, address recipient, address exclusiveRelayer, address inputToken, address outputToken, uint256 inputAmount, uint256 outputAmount, uint256 originChainId, uint32 depositId, uint32 fillDeadline, uint32 exclusivityDeadline, bytes message)",
|
|
52
|
+
"uint256 destinationChainId",
|
|
53
|
+
], [relayData, destChainId]));
|
|
54
|
+
}
|
|
55
|
+
function getDepositParams(args) {
|
|
56
|
+
var _a, _b, _c, _d;
|
|
57
|
+
return [
|
|
58
|
+
(_a = args.recipient) !== null && _a !== void 0 ? _a : (0, constants_1.randomAddress)(),
|
|
59
|
+
args.originToken,
|
|
60
|
+
args.amount.toString(),
|
|
61
|
+
args.destinationChainId.toString(),
|
|
62
|
+
args.relayerFeePct.toString(),
|
|
63
|
+
args.quoteTimestamp.toString(),
|
|
64
|
+
(_b = args.message) !== null && _b !== void 0 ? _b : "0x",
|
|
65
|
+
(_d = (_c = args === null || args === void 0 ? void 0 : args.maxCount) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : constants_1.maxUint256.toString(),
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
function getFillRelayParams(_relayData, _maxTokensToSend, _repaymentChain, _maxCount) {
|
|
69
|
+
return [
|
|
70
|
+
_relayData.depositor,
|
|
71
|
+
_relayData.recipient,
|
|
72
|
+
_relayData.destinationToken,
|
|
73
|
+
_relayData.amount.toString(),
|
|
74
|
+
_maxTokensToSend.toString(),
|
|
75
|
+
_repaymentChain ? _repaymentChain.toString() : constants_1.repaymentChainId.toString(),
|
|
76
|
+
_relayData.originChainId,
|
|
77
|
+
_relayData.realizedLpFeePct.toString(),
|
|
78
|
+
_relayData.relayerFeePct.toString(),
|
|
79
|
+
_relayData.depositId,
|
|
80
|
+
_relayData.message || "0x",
|
|
81
|
+
_maxCount ? _maxCount.toString() : constants_1.maxUint256.toString(),
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
function getFillRelayUpdatedFeeParams(_relayData, _maxTokensToSend, _updatedFee, _signature, _repaymentChain, _updatedRecipient, _updatedMessage, _maxCount) {
|
|
85
|
+
return [
|
|
86
|
+
_relayData.depositor,
|
|
87
|
+
_relayData.recipient,
|
|
88
|
+
_updatedRecipient || _relayData.recipient,
|
|
89
|
+
_relayData.destinationToken,
|
|
90
|
+
_relayData.amount.toString(),
|
|
91
|
+
_maxTokensToSend.toString(),
|
|
92
|
+
_repaymentChain ? _repaymentChain.toString() : constants_1.repaymentChainId.toString(),
|
|
93
|
+
_relayData.originChainId,
|
|
94
|
+
_relayData.realizedLpFeePct.toString(),
|
|
95
|
+
_relayData.relayerFeePct.toString(),
|
|
96
|
+
_updatedFee.toString(),
|
|
97
|
+
_relayData.depositId,
|
|
98
|
+
_relayData.message,
|
|
99
|
+
_updatedMessage || _relayData.message,
|
|
100
|
+
_signature,
|
|
101
|
+
_maxCount ? _maxCount.toString() : constants_1.maxUint256.toString(),
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
function getExecuteSlowRelayParams(_depositor, _recipient, _destToken, _amount, _originChainId, _realizedLpFeePct, _relayerFeePct, _depositId, _relayerRefundId, _message, _payoutAdjustment, _proof) {
|
|
105
|
+
return [
|
|
106
|
+
_depositor,
|
|
107
|
+
_recipient,
|
|
108
|
+
_destToken,
|
|
109
|
+
_amount.toString(),
|
|
110
|
+
_originChainId.toString(),
|
|
111
|
+
_realizedLpFeePct.toString(),
|
|
112
|
+
_relayerFeePct.toString(),
|
|
113
|
+
_depositId.toString(),
|
|
114
|
+
_relayerRefundId.toString(),
|
|
115
|
+
_message,
|
|
116
|
+
_payoutAdjustment.toString(),
|
|
117
|
+
_proof,
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
function modifyRelayHelper(modifiedRelayerFeePct, depositId, originChainId, depositor, updatedRecipient, updatedMessage) {
|
|
121
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
122
|
+
var typedData, signature;
|
|
123
|
+
return tslib_1.__generator(this, function (_a) {
|
|
124
|
+
switch (_a.label) {
|
|
125
|
+
case 0:
|
|
126
|
+
typedData = {
|
|
127
|
+
types: {
|
|
128
|
+
UpdateDepositDetails: [
|
|
129
|
+
{ name: "depositId", type: "uint32" },
|
|
130
|
+
{ name: "originChainId", type: "uint256" },
|
|
131
|
+
{ name: "updatedRelayerFeePct", type: "int64" },
|
|
132
|
+
{ name: "updatedRecipient", type: "address" },
|
|
133
|
+
{ name: "updatedMessage", type: "bytes" },
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
domain: {
|
|
137
|
+
name: "ACROSS-V2",
|
|
138
|
+
version: "1.0.0",
|
|
139
|
+
chainId: Number(originChainId),
|
|
140
|
+
},
|
|
141
|
+
message: {
|
|
142
|
+
depositId: depositId,
|
|
143
|
+
originChainId: originChainId,
|
|
144
|
+
updatedRelayerFeePct: modifiedRelayerFeePct,
|
|
145
|
+
updatedRecipient: updatedRecipient,
|
|
146
|
+
updatedMessage: updatedMessage,
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
return [4, depositor._signTypedData(typedData.domain, typedData.types, typedData.message)];
|
|
150
|
+
case 1:
|
|
151
|
+
signature = _a.sent();
|
|
152
|
+
return [2, { signature: signature }];
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function getUpdatedV3DepositSignature(depositor, depositId, originChainId, updatedOutputAmount, updatedRecipient, updatedMessage) {
|
|
158
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
159
|
+
var typedData;
|
|
160
|
+
return tslib_1.__generator(this, function (_a) {
|
|
161
|
+
switch (_a.label) {
|
|
162
|
+
case 0:
|
|
163
|
+
typedData = {
|
|
164
|
+
types: {
|
|
165
|
+
UpdateDepositDetails: [
|
|
166
|
+
{ name: "depositId", type: "uint256" },
|
|
167
|
+
{ name: "originChainId", type: "uint256" },
|
|
168
|
+
{ name: "updatedOutputAmount", type: "uint256" },
|
|
169
|
+
{ name: "updatedRecipient", type: "bytes32" },
|
|
170
|
+
{ name: "updatedMessage", type: "bytes" },
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
domain: {
|
|
174
|
+
name: "ACROSS-V2",
|
|
175
|
+
version: "1.0.0",
|
|
176
|
+
chainId: originChainId,
|
|
177
|
+
},
|
|
178
|
+
message: {
|
|
179
|
+
depositId: depositId,
|
|
180
|
+
originChainId: originChainId,
|
|
181
|
+
updatedOutputAmount: updatedOutputAmount,
|
|
182
|
+
updatedRecipient: updatedRecipient,
|
|
183
|
+
updatedMessage: updatedMessage,
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
return [4, depositor._signTypedData(typedData.domain, typedData.types, typedData.message)];
|
|
187
|
+
case 1: return [2, _a.sent()];
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function deployMockSpokePoolCaller(spokePool, rootBundleId, leaf, proof) {
|
|
193
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
194
|
+
var _a, _b;
|
|
195
|
+
return tslib_1.__generator(this, function (_c) {
|
|
196
|
+
switch (_c.label) {
|
|
197
|
+
case 0:
|
|
198
|
+
_a = getContractFactory_1.getContractFactory;
|
|
199
|
+
_b = ["MockCaller"];
|
|
200
|
+
return [4, hardhat_1.default.ethers.getSigners()];
|
|
201
|
+
case 1: return [4, _a.apply(void 0, _b.concat([(_c.sent())[0]]))];
|
|
202
|
+
case 2: return [4, (_c.sent()).deploy(spokePool.address, rootBundleId, leaf, proof)];
|
|
203
|
+
case 3: return [2, _c.sent()];
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function deploySpokePool(ethers_2) {
|
|
14
209
|
return tslib_1.__awaiter(this, arguments, void 0, function (ethers, spokePoolName) {
|
|
15
210
|
var _a, deployerWallet, crossChainAdmin, hubPool, weth, erc20, unwhitelistedErc20, destErc20, spokePool, _b, _c, erc1271;
|
|
16
211
|
if (spokePoolName === void 0) { spokePoolName = "MockSpokePool"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpokePool.Fixture.js","sourceRoot":"","sources":["../../../../test/fixtures/SpokePool.Fixture.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SpokePool.Fixture.js","sourceRoot":"","sources":["../../../../test/fixtures/SpokePool.Fixture.ts"],"names":[],"mappings":";;;AAsGA,oCAiCC;AAED,wCAUC;AAED,oDAUC;AAMD,4CAoBC;AAED,gDAoBC;AAED,oEA4BC;AAED,8DA4BC;AAMD,8CAiCC;AAED,oEAgCC;AAMD,8DAgBC;AAWD,0CA+CC;;AApaD,qCAAmC;AACnC,0CAAwC;AACxC,0BAAwB;AACxB,4DAA0B;AAC1B,iCA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EAAA;yBADvC,WAAM,cACtB,SAAuD,EACvD,CAAC,CAAC,EAAE,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;wBAC7C,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,cAAc,CAAC,EAAE,eAAe,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EACjF,EAAA;;oBAJK,SAAS,GAAG,SAIjB;oBACD,WAAM,SAAS,CAAC,UAAU,CAAC,8BAAkB,CAAC,EAAA;;oBAA9C,SAA8C,CAAC;oBAGxB,WAAM,IAAA,uCAAkB,EAAC,aAAa,EAAE,cAAc,CAAC,EAAA;yBAA9D,WAAM,CAAC,SAAuD,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAA;;oBAAxG,OAAO,GAAG,SAA8F;oBAE9G,WAAO;4BACL,IAAI,MAAA;4BACJ,KAAK,OAAA;4BACL,SAAS,WAAA;4BACT,kBAAkB,oBAAA;4BAClB,SAAS,WAAA;4BACT,OAAO,SAAA;yBACR,EAAC;;;;CACH;AAKY,QAAA,gBAAgB,GAAG,iBAAG,CAAC,WAAW,CAAC,aAAa,CAAC,yEAAO,EAAU;QAAR,MAAM,YAAA;;;oBACpE,WAAM,eAAe,CAAC,MAAM,CAAC,EAAA;oBAApC,WAAO,SAA6B,EAAC;;;KACtC,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { HardhatEthersHelpers } from "@nomiclabs/hardhat-ethers/types";
|
|
2
|
-
import type { ethers } from "ethers";
|
|
2
|
+
import type { ethers, Contract, BigNumber } from "ethers";
|
|
3
3
|
import winston from "winston";
|
|
4
|
-
import * as utils from "@across-protocol/contracts/dist/test-utils";
|
|
5
4
|
import { sinon } from "../utils";
|
|
6
5
|
export type EthersTestLibrary = typeof ethers & HardhatEthersHelpers;
|
|
7
6
|
export type SpyLoggerResult = {
|
|
@@ -9,20 +8,20 @@ export type SpyLoggerResult = {
|
|
|
9
8
|
spyLogger: winston.Logger;
|
|
10
9
|
};
|
|
11
10
|
export type SpokePoolDeploymentResult = {
|
|
12
|
-
weth:
|
|
13
|
-
erc20:
|
|
14
|
-
spokePool:
|
|
15
|
-
unwhitelistedErc20:
|
|
16
|
-
destErc20:
|
|
11
|
+
weth: Contract;
|
|
12
|
+
erc20: Contract;
|
|
13
|
+
spokePool: Contract;
|
|
14
|
+
unwhitelistedErc20: Contract;
|
|
15
|
+
destErc20: Contract;
|
|
17
16
|
deploymentBlock: number;
|
|
18
17
|
};
|
|
19
18
|
export type ContractsV2SlowFillRelayData = {
|
|
20
19
|
depositor: string;
|
|
21
20
|
recipient: string;
|
|
22
21
|
destinationToken: string;
|
|
23
|
-
amount:
|
|
24
|
-
realizedLpFeePct:
|
|
25
|
-
relayerFeePct:
|
|
22
|
+
amount: BigNumber;
|
|
23
|
+
realizedLpFeePct: BigNumber;
|
|
24
|
+
relayerFeePct: BigNumber;
|
|
26
25
|
depositId: string;
|
|
27
26
|
originChainId: string;
|
|
28
27
|
destinationChainId: string;
|
|
@@ -30,5 +29,5 @@ export type ContractsV2SlowFillRelayData = {
|
|
|
30
29
|
};
|
|
31
30
|
export type ContractsV2SlowFill = {
|
|
32
31
|
relayData: ContractsV2SlowFillRelayData;
|
|
33
|
-
payoutAdjustmentPct:
|
|
32
|
+
payoutAdjustmentPct: BigNumber;
|
|
34
33
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BigNumber, ethers } from "ethers";
|
|
1
|
+
import { BigNumber, Contract, ethers } from "ethers";
|
|
2
2
|
import { MerkleTree } from "@across-protocol/contracts/dist/utils/MerkleTree";
|
|
3
3
|
export declare function getParamType(contractName: string, functionName: string, paramName: string): Promise<ethers.utils.ParamType | string>;
|
|
4
4
|
export declare function buildRelayerRefundTree(relayerRefundLeaves: {
|
|
@@ -37,3 +37,28 @@ export declare function buildPoolRebalanceLeaves(destinationChainIds: number[],
|
|
|
37
37
|
}[];
|
|
38
38
|
export declare function buildSlowRelayTree(slowFills: unknown[]): Promise<MerkleTree<unknown>>;
|
|
39
39
|
export declare function buildV3SlowRelayTree(slowFills: unknown[]): Promise<MerkleTree<unknown>>;
|
|
40
|
+
export declare function constructSingleRelayerRefundTree(l2Token: Contract | string, destinationChainId: number, amount?: BigNumber): Promise<{
|
|
41
|
+
leaves: {
|
|
42
|
+
leafId: BigNumber;
|
|
43
|
+
chainId: BigNumber;
|
|
44
|
+
amountToReturn: BigNumber;
|
|
45
|
+
l2TokenAddress: string;
|
|
46
|
+
refundAddresses: string[];
|
|
47
|
+
refundAmounts: BigNumber[];
|
|
48
|
+
}[];
|
|
49
|
+
tree: MerkleTree<unknown>;
|
|
50
|
+
}>;
|
|
51
|
+
export declare function constructSingleChainTree(token: string, scalingSize?: number, repaymentChain?: number, decimals?: number): Promise<{
|
|
52
|
+
tokensSendToL2: BigNumber;
|
|
53
|
+
realizedLpFees: BigNumber;
|
|
54
|
+
leaves: {
|
|
55
|
+
leafId: BigNumber;
|
|
56
|
+
chainId: BigNumber;
|
|
57
|
+
groupIndex: BigNumber;
|
|
58
|
+
bundleLpFees: BigNumber[];
|
|
59
|
+
netSendAmounts: BigNumber[];
|
|
60
|
+
runningBalances: BigNumber[];
|
|
61
|
+
l1Tokens: string[];
|
|
62
|
+
}[];
|
|
63
|
+
tree: MerkleTree<unknown>;
|
|
64
|
+
}>;
|