@venusprotocol/venus-protocol 9.0.0-dev.4 → 9.0.0-dev.5

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.
@@ -29,6 +29,6 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
29
29
  });
30
30
  };
31
31
 
32
- func.tags = ["deploy-vault"];
32
+ func.tags = ["xvs-vault"];
33
33
 
34
34
  export default func;
@@ -45,17 +45,23 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
45
45
  const xvsVaultProxyDeployment = await ethers.getContract("XVSVaultProxy");
46
46
  const xvsStoreDeployment = await ethers.getContract("XVSStore");
47
47
 
48
- const xvsVaultProxy = await ethers.getContractAt("XVSVault", xvsVaultProxyDeployment.address);
48
+ let xvsVault = await ethers.getContract("XVSVaultProxy_Implementation");
49
+ await xvsVaultProxyDeployment._setPendingImplementation(xvsVault.address);
50
+ await xvsVault._become(xvsVaultProxyDeployment.address);
49
51
 
50
- let txn = await xvsVaultProxy.initializeTimeManager(isTimeBased, blocksPerYear[network.name]);
52
+ xvsVault = await ethers.getContractAt("XVSVault", xvsVaultProxyDeployment.address);
53
+
54
+ let txn = await xvsVault.initializeTimeManager(isTimeBased, blocksPerYear[network.name]);
51
55
  await txn.wait();
52
56
 
53
- txn = await xvsVaultProxy.setXvsStore(xvs.address, xvsStoreDeployment.address);
57
+ txn = await xvsVault.setXvsStore(xvs.address, xvsStoreDeployment.address);
54
58
  await txn.wait();
55
59
 
56
- txn = await xvsVaultProxy.setAccessControl(accessControlManager.address);
60
+ txn = await xvsVault.setAccessControl(accessControlManager.address);
57
61
  await txn.wait();
58
62
 
63
+ await xvsStoreDeployment.setNewOwner(xvsVaultProxyDeployment.address);
64
+
59
65
  if (!hre.network.live) {
60
66
  const tx = await accessControlManager.giveCallPermission(
61
67
  ethers.constants.AddressZero,
@@ -71,7 +77,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
71
77
  const rewardPerBlock = "61805555555555555";
72
78
  const lockPeriod = 604800;
73
79
 
74
- await xvsVaultProxy.add(rewardToken, allocPoint, token, rewardPerBlock, lockPeriod);
80
+ await xvsVault.add(rewardToken, allocPoint, token, rewardPerBlock, lockPeriod);
75
81
  } else {
76
82
  const owner = adminAccount[hre.network.name];
77
83
  console.log("Please accept ownership of vault and store");
@@ -24,5 +24,5 @@ const func = async function (hre) {
24
24
  autoMine: true,
25
25
  });
26
26
  };
27
- func.tags = ["deploy-vault"];
27
+ func.tags = ["xvs-vault"];
28
28
  exports.default = func;
