@venusprotocol/isolated-pools 3.7.1-dev.1 → 3.8.0-dev.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/README.md +10 -0
- package/dist/deploy/001-deploy-mock-tokens.js +2 -1
- package/dist/deploy/004-swap-router.js +7 -7
- package/dist/deploy/006-deploy-pool-registry.js +3 -3
- package/dist/deploy/007-deploy-pool-lens.js +1 -1
- package/dist/deploy/008-deploy-comptrollers.js +4 -5
- package/dist/deploy/009-deploy-vtokens.js +3 -6
- package/dist/deploy/010-deploy-reward-distributors.js +5 -5
- package/dist/deploy/011-initial-liquidity.js +12 -15
- package/dist/deploy/012-transfer-pools-ownership.js +18 -18
- package/dist/deploy/013-vip-based-config.js +30 -30
- package/dist/deploy/014-shortfall-protocolshare.js +8 -3
- package/dist/deploy/018-native-token-gateway.js +3 -3
- package/dist/deploy/019-deploy-ir-models.js +3 -5
- package/dist/hardhat.config.js +44 -2
- package/dist/helpers/deploymentConfig.js +2 -2
- package/dist/helpers/deploymentUtils.d.ts +4 -5
- package/dist/helpers/deploymentUtils.js +9 -14
- package/dist/type-extensions.d.ts +6 -0
- package/dist/type-extensions.js +3 -0
- package/dist/typechain/factories/IVToken__factory.d.ts +5 -1
- package/dist/typechain/factories/IVToken__factory.js +201 -1
- package/package.json +1 -1
- package/typechain/IVToken.d.ts +341 -4
- package/typechain/factories/IVToken__factory.ts +201 -1
- package/dist/deploy/016-deploy-beacon-implementations.d.ts +0 -3
- package/dist/deploy/016-deploy-beacon-implementations.js +0 -32
- package/dist/deploy/017-update-pool-registry.d.ts +0 -3
- package/dist/deploy/017-update-pool-registry.js +0 -28
|
@@ -3910,7 +3910,7 @@ exports.globalConfig = {
|
|
|
3910
3910
|
// 3600 XVS for Borrowers
|
|
3911
3911
|
{
|
|
3912
3912
|
asset: "XVS",
|
|
3913
|
-
markets: ["
|
|
3913
|
+
markets: ["CRV", "crvUSD"],
|
|
3914
3914
|
supplySpeeds: ["925925925925925", "3703703703703703"],
|
|
3915
3915
|
borrowSpeeds: ["1388888888888888", "5555555555555555"],
|
|
3916
3916
|
},
|
|
@@ -3922,7 +3922,7 @@ exports.globalConfig = {
|
|
|
3922
3922
|
},
|
|
3923
3923
|
{
|
|
3924
3924
|
asset: "XVS",
|
|
3925
|
-
markets: ["
|
|
3925
|
+
markets: ["CRV", "crvUSD"],
|
|
3926
3926
|
supplySpeeds: ["694444444444444", "694444444444444"],
|
|
3927
3927
|
borrowSpeeds: ["1041666666666666", "1041666666666666"],
|
|
3928
3928
|
},
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
|
2
1
|
import { ERC20, MockToken } from "../typechain";
|
|
3
2
|
import { DeploymentInfo, PoolConfig, TokenConfig } from "./deploymentConfig";
|
|
4
|
-
export declare const toAddress: (addressOrAlias: string
|
|
3
|
+
export declare const toAddress: (addressOrAlias: string) => Promise<string>;
|
|
5
4
|
export declare const getUnderlyingMock: (assetSymbol: string) => Promise<MockToken>;
|
|
6
5
|
export declare const getUnderlyingToken: (assetSymbol: string, tokensConfig: TokenConfig[]) => Promise<ERC20>;
|
|
7
|
-
export declare const getUnregisteredPools: (poolConfig: PoolConfig[]
|
|
8
|
-
export declare const getUnregisteredVTokens: (poolConfig: PoolConfig[]
|
|
9
|
-
export declare const getUnregisteredRewardsDistributors: (poolConfig: PoolConfig[]
|
|
6
|
+
export declare const getUnregisteredPools: (poolConfig: PoolConfig[]) => Promise<PoolConfig[]>;
|
|
7
|
+
export declare const getUnregisteredVTokens: (poolConfig: PoolConfig[]) => Promise<PoolConfig[]>;
|
|
8
|
+
export declare const getUnregisteredRewardsDistributors: (poolConfig: PoolConfig[]) => Promise<PoolConfig[]>;
|
|
10
9
|
export declare const getBlockOrTimestampBasedDeploymentInfo: (network: string) => DeploymentInfo;
|
|
@@ -3,17 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getBlockOrTimestampBasedDeploymentInfo = exports.getUnregisteredRewardsDistributors = exports.getUnregisteredVTokens = exports.getUnregisteredPools = exports.getUnderlyingToken = exports.getUnderlyingMock = exports.toAddress = void 0;
|
|
4
4
|
const hardhat_1 = require("hardhat");
|
|
5
5
|
const deploymentConfig_1 = require("./deploymentConfig");
|
|
6
|
-
const toAddress = async (addressOrAlias
|
|
7
|
-
const { getNamedAccounts } = hre;
|
|
8
|
-
const { deployments } = hre;
|
|
6
|
+
const toAddress = async (addressOrAlias) => {
|
|
9
7
|
if (addressOrAlias.startsWith("0x")) {
|
|
10
8
|
return addressOrAlias;
|
|
11
9
|
}
|
|
12
10
|
if (addressOrAlias.startsWith("account:")) {
|
|
13
|
-
const namedAccounts = await getNamedAccounts();
|
|
11
|
+
const namedAccounts = await (0, hardhat_1.getNamedAccounts)();
|
|
14
12
|
return namedAccounts[addressOrAlias.slice("account:".length)];
|
|
15
13
|
}
|
|
16
|
-
const deployment = await deployments.get(addressOrAlias);
|
|
14
|
+
const deployment = await hardhat_1.deployments.get(addressOrAlias);
|
|
17
15
|
return deployment.address;
|
|
18
16
|
};
|
|
19
17
|
exports.toAddress = toAddress;
|
|
@@ -30,12 +28,11 @@ const getUnderlyingToken = async (assetSymbol, tokensConfig) => {
|
|
|
30
28
|
return hardhat_1.ethers.getContractAt("@openzeppelin/contracts/token/ERC20/ERC20.sol:ERC20", underlyingAddress);
|
|
31
29
|
};
|
|
32
30
|
exports.getUnderlyingToken = getUnderlyingToken;
|
|
33
|
-
const getUnregisteredPools = async (poolConfig
|
|
34
|
-
const { deployments } = hre;
|
|
31
|
+
const getUnregisteredPools = async (poolConfig) => {
|
|
35
32
|
const registry = await hardhat_1.ethers.getContract("PoolRegistry");
|
|
36
33
|
const registeredPools = (await registry.getAllPools()).map((p) => p.comptroller);
|
|
37
34
|
const isRegistered = await Promise.all(poolConfig.map(async (pool) => {
|
|
38
|
-
const comptroller = await deployments.getOrNull(`Comptroller_${pool.name}`);
|
|
35
|
+
const comptroller = await hardhat_1.deployments.getOrNull(`Comptroller_${pool.name}`);
|
|
39
36
|
if (!comptroller) {
|
|
40
37
|
// If the Comptroller deployment doesn't exist, it's not registered
|
|
41
38
|
return false;
|
|
@@ -45,8 +42,7 @@ const getUnregisteredPools = async (poolConfig, hre) => {
|
|
|
45
42
|
return poolConfig.filter((_, idx) => !isRegistered[idx]);
|
|
46
43
|
};
|
|
47
44
|
exports.getUnregisteredPools = getUnregisteredPools;
|
|
48
|
-
const getUnregisteredVTokens = async (poolConfig
|
|
49
|
-
const { deployments } = hre;
|
|
45
|
+
const getUnregisteredVTokens = async (poolConfig) => {
|
|
50
46
|
const registry = await hardhat_1.ethers.getContract("PoolRegistry");
|
|
51
47
|
const registeredPools = await registry.getAllPools();
|
|
52
48
|
const comptrollers = await Promise.all(registeredPools.map(async (p) => {
|
|
@@ -57,7 +53,7 @@ const getUnregisteredVTokens = async (poolConfig, hre) => {
|
|
|
57
53
|
}))).flat();
|
|
58
54
|
return Promise.all(poolConfig.map(async (pool) => {
|
|
59
55
|
const isRegistered = await Promise.all(pool.vtokens.map(async (vTokenConfig) => {
|
|
60
|
-
const vToken = await deployments.getOrNull(`VToken_${vTokenConfig.name}`);
|
|
56
|
+
const vToken = await hardhat_1.deployments.getOrNull(`VToken_${vTokenConfig.name}`);
|
|
61
57
|
if (!vToken) {
|
|
62
58
|
// If the VToken deployment doesn't exist, it's not registered
|
|
63
59
|
return false;
|
|
@@ -68,8 +64,7 @@ const getUnregisteredVTokens = async (poolConfig, hre) => {
|
|
|
68
64
|
}));
|
|
69
65
|
};
|
|
70
66
|
exports.getUnregisteredVTokens = getUnregisteredVTokens;
|
|
71
|
-
const getUnregisteredRewardsDistributors = async (poolConfig
|
|
72
|
-
const { deployments } = hre;
|
|
67
|
+
const getUnregisteredRewardsDistributors = async (poolConfig) => {
|
|
73
68
|
const registry = await hardhat_1.ethers.getContract("PoolRegistry");
|
|
74
69
|
const registeredPools = await registry.getAllPools();
|
|
75
70
|
const comptrollers = await Promise.all(registeredPools.map(async (p) => {
|
|
@@ -81,7 +76,7 @@ const getUnregisteredRewardsDistributors = async (poolConfig, hre) => {
|
|
|
81
76
|
return Promise.all(poolConfig.map(async (pool) => {
|
|
82
77
|
const rewards = pool.rewards || [];
|
|
83
78
|
const isRegistered = await Promise.all(rewards.map(async (reward) => {
|
|
84
|
-
const rewardsDistributor = await deployments.getOrNull(`RewardsDistributor_${reward.asset}_${pool.name}`);
|
|
79
|
+
const rewardsDistributor = await hardhat_1.deployments.getOrNull(`RewardsDistributor_${reward.asset}_${pool.name}`);
|
|
85
80
|
if (!rewardsDistributor) {
|
|
86
81
|
// If the RewardsDistributor deployment doesn't exist, it's not registered
|
|
87
82
|
return false;
|
|
@@ -3,7 +3,11 @@ import { Provider } from "@ethersproject/providers";
|
|
|
3
3
|
import type { IVToken, IVTokenInterface } from "../IVToken";
|
|
4
4
|
export declare class IVToken__factory {
|
|
5
5
|
static readonly abi: {
|
|
6
|
-
inputs:
|
|
6
|
+
inputs: {
|
|
7
|
+
internalType: string;
|
|
8
|
+
name: string;
|
|
9
|
+
type: string;
|
|
10
|
+
}[];
|
|
7
11
|
name: string;
|
|
8
12
|
outputs: {
|
|
9
13
|
internalType: string;
|
|
@@ -6,6 +6,206 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.IVToken__factory = void 0;
|
|
7
7
|
const ethers_1 = require("ethers");
|
|
8
8
|
const _abi = [
|
|
9
|
+
{
|
|
10
|
+
inputs: [
|
|
11
|
+
{
|
|
12
|
+
internalType: "address",
|
|
13
|
+
name: "account",
|
|
14
|
+
type: "address",
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
name: "borrowBalanceCurrent",
|
|
18
|
+
outputs: [
|
|
19
|
+
{
|
|
20
|
+
internalType: "uint256",
|
|
21
|
+
name: "",
|
|
22
|
+
type: "uint256",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
stateMutability: "nonpayable",
|
|
26
|
+
type: "function",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
inputs: [
|
|
30
|
+
{
|
|
31
|
+
internalType: "address",
|
|
32
|
+
name: "borrower",
|
|
33
|
+
type: "address",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
internalType: "uint256",
|
|
37
|
+
name: "borrowAmount",
|
|
38
|
+
type: "uint256",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
name: "borrowBehalf",
|
|
42
|
+
outputs: [
|
|
43
|
+
{
|
|
44
|
+
internalType: "uint256",
|
|
45
|
+
name: "",
|
|
46
|
+
type: "uint256",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
stateMutability: "nonpayable",
|
|
50
|
+
type: "function",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
inputs: [],
|
|
54
|
+
name: "exchangeRateCurrent",
|
|
55
|
+
outputs: [
|
|
56
|
+
{
|
|
57
|
+
internalType: "uint256",
|
|
58
|
+
name: "",
|
|
59
|
+
type: "uint256",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
stateMutability: "nonpayable",
|
|
63
|
+
type: "function",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
inputs: [
|
|
67
|
+
{
|
|
68
|
+
internalType: "address",
|
|
69
|
+
name: "receiver",
|
|
70
|
+
type: "address",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
internalType: "uint256",
|
|
74
|
+
name: "mintAmount",
|
|
75
|
+
type: "uint256",
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
name: "mintBehalf",
|
|
79
|
+
outputs: [
|
|
80
|
+
{
|
|
81
|
+
internalType: "uint256",
|
|
82
|
+
name: "",
|
|
83
|
+
type: "uint256",
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
stateMutability: "nonpayable",
|
|
87
|
+
type: "function",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
inputs: [
|
|
91
|
+
{
|
|
92
|
+
internalType: "uint256",
|
|
93
|
+
name: "redeemTokens",
|
|
94
|
+
type: "uint256",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
name: "redeem",
|
|
98
|
+
outputs: [
|
|
99
|
+
{
|
|
100
|
+
internalType: "uint256",
|
|
101
|
+
name: "",
|
|
102
|
+
type: "uint256",
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
stateMutability: "nonpayable",
|
|
106
|
+
type: "function",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
inputs: [
|
|
110
|
+
{
|
|
111
|
+
internalType: "address",
|
|
112
|
+
name: "redeemer",
|
|
113
|
+
type: "address",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
internalType: "uint256",
|
|
117
|
+
name: "redeemTokens",
|
|
118
|
+
type: "uint256",
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
name: "redeemBehalf",
|
|
122
|
+
outputs: [
|
|
123
|
+
{
|
|
124
|
+
internalType: "uint256",
|
|
125
|
+
name: "",
|
|
126
|
+
type: "uint256",
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
stateMutability: "nonpayable",
|
|
130
|
+
type: "function",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
inputs: [
|
|
134
|
+
{
|
|
135
|
+
internalType: "address",
|
|
136
|
+
name: "redeemer",
|
|
137
|
+
type: "address",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
internalType: "uint256",
|
|
141
|
+
name: "redeemAmount",
|
|
142
|
+
type: "uint256",
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
name: "redeemUnderlyingBehalf",
|
|
146
|
+
outputs: [
|
|
147
|
+
{
|
|
148
|
+
internalType: "uint256",
|
|
149
|
+
name: "",
|
|
150
|
+
type: "uint256",
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
stateMutability: "nonpayable",
|
|
154
|
+
type: "function",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
inputs: [
|
|
158
|
+
{
|
|
159
|
+
internalType: "address",
|
|
160
|
+
name: "borrower",
|
|
161
|
+
type: "address",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
internalType: "uint256",
|
|
165
|
+
name: "repayAmount",
|
|
166
|
+
type: "uint256",
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
name: "repayBorrowBehalf",
|
|
170
|
+
outputs: [
|
|
171
|
+
{
|
|
172
|
+
internalType: "uint256",
|
|
173
|
+
name: "",
|
|
174
|
+
type: "uint256",
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
stateMutability: "nonpayable",
|
|
178
|
+
type: "function",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
inputs: [
|
|
182
|
+
{
|
|
183
|
+
internalType: "address",
|
|
184
|
+
name: "from",
|
|
185
|
+
type: "address",
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
internalType: "address",
|
|
189
|
+
name: "to",
|
|
190
|
+
type: "address",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
internalType: "uint256",
|
|
194
|
+
name: "amount",
|
|
195
|
+
type: "uint256",
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
name: "transferFrom",
|
|
199
|
+
outputs: [
|
|
200
|
+
{
|
|
201
|
+
internalType: "bool",
|
|
202
|
+
name: "",
|
|
203
|
+
type: "bool",
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
stateMutability: "nonpayable",
|
|
207
|
+
type: "function",
|
|
208
|
+
},
|
|
9
209
|
{
|
|
10
210
|
inputs: [],
|
|
11
211
|
name: "underlying",
|
|
@@ -16,7 +216,7 @@ const _abi = [
|
|
|
16
216
|
type: "address",
|
|
17
217
|
},
|
|
18
218
|
],
|
|
19
|
-
stateMutability: "
|
|
219
|
+
stateMutability: "nonpayable",
|
|
20
220
|
type: "function",
|
|
21
221
|
},
|
|
22
222
|
];
|