@venusprotocol/venus-protocol 6.1.0-dev.2 → 6.1.0-dev.3

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.
@@ -0,0 +1,21 @@
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 deploy("XVS", {
10
+ from: deployer,
11
+ args: [deployer],
12
+ log: true,
13
+ autoMine: true,
14
+ });
15
+ };
16
+
17
+ func.tags = ["xvs"];
18
+
19
+ func.skip = async (hre: HardhatRuntimeEnvironment) => hre.network.live;
20
+
21
+ export default func;
@@ -0,0 +1,53 @@
1
+ import { ethers } from "hardhat";
2
+ import { DeployFunction } from "hardhat-deploy/types";
3
+ import { HardhatRuntimeEnvironment } from "hardhat/types";
4
+
5
+ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
6
+ const { deployments, getNamedAccounts } = hre;
7
+ const { deploy } = deployments;
8
+ const { deployer } = await getNamedAccounts();
9
+
10
+ const xvsVaultDeployment = await deploy("XVSVault", {
11
+ from: deployer,
12
+ args: [],
13
+ log: true,
14
+ autoMine: true,
15
+ });
16
+
17
+ const xvsVaultAddress = xvsVaultDeployment.address;
18
+
19
+ const xvsVaultProxyDeployment = await deploy("XVSVaultProxy", {
20
+ from: deployer,
21
+ args: [],
22
+ log: true,
23
+ autoMine: true,
24
+ });
25
+
26
+ const xvsVaultProxyAddress = xvsVaultProxyDeployment.address;
27
+
28
+ await deploy("XVSStore", {
29
+ from: deployer,
30
+ args: [],
31
+ log: true,
32
+ autoMine: true,
33
+ });
34
+
35
+ const xvsVault = await ethers.getContract("XVSVault");
36
+ const xvsStore = await ethers.getContract("XVSStore");
37
+ const xvsVaultProxy = await ethers.getContract("XVSVaultProxy");
38
+
39
+ // Become Implementation of XVSVaultProxy
40
+ const tx = await xvsVaultProxy._setPendingImplementation(xvsVaultAddress);
41
+ await tx.wait();
42
+
43
+ await xvsVault._become(xvsVaultProxyAddress);
44
+ await tx.wait();
45
+
46
+ // Set new owner to xvs store
47
+ await xvsStore.setNewOwner(xvsVaultProxyAddress);
48
+ await tx.wait();
49
+ };
50
+
51
+ func.tags = ["xvs-vault"];
52
+
53
+ export default func;
@@ -0,0 +1,60 @@
1
+ import { ethers } from "hardhat";
2
+ import { DeployFunction } from "hardhat-deploy/types";
3
+ import { HardhatRuntimeEnvironment } from "hardhat/types";
4
+
5
+ interface AdminAccounts {
6
+ [key: string]: string;
7
+ }
8
+ const adminAccount: AdminAccounts = {
9
+ sepolia: "0x94fa6078b6b8a26f0b6edffbe6501b22a10470fb", // SEPOLIA MULTISIG
10
+ ethereum: "0x285960C5B22fD66A736C7136967A3eB15e93CC67", // ETHEREUM MULTISIG
11
+ };
12
+
13
+ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
14
+ const { getNamedAccounts } = hre;
15
+ const { deployer } = await getNamedAccounts();
16
+
17
+ const accessControlManager = await ethers.getContract("AccessControlManager");
18
+
19
+ const xvs = await ethers.getContract("XVS");
20
+ const xvsVaultProxyDeployment = await ethers.getContract("XVSVaultProxy");
21
+ const xvsStoreDeployment = await ethers.getContract("XVSStore");
22
+
23
+ const xvsVaultProxy = await ethers.getContractAt("XVSVault", xvsVaultProxyDeployment.address);
24
+
25
+ let txn = await xvsVaultProxy.setXvsStore(xvs.address, xvsStoreDeployment.address);
26
+ await txn.wait();
27
+
28
+ txn = await xvsVaultProxy.setAccessControl(accessControlManager.address);
29
+ await txn.wait();
30
+
31
+ if (!hre.network.live) {
32
+ const tx = await accessControlManager.giveCallPermission(
33
+ ethers.constants.AddressZero,
34
+ "add(address,uint256,address,uint256,uint256)",
35
+ deployer,
36
+ );
37
+ await tx.wait();
38
+
39
+ // Add token pool to xvs vault
40
+ const allocPoint = 100;
41
+ const token = xvs.address;
42
+ const rewardToken = xvs.address;
43
+ const rewardPerBlock = "61805555555555555";
44
+ const lockPeriod = 604800;
45
+
46
+ await xvsVaultProxy.add(rewardToken, allocPoint, token, rewardPerBlock, lockPeriod);
47
+ } else {
48
+ const owner = adminAccount[hre.network.name];
49
+ console.log("Please accept ownership of vault and store");
50
+ txn = await xvsVaultProxyDeployment._setPendingAdmin(owner);
51
+ await txn.wait();
52
+
53
+ txn = await xvsStoreDeployment.setPendingAdmin(owner);
54
+ await txn.wait();
55
+ }
56
+ };
57
+
58
+ func.tags = ["xvs-vault"];
59
+
60
+ export default func;