@@ -29,13 +29,17 @@ const func = async function (hre) {
29
29
  const xvs = await hardhat_1.ethers.getContract("XVS");
30
30
  const xvsVaultProxyDeployment = await hardhat_1.ethers.getContract("XVSVaultProxy");
31
31
  const xvsStoreDeployment = await hardhat_1.ethers.getContract("XVSStore");
32
- const xvsVaultProxy = await hardhat_1.ethers.getContractAt("XVSVault", xvsVaultProxyDeployment.address);
33
- let txn = await xvsVaultProxy.initializeTimeManager(isTimeBased, blocksPerYear[hardhat_1.network.name]);
32
+ let xvsVault = await hardhat_1.ethers.getContract("XVSVaultProxy_Implementation");
33
+ await xvsVaultProxyDeployment._setPendingImplementation(xvsVault.address);
34
+ await xvsVault._become(xvsVaultProxyDeployment.address);
35
+ xvsVault = await hardhat_1.ethers.getContractAt("XVSVault", xvsVaultProxyDeployment.address);
36
+ let txn = await xvsVault.initializeTimeManager(isTimeBased, blocksPerYear[hardhat_1.network.name]);
34
37
  await txn.wait();
35
- txn = await xvsVaultProxy.setXvsStore(xvs.address, xvsStoreDeployment.address);
38
+ txn = await xvsVault.setXvsStore(xvs.address, xvsStoreDeployment.address);
36
39
  await txn.wait();
37
- txn = await xvsVaultProxy.setAccessControl(accessControlManager.address);
40
+ txn = await xvsVault.setAccessControl(accessControlManager.address);
38
41
  await txn.wait();
42
+ await xvsStoreDeployment.setNewOwner(xvsVaultProxyDeployment.address);
39
43
  if (!hre.network.live) {
40
44
  const tx = await accessControlManager.giveCallPermission(hardhat_1.ethers.constants.AddressZero, "add(address,uint256,address,uint256,uint256)", deployer);
41
45
  await tx.wait();
@@ -45,7 +49,7 @@ const func = async function (hre) {
45
49
  const rewardToken = xvs.address;
46
50
  const rewardPerBlock = "61805555555555555";
47
51
  const lockPeriod = 604800;
48
- await xvsVaultProxy.add(rewardToken, allocPoint, token, rewardPerBlock, lockPeriod);
52
+ await xvsVault.add(rewardToken, allocPoint, token, rewardPerBlock, lockPeriod);
49
53
  }
50
54
  else {
51
55
  const owner = adminAccount[hre.network.name];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venusprotocol/venus-protocol",
3
- "version": "9.0.0-dev.4",
3
+ "version": "9.0.0-dev.5",
4
4
  "description": "The Venus Money Market",
5
5
  "repository": "git@github.com:VenusProtocol/venus-protocol.git",
6
6
  "author": "Venus",
@@ -1,21 +0,0 @@
1
- import { DeployFunction } from "hardhat-deploy/types";
2
- import { HardhatRuntimeEnvironment } from "hardhat/types";
3
-
4
- const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5
- const { deployments, getNamedAccounts } = hre;
6
- const { deploy } = deployments;
7
- const { deployer } = await getNamedAccounts();
8
-
9
- await deployments.delete("XVSVault");
10
-
11
- await deploy("XVSVault", {
12
- from: deployer,
13
- args: [],
14
- log: true,
15
- autoMine: true,
16
- });
17
- };
18
-
19
- func.tags = ["xvs-vault"];
20
-
21
- export default func;
@@ -1,19 +0,0 @@
1
- import { ethers } from "hardhat";
2
- import { DeployFunction } from "hardhat-deploy/types";
3
-
4
- const func: DeployFunction = async function () {
5
- const xvsVault = await ethers.getContract("XVSVaultProxy_Implementation");
6
- const xvsStore = await ethers.getContract("XVSStore");
7
- const xvsVaultProxy = await ethers.getContract("XVSVaultProxy");
8
-
9
- // Become Implementation of XVSVaultProxy
10
- await xvsVaultProxy._setPendingImplementation(xvsVault.address);
11
- await xvsVault._become(xvsVaultProxy.address);
12
-
13
- await xvsStore.setNewOwner(xvsVaultProxy.address);
14
- };
15
-
16
- func.tags = ["configure-xvs-vault"];
17
- func.id = "configure_xvs_vaults"; // id required to prevent re-execution
18
-
19
- export default func;
@@ -1,3 +0,0 @@
1
- import { DeployFunction } from "hardhat-deploy/types";
2
- declare const func: DeployFunction;
3
- export default func;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const func = async function (hre) {
4
- const { deployments, getNamedAccounts } = hre;
5
- const { deploy } = deployments;
6
- const { deployer } = await getNamedAccounts();
7
- await deployments.delete("XVSVault");
8
- await deploy("XVSVault", {
9
- from: deployer,
10
- args: [],
11
- log: true,
12
- autoMine: true,
13
- });
14
- };
15
- func.tags = ["xvs-vault"];
16
- exports.default = func;
@@ -1,3 +0,0 @@
1
- import { DeployFunction } from "hardhat-deploy/types";
2
- declare const func: DeployFunction;
3
- export default func;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const hardhat_1 = require("hardhat");
4
- const func = async function () {
5
- const xvsVault = await hardhat_1.ethers.getContract("XVSVaultProxy_Implementation");
6
- const xvsStore = await hardhat_1.ethers.getContract("XVSStore");
7
- const xvsVaultProxy = await hardhat_1.ethers.getContract("XVSVaultProxy");
8
- // Become Implementation of XVSVaultProxy
9
- await xvsVaultProxy._setPendingImplementation(xvsVault.address);
10
- await xvsVault._become(xvsVaultProxy.address);
11
- await xvsStore.setNewOwner(xvsVaultProxy.address);
12
- };
13
- func.tags = ["configure-xvs-vault"];
14
- func.id = "configure_xvs_vaults"; // id required to prevent re-execution
15
- exports.default = func;