@across-protocol/sdk 4.3.118 → 4.3.120-alpha.1
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/src/clients/BundleDataClient/BundleDataClient.js +26 -16
- package/dist/cjs/src/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- package/dist/cjs/src/clients/BundleDataClient/utils/PoolRebalanceUtils.d.ts +1 -0
- package/dist/cjs/src/clients/BundleDataClient/utils/PoolRebalanceUtils.js +4 -0
- package/dist/cjs/src/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
- 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/esm/src/clients/BundleDataClient/BundleDataClient.js +32 -17
- package/dist/esm/src/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- package/dist/esm/src/clients/BundleDataClient/utils/PoolRebalanceUtils.d.ts +1 -0
- package/dist/esm/src/clients/BundleDataClient/utils/PoolRebalanceUtils.js +3 -0
- package/dist/esm/src/clients/BundleDataClient/utils/PoolRebalanceUtils.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/types/src/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
- package/dist/types/src/clients/BundleDataClient/utils/PoolRebalanceUtils.d.ts +1 -0
- package/dist/types/src/clients/BundleDataClient/utils/PoolRebalanceUtils.d.ts.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/package.json +1 -1
- package/src/clients/BundleDataClient/BundleDataClient.ts +28 -9
- package/src/clients/BundleDataClient/utils/PoolRebalanceUtils.ts +4 -0
|
@@ -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,oE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,iBAAG,CAAC,QAAQ,CAAA,CAAC,WAAW,CAAA;oBAC9C,WAAM,IAAA,uCAAkB,EAAC,aAAa,EAAE,cAAc,CAAC,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
|
+
}>;
|
|
@@ -7,11 +7,14 @@ exports.buildPoolRebalanceLeafTree = buildPoolRebalanceLeafTree;
|
|
|
7
7
|
exports.buildPoolRebalanceLeaves = buildPoolRebalanceLeaves;
|
|
8
8
|
exports.buildSlowRelayTree = buildSlowRelayTree;
|
|
9
9
|
exports.buildV3SlowRelayTree = buildV3SlowRelayTree;
|
|
10
|
+
exports.constructSingleRelayerRefundTree = constructSingleRelayerRefundTree;
|
|
11
|
+
exports.constructSingleChainTree = constructSingleChainTree;
|
|
10
12
|
var tslib_1 = require("tslib");
|
|
11
13
|
var ethers_1 = require("ethers");
|
|
12
14
|
var getContractFactory_1 = require("./getContractFactory");
|
|
13
15
|
var MerkleTree_1 = require("@across-protocol/contracts/dist/utils/MerkleTree");
|
|
14
16
|
var chai_1 = require("chai");
|
|
17
|
+
var constants_1 = require("../constants");
|
|
15
18
|
var _a = ethers_1.ethers.utils, keccak256 = _a.keccak256, defaultAbiCoder = _a.defaultAbiCoder;
|
|
16
19
|
function getParamType(contractName, functionName, paramName) {
|
|
17
20
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
@@ -129,4 +132,41 @@ function buildV3SlowRelayTree(slowFills) {
|
|
|
129
132
|
});
|
|
130
133
|
});
|
|
131
134
|
}
|
|
135
|
+
function constructSingleRelayerRefundTree(l2Token, destinationChainId, amount) {
|
|
136
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
137
|
+
var amountToUse, l2TokenAddress, leaves, tree;
|
|
138
|
+
return tslib_1.__generator(this, function (_a) {
|
|
139
|
+
switch (_a.label) {
|
|
140
|
+
case 0:
|
|
141
|
+
amountToUse = amount !== undefined ? amount : constants_1.amountToReturn;
|
|
142
|
+
l2TokenAddress = typeof l2Token === "string" ? l2Token : l2Token.address;
|
|
143
|
+
leaves = buildRelayerRefundLeaves([destinationChainId], [amountToUse], [l2TokenAddress], [[]], [[]]);
|
|
144
|
+
return [4, buildRelayerRefundTree(leaves)];
|
|
145
|
+
case 1:
|
|
146
|
+
tree = _a.sent();
|
|
147
|
+
return [2, { leaves: leaves, tree: tree }];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function constructSingleChainTree(token_1) {
|
|
153
|
+
return tslib_1.__awaiter(this, arguments, void 0, function (token, scalingSize, repaymentChain, decimals) {
|
|
154
|
+
var tokensSendToL2, realizedLpFees, leaves, tree;
|
|
155
|
+
if (scalingSize === void 0) { scalingSize = 1; }
|
|
156
|
+
if (repaymentChain === void 0) { repaymentChain = constants_1.repaymentChainId; }
|
|
157
|
+
if (decimals === void 0) { decimals = 18; }
|
|
158
|
+
return tslib_1.__generator(this, function (_a) {
|
|
159
|
+
switch (_a.label) {
|
|
160
|
+
case 0:
|
|
161
|
+
tokensSendToL2 = ethers_1.ethers.utils.parseUnits((100 * scalingSize).toString(), decimals);
|
|
162
|
+
realizedLpFees = ethers_1.ethers.utils.parseUnits((10 * scalingSize).toString(), decimals);
|
|
163
|
+
leaves = buildPoolRebalanceLeaves([repaymentChain], [[token]], [[realizedLpFees]], [[tokensSendToL2]], [[tokensSendToL2]], [0]);
|
|
164
|
+
return [4, buildPoolRebalanceLeafTree(leaves)];
|
|
165
|
+
case 1:
|
|
166
|
+
tree = _a.sent();
|
|
167
|
+
return [2, { tokensSendToL2: tokensSendToL2, realizedLpFees: realizedLpFees, leaves: leaves, tree: tree }];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
132
172
|
//# sourceMappingURL=MerkleLib.utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MerkleLib.utils.js","sourceRoot":"","sources":["../../../../test/utils/MerkleLib.utils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"MerkleLib.utils.js","sourceRoot":"","sources":["../../../../test/utils/MerkleLib.utils.ts"],"names":[],"mappings":";;AAiBA,oCAYC;AAKD,wDAgBC;AAKD,4DA0BC;AAKD,gEAqBC;AAKD,4DA6BC;AAKD,gDAIC;AAKD,oDAIC;AAKD,4EAoBC;AAKD,4DA+BC;;AAvND,iCAAqD;AACrD,2DAA0D;AAC1D,+EAA8E;AAC9E,6BAA8B;AAC9B,0CAAgE;AAE1D,IAAA,KAAiC,eAAM,CAAC,KAAK,EAA3C,SAAS,eAAA,EAAE,eAAe,qBAAiB,CAAC;AAMpD,SAAsB,YAAY,CAChC,YAAoB,EACp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AA,eAAe;QACf,+BAAA,EAAA,iBAAiB,4BAAgB;QACjC,yBAAA,EAAA,aAAa;;;;oBAeP,cAAc,GAAG,eAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;oBACnF,cAAc,GAAG,eAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;oBAClF,MAAM,GAAG,wBAAwB,CACrC,CAAC,cAAc,CAAC,EAChB,CAAC,CAAC,KAAK,CAAC,CAAC,EACT,CAAC,CAAC,cAAc,CAAC,CAAC,EAClB,CAAC,CAAC,cAAc,CAAC,CAAC,EAClB,CAAC,CAAC,cAAc,CAAC,CAAC,EAClB,CAAC,CAAC,CAAC,CACJ,CAAC;oBACW,WAAM,0BAA0B,CAAC,MAAM,CAAC,EAAA;;oBAA/C,IAAI,GAAG,SAAwC;oBACrD,WAAO,EAAE,cAAc,gBAAA,EAAE,cAAc,gBAAA,EAAE,MAAM,QAAA,EAAE,IAAI,MAAA,EAAE,EAAC;;;;CACzD"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.smock = exports.ethers =
|
|
3
|
+
exports.smock = exports.ethers = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
require("@nomiclabs/hardhat-ethers");
|
|
6
|
-
exports.contractsV2Utils = tslib_1.__importStar(require("@across-protocol/contracts/dist/test-utils"));
|
|
7
6
|
var hardhat_1 = require("hardhat");
|
|
8
7
|
Object.defineProperty(exports, "ethers", { enumerable: true, get: function () { return hardhat_1.ethers; } });
|
|
9
8
|
var smock_1 = require("@defi-wonderland/smock");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../test/utils/index.ts"],"names":[],"mappings":";;;;AAAA,qCAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../test/utils/index.ts"],"names":[],"mappings":";;;;AAAA,qCAAmC;AACnC,mCAAiC;AAAxB,iGAAA,MAAM,OAAA;AACf,gDAA+C;AAAtC,8FAAA,KAAK,OAAA;AAEd,kDAAwB;AACxB,4DAAkC;AAClC,2DAAiC;AACjC,yDAA+B;AAC/B,sDAA4B"}
|
|
@@ -1,53 +1,80 @@
|
|
|
1
1
|
import { AcrossConfigStore } from "@across-protocol/contracts";
|
|
2
|
-
import * as utils from "@across-protocol/contracts/dist/test-utils";
|
|
3
2
|
import chai, { expect } from "chai";
|
|
4
|
-
import { Contract, providers } from "ethers";
|
|
3
|
+
import { ethers, BaseContract, Contract, providers, Signer } from "ethers";
|
|
4
|
+
import { FakeContract } from "@defi-wonderland/smock";
|
|
5
5
|
import sinon from "sinon";
|
|
6
6
|
import winston from "winston";
|
|
7
|
+
import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
|
7
8
|
import { AcrossConfigStoreClient as ConfigStoreClient } from "../../src/clients";
|
|
8
9
|
import { Deposit, DepositWithBlock, FillWithBlock, RelayData, SlowFillRequestWithBlock } from "../../src/interfaces";
|
|
9
10
|
import { Address, BigNumber, BigNumberish, toBN, toBNWei, toWei, utf8ToHex } from "../../src/utils";
|
|
11
|
+
import { randomAddress, zeroAddress } from "../constants";
|
|
10
12
|
import { SpokePoolDeploymentResult, SpyLoggerResult } from "../types";
|
|
11
13
|
declare const chaiAssert: Chai.AssertStatic;
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export {
|
|
14
|
+
export { ethers };
|
|
15
|
+
export type { SignerWithAddress };
|
|
16
|
+
export { getDepositParams, getUpdatedV3DepositSignature, modifyRelayHelper, getRelayHash, getV3RelayHash, getLegacyV3RelayHash, getFillRelayParams, getFillRelayUpdatedFeeParams, getExecuteSlowRelayParams, deployMockSpokePoolCaller, } from "../fixtures/SpokePool.Fixture";
|
|
17
|
+
export type { ContractRelayData, V3RelayData, V3RelayExecutionParams, SlowFill, V3SlowFill, UpdatedRelayerFeeData, } from "../fixtures/SpokePool.Fixture";
|
|
18
|
+
export { FillType, FillStatus } from "../fixtures/SpokePool.Fixture";
|
|
19
|
+
export { randomAddress, zeroAddress };
|
|
20
|
+
export { buildPoolRebalanceLeafTree, buildPoolRebalanceLeaves, buildRelayerRefundTree, buildRelayerRefundLeaves, buildSlowRelayTree, buildV3SlowRelayTree, getParamType, constructSingleRelayerRefundTree, constructSingleChainTree, } from "./MerkleLib.utils";
|
|
15
21
|
import { getContractFactory } from "./getContractFactory";
|
|
16
22
|
export { getContractFactory };
|
|
17
23
|
import { hubPoolFixture, deployHubPool } from "../fixtures/HubPool.Fixture";
|
|
18
24
|
import { spokePoolFixture, deploySpokePool } from "../fixtures/SpokePool.Fixture";
|
|
19
25
|
export { hubPoolFixture, deployHubPool, spokePoolFixture, deploySpokePool };
|
|
26
|
+
export { merkleLibFixture } from "../fixtures/MerkleLib.Fixture";
|
|
20
27
|
export { BigNumber, Contract, chai, chaiAssert, expect, sinon, toBN, toBNWei, toWei, utf8ToHex, winston };
|
|
28
|
+
declare const defaultAbiCoder: ethers.utils.AbiCoder, keccak256: typeof ethers.utils.keccak256;
|
|
29
|
+
export { defaultAbiCoder, keccak256, Signer, FakeContract };
|
|
30
|
+
export declare const toWeiWithDecimals: (num: string | number | BigNumber, decimals: number) => BigNumber;
|
|
31
|
+
export declare const toBNWeiWithDecimals: (num: string | number | BigNumber, decimals: number) => BigNumber;
|
|
32
|
+
export declare const fromWei: (num: string | number | BigNumber) => string;
|
|
33
|
+
export declare const hexToUtf8: (input: string) => string;
|
|
34
|
+
export declare const hexZeroPad: (input: string, length: number) => string;
|
|
35
|
+
export declare const addressToBytes: (input: string) => string;
|
|
36
|
+
export declare const bytes32ToAddress: (input: string) => string;
|
|
37
|
+
export declare const isBytes32: (input: string) => boolean;
|
|
38
|
+
export declare function randomBigNumber(bytes?: number, signed?: boolean): BigNumber;
|
|
39
|
+
export declare function randomBytes32(): string;
|
|
40
|
+
export declare function seedWallet(walletToFund: Signer, tokens: Contract[], weth: Contract | undefined, amountToSeedWith: number | BigNumber): Promise<void>;
|
|
41
|
+
export declare function seedContract(contract: Contract, walletToFund: Signer, tokens: Contract[], weth: Contract | undefined, amountToSeedWith: number | BigNumber): Promise<void>;
|
|
42
|
+
export declare function createFake(contractName: string, targetAddress?: string): Promise<FakeContract<BaseContract>>;
|
|
43
|
+
export declare function createFakeFromABI(abi: unknown[], targetAddress?: string): Promise<FakeContract<BaseContract>>;
|
|
44
|
+
export declare function createTypedFakeFromABI<T extends BaseContract>(abi: unknown[], targetAddress?: string): Promise<FakeContract<T>>;
|
|
45
|
+
export declare function trimSolanaAddress(bytes32Address: string): string;
|
|
46
|
+
export declare function hashNonEmptyMessage(message: string): string;
|
|
47
|
+
export declare const createRandomBytes32: () => string;
|
|
21
48
|
export declare function deepEqualsWithBigNumber(x: unknown, y: unknown, omitKeys?: string[]): boolean;
|
|
22
49
|
export declare function assertPromiseError<T>(promise: Promise<T>, errMessage?: string): Promise<void>;
|
|
23
50
|
export declare function assertPromisePasses<T>(promise: Promise<T>): Promise<void>;
|
|
24
|
-
export declare function setupTokensForWallet(contractToApprove:
|
|
51
|
+
export declare function setupTokensForWallet(contractToApprove: Contract, wallet: SignerWithAddress, tokens: Contract[], weth?: Contract, seedMultiplier?: number): Promise<void>;
|
|
25
52
|
export declare function createSpyLogger(): SpyLoggerResult;
|
|
26
53
|
export declare function deploySpokePoolWithToken(fromChainId?: number): Promise<SpokePoolDeploymentResult>;
|
|
27
|
-
export declare function deployConfigStore(signer:
|
|
54
|
+
export declare function deployConfigStore(signer: SignerWithAddress, tokensToAdd: Contract[], maxL1TokensPerPoolRebalanceLeaf?: number, maxRefundPerRelayerRefundLeaf?: number, rateModel?: unknown, additionalChainIdIndices?: number[]): Promise<{
|
|
28
55
|
configStore: AcrossConfigStore;
|
|
29
56
|
deploymentBlock: number;
|
|
30
57
|
}>;
|
|
31
|
-
export declare function deployAndConfigureHubPool(signer:
|
|
58
|
+
export declare function deployAndConfigureHubPool(signer: SignerWithAddress, spokePools: {
|
|
32
59
|
l2ChainId: number;
|
|
33
|
-
spokePool:
|
|
60
|
+
spokePool: Contract;
|
|
34
61
|
}[], finderAddress?: string, timerAddress?: string): Promise<{
|
|
35
|
-
hubPool:
|
|
36
|
-
mockAdapter:
|
|
37
|
-
l1Token_1:
|
|
38
|
-
l1Token_2:
|
|
62
|
+
hubPool: Contract;
|
|
63
|
+
mockAdapter: Contract;
|
|
64
|
+
l1Token_1: Contract;
|
|
65
|
+
l1Token_2: Contract;
|
|
39
66
|
hubPoolDeploymentBlock: number;
|
|
40
67
|
}>;
|
|
41
|
-
export declare function enableRoutesOnHubPool(hubPool:
|
|
68
|
+
export declare function enableRoutesOnHubPool(hubPool: Contract, rebalanceRouteTokens: {
|
|
42
69
|
destinationChainId: number;
|
|
43
|
-
l1Token:
|
|
44
|
-
destinationToken:
|
|
70
|
+
l1Token: Contract;
|
|
71
|
+
destinationToken: Contract;
|
|
45
72
|
}[]): Promise<void>;
|
|
46
73
|
export declare function appendMessageToResult<T>(body: T): T & {
|
|
47
74
|
message: string;
|
|
48
75
|
};
|
|
49
76
|
export declare function getLastBlockTime(provider: providers.Provider): Promise<number>;
|
|
50
|
-
export declare function addLiquidity(signer:
|
|
77
|
+
export declare function addLiquidity(signer: SignerWithAddress, hubPool: Contract, l1Token: Contract, amount: BigNumber): Promise<void>;
|
|
51
78
|
export declare function deposit(spokePool: Contract, destinationChainId: number, signer: SignerWithAddress, inputToken: Address, inputAmount: BigNumber, outputToken: Address, outputAmount: BigNumber, opts?: {
|
|
52
79
|
destinationChainId?: number;
|
|
53
80
|
recipient?: Address;
|