@venusprotocol/governance-contracts 1.0.1-dev.4 → 1.0.1-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.
@@ -0,0 +1,4 @@
1
+ import { DeployFunction } from "hardhat-deploy/types";
2
+ declare const func: DeployFunction;
3
+ export default func;
4
+ //# sourceMappingURL=001-access-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"001-access-control.d.ts","sourceRoot":"","sources":["../../deploy/001-access-control.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,QAAA,MAAM,IAAI,EAAE,cAsBX,CAAC;AAIF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,36 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const hardhat_1 = require("hardhat");
13
+ const deploymentUtils_1 = require("./helpers/deploymentUtils");
14
+ const func = function (hre) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ const { deployments, getNamedAccounts } = hre;
17
+ const { deploy } = deployments;
18
+ const { deployer } = yield getNamedAccounts();
19
+ const acmDeployment = yield deploy("AccessControlManager", {
20
+ from: deployer,
21
+ args: [],
22
+ log: true,
23
+ autoMine: true,
24
+ });
25
+ const acm = yield hardhat_1.ethers.getContractAt("AccessControlManager", acmDeployment.address);
26
+ const networkName = hre.network.name;
27
+ const adminAccount = deploymentUtils_1.acmAdminAccount[networkName];
28
+ console.log(`Granting DEFAULT_ADMIN_ROLE to ${adminAccount} for ${networkName} network`);
29
+ yield acm.grantRole(acm.DEFAULT_ADMIN_ROLE(), deploymentUtils_1.acmAdminAccount[hre.network.name]);
30
+ console.log(`Renouncing DEFAULT_ADMIN_ROLE from deployer (${deployer}) for ${networkName} network`);
31
+ yield acm.renounceRole(acm.DEFAULT_ADMIN_ROLE(), deployer);
32
+ });
33
+ };
34
+ func.tags = ["AccessControl"];
35
+ exports.default = func;
36
+ //# sourceMappingURL=001-access-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"001-access-control.js","sourceRoot":"","sources":["../../deploy/001-access-control.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qCAAiC;AAIjC,+DAA4D;AAE5D,MAAM,IAAI,GAAmB,UAAgB,GAA8B;;QACzE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,GAAG,CAAC;QAC9C,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;QAC/B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,gBAAgB,EAAE,CAAC;QAE9C,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,sBAAsB,EAAE;YACzD,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,EAAE;YACR,GAAG,EAAE,IAAI;YACT,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QAEH,MAAM,GAAG,GAAG,MAAM,gBAAM,CAAC,aAAa,CAAC,sBAAsB,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAEtF,MAAM,WAAW,GAAW,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;QAC7C,MAAM,YAAY,GAAW,iCAAe,CAAC,WAAW,CAAC,CAAC;QAE1D,OAAO,CAAC,GAAG,CAAC,kCAAkC,YAAY,QAAQ,WAAW,UAAU,CAAC,CAAC;QACzF,MAAM,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,iCAAe,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAEjF,OAAO,CAAC,GAAG,CAAC,gDAAgD,QAAQ,SAAS,WAAW,UAAU,CAAC,CAAC;QACpG,MAAM,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;CAAA,CAAC;AAEF,IAAI,CAAC,IAAI,GAAG,CAAC,eAAe,CAAC,CAAC;AAE9B,kBAAe,IAAI,CAAC"}
@@ -0,0 +1,6 @@
1
+ interface AdminAccounts {
2
+ [key: string]: string;
3
+ }
4
+ export declare const acmAdminAccount: AdminAccounts;
5
+ export {};
6
+ //# sourceMappingURL=deploymentUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploymentUtils.d.ts","sourceRoot":"","sources":["../../../deploy/helpers/deploymentUtils.ts"],"names":[],"mappings":"AAAA,UAAU,aAAa;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,EAAE,aAK7B,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.acmAdminAccount = void 0;
4
+ exports.acmAdminAccount = {
5
+ bsctestnet: "0xce10739590001705F7FF231611ba4A48B2820327",
6
+ bscmainnet: "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396",
7
+ sepolia: "0x94fa6078b6b8a26f0b6edffbe6501b22a10470fb",
8
+ ethereum: "",
9
+ };
10
+ //# sourceMappingURL=deploymentUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploymentUtils.js","sourceRoot":"","sources":["../../../deploy/helpers/deploymentUtils.ts"],"names":[],"mappings":";;;AAIa,QAAA,eAAe,GAAkB;IAC5C,UAAU,EAAE,4CAA4C;IACxD,UAAU,EAAE,4CAA4C;IACxD,OAAO,EAAE,4CAA4C;IACrD,QAAQ,EAAE,EAAE;CACb,CAAC"}
@@ -0,0 +1,13 @@
1
+ import "@nomicfoundation/hardhat-chai-matchers";
2
+ import "@nomicfoundation/hardhat-toolbox";
3
+ import "@nomiclabs/hardhat-ethers";
4
+ import "@nomiclabs/hardhat-etherscan";
5
+ import "@openzeppelin/hardhat-upgrades";
6
+ import "@typechain/hardhat";
7
+ import "hardhat-deploy";
8
+ import { HardhatUserConfig } from "hardhat/config";
9
+ import "solidity-coverage";
10
+ import "solidity-docgen";
11
+ declare const config: HardhatUserConfig;
12
+ export default config;
13
+ //# sourceMappingURL=hardhat.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hardhat.config.d.ts","sourceRoot":"","sources":["../hardhat.config.ts"],"names":[],"mappings":"AAAA,OAAO,wCAAwC,CAAC;AAChD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AACtC,OAAO,gCAAgC,CAAC;AACxC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAQ,MAAM,gBAAgB,CAAC;AACzD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AAezB,QAAA,MAAM,MAAM,EAAE,iBA6Fb,CAAC;AAuBF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,144 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ require("@nomicfoundation/hardhat-chai-matchers");
13
+ require("@nomicfoundation/hardhat-toolbox");
14
+ require("@nomiclabs/hardhat-ethers");
15
+ require("@nomiclabs/hardhat-etherscan");
16
+ require("@openzeppelin/hardhat-upgrades");
17
+ require("@typechain/hardhat");
18
+ require("hardhat-deploy");
19
+ const config_1 = require("hardhat/config");
20
+ require("solidity-coverage");
21
+ require("solidity-docgen");
22
+ require("dotenv").config();
23
+ const BSCSCAN_API_KEY = process.env.BSCSCAN_API_KEY;
24
+ const DEPLOYER_PRIVATE_KEY = process.env.DEPLOYER_PRIVATE_KEY;
25
+ (0, config_1.task)("accounts", "Prints the list of accounts", (taskArgs, hre) => __awaiter(void 0, void 0, void 0, function* () {
26
+ const accounts = yield hre.ethers.getSigners();
27
+ for (const account of accounts) {
28
+ console.log(account.address);
29
+ }
30
+ }));
31
+ const config = {
32
+ defaultNetwork: "hardhat",
33
+ solidity: {
34
+ compilers: [
35
+ {
36
+ version: "0.5.16",
37
+ settings: {
38
+ optimizer: {
39
+ enabled: true,
40
+ runs: 200,
41
+ },
42
+ outputSelection: {
43
+ "*": {
44
+ "*": ["storageLayout"],
45
+ },
46
+ },
47
+ },
48
+ },
49
+ {
50
+ version: "0.8.13",
51
+ settings: {
52
+ optimizer: {
53
+ enabled: true,
54
+ runs: 10000,
55
+ },
56
+ outputSelection: {
57
+ "*": {
58
+ "*": ["storageLayout"],
59
+ },
60
+ },
61
+ },
62
+ },
63
+ ],
64
+ },
65
+ networks: {
66
+ hardhat: isFork(),
67
+ bsctestnet: {
68
+ url: process.env.RPC_URL || "https://data-seed-prebsc-1-s1.binance.org:8545",
69
+ chainId: 97,
70
+ accounts: {
71
+ mnemonic: process.env.MNEMONIC || "",
72
+ },
73
+ gasPrice: 10000000000,
74
+ gasMultiplier: 10,
75
+ timeout: 12000000,
76
+ },
77
+ bscmainnet: {
78
+ url: process.env.RPC_URL || "https://bsc-dataseed.binance.org/",
79
+ accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
80
+ },
81
+ sepolia: {
82
+ url: process.env.RPC_URL || "https://rpc.notadegen.com/eth/sepolia",
83
+ chainId: 11155111,
84
+ live: true,
85
+ gasPrice: 20000000000,
86
+ accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [],
87
+ },
88
+ },
89
+ etherscan: {
90
+ apiKey: BSCSCAN_API_KEY,
91
+ },
92
+ paths: {
93
+ sources: "./contracts",
94
+ tests: "./tests",
95
+ cache: "./cache",
96
+ artifacts: "./artifacts",
97
+ },
98
+ mocha: {
99
+ timeout: 200000000,
100
+ },
101
+ typechain: {
102
+ outDir: "typechain",
103
+ target: "ethers-v5",
104
+ },
105
+ namedAccounts: {
106
+ deployer: {
107
+ default: 0,
108
+ },
109
+ },
110
+ external: {
111
+ contracts: [
112
+ {
113
+ artifacts: "./node_modules/@venusprotocol/venus-protocol/artifacts",
114
+ },
115
+ ],
116
+ },
117
+ docgen: {
118
+ outputDir: "./docs",
119
+ pages: "files",
120
+ templates: "docgen-templates",
121
+ },
122
+ };
123
+ function isFork() {
124
+ return process.env.FORK_MAINNET === "true"
125
+ ? {
126
+ allowUnlimitedContractSize: false,
127
+ loggingEnabled: false,
128
+ forking: {
129
+ url: `${process.env.BSC_ARCHIVE_NODE}`,
130
+ blockNumber: 21068448,
131
+ },
132
+ accounts: {
133
+ accountsBalance: "1000000000000000000",
134
+ },
135
+ live: false,
136
+ }
137
+ : {
138
+ allowUnlimitedContractSize: true,
139
+ loggingEnabled: false,
140
+ live: false,
141
+ };
142
+ }
143
+ exports.default = config;
144
+ //# sourceMappingURL=hardhat.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hardhat.config.js","sourceRoot":"","sources":["../hardhat.config.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,kDAAgD;AAChD,4CAA0C;AAC1C,qCAAmC;AACnC,wCAAsC;AAC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AC,YAAY,KAAK,MAAM;QACxC,CAAC,CAAC;YACE,0BAA0B,EAAE,KAAK;YACjC,cAAc,EAAE,KAAK;YACrB,OAAO,EAAE;gBACP,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE;gBACtC,WAAW,EAAE,QAAQ;aACtB;YACD,QAAQ,EAAE;gBACR,eAAe,EAAE,qBAAqB;aACvC;YACD,IAAI,EAAE,KAAK;SACZ;QACH,CAAC,CAAC;YACE,0BAA0B,EAAE,IAAI;YAChC,cAAc,EAAE,KAAK;YACrB,IAAI,EAAE,KAAK;SACZ,CAAC;AACR,CAAC;AAED,kBAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@venusprotocol/governance-contracts",
3
3
  "description": "",
