@enzymefinance/testutils 4.0.0-next.2 → 4.0.0-next.7
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/CHANGELOG.md +32 -0
- package/dist/declarations/src/assertions.d.ts +2 -2
- package/dist/declarations/src/deployment.d.ts +172 -68
- package/dist/declarations/src/gasRelayer.d.ts +14 -12
- package/dist/declarations/src/helpers.d.ts +5 -4
- package/dist/declarations/src/scaffolding/assets.d.ts +4 -4
- package/dist/declarations/src/scaffolding/chainlink.d.ts +2 -2
- package/dist/declarations/src/scaffolding/common.d.ts +1 -1
- package/dist/declarations/src/scaffolding/core.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/common.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/external-positions/actions.d.ts +8 -6
- package/dist/declarations/src/scaffolding/extensions/external-positions/compound.d.ts +5 -5
- package/dist/declarations/src/scaffolding/extensions/external-positions/index.d.ts +1 -0
- package/dist/declarations/src/scaffolding/extensions/external-positions/mocks.d.ts +16 -12
- package/dist/declarations/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.d.ts +100 -0
- package/dist/declarations/src/scaffolding/extensions/fees.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/aave.d.ts +6 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/compound.d.ts +33 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/curve.d.ts +101 -84
- package/dist/declarations/src/scaffolding/extensions/integrations/idle.d.ts +6 -6
- package/dist/declarations/src/scaffolding/extensions/integrations/index.d.ts +3 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/mock.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/olympusV2.d.ts +17 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV4.d.ts +6 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/paraSwapV5.d.ts +23 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/poolTogetherV4.d.ts +29 -0
- package/dist/declarations/src/scaffolding/extensions/integrations/synthetix.d.ts +15 -12
- package/dist/declarations/src/scaffolding/extensions/integrations/trackedAssets.d.ts +3 -3
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV2.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/uniswapV3.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/integrations/yearn.d.ts +5 -5
- package/dist/declarations/src/scaffolding/extensions/integrations/zeroExV2.d.ts +4 -4
- package/dist/declarations/src/scaffolding/extensions/policies.d.ts +9 -9
- package/dist/declarations/src/scaffolding/setup.d.ts +11 -9
- package/dist/declarations/src/scaffolding/shares.d.ts +4 -4
- package/dist/declarations/src/scaffolding/vaultCalls.d.ts +11 -2
- package/dist/declarations/src/whales.d.ts +24 -19
- package/dist/enzymefinance-testutils.browser.cjs.js +1541 -673
- package/dist/enzymefinance-testutils.browser.esm.js +1502 -655
- package/dist/enzymefinance-testutils.cjs.dev.js +1541 -673
- package/dist/enzymefinance-testutils.cjs.prod.js +1541 -673
- package/dist/enzymefinance-testutils.esm.js +1502 -655
- package/package.json +6 -6
- package/src/assertions.ts +5 -2
- package/src/deployment.ts +221 -120
- package/src/gasRelayer.ts +17 -18
- package/src/helpers.ts +6 -4
- package/src/scaffolding/assets.ts +7 -6
- package/src/scaffolding/chainlink.ts +2 -2
- package/src/scaffolding/common.ts +1 -1
- package/src/scaffolding/core.ts +4 -8
- package/src/scaffolding/extensions/common.ts +4 -4
- package/src/scaffolding/extensions/external-positions/actions.ts +14 -9
- package/src/scaffolding/extensions/external-positions/compound.ts +28 -29
- package/src/scaffolding/extensions/external-positions/index.ts +1 -0
- package/src/scaffolding/extensions/external-positions/mocks.ts +32 -36
- package/src/scaffolding/extensions/external-positions/uniswap-v3-liquidity.ts +284 -0
- package/src/scaffolding/extensions/fees.ts +1 -1
- package/src/scaffolding/extensions/integrations/aave.ts +6 -8
- package/src/scaffolding/extensions/integrations/compound.ts +171 -11
- package/src/scaffolding/extensions/integrations/curve.ts +303 -255
- package/src/scaffolding/extensions/integrations/idle.ts +9 -11
- package/src/scaffolding/extensions/integrations/index.ts +3 -0
- package/src/scaffolding/extensions/integrations/mock.ts +11 -13
- package/src/scaffolding/extensions/integrations/olympusV2.ts +71 -0
- package/src/scaffolding/extensions/integrations/paraSwapV4.ts +16 -11
- package/src/scaffolding/extensions/integrations/paraSwapV5.ts +73 -0
- package/src/scaffolding/extensions/integrations/poolTogetherV4.ts +117 -0
- package/src/scaffolding/extensions/integrations/synthetix.ts +45 -31
- package/src/scaffolding/extensions/integrations/trackedAssets.ts +3 -4
- package/src/scaffolding/extensions/integrations/uniswapV2.ts +22 -19
- package/src/scaffolding/extensions/integrations/uniswapV3.ts +9 -10
- package/src/scaffolding/extensions/integrations/yearn.ts +9 -11
- package/src/scaffolding/extensions/integrations/zeroExV2.ts +9 -7
- package/src/scaffolding/extensions/policies.ts +2 -1
- package/src/scaffolding/setup.ts +27 -13
- package/src/scaffolding/shares.ts +5 -4
- package/src/scaffolding/vaultCalls.ts +32 -2
- package/src/types.d.ts +1 -0
- package/src/whales.ts +36 -18
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { AddressLike } from '@enzymefinance/ethers';
|
|
2
|
-
import { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
1
|
+
import type { AddressLike } from '@enzymefinance/ethers';
|
|
2
|
+
import type { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
3
|
+
import type { ComptrollerLib, IntegrationManager, StandardToken } from '@enzymefinance/protocol';
|
|
3
4
|
import {
|
|
4
5
|
callOnIntegrationArgs,
|
|
5
|
-
ComptrollerLib,
|
|
6
|
-
IntegrationManager,
|
|
7
6
|
IntegrationManagerActionId,
|
|
8
|
-
StandardToken,
|
|
9
7
|
takeOrderSelector,
|
|
10
8
|
uniswapV3TakeOrderArgs,
|
|
11
9
|
} from '@enzymefinance/protocol';
|
|
12
|
-
import { BigNumber, BigNumberish } from 'ethers';
|
|
10
|
+
import type { BigNumber, BigNumberish } from 'ethers';
|
|
13
11
|
|
|
14
12
|
export async function uniswapV3TakeOrder({
|
|
15
13
|
comptrollerProxy,
|
|
@@ -34,20 +32,21 @@ export async function uniswapV3TakeOrder({
|
|
|
34
32
|
}) {
|
|
35
33
|
if (seedFund) {
|
|
36
34
|
// Seed the VaultProxy with enough outgoingAsset for the tx
|
|
37
|
-
|
|
35
|
+
const vaultProxy = await comptrollerProxy.getVaultProxy();
|
|
36
|
+
await pathAddresses[0].transfer(vaultProxy, outgoingAssetAmount);
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
const takeOrderArgs = uniswapV3TakeOrderArgs({
|
|
40
|
+
minIncomingAssetAmount,
|
|
41
|
+
outgoingAssetAmount,
|
|
41
42
|
pathAddresses,
|
|
42
43
|
pathFees,
|
|
43
|
-
outgoingAssetAmount,
|
|
44
|
-
minIncomingAssetAmount,
|
|
45
44
|
});
|
|
46
45
|
|
|
47
46
|
const callArgs = callOnIntegrationArgs({
|
|
48
47
|
adapter: uniswapV3Adapter,
|
|
49
|
-
selector: takeOrderSelector,
|
|
50
48
|
encodedCallArgs: takeOrderArgs,
|
|
49
|
+
selector: takeOrderSelector,
|
|
51
50
|
});
|
|
52
51
|
|
|
53
52
|
return comptrollerProxy
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
1
|
+
import type { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
2
|
+
import type { ComptrollerLib, IntegrationManager, StandardToken, YearnVaultV2Adapter } from '@enzymefinance/protocol';
|
|
2
3
|
import {
|
|
3
4
|
callOnIntegrationArgs,
|
|
4
|
-
ComptrollerLib,
|
|
5
|
-
IntegrationManager,
|
|
6
5
|
IntegrationManagerActionId,
|
|
7
6
|
lendSelector,
|
|
8
7
|
redeemSelector,
|
|
9
|
-
StandardToken,
|
|
10
|
-
YearnVaultV2Adapter,
|
|
11
8
|
yearnVaultV2LendArgs,
|
|
12
9
|
yearnVaultV2RedeemArgs,
|
|
13
10
|
} from '@enzymefinance/protocol';
|
|
14
|
-
import {
|
|
11
|
+
import type { BigNumberish } from 'ethers';
|
|
12
|
+
import { BigNumber } from 'ethers';
|
|
15
13
|
|
|
16
14
|
export async function yearnVaultV2Lend({
|
|
17
15
|
signer,
|
|
@@ -32,12 +30,12 @@ export async function yearnVaultV2Lend({
|
|
|
32
30
|
}) {
|
|
33
31
|
const callArgs = callOnIntegrationArgs({
|
|
34
32
|
adapter: yearnVaultV2Adapter,
|
|
35
|
-
selector: lendSelector,
|
|
36
33
|
encodedCallArgs: yearnVaultV2LendArgs({
|
|
37
|
-
yVault,
|
|
38
|
-
outgoingUnderlyingAmount,
|
|
39
34
|
minIncomingYVaultSharesAmount,
|
|
35
|
+
outgoingUnderlyingAmount,
|
|
36
|
+
yVault,
|
|
40
37
|
}),
|
|
38
|
+
selector: lendSelector,
|
|
41
39
|
});
|
|
42
40
|
|
|
43
41
|
return comptrollerProxy
|
|
@@ -66,13 +64,13 @@ export async function yearnVaultV2Redeem({
|
|
|
66
64
|
}) {
|
|
67
65
|
const callArgs = callOnIntegrationArgs({
|
|
68
66
|
adapter: yearnVaultV2Adapter,
|
|
69
|
-
selector: redeemSelector,
|
|
70
67
|
encodedCallArgs: yearnVaultV2RedeemArgs({
|
|
71
|
-
yVault,
|
|
72
68
|
maxOutgoingYVaultSharesAmount,
|
|
73
69
|
minIncomingUnderlyingAmount,
|
|
74
70
|
slippageToleranceBps,
|
|
71
|
+
yVault,
|
|
75
72
|
}),
|
|
73
|
+
selector: redeemSelector,
|
|
76
74
|
});
|
|
77
75
|
|
|
78
76
|
return comptrollerProxy
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
2
|
-
import {
|
|
1
|
+
import type { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
2
|
+
import type {
|
|
3
3
|
ComptrollerLib,
|
|
4
4
|
IntegrationManager,
|
|
5
|
-
ZeroExV2Adapter,
|
|
6
|
-
VaultLib,
|
|
7
5
|
SignedZeroExV2Order,
|
|
6
|
+
VaultLib,
|
|
7
|
+
ZeroExV2Adapter,
|
|
8
|
+
} from '@enzymefinance/protocol';
|
|
9
|
+
import {
|
|
8
10
|
callOnIntegrationArgs,
|
|
11
|
+
IntegrationManagerActionId,
|
|
9
12
|
takeOrderSelector,
|
|
10
13
|
zeroExV2TakeOrderArgs,
|
|
11
|
-
IntegrationManagerActionId,
|
|
12
14
|
} from '@enzymefinance/protocol';
|
|
13
|
-
import { BigNumberish } from 'ethers';
|
|
15
|
+
import type { BigNumberish } from 'ethers';
|
|
14
16
|
|
|
15
17
|
export async function zeroExV2TakeOrder({
|
|
16
18
|
comptrollerProxy,
|
|
@@ -35,8 +37,8 @@ export async function zeroExV2TakeOrder({
|
|
|
35
37
|
|
|
36
38
|
const callArgs = callOnIntegrationArgs({
|
|
37
39
|
adapter: zeroExV2Adapter,
|
|
38
|
-
selector: takeOrderSelector,
|
|
39
40
|
encodedCallArgs: takeOrderArgs,
|
|
41
|
+
selector: takeOrderSelector,
|
|
40
42
|
});
|
|
41
43
|
|
|
42
44
|
return comptrollerProxy
|
package/src/scaffolding/setup.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { AddressLike
|
|
2
|
-
import {
|
|
1
|
+
import type { AddressLike } from '@enzymefinance/ethers';
|
|
2
|
+
import { randomAddress } from '@enzymefinance/ethers';
|
|
3
|
+
import type { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
4
|
+
import type { FundDeployer, StandardToken } from '@enzymefinance/protocol';
|
|
3
5
|
import {
|
|
4
6
|
ComptrollerLib,
|
|
5
7
|
ComptrollerProxy,
|
|
6
8
|
encodeFunctionData,
|
|
7
|
-
FundDeployer,
|
|
8
9
|
GasRelayPaymasterLib,
|
|
9
|
-
StandardToken,
|
|
10
10
|
VaultLib,
|
|
11
11
|
VaultProxy,
|
|
12
12
|
} from '@enzymefinance/protocol';
|
|
13
|
-
import {
|
|
13
|
+
import type { BigNumberish, BytesLike } from 'ethers';
|
|
14
|
+
import { BigNumber, utils } from 'ethers';
|
|
15
|
+
|
|
14
16
|
import { assertEvent } from '../assertions';
|
|
15
|
-
import {
|
|
17
|
+
import type { BuySharesParams } from './shares';
|
|
18
|
+
import { buyShares } from './shares';
|
|
16
19
|
|
|
17
20
|
export type InitialInvestmentParams = Omit<BuySharesParams, 'comptrollerProxy' | 'denominationAsset'>;
|
|
18
21
|
|
|
@@ -34,6 +37,7 @@ export interface CreateNewFundParams {
|
|
|
34
37
|
sharesActionTimelock?: BigNumberish;
|
|
35
38
|
fundOwner?: AddressLike;
|
|
36
39
|
fundName?: string;
|
|
40
|
+
fundSymbol?: string;
|
|
37
41
|
feeManagerConfig?: BytesLike;
|
|
38
42
|
policyManagerConfig?: BytesLike;
|
|
39
43
|
investment?: InitialInvestmentParams;
|
|
@@ -66,6 +70,7 @@ export async function createComptrollerProxy({
|
|
|
66
70
|
|
|
67
71
|
return {
|
|
68
72
|
comptrollerProxy: new ComptrollerLib(comptrollerProxyContract, signer),
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
69
74
|
receipt: comptrollerProxyContract.deployment!,
|
|
70
75
|
};
|
|
71
76
|
}
|
|
@@ -92,15 +97,15 @@ export async function createMigrationRequest({
|
|
|
92
97
|
);
|
|
93
98
|
|
|
94
99
|
const comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
|
95
|
-
creator: signer,
|
|
96
100
|
comptrollerProxy: expect.any(String) as string,
|
|
101
|
+
creator: signer,
|
|
97
102
|
denominationAsset,
|
|
98
103
|
sharesActionTimelock: BigNumber.from(sharesActionTimelock),
|
|
99
104
|
});
|
|
100
105
|
|
|
101
106
|
return {
|
|
102
|
-
receipt,
|
|
103
107
|
comptrollerProxy: new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
|
108
|
+
receipt,
|
|
104
109
|
};
|
|
105
110
|
}
|
|
106
111
|
|
|
@@ -112,17 +117,26 @@ export async function createNewFund({
|
|
|
112
117
|
sharesActionTimelock = 0,
|
|
113
118
|
fundOwner = randomAddress(),
|
|
114
119
|
fundName = 'My Fund',
|
|
120
|
+
fundSymbol = '',
|
|
115
121
|
feeManagerConfig = '0x',
|
|
116
122
|
policyManagerConfig = '0x',
|
|
117
123
|
investment,
|
|
118
124
|
}: CreateNewFundParams) {
|
|
119
125
|
const receipt = await fundDeployer
|
|
120
126
|
.connect(signer)
|
|
121
|
-
.createNewFund(
|
|
127
|
+
.createNewFund(
|
|
128
|
+
fundOwner,
|
|
129
|
+
fundName,
|
|
130
|
+
fundSymbol,
|
|
131
|
+
denominationAsset,
|
|
132
|
+
sharesActionTimelock,
|
|
133
|
+
feeManagerConfig,
|
|
134
|
+
policyManagerConfig,
|
|
135
|
+
);
|
|
122
136
|
|
|
123
137
|
const comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
|
124
|
-
creator: signer,
|
|
125
138
|
comptrollerProxy: expect.any(String) as string,
|
|
139
|
+
creator: signer,
|
|
126
140
|
denominationAsset,
|
|
127
141
|
sharesActionTimelock: BigNumber.from(sharesActionTimelock),
|
|
128
142
|
});
|
|
@@ -130,9 +144,9 @@ export async function createNewFund({
|
|
|
130
144
|
const comptrollerProxy = new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer);
|
|
131
145
|
|
|
132
146
|
const newFundDeployedArgs = assertEvent(receipt, 'NewFundCreated', {
|
|
147
|
+
comptrollerProxy,
|
|
133
148
|
creator: signer,
|
|
134
149
|
vaultProxy: expect.any(String) as string,
|
|
135
|
-
comptrollerProxy,
|
|
136
150
|
});
|
|
137
151
|
|
|
138
152
|
const vaultProxy = new VaultLib(newFundDeployedArgs.vaultProxy, signer);
|
|
@@ -172,15 +186,15 @@ export async function createReconfigurationRequest({
|
|
|
172
186
|
);
|
|
173
187
|
|
|
174
188
|
const comptrollerDeployedArgs = assertEvent(receipt, 'ComptrollerProxyDeployed', {
|
|
175
|
-
creator: signer,
|
|
176
189
|
comptrollerProxy: expect.any(String) as string,
|
|
190
|
+
creator: signer,
|
|
177
191
|
denominationAsset,
|
|
178
192
|
sharesActionTimelock: BigNumber.from(sharesActionTimelock),
|
|
179
193
|
});
|
|
180
194
|
|
|
181
195
|
return {
|
|
182
|
-
receipt,
|
|
183
196
|
comptrollerProxy: new ComptrollerLib(comptrollerDeployedArgs.comptrollerProxy, signer),
|
|
197
|
+
receipt,
|
|
184
198
|
};
|
|
185
199
|
}
|
|
186
200
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AddressLike } from '@enzymefinance/ethers';
|
|
2
|
-
import { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
3
|
-
import { ComptrollerLib, StandardToken } from '@enzymefinance/protocol';
|
|
4
|
-
import { BigNumberish
|
|
1
|
+
import type { AddressLike } from '@enzymefinance/ethers';
|
|
2
|
+
import type { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
3
|
+
import type { ComptrollerLib, StandardToken } from '@enzymefinance/protocol';
|
|
4
|
+
import type { BigNumberish } from 'ethers';
|
|
5
|
+
import { constants, utils } from 'ethers';
|
|
5
6
|
|
|
6
7
|
export interface BuySharesParams {
|
|
7
8
|
comptrollerProxy: ComptrollerLib;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { AddressLike } from '@enzymefinance/ethers';
|
|
1
|
+
import type { AddressLike } from '@enzymefinance/ethers';
|
|
2
|
+
import type { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
3
|
+
import type { AddressListRegistry, AddressListUpdateType, ComptrollerLib } from '@enzymefinance/protocol';
|
|
2
4
|
import {
|
|
3
|
-
|
|
5
|
+
addressListRegistryCreateListSelector,
|
|
4
6
|
curveMinterMintManySelector,
|
|
5
7
|
curveMinterMintSelector,
|
|
6
8
|
curveMinterToggleApproveMintSelector,
|
|
@@ -9,6 +11,34 @@ import {
|
|
|
9
11
|
} from '@enzymefinance/protocol';
|
|
10
12
|
import { constants, utils } from 'ethers';
|
|
11
13
|
|
|
14
|
+
export async function vaultCallCreateNewList({
|
|
15
|
+
addressListRegistry,
|
|
16
|
+
comptrollerProxy,
|
|
17
|
+
items,
|
|
18
|
+
owner,
|
|
19
|
+
signer,
|
|
20
|
+
updateType,
|
|
21
|
+
}: {
|
|
22
|
+
addressListRegistry: AddressListRegistry;
|
|
23
|
+
comptrollerProxy: ComptrollerLib;
|
|
24
|
+
items: AddressLike[];
|
|
25
|
+
owner: AddressLike;
|
|
26
|
+
signer: SignerWithAddress;
|
|
27
|
+
updateType: AddressListUpdateType;
|
|
28
|
+
}) {
|
|
29
|
+
await comptrollerProxy
|
|
30
|
+
.connect(signer)
|
|
31
|
+
.vaultCallOnContract(
|
|
32
|
+
addressListRegistry.address,
|
|
33
|
+
addressListRegistryCreateListSelector,
|
|
34
|
+
encodeArgs(['address', 'uint8', 'address[]'], [owner, updateType, items]),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const listCount = await addressListRegistry.getListCount();
|
|
38
|
+
|
|
39
|
+
return listCount.sub(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
12
42
|
export function vaultCallCurveMinterMint({
|
|
13
43
|
comptrollerProxy,
|
|
14
44
|
minter,
|
package/src/types.d.ts
CHANGED
package/src/whales.ts
CHANGED
|
@@ -1,43 +1,58 @@
|
|
|
1
1
|
import { resolveAddress } from '@enzymefinance/ethers';
|
|
2
|
-
import { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
2
|
+
import type { SignerWithAddress } from '@enzymefinance/hardhat';
|
|
3
3
|
|
|
4
|
+
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
4
5
|
const whales = {
|
|
5
|
-
|
|
6
|
-
adai: '0x62e41b1185023bcc14a465d350e1dde341557925',
|
|
7
|
-
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
|
6
|
+
// primitives
|
|
8
7
|
bat: '0x12274c71304bc0e6b38a56b94d2949b118feb838',
|
|
9
8
|
bnb: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
|
10
|
-
bnt: '
|
|
11
|
-
|
|
9
|
+
bnt: '0x7d1ed1601a12a172269436fa95fe156650603c1d',
|
|
10
|
+
busd: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
|
11
|
+
comp: '0x0f50d31b3eaefd65236dd3736b863cffa4c63c4e',
|
|
12
12
|
crv: '0x4ce799e6eD8D64536b67dD428565d52A531B3640',
|
|
13
|
-
dai: '
|
|
14
|
-
knc: '
|
|
13
|
+
dai: '0x47ac0fb4f2d84898e4d9e7b4dab3c24507a6d503',
|
|
14
|
+
knc: '0x09d51654bd9efbfcb56da3491989cc1444095fff',
|
|
15
15
|
ldo: '0x3dba737ccc50a32a1764b493285dd51c8af6c278',
|
|
16
16
|
link: '0xbe6977e08d4479c0a6777539ae0e8fa27be4e9d6',
|
|
17
17
|
mana: '0xefb94ac00f1cee8a89d5c3f49faa799da6f03024',
|
|
18
18
|
mln: '0xd8f8a53945bcfbbc19da162aa405e662ef71c40d',
|
|
19
|
+
ohm: '0x71a53aff36a699110d66d6bdfff2320caf8d2d59',
|
|
19
20
|
rep: '0xc6a043b07d33b6f30d8cb501026c391cfd25abe1',
|
|
20
21
|
ren: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8',
|
|
22
|
+
susd: '0xa5f7a39e55d7878bc5bd754ee5d6bd7a7662355b',
|
|
23
|
+
sohm: '0xf280f037cdbda99727ddf5dfede91e68fa78605c',
|
|
21
24
|
uni: '0x47173b170c64d16393a52e6c480b3ad8c302ba1e',
|
|
22
25
|
usdc: '0xae2d4617c862309a3d75a0ffb358c7a5009c673f',
|
|
23
26
|
usdt: '0x5041ed759dd4afc3a72b8192c143f72f4724081a',
|
|
24
27
|
weth: '0xe08A8b19e5722a201EaF20A6BC595eF655397bd5',
|
|
25
28
|
zrx: '0x206376e8940e42538781cd94ef024df3c1e0fd43',
|
|
26
|
-
|
|
29
|
+
// aTokens
|
|
30
|
+
ausdc: '0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296',
|
|
31
|
+
ausdt: '0x7d6149ad9a573a6e2ca6ebf7d4897c1b766841b4',
|
|
32
|
+
// cTokens
|
|
27
33
|
ccomp: '0xd74f186194ab9219fafac5c2fe4b3270169666db',
|
|
28
|
-
cdai: '
|
|
34
|
+
cdai: '0xab4ce310054a11328685ece1043211b68ba5d082',
|
|
29
35
|
ceth: '0x8aceab8167c80cb8b3de7fa6228b889bb1130ee8',
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
cuni: '0x39d8014b4f40d2cbc441137011d32023f4f1fd87',
|
|
37
|
+
cusdc: '0xe1ed4da4284924ddaf69983b4d813fb1be58c380',
|
|
38
|
+
// fTokens
|
|
39
|
+
fdai7: '0x88884e35d7006ae84efef09ee6bc6a43dd8e2bb8',
|
|
40
|
+
feth7: '0xcd2ba6a4d50745b0b4096186f925115387852c15',
|
|
41
|
+
fdai8: '0x93f3f612a525a59523e91cc5552f718df9fc0746',
|
|
42
|
+
ftribe8: '0xdb5ac83c137321da29a59a7592232bc4ed461730',
|
|
43
|
+
// ptTokens
|
|
44
|
+
ptUsdc: '0xd18236cd213f39d078177b6f6908f0e44e88e4aa',
|
|
45
|
+
// synths (unsupported)
|
|
34
46
|
seth: '0xc34a7c65aa08cb36744bda8eeec7b8e9891e147c',
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
sxag: '0x40d68c490bf7262ec40048099aec23535f734be2',
|
|
48
|
+
sxau: '0x92eb453b7b5b8d41edb44e2c8b8b53eb70a482c7',
|
|
49
|
+
// misc
|
|
37
50
|
lidoSteth: '0x31f644e2dd5d74f5c8d6d9de89dd517474d51800',
|
|
38
|
-
|
|
39
|
-
|
|
51
|
+
ust: '0xf584f8728b874a6a5c7a8d4d387c9aae9172d621',
|
|
52
|
+
// Curve steth pool related
|
|
53
|
+
stecrv: '0x56c915758ad3f76fd287fff7563ee313142fb663',
|
|
40
54
|
} as const;
|
|
55
|
+
/* eslint-enable sort-keys-fix/sort-keys-fix */
|
|
41
56
|
|
|
42
57
|
export type Whale = keyof typeof whales;
|
|
43
58
|
export type WhaleSigners<T extends Partial<Whale> = Whale> = Record<T, SignerWithAddress>;
|
|
@@ -45,12 +60,14 @@ export type WhaleSigners<T extends Partial<Whale> = Whale> = Record<T, SignerWit
|
|
|
45
60
|
export async function unlockWhale(token: Whale) {
|
|
46
61
|
const address = resolveAddress(whales[token]);
|
|
47
62
|
await provider.send('hardhat_impersonateAccount', [address]);
|
|
63
|
+
|
|
48
64
|
return provider.getSignerWithAddress(address);
|
|
49
65
|
}
|
|
50
66
|
|
|
51
67
|
export async function unlockAllWhales() {
|
|
52
68
|
const keys = Object.keys(whales) as Whale[];
|
|
53
69
|
const signers = await Promise.all(keys.map(async (token) => unlockWhale(token)));
|
|
70
|
+
|
|
54
71
|
return keys.reduce((carry, key, index) => {
|
|
55
72
|
return { ...carry, [key]: signers[index] };
|
|
56
73
|
}, {} as WhaleSigners);
|
|
@@ -58,6 +75,7 @@ export async function unlockAllWhales() {
|
|
|
58
75
|
|
|
59
76
|
export async function unlockWhales<T extends Whale>(...tokens: T[]) {
|
|
60
77
|
const signers = await Promise.all(tokens.map(async (token) => unlockWhale(token)));
|
|
78
|
+
|
|
61
79
|
return tokens.reduce((carry, key, index) => {
|
|
62
80
|
return { ...carry, [key]: signers[index] };
|
|
63
81
|
}, {} as WhaleSigners<T>);
|