@venusprotocol/protocol-reserve 2.4.0 → 3.0.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/deployments/arbitrumsepolia/ConverterNetwork.json +723 -0
- package/deployments/arbitrumsepolia/ConverterNetwork_Implementation.json +828 -0
- package/deployments/arbitrumsepolia/ConverterNetwork_Proxy.json +277 -0
- package/deployments/arbitrumsepolia/SingleTokenConverterBeacon.json +206 -0
- package/deployments/arbitrumsepolia/SingleTokenConverterImp.json +2170 -0
- package/deployments/arbitrumsepolia/USDCPrimeConverter.json +229 -0
- package/deployments/arbitrumsepolia/USDTPrimeConverter.json +229 -0
- package/deployments/arbitrumsepolia/WBTCPrimeConverter.json +229 -0
- package/deployments/arbitrumsepolia/WETHPrimeConverter.json +229 -0
- package/deployments/arbitrumsepolia/XVSVaultConverter.json +229 -0
- package/deployments/arbitrumsepolia/XVSVaultTreasury.json +627 -0
- package/deployments/arbitrumsepolia/XVSVaultTreasury_Implementation.json +672 -0
- package/deployments/arbitrumsepolia/XVSVaultTreasury_Proxy.json +281 -0
- package/deployments/arbitrumsepolia/solcInputs/176b6b19adc371c32ad674fe4863e12d.json +238 -0
- package/deployments/arbitrumsepolia.json +4936 -889
- package/deployments/arbitrumsepolia_addresses.json +14 -1
- package/dist/deploy/{001-psr.d.ts → 000-psr.d.ts} +1 -1
- package/dist/deploy/000-psr.d.ts.map +1 -0
- package/dist/deploy/000-psr.js +67 -0
- package/dist/deploy/000-psr.js.map +1 -0
- package/dist/deploy/{006-risk-fund-v2.d.ts → 001-risk-fund-v2.d.ts} +1 -1
- package/dist/deploy/001-risk-fund-v2.d.ts.map +1 -0
- package/dist/deploy/001-risk-fund-v2.js +38 -0
- package/dist/deploy/001-risk-fund-v2.js.map +1 -0
- package/dist/deploy/002-risk-fund-converter.d.ts.map +1 -1
- package/dist/deploy/002-risk-fund-converter.js +48 -54
- package/dist/deploy/002-risk-fund-converter.js.map +1 -1
- package/dist/deploy/003-xvs-vault-treasury.d.ts.map +1 -1
- package/dist/deploy/003-xvs-vault-treasury.js +21 -29
- package/dist/deploy/003-xvs-vault-treasury.js.map +1 -1
- package/dist/deploy/004-single-token-converter.d.ts.map +1 -1
- package/dist/deploy/004-single-token-converter.js +86 -87
- package/dist/deploy/004-single-token-converter.js.map +1 -1
- package/dist/deploy/005-converter-network.d.ts.map +1 -1
- package/dist/deploy/005-converter-network.js +19 -27
- package/dist/deploy/005-converter-network.js.map +1 -1
- package/dist/hardhat.config.d.ts.map +1 -1
- package/dist/hardhat.config.js +10 -13
- package/dist/hardhat.config.js.map +1 -1
- package/dist/helpers/utils.d.ts +0 -1
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/helpers/utils.js +1 -2
- package/dist/helpers/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/deploy/001-psr.d.ts.map +0 -1
- package/dist/deploy/001-psr.js +0 -76
- package/dist/deploy/001-psr.js.map +0 -1
- package/dist/deploy/006-risk-fund-v2.d.ts.map +0 -1
- package/dist/deploy/006-risk-fund-v2.js +0 -43
- package/dist/deploy/006-risk-fund-v2.js.map +0 -1
|
@@ -2,9 +2,22 @@
|
|
|
2
2
|
"name": "arbitrumsepolia",
|
|
3
3
|
"chainId": "421614",
|
|
4
4
|
"addresses": {
|
|
5
|
+
"ConverterNetwork": "0x9dD63dC8DADf90B67511939C00607484567B0D7A",
|
|
6
|
+
"ConverterNetwork_Implementation": "0xa5FD972D51aC9a74Bb02E9072CE8b3eC33BfB832",
|
|
7
|
+
"ConverterNetwork_Proxy": "0x9dD63dC8DADf90B67511939C00607484567B0D7A",
|
|
5
8
|
"DefaultProxyAdmin": "0xA78A1Df376c3CEeBC5Fab574fe6EdDbbF76fd03e",
|
|
6
9
|
"ProtocolShareReserve": "0x09267d30798B59c581ce54E861A084C6FC298666",
|
|
7
10
|
"ProtocolShareReserve_Implementation": "0xF5B07c27d213A2B838A3D155FFEC0d52B17E91fd",
|
|
8
|
-
"ProtocolShareReserve_Proxy": "0x09267d30798B59c581ce54E861A084C6FC298666"
|
|
11
|
+
"ProtocolShareReserve_Proxy": "0x09267d30798B59c581ce54E861A084C6FC298666",
|
|
12
|
+
"SingleTokenConverterBeacon": "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4",
|
|
13
|
+
"SingleTokenConverterImp": "0x4ea44b72e00e942b259a6a3720Cf1B8776b9fe93",
|
|
14
|
+
"USDCPrimeConverter": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74",
|
|
15
|
+
"USDTPrimeConverter": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be",
|
|
16
|
+
"WBTCPrimeConverter": "0x3089F46caf6611806caA39Ffaf672097156b893a",
|
|
17
|
+
"WETHPrimeConverter": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8",
|
|
18
|
+
"XVSVaultConverter": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd",
|
|
19
|
+
"XVSVaultTreasury": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6",
|
|
20
|
+
"XVSVaultTreasury_Implementation": "0xe0481f604D9B127F3Bb93FA73cF3e48A9e47b82a",
|
|
21
|
+
"XVSVaultTreasury_Proxy": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6"
|
|
9
22
|
}
|
|
10
23
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"000-psr.d.ts","sourceRoot":"","sources":["../../deploy/000-psr.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,QAAA,MAAM,IAAI,EAAE,cA+CX,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const hardhat_1 = __importStar(require("hardhat"));
|
|
27
|
+
const utils_1 = require("../helpers/utils");
|
|
28
|
+
const func = async ({ network: { live, name }, getNamedAccounts, deployments, }) => {
|
|
29
|
+
const { deploy } = deployments;
|
|
30
|
+
const { deployer } = await getNamedAccounts();
|
|
31
|
+
const vBNBAddress = (await hardhat_1.ethers.getContractOrNull("vBNB"))?.address || utils_1.ADDRESS_ONE;
|
|
32
|
+
const comptrollerAddress = (await hardhat_1.ethers.getContract("Unitroller"))?.address;
|
|
33
|
+
const WBNBAddress = (await hardhat_1.ethers.getContractOrNull("WBNB"))?.address || utils_1.ADDRESS_ONE;
|
|
34
|
+
const timelockAddress = (await hardhat_1.ethers.getContract("NormalTimelock"))?.address || utils_1.multisigs[name];
|
|
35
|
+
const acmAddress = (await hardhat_1.ethers.getContract("AccessControlManager"))?.address;
|
|
36
|
+
const loopsLimit = 20;
|
|
37
|
+
const defaultProxyAdmin = await hardhat_1.default.artifacts.readArtifact("hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol:ProxyAdmin");
|
|
38
|
+
await deploy("ProtocolShareReserve", {
|
|
39
|
+
from: deployer,
|
|
40
|
+
log: true,
|
|
41
|
+
deterministicDeployment: false,
|
|
42
|
+
args: [comptrollerAddress, WBNBAddress, vBNBAddress],
|
|
43
|
+
proxy: live
|
|
44
|
+
? {
|
|
45
|
+
owner: timelockAddress,
|
|
46
|
+
proxyContract: "OpenZeppelinTransparentProxy",
|
|
47
|
+
execute: {
|
|
48
|
+
methodName: "initialize",
|
|
49
|
+
args: [acmAddress, loopsLimit],
|
|
50
|
+
},
|
|
51
|
+
viaAdminContract: {
|
|
52
|
+
name: "DefaultProxyAdmin",
|
|
53
|
+
artifact: defaultProxyAdmin,
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
: undefined,
|
|
57
|
+
});
|
|
58
|
+
const psr = await hardhat_1.default.ethers.getContract("ProtocolShareReserve");
|
|
59
|
+
if (live) {
|
|
60
|
+
const tx = await psr.transferOwnership(timelockAddress);
|
|
61
|
+
await tx.wait();
|
|
62
|
+
console.log("Transferred ownership of PSR to Timelock");
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
func.tags = ["ProtocolShareReserve"];
|
|
66
|
+
exports.default = func;
|
|
67
|
+
//# sourceMappingURL=000-psr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"000-psr.js","sourceRoot":"","sources":["../../deploy/000-psr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAsC;AAItC,4CAA0D;AAE1D,MAAM,IAAI,GAAmB,KAAK,EAAE,EAClC,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EACvB,gBAAgB,EAChB,WAAW,GACe,EAAE,EA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QAAQ,EAAE,iBAAiB;iBAC5B;aACF;YACH,CAAC,CAAC,SAAS;KACd,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,MAAM,iBAAG,CAAC,MAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAEjE,IAAI,IAAI,EAAE;QACR,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;QACxD,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;KACzD;AACH,CAAC,CAAC;AAEF,IAAI,CAAC,IAAI,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAErC,kBAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"001-risk-fund-v2.d.ts","sourceRoot":"","sources":["../../deploy/001-risk-fund-v2.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,QAAA,MAAM,IAAI,EAAE,cAsCX,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const hardhat_1 = require("hardhat");
|
|
4
|
+
const utils_1 = require("../helpers/utils");
|
|
5
|
+
const func = async ({ network: { name, live }, getNamedAccounts, deployments, }) => {
|
|
6
|
+
const { deploy } = deployments;
|
|
7
|
+
const { deployer } = await getNamedAccounts();
|
|
8
|
+
const proxyAdmin = await hardhat_1.ethers.getContract("DefaultProxyAdmin");
|
|
9
|
+
let owner = deployer;
|
|
10
|
+
if (live) {
|
|
11
|
+
owner = await proxyAdmin.owner();
|
|
12
|
+
}
|
|
13
|
+
await deploy("RiskFundV2", {
|
|
14
|
+
from: deployer,
|
|
15
|
+
contract: "RiskFundV2",
|
|
16
|
+
proxy: live
|
|
17
|
+
? {
|
|
18
|
+
owner: owner,
|
|
19
|
+
proxyContract: "OpenZeppelinTransparentProxy",
|
|
20
|
+
upgradeIndex: 0,
|
|
21
|
+
}
|
|
22
|
+
: undefined,
|
|
23
|
+
autoMine: true,
|
|
24
|
+
log: true,
|
|
25
|
+
});
|
|
26
|
+
if (live) {
|
|
27
|
+
const targetOwner = (await hardhat_1.ethers.getContractOrNull("NormalTimelock"))?.address || utils_1.multisigs[name];
|
|
28
|
+
const contract = await hardhat_1.ethers.getContract("RiskFundV2");
|
|
29
|
+
if ((await contract.owner()) !== targetOwner && (await contract.pendingOwner()) !== targetOwner) {
|
|
30
|
+
console.log(`Transferring ownership of RiskFundV2 to ${targetOwner}`);
|
|
31
|
+
const tx = await contract.transferOwnership(targetOwner);
|
|
32
|
+
await tx.wait();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
func.tags = ["RiskFundV2"];
|
|
37
|
+
exports.default = func;
|
|
38
|
+
//# sourceMappingURL=001-risk-fund-v2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"001-risk-fund-v2.js","sourceRoot":"","sources":["../../deploy/001-risk-fund-v2.ts"],"names":[],"mappings":";;AAAA,qCAAiC;AAIjC,4CAA6C;AAE7C,MAAM,IAAI,GAAmB,KAAK,EAAE,EAClC,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EACvB,gBAAgB,EAChB,WAAW,GACe,EAAE,EAAE;IAC9B,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAC/B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAE9C,MAAM,UAAU,GAAG,MAAM,gBAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;IACjE,IAAI,KAAK,GAAG,QAAQ,CAAC;IACrB,IAAI,IAAI,EAAE;QACR,KAAK,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;KAClC;IAED,MAAM,MAAM,CAAC,YAAY,EAAE;QACzB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,YAAY;QACtB,KAAK,EAAE,IAAI;YACT,CAAC,CAAC;gBACE,KAAK,EAAE,KAAK;gBACZ,aAAa,EAAE,8BAA8B;gBAC7C,YAAY,EAAE,CAAC;aAChB;YACH,CAAC,CAAC,SAAS;QACb,QAAQ,EAAE,IAAI;QACd,GAAG,EAAE,IAAI;KACV,CAAC,CAAC;IAEH,IAAI,IAAI,EAAE;QACR,MAAM,WAAW,GAAG,CAAC,MAAM,gBAAM,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,EAAE,OAAO,IAAI,iBAAS,CAAC,IAAI,CAAC,CAAC;QAEnG,MAAM,QAAQ,GAAG,MAAM,gBAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,WAAW,IAAI,CAAC,MAAM,QAAQ,CAAC,YAAY,EAAE,CAAC,KAAK,WAAW,EAAE;YAC/F,OAAO,CAAC,GAAG,CAAC,2CAA2C,WAAW,EAAE,CAAC,CAAC;YACtE,MAAM,EAAE,GAAG,MAAM,QAAQ,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;YACzD,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;SACjB;KACF;AACH,CAAC,CAAC;AAEF,IAAI,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;AAE3B,kBAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"002-risk-fund-converter.d.ts","sourceRoot":"","sources":["../../deploy/002-risk-fund-converter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAOtD,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"002-risk-fund-converter.d.ts","sourceRoot":"","sources":["../../deploy/002-risk-fund-converter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAOtD,QAAA,MAAM,IAAI,EAAE,cAuEX,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
|
@@ -1,78 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const utils_1 = require("ethers/lib/utils");
|
|
13
4
|
const hardhat_1 = require("hardhat");
|
|
14
5
|
const utils_2 = require("../helpers/utils");
|
|
15
6
|
const MIN_AMOUNT_TO_CONVERT = (0, utils_1.parseUnits)("10", 18);
|
|
16
|
-
const func = ({ network: { live, name }, getNamedAccounts, deployments, }) =>
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
7
|
+
const func = async ({ network: { live, name }, getNamedAccounts, deployments, }) => {
|
|
18
8
|
const { deploy } = deployments;
|
|
19
|
-
const { deployer } =
|
|
20
|
-
const acmAddress = (
|
|
21
|
-
const oracleAddress = (
|
|
22
|
-
const usdtAddress = (
|
|
23
|
-
const corePoolAddress = (
|
|
24
|
-
const btcbAddress = (
|
|
25
|
-
const ethAddress = (
|
|
26
|
-
const vBNBAddress = (
|
|
27
|
-
const wBNBAddress = (
|
|
28
|
-
const riskFundAddress = (
|
|
29
|
-
const poolRegistryAddress = (
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
poolStableCoinAddress = (
|
|
9
|
+
const { deployer } = await getNamedAccounts();
|
|
10
|
+
const acmAddress = (await hardhat_1.ethers.getContract("AccessControlManager"))?.address;
|
|
11
|
+
const oracleAddress = (await hardhat_1.ethers.getContract("ResilientOracle"))?.address;
|
|
12
|
+
const usdtAddress = (await hardhat_1.ethers.getContract("USDT"))?.address;
|
|
13
|
+
const corePoolAddress = (await hardhat_1.ethers.getContract("Unitroller"))?.address;
|
|
14
|
+
const btcbAddress = (await hardhat_1.ethers.getContract("BTCB"))?.address;
|
|
15
|
+
const ethAddress = (await hardhat_1.ethers.getContract("ETH"))?.address;
|
|
16
|
+
const vBNBAddress = (await hardhat_1.ethers.getContractOrNull("vBNB"))?.address || utils_2.ADDRESS_ONE;
|
|
17
|
+
const wBNBAddress = (await hardhat_1.ethers.getContractOrNull("WBNB"))?.address || utils_2.ADDRESS_ONE;
|
|
18
|
+
const riskFundAddress = (await hardhat_1.ethers.getContract("RiskFundV2"))?.address;
|
|
19
|
+
const poolRegistryAddress = (await hardhat_1.ethers.getContract("PoolRegistry"))?.address;
|
|
20
|
+
let comptrollers;
|
|
21
|
+
const timelockAddress = (await hardhat_1.ethers.getContract("NormalTimelock"))?.address || utils_2.multisigs[name];
|
|
22
|
+
if (live) {
|
|
23
|
+
const poolDeFiAddress = (await hardhat_1.ethers.getContract("Comptroller_DeFi"))?.address;
|
|
24
|
+
const poolGameFiAddress = (await hardhat_1.ethers.getContract("Comptroller_GameFi"))?.address;
|
|
25
|
+
const poolTronAddress = (await hardhat_1.ethers.getContract("Comptroller_Tron"))?.address;
|
|
26
|
+
const poolStableCoinAddress = (await hardhat_1.ethers.getContract("Comptroller_Stablecoins"))?.address;
|
|
27
|
+
comptrollers = [corePoolAddress, poolStableCoinAddress, poolDeFiAddress, poolGameFiAddress, poolTronAddress];
|
|
37
28
|
}
|
|
38
29
|
else {
|
|
39
|
-
|
|
30
|
+
const pool1Address = (await hardhat_1.ethers.getContractOrNull("Comptroller_Pool1"))?.address || utils_2.ADDRESS_ONE;
|
|
31
|
+
const pool2Address = (await hardhat_1.ethers.getContractOrNull("Comptroller_Pool2"))?.address || utils_2.ADDRESS_ONE;
|
|
32
|
+
comptrollers = [pool1Address, pool2Address];
|
|
40
33
|
}
|
|
41
|
-
const comptrollers = [corePoolAddress, poolStableCoinAddress, poolDeFiAddress, poolGameFiAddress, poolTronAddress];
|
|
42
34
|
const assets = [[usdtAddress, btcbAddress, ethAddress], [usdtAddress], [usdtAddress], [usdtAddress], [usdtAddress]];
|
|
43
35
|
const values = [[true, true, true], [true], [true], [true], [true]];
|
|
44
|
-
|
|
36
|
+
await deploy("RiskFundConverter", {
|
|
45
37
|
from: deployer,
|
|
46
38
|
contract: "RiskFundConverter",
|
|
47
39
|
args: [corePoolAddress, vBNBAddress, wBNBAddress],
|
|
48
|
-
proxy:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
40
|
+
proxy: live
|
|
41
|
+
? {
|
|
42
|
+
owner: timelockAddress,
|
|
43
|
+
proxyContract: "OpenZeppelinTransparentProxy",
|
|
44
|
+
execute: {
|
|
45
|
+
methodName: "initialize",
|
|
46
|
+
args: [
|
|
47
|
+
acmAddress,
|
|
48
|
+
oracleAddress,
|
|
49
|
+
riskFundAddress,
|
|
50
|
+
poolRegistryAddress,
|
|
51
|
+
MIN_AMOUNT_TO_CONVERT,
|
|
52
|
+
comptrollers,
|
|
53
|
+
assets,
|
|
54
|
+
values,
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
upgradeIndex: 0,
|
|
58
|
+
}
|
|
59
|
+
: undefined,
|
|
66
60
|
autoMine: true,
|
|
67
61
|
log: true,
|
|
68
62
|
});
|
|
69
|
-
const converter =
|
|
63
|
+
const converter = await hardhat_1.ethers.getContract("RiskFundConverter");
|
|
70
64
|
if (live) {
|
|
71
|
-
const tx =
|
|
72
|
-
|
|
65
|
+
const tx = await converter.transferOwnership(timelockAddress);
|
|
66
|
+
await tx.wait();
|
|
73
67
|
console.log(`Transferred ownership of RiskFundConverter to Timelock`);
|
|
74
68
|
}
|
|
75
|
-
}
|
|
69
|
+
};
|
|
76
70
|
func.tags = ["RiskFundConverter"];
|
|
77
71
|
exports.default = func;
|
|
78
72
|
//# sourceMappingURL=002-risk-fund-converter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"002-risk-fund-converter.js","sourceRoot":"","sources":["../../deploy/002-risk-fund-converter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"002-risk-fund-converter.js","sourceRoot":"","sources":["../../deploy/002-risk-fund-converter.ts"],"names":[],"mappings":";;AAAA,4CAA8C;AAC9C,qCAAiC;AAIjC,4CAA0D;AAE1D,MAAM,qBAAqB,GAAG,IAAA,kBAAU,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAEnD,MAAM,IAAI,GAAmB,KAAK,EAAE,EAClC,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EACvB,gBAAgB,EAChB,WAAW,GACe,EAAE,EAAE;IAC9B,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAC/B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAE9C,MAAM,UAAU,GAAG,CAAC,MAAM,gBAAM,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC,EAAE,OAAO,CAAC;IAC/E,MAAM,aAAa,GAAG,CAAC,MAAM,gBAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,EAAE,OAAO,C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IAAI,EAAE;wBACJ,UAAU;wBACV,aAAa;wBACb,eAAe;wBACf,mBAAmB;wBACnB,qBAAqB;wBACrB,YAAY;wBACZ,MAAM;wBACN,MAAM;qBACP;iBACF;gBACD,YAAY,EAAE,CAAC;aAChB;YACH,CAAC,CAAC,SAAS;QACb,QAAQ,EAAE,IAAI;QACd,GAAG,EAAE,IAAI;KACV,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,MAAM,gBAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAEhE,IAAI,IAAI,EAAE;QACR,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAC9D,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;KACvE;AACH,CAAC,CAAC;AAEF,IAAI,CAAC,IAAI,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAElC,kBAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"003-xvs-vault-treasury.d.ts","sourceRoot":"","sources":["../../deploy/003-xvs-vault-treasury.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAI1D,QAAA,MAAM,IAAI;iEAAsE,yBAAyB;;
|
|
1
|
+
{"version":3,"file":"003-xvs-vault-treasury.d.ts","sourceRoot":"","sources":["../../deploy/003-xvs-vault-treasury.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAI1D,QAAA,MAAM,IAAI;iEAAsE,yBAAyB;;CAiCxG,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
|
@@ -1,45 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const hardhat_1 = require("hardhat");
|
|
13
4
|
const utils_1 = require("../helpers/utils");
|
|
14
|
-
const func = ({ network: { live, name }, getNamedAccounts, deployments }) =>
|
|
15
|
-
var _a, _b, _c, _d;
|
|
5
|
+
const func = async ({ network: { live, name }, getNamedAccounts, deployments }) => {
|
|
16
6
|
const { deploy } = deployments;
|
|
17
|
-
const { deployer } =
|
|
18
|
-
const xvsAddress = (
|
|
19
|
-
const proxyOwnerAddress = (
|
|
20
|
-
const acmAddress = (
|
|
21
|
-
const xvsVaultAddress = (
|
|
22
|
-
|
|
7
|
+
const { deployer } = await getNamedAccounts();
|
|
8
|
+
const xvsAddress = (await hardhat_1.ethers.getContract("XVS"))?.address;
|
|
9
|
+
const proxyOwnerAddress = (await hardhat_1.ethers.getContractOrNull("NormalTimelock"))?.address || utils_1.multisigs[name];
|
|
10
|
+
const acmAddress = (await hardhat_1.ethers.getContract("AccessControlManager"))?.address;
|
|
11
|
+
const xvsVaultAddress = (await hardhat_1.ethers.getContract("XVSVaultProxy"))?.address;
|
|
12
|
+
await deploy("XVSVaultTreasury", {
|
|
23
13
|
from: deployer,
|
|
24
14
|
log: true,
|
|
25
15
|
deterministicDeployment: false,
|
|
26
16
|
args: [xvsAddress],
|
|
27
|
-
proxy:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
proxy: live
|
|
18
|
+
? {
|
|
19
|
+
owner: proxyOwnerAddress,
|
|
20
|
+
proxyContract: "OpenZeppelinTransparentProxy",
|
|
21
|
+
execute: {
|
|
22
|
+
methodName: "initialize",
|
|
23
|
+
args: [acmAddress, xvsVaultAddress],
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
: undefined,
|
|
35
27
|
});
|
|
36
|
-
const xvsVaultTreasury =
|
|
28
|
+
const xvsVaultTreasury = await hardhat_1.ethers.getContract("XVSVaultTreasury");
|
|
37
29
|
if (live) {
|
|
38
|
-
const tx =
|
|
39
|
-
|
|
30
|
+
const tx = await xvsVaultTreasury.transferOwnership(proxyOwnerAddress);
|
|
31
|
+
await tx.wait();
|
|
40
32
|
console.log("Transferred ownership of XVSVaultTreasury to Timelock");
|
|
41
33
|
}
|
|
42
|
-
}
|
|
34
|
+
};
|
|
43
35
|
func.tags = ["XVSVaultTreasury"];
|
|
44
36
|
exports.default = func;
|
|
45
37
|
//# sourceMappingURL=003-xvs-vault-treasury.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"003-xvs-vault-treasury.js","sourceRoot":"","sources":["../../deploy/003-xvs-vault-treasury.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"003-xvs-vault-treasury.js","sourceRoot":"","sources":["../../deploy/003-xvs-vault-treasury.ts"],"names":[],"mappings":";;AAAA,qCAAiC;AAGjC,4CAA6C;AAE7C,MAAM,IAAI,GAAG,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,gBAAgB,EAAE,WAAW,EAA6B,EAAE,EAAE;IAC3G,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAC/B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAE9C,MAAM,UAAU,GAAG,CAAC,MAAM,gBAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC;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AAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"004-single-token-converter.d.ts","sourceRoot":"","sources":["../../deploy/004-single-token-converter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA8DtD,QAAA,MAAM,IAAI,EAAE,cA0DX,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
|
@@ -1,102 +1,101 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
const utils_1 = require("ethers/lib/utils");
|
|
13
4
|
const hardhat_1 = require("hardhat");
|
|
14
5
|
const utils_2 = require("../helpers/utils");
|
|
15
|
-
function getBaseAssets(network) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
6
|
+
async function getBaseAssets(network) {
|
|
7
|
+
const networkBaseAssets = {
|
|
8
|
+
hardhat: async () => ({
|
|
9
|
+
USDTPrimeConverter: (await hardhat_1.ethers.getContract("USDT"))?.address,
|
|
10
|
+
USDCPrimeConverter: (await hardhat_1.ethers.getContract("USDC"))?.address,
|
|
11
|
+
BTCBPrimeConverter: (await hardhat_1.ethers.getContract("BTCB"))?.address,
|
|
12
|
+
ETHPrimeConverter: (await hardhat_1.ethers.getContract("ETH"))?.address,
|
|
13
|
+
XVSVaultConverter: (await hardhat_1.ethers.getContract("XVS"))?.address,
|
|
14
|
+
}),
|
|
15
|
+
bsctestnet: async () => ({
|
|
16
|
+
USDTPrimeConverter: (await hardhat_1.ethers.getContract("USDT"))?.address,
|
|
17
|
+
USDCPrimeConverter: (await hardhat_1.ethers.getContract("USDC"))?.address,
|
|
18
|
+
BTCBPrimeConverter: (await hardhat_1.ethers.getContract("BTCB"))?.address,
|
|
19
|
+
ETHPrimeConverter: (await hardhat_1.ethers.getContract("ETH"))?.address,
|
|
20
|
+
XVSVaultConverter: (await hardhat_1.ethers.getContract("XVS"))?.address,
|
|
21
|
+
}),
|
|
22
|
+
bscmainnet: async () => ({
|
|
23
|
+
USDTPrimeConverter: (await hardhat_1.ethers.getContract("USDT"))?.address,
|
|
24
|
+
USDCPrimeConverter: (await hardhat_1.ethers.getContract("USDC"))?.address,
|
|
25
|
+
BTCBPrimeConverter: (await hardhat_1.ethers.getContract("BTCB"))?.address,
|
|
26
|
+
ETHPrimeConverter: (await hardhat_1.ethers.getContract("ETH"))?.address,
|
|
27
|
+
XVSVaultConverter: (await hardhat_1.ethers.getContract("XVS"))?.address,
|
|
28
|
+
}),
|
|
29
|
+
sepolia: async () => ({
|
|
30
|
+
USDTPrimeConverter: (await hardhat_1.ethers.getContract("MockUSDT"))?.address,
|
|
31
|
+
USDCPrimeConverter: (await hardhat_1.ethers.getContract("MockUSDC"))?.address,
|
|
32
|
+
WBTCPrimeConverter: (await hardhat_1.ethers.getContract("MockWBTC"))?.address,
|
|
33
|
+
WETHPrimeConverter: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9",
|
|
34
|
+
XVSVaultConverter: (await hardhat_1.ethers.getContract("XVS"))?.address,
|
|
35
|
+
}),
|
|
36
|
+
ethereum: async () => ({
|
|
37
|
+
USDTPrimeConverter: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
|
38
|
+
USDCPrimeConverter: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
39
|
+
WBTCPrimeConverter: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
|
|
40
|
+
WETHPrimeConverter: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
41
|
+
XVSVaultConverter: (await hardhat_1.ethers.getContract("XVS"))?.address,
|
|
42
|
+
}),
|
|
43
|
+
arbitrumsepolia: async () => ({
|
|
44
|
+
USDTPrimeConverter: "0xf3118a17863996B9F2A073c9A66Faaa664355cf8",
|
|
45
|
+
USDCPrimeConverter: "0x86f096B1D970990091319835faF3Ee011708eAe8",
|
|
46
|
+
WBTCPrimeConverter: "0xFb8d93FD3Cf18386a5564bb5619cD1FdB130dF7D",
|
|
47
|
+
WETHPrimeConverter: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
|
|
48
|
+
XVSVaultConverter: "0x877Dc896e7b13096D3827872e396927BbE704407",
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
return await networkBaseAssets[network]();
|
|
50
52
|
}
|
|
51
53
|
const MIN_AMOUNT_TO_CONVERT = (0, utils_1.parseUnits)("10", 18).toString();
|
|
52
|
-
const func = function (hre) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
const func = async function (hre) {
|
|
55
|
+
const { deployments, getNamedAccounts, network } = hre;
|
|
56
|
+
const { deploy } = deployments;
|
|
57
|
+
const { deployer } = await getNamedAccounts();
|
|
58
|
+
const networkName = network.name;
|
|
59
|
+
const baseAssets = await getBaseAssets(networkName);
|
|
60
|
+
const acmAddress = (await hardhat_1.ethers.getContract("AccessControlManager"))?.address;
|
|
61
|
+
const oracleAddress = (await hardhat_1.ethers.getContract("ResilientOracle"))?.address;
|
|
62
|
+
const proxyOwnerAddress = (await hardhat_1.ethers.getContract("NormalTimelock"))?.address || utils_2.multisigs[networkName];
|
|
63
|
+
const singleTokenConverterImp = await deploy("SingleTokenConverterImp", {
|
|
64
|
+
contract: "SingleTokenConverter",
|
|
65
|
+
from: deployer,
|
|
66
|
+
args: [],
|
|
67
|
+
log: true,
|
|
68
|
+
autoMine: true,
|
|
69
|
+
});
|
|
70
|
+
const SingleTokenConverterBeacon = await deploy("SingleTokenConverterBeacon", {
|
|
71
|
+
contract: "UpgradeableBeacon",
|
|
72
|
+
from: deployer,
|
|
73
|
+
args: [singleTokenConverterImp.address],
|
|
74
|
+
log: true,
|
|
75
|
+
autoMine: true,
|
|
76
|
+
});
|
|
77
|
+
const SingleTokenConverter = await hardhat_1.ethers.getContractFactory("SingleTokenConverter");
|
|
78
|
+
for (const singleTokenConverterName in baseAssets) {
|
|
79
|
+
const baseAsset = baseAssets[singleTokenConverterName];
|
|
80
|
+
let destinationAddress = (await hardhat_1.ethers.getContract("PrimeLiquidityProvider"))?.address;
|
|
81
|
+
if (baseAsset == (await hardhat_1.ethers.getContract("XVS"))?.address) {
|
|
82
|
+
destinationAddress = (await hardhat_1.ethers.getContract("XVSVaultTreasury"))?.address;
|
|
83
|
+
}
|
|
84
|
+
const args = [acmAddress, oracleAddress, destinationAddress, baseAsset, MIN_AMOUNT_TO_CONVERT];
|
|
85
|
+
const converterProxy = await deploy(singleTokenConverterName, {
|
|
72
86
|
from: deployer,
|
|
73
|
-
|
|
87
|
+
contract: "BeaconProxy",
|
|
88
|
+
args: [SingleTokenConverterBeacon.address, SingleTokenConverter.interface.encodeFunctionData("initialize", args)],
|
|
74
89
|
log: true,
|
|
75
90
|
autoMine: true,
|
|
76
91
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
destinationAddress = ((_f = (yield hardhat_1.ethers.getContractOrNull("XVSVaultTreasury"))) === null || _f === void 0 ? void 0 : _f.address) || utils_2.ADDRESS_ONE;
|
|
83
|
-
}
|
|
84
|
-
const args = [acmAddress, oracleAddress, destinationAddress, baseAsset, MIN_AMOUNT_TO_CONVERT];
|
|
85
|
-
const converterProxy = yield deploy(singleTokenConverterName, {
|
|
86
|
-
from: deployer,
|
|
87
|
-
contract: "BeaconProxy",
|
|
88
|
-
args: [SingleTokenConverterBeacon.address, SingleTokenConverter.interface.encodeFunctionData("initialize", args)],
|
|
89
|
-
log: true,
|
|
90
|
-
autoMine: true,
|
|
91
|
-
});
|
|
92
|
-
if (network.live) {
|
|
93
|
-
const converter = yield hardhat_1.ethers.getContractAt("SingleTokenConverter", converterProxy.address);
|
|
94
|
-
const tx = yield converter.transferOwnership(proxyOwnerAddress);
|
|
95
|
-
yield tx.wait();
|
|
96
|
-
console.log(`Transferred ownership of ${singleTokenConverterName} to Timelock: ` + proxyOwnerAddress);
|
|
97
|
-
}
|
|
92
|
+
if (network.live) {
|
|
93
|
+
const converter = await hardhat_1.ethers.getContractAt("SingleTokenConverter", converterProxy.address);
|
|
94
|
+
const tx = await converter.transferOwnership(proxyOwnerAddress);
|
|
95
|
+
await tx.wait();
|
|
96
|
+
console.log(`Transferred ownership of ${singleTokenConverterName} to Timelock: ` + proxyOwnerAddress);
|
|
98
97
|
}
|
|
99
|
-
}
|
|
98
|
+
}
|
|
100
99
|
};
|
|
101
100
|
func.tags = ["SingleTokenConverter", "Converters"];
|
|
102
101
|
exports.default = func;
|