4
- "version": "1.0.1-dev.4",
4
+ "version": "1.0.1-dev.5",
5
5
  "author": "",
6
6
  "files": [
7
7
  "artifacts",
8
- "deploy",
8
+ "dist",
9
9
  "deployments",
10
10
  "contracts"
11
11
  ],
@@ -20,12 +20,6 @@
20
20
  "typescript",
21
21
  "typechain"
22
22
  ],
23
- "exports": {
24
- "deploy": "./dist/deploy",
25
- "artifacts": "./artifacts",
26
- "contracts": "./contracts",
27
- "deployments": "./deployments"
28
- },
29
23
  "packageManager": "yarn@3.2.0",
30
24
  "publishConfig": {
31
25
  "access": "public"
@@ -1,33 +0,0 @@
1
- import { ethers } from "hardhat";
2
- import { DeployFunction } from "hardhat-deploy/types";
3
- import { HardhatRuntimeEnvironment } from "hardhat/types";
4
-
5
- import { acmAdminAccount } from "./helpers/deploymentUtils";
6
-
7
- const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
8
- const { deployments, getNamedAccounts } = hre;
9
- const { deploy } = deployments;
10
- const { deployer } = await getNamedAccounts();
11
-
12
- const acmDeployment = await deploy("AccessControlManager", {
13
- from: deployer,
14
- args: [],
15
- log: true,
16
- autoMine: true,
17
- });
18
-
19
- const acm = await ethers.getContractAt("AccessControlManager", acmDeployment.address);
20
-
21
- const networkName: string = hre.network.name;
22
- const adminAccount: string = acmAdminAccount[networkName];
23
-
24
- console.log(`Granting DEFAULT_ADMIN_ROLE to ${adminAccount} for ${networkName} network`);
25
- await acm.grantRole(acm.DEFAULT_ADMIN_ROLE(), acmAdminAccount[hre.network.name]);
26
-
27
- console.log(`Renouncing DEFAULT_ADMIN_ROLE from deployer (${deployer}) for ${networkName} network`);
28
- await acm.renounceRole(acm.DEFAULT_ADMIN_ROLE(), deployer);
29
- };
30
-
31
- func.tags = ["AccessControl"];
32
-
33
- export default func;
@@ -1,10 +0,0 @@
1
- interface AdminAccounts {
2
- [key: string]: string;
3
- }
4
-
5
- export const acmAdminAccount: AdminAccounts = {
6
- bsctestnet: "0xce10739590001705F7FF231611ba4A48B2820327", // NORMAL TIMELOCK
7
- bscmainnet: "0x939bD8d64c0A9583A7Dcea9933f7b21697ab6396", // NORMAL TIMELOCK
8
- sepolia: "0x94fa6078b6b8a26f0b6edffbe6501b22a10470fb", // SEPOLIA MULTISIG
9
- ethereum: "", // TODO: add Ethereum MULTISIG once it is deployed
10
- };