@venusprotocol/oracle 1.6.11-dev.5 → 1.6.11-dev.7
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/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol/AggregatorInterface.dbg.json +4 -0
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol/AggregatorInterface.json +138 -0
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.dbg.json +4 -0
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.json +249 -0
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol/AggregatorV3Interface.dbg.json +4 -0
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol/AggregatorV3Interface.json +122 -0
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.json +215 -0
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.json +183 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json +297 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.json +194 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.json +233 -0
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +30 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +30 -0
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.json +10 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.json +115 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.json +76 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.json +24 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.json +63 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.json +10 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.json +24 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlManager.sol/AccessControlManager.dbg.json +4 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlManager.sol/AccessControlManager.json +369 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol/AccessControlledV8.dbg.json +4 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol/AccessControlledV8.json +181 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.dbg.json +4 -0
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.json +282 -0
- package/artifacts/build-info/0fa2b75b56480052b72f8190a534e534.json +1 -0
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.dbg.json +4 -0
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json +617 -0
- package/artifacts/contracts/interfaces/FeedRegistryInterface.sol/FeedRegistryInterface.dbg.json +4 -0
- package/artifacts/contracts/interfaces/FeedRegistryInterface.sol/FeedRegistryInterface.json +79 -0
- package/artifacts/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.dbg.json +4 -0
- package/artifacts/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.json +40 -0
- package/artifacts/contracts/interfaces/OracleInterface.sol/OracleInterface.dbg.json +4 -0
- package/artifacts/contracts/interfaces/OracleInterface.sol/OracleInterface.json +30 -0
- package/artifacts/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.dbg.json +4 -0
- package/artifacts/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.json +43 -0
- package/artifacts/contracts/interfaces/OracleInterface.sol/TwapInterface.dbg.json +4 -0
- package/artifacts/contracts/interfaces/OracleInterface.sol/TwapInterface.json +49 -0
- package/artifacts/contracts/interfaces/PublicResolverInterface.sol/PublicResolverInterface.dbg.json +4 -0
- package/artifacts/contracts/interfaces/PublicResolverInterface.sol/PublicResolverInterface.json +30 -0
- package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.dbg.json +4 -0
- package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.json +545 -0
- package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.dbg.json +4 -0
- package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.json +446 -0
- package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.dbg.json +4 -0
- package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.json +10 -0
- package/artifacts/contracts/interfaces/SIDRegistryInterface.sol/SIDRegistryInterface.dbg.json +4 -0
- package/artifacts/contracts/interfaces/SIDRegistryInterface.sol/SIDRegistryInterface.json +30 -0
- package/artifacts/contracts/interfaces/VBep20Interface.sol/VBep20Interface.dbg.json +4 -0
- package/artifacts/contracts/interfaces/VBep20Interface.sol/VBep20Interface.json +246 -0
- package/artifacts/contracts/libraries/PancakeLibrary.sol/FixedPoint.dbg.json +4 -0
- package/artifacts/contracts/libraries/PancakeLibrary.sol/FixedPoint.json +10 -0
- package/artifacts/contracts/libraries/PancakeLibrary.sol/IPancakePair.dbg.json +4 -0
- package/artifacts/contracts/libraries/PancakeLibrary.sol/IPancakePair.json +60 -0
- package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.dbg.json +4 -0
- package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.json +10 -0
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.dbg.json +4 -0
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.json +342 -0
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.dbg.json +4 -0
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.json +392 -0
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.dbg.json +4 -0
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.json +468 -0
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.dbg.json +4 -0
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.json +439 -0
- package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.dbg.json +4 -0
- package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.json +663 -0
- package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.dbg.json +4 -0
- package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.json +116 -0
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.dbg.json +4 -0
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.json +144 -0
- package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.dbg.json +4 -0
- package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.json +144 -0
- package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.dbg.json +4 -0
- package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.json +163 -0
- package/artifacts/contracts/oracles/mocks/MockTwapOracle.sol/MockTwapOracle.dbg.json +4 -0
- package/artifacts/contracts/oracles/mocks/MockTwapOracle.sol/MockTwapOracle.json +163 -0
- package/artifacts/contracts/test/AccessControlManager.sol/AccessControlManagerScenario.dbg.json +4 -0
- package/artifacts/contracts/test/AccessControlManager.sol/AccessControlManagerScenario.json +364 -0
- package/artifacts/contracts/test/BEP20Harness.sol/BEP20Harness.dbg.json +4 -0
- package/artifacts/contracts/test/BEP20Harness.sol/BEP20Harness.json +328 -0
- package/artifacts/contracts/test/MockPyth.sol/MockPyth.dbg.json +4 -0
- package/artifacts/contracts/test/MockPyth.sol/MockPyth.json +684 -0
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.dbg.json +4 -0
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.json +95 -0
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.dbg.json +4 -0
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.json +72 -0
- package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.dbg.json +4 -0
- package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.json +306 -0
- package/artifacts/contracts/test/PancakePairHarness.sol/Math.dbg.json +4 -0
- package/artifacts/contracts/test/PancakePairHarness.sol/Math.json +10 -0
- package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.dbg.json +4 -0
- package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.json +158 -0
- package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.dbg.json +4 -0
- package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.json +10 -0
- package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.dbg.json +4 -0
- package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.json +346 -0
- package/contracts/test/BEP20Harness.sol +4 -0
- package/dist/deploy/1-deploy-oracles.d.ts +5 -0
- package/dist/deploy/1-deploy-oracles.d.ts.map +1 -0
- package/dist/deploy/1-deploy-oracles.js +186 -0
- package/dist/deploy/1-deploy-oracles.js.map +1 -0
- package/dist/deploy/2-configure-feeds.d.ts +15 -0
- package/dist/deploy/2-configure-feeds.d.ts.map +1 -0
- package/dist/deploy/2-configure-feeds.js +300 -0
- package/dist/deploy/2-configure-feeds.js.map +1 -0
- package/dist/hardhat.config.d.ts +13 -0
- package/dist/hardhat.config.d.ts.map +1 -0
- package/dist/hardhat.config.js +142 -0
- package/dist/hardhat.config.js.map +1 -0
- package/package.json +2 -14
- package/deploy/1-deploy-oracles.ts +0 -195
- package/deploy/2-configure-feeds.ts +0 -324
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
require("module-alias/register");
|
|
27
|
+
require("@nomiclabs/hardhat-etherscan");
|
|
28
|
+
require("@nomiclabs/hardhat-waffle");
|
|
29
|
+
require("@openzeppelin/hardhat-upgrades");
|
|
30
|
+
require("@typechain/hardhat");
|
|
31
|
+
const dotenv = __importStar(require("dotenv"));
|
|
32
|
+
require("hardhat-deploy");
|
|
33
|
+
require("hardhat-gas-reporter");
|
|
34
|
+
require("solidity-coverage");
|
|
35
|
+
require("solidity-docgen");
|
|
36
|
+
dotenv.config();
|
|
37
|
+
function isFork() {
|
|
38
|
+
return process.env.FORK_MAINNET === "true"
|
|
39
|
+
? {
|
|
40
|
+
allowUnlimitedContractSize: false,
|
|
41
|
+
loggingEnabled: false,
|
|
42
|
+
forking: {
|
|
43
|
+
url: process.env.QUICK_NODE_URL || "",
|
|
44
|
+
blockNumber: 26349263,
|
|
45
|
+
},
|
|
46
|
+
accounts: {
|
|
47
|
+
accountsBalance: "1000000000000000000",
|
|
48
|
+
},
|
|
49
|
+
live: false,
|
|
50
|
+
}
|
|
51
|
+
: {
|
|
52
|
+
allowUnlimitedContractSize: true,
|
|
53
|
+
loggingEnabled: false,
|
|
54
|
+
live: false,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const config = {
|
|
58
|
+
solidity: {
|
|
59
|
+
compilers: [
|
|
60
|
+
{
|
|
61
|
+
version: "0.8.13",
|
|
62
|
+
settings: {
|
|
63
|
+
optimizer: {
|
|
64
|
+
enabled: true,
|
|
65
|
+
details: {
|
|
66
|
+
yul: !process.env.CI,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
outputSelection: {
|
|
70
|
+
"*": {
|
|
71
|
+
"*": ["storageLayout"],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
version: "0.6.6",
|
|
78
|
+
settings: {
|
|
79
|
+
optimizer: {
|
|
80
|
+
enabled: true,
|
|
81
|
+
details: {
|
|
82
|
+
yul: !process.env.CI,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
outputSelection: {
|
|
86
|
+
"*": {
|
|
87
|
+
"*": ["storageLayout"],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
networks: {
|
|
95
|
+
hardhat: isFork(),
|
|
96
|
+
development: {
|
|
97
|
+
url: "http://127.0.0.1:8545/",
|
|
98
|
+
chainId: 31337,
|
|
99
|
+
live: false,
|
|
100
|
+
},
|
|
101
|
+
bsctestnet: {
|
|
102
|
+
url: "https://bsc-testnet.public.blastapi.io",
|
|
103
|
+
chainId: 97,
|
|
104
|
+
live: true,
|
|
105
|
+
gasPrice: 20000000000,
|
|
106
|
+
accounts: {
|
|
107
|
+
mnemonic: process.env.MNEMONIC || "",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
bscmainnet: {
|
|
111
|
+
url: "https://bsc-dataseed1.ninicoin.io",
|
|
112
|
+
chainId: 56,
|
|
113
|
+
live: true,
|
|
114
|
+
accounts: {
|
|
115
|
+
mnemonic: process.env.MNEMONIC || "",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
gasReporter: {
|
|
120
|
+
enabled: process.env.REPORT_GAS !== undefined,
|
|
121
|
+
currency: "USD",
|
|
122
|
+
},
|
|
123
|
+
etherscan: {
|
|
124
|
+
apiKey: {
|
|
125
|
+
bscmainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
|
|
126
|
+
bsctestnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY",
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
paths: {
|
|
130
|
+
tests: "./test",
|
|
131
|
+
},
|
|
132
|
+
namedAccounts: {
|
|
133
|
+
deployer: 0,
|
|
134
|
+
},
|
|
135
|
+
docgen: {
|
|
136
|
+
outputDir: "./docs",
|
|
137
|
+
pages: "files",
|
|
138
|
+
templates: "./docgen-templates",
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
exports.default = config;
|
|
142
|
+
//# sourceMappingURL=hardhat.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardhat.config.js","sourceRoot":"","sources":["../hardhat.config.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venusprotocol/oracle",
|
|
3
3
|
"description": "Venus Protocol Price Oracle",
|
|
4
|
-
"version": "1.6.11-dev.
|
|
4
|
+
"version": "1.6.11-dev.7",
|
|
5
5
|
"author": "",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=14.x.x"
|
|
@@ -9,17 +9,10 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"artifacts",
|
|
11
11
|
"networks",
|
|
12
|
-
"
|
|
12
|
+
"dist",
|
|
13
13
|
"deployments",
|
|
14
14
|
"contracts"
|
|
15
15
|
],
|
|
16
|
-
"exports": {
|
|
17
|
-
"deploy": "./dist/deploy",
|
|
18
|
-
"artifacts": "./artifacts",
|
|
19
|
-
"networks": "./networks",
|
|
20
|
-
"contracts": "./contracts",
|
|
21
|
-
"deployments": "./deployments"
|
|
22
|
-
},
|
|
23
16
|
"scripts": {
|
|
24
17
|
"clean": "shx rm -rf ./artifacts ./cache ./coverage ./coverage.json",
|
|
25
18
|
"commit": "git-cz",
|
|
@@ -36,7 +29,6 @@
|
|
|
36
29
|
"test": "npm run compile && hardhat test",
|
|
37
30
|
"typechain": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat typechain",
|
|
38
31
|
"build": "rm -rf dist && tsc --declaration && hardhat compile",
|
|
39
|
-
"publish": "yarn build && yarn npm publish",
|
|
40
32
|
"docgen": "hardhat docgen",
|
|
41
33
|
"prepare": "husky install"
|
|
42
34
|
},
|
|
@@ -71,14 +63,12 @@
|
|
|
71
63
|
"@typechain/ethers-v5": "^10.1.0",
|
|
72
64
|
"@typechain/hardhat": "^6.1.0",
|
|
73
65
|
"@types/chai": "^4.3.1",
|
|
74
|
-
"@types/fs-extra": "^9.0.13",
|
|
75
66
|
"@types/mocha": "^9.1.1",
|
|
76
67
|
"@types/node": "^17.0.42",
|
|
77
68
|
"@types/sinon-chai": "^3.2.9",
|
|
78
69
|
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
79
70
|
"@typescript-eslint/parser": "^5.27.1",
|
|
80
71
|
"chai": "^4.3.6",
|
|
81
|
-
"commitizen": "^4.2.4",
|
|
82
72
|
"cross-env": "^7.0.3",
|
|
83
73
|
"cz-conventional-changelog": "^3.3.0",
|
|
84
74
|
"dotenv": "^16.0.1",
|
|
@@ -87,7 +77,6 @@
|
|
|
87
77
|
"eslint-config-prettier": "^8.5.0",
|
|
88
78
|
"eslint-plugin-import": "^2.22.2",
|
|
89
79
|
"ethereum-waffle": "^3.4.4",
|
|
90
|
-
"fs-extra": "^10.1.0",
|
|
91
80
|
"hardhat-deploy-ethers": "^0.3.0-beta.13",
|
|
92
81
|
"hardhat-gas-reporter": "^1.0.8",
|
|
93
82
|
"husky": "^8.0.1",
|
|
@@ -97,7 +86,6 @@
|
|
|
97
86
|
"prettier": "^2.6.2",
|
|
98
87
|
"prettier-plugin-solidity": "^1.0.0",
|
|
99
88
|
"semantic-release": "^19.0.3",
|
|
100
|
-
"shelljs": "^0.8.5",
|
|
101
89
|
"shx": "^0.3.4",
|
|
102
90
|
"solhint": "^3.3.7",
|
|
103
91
|
"solhint-plugin-prettier": "^0.0.5",
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import mainnetDeployments from "@venusprotocol/venus-protocol/networks/mainnet.json";
|
|
2
|
-
import testnetDeployments from "@venusprotocol/venus-protocol/networks/testnet.json";
|
|
3
|
-
import hre from "hardhat";
|
|
4
|
-
import { DeployFunction } from "hardhat-deploy/dist/types";
|
|
5
|
-
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
|
6
|
-
|
|
7
|
-
const ADDRESSES = {
|
|
8
|
-
bsctestnet: {
|
|
9
|
-
vBNBAddress: testnetDeployments.Contracts.vBNB,
|
|
10
|
-
WBNBAddress: "0xae13d989daC2f0dEbFf460aC112a837C89BAa7cd",
|
|
11
|
-
VAIAddress: testnetDeployments.Contracts.VAI,
|
|
12
|
-
pythOracleAddress: "0xd7308b14BF4008e7C7196eC35610B1427C5702EA",
|
|
13
|
-
sidRegistryAddress: "0xfFB52185b56603e0fd71De9de4F6f902f05EEA23",
|
|
14
|
-
acm: "0x45f8a08F534f34A97187626E05d4b6648Eeaa9AA",
|
|
15
|
-
timelock: testnetDeployments.Contracts.Timelock,
|
|
16
|
-
},
|
|
17
|
-
bscmainnet: {
|
|
18
|
-
vBNBAddress: mainnetDeployments.Contracts.vBNB,
|
|
19
|
-
WBNBAddress: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
|
|
20
|
-
VAIAddress: mainnetDeployments.Contracts.VAI,
|
|
21
|
-
pythOracleAddress: "0x4D7E825f80bDf85e913E0DD2A2D54927e9dE1594",
|
|
22
|
-
sidRegistryAddress: "0x08CEd32a7f3eeC915Ba84415e9C07a7286977956",
|
|
23
|
-
acm: "0x4788629ABc6cFCA10F9f969efdEAa1cF70c23555",
|
|
24
|
-
timelock: mainnetDeployments.Contracts.Timelock,
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const func: DeployFunction = async function ({ getNamedAccounts, deployments, network }: HardhatRuntimeEnvironment) {
|
|
29
|
-
const { deploy } = deployments;
|
|
30
|
-
const { deployer } = await getNamedAccounts();
|
|
31
|
-
|
|
32
|
-
const networkName = network.name === "bscmainnet" ? "bscmainnet" : "bsctestnet";
|
|
33
|
-
|
|
34
|
-
const { vBNBAddress } = ADDRESSES[networkName];
|
|
35
|
-
const { VAIAddress } = ADDRESSES[networkName];
|
|
36
|
-
const { WBNBAddress } = ADDRESSES[networkName];
|
|
37
|
-
|
|
38
|
-
let accessControlManager;
|
|
39
|
-
if (!network.live) {
|
|
40
|
-
await deploy("AccessControlManagerScenario", {
|
|
41
|
-
from: deployer,
|
|
42
|
-
args: [],
|
|
43
|
-
log: true,
|
|
44
|
-
autoMine: true,
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
accessControlManager = await hre.ethers.getContract("AccessControlManagerScenario");
|
|
48
|
-
}
|
|
49
|
-
const accessControlManagerAddress = network.live ? ADDRESSES[networkName].acm : accessControlManager?.address;
|
|
50
|
-
const proxyOwnerAddress = network.live ? ADDRESSES[networkName].timelock : deployer;
|
|
51
|
-
|
|
52
|
-
await deploy("BoundValidator", {
|
|
53
|
-
from: deployer,
|
|
54
|
-
log: true,
|
|
55
|
-
deterministicDeployment: false,
|
|
56
|
-
args: [vBNBAddress, VAIAddress],
|
|
57
|
-
proxy: {
|
|
58
|
-
owner: proxyOwnerAddress,
|
|
59
|
-
proxyContract: "OptimizedTransparentProxy",
|
|
60
|
-
execute: {
|
|
61
|
-
methodName: "initialize",
|
|
62
|
-
args: [accessControlManagerAddress],
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
const boundValidator = await hre.ethers.getContract("BoundValidator");
|
|
68
|
-
|
|
69
|
-
await deploy("ResilientOracle", {
|
|
70
|
-
from: deployer,
|
|
71
|
-
log: true,
|
|
72
|
-
deterministicDeployment: false,
|
|
73
|
-
args: [vBNBAddress, VAIAddress],
|
|
74
|
-
proxy: {
|
|
75
|
-
owner: proxyOwnerAddress,
|
|
76
|
-
proxyContract: "OptimizedTransparentProxy",
|
|
77
|
-
execute: {
|
|
78
|
-
methodName: "initialize",
|
|
79
|
-
args: [boundValidator.address, accessControlManagerAddress],
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
await deploy("ChainlinkOracle", {
|
|
85
|
-
contract: network.live ? "ChainlinkOracle" : "MockChainlinkOracle",
|
|
86
|
-
from: deployer,
|
|
87
|
-
log: true,
|
|
88
|
-
deterministicDeployment: false,
|
|
89
|
-
args: network.live ? [vBNBAddress, VAIAddress] : [],
|
|
90
|
-
proxy: {
|
|
91
|
-
owner: proxyOwnerAddress,
|
|
92
|
-
proxyContract: "OptimizedTransparentProxy",
|
|
93
|
-
execute: {
|
|
94
|
-
methodName: "initialize",
|
|
95
|
-
args: network.live ? [accessControlManagerAddress] : [],
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
await deploy("TwapOracle", {
|
|
101
|
-
contract: network.live ? "TwapOracle" : "MockTwapOracle",
|
|
102
|
-
from: deployer,
|
|
103
|
-
log: true,
|
|
104
|
-
deterministicDeployment: false,
|
|
105
|
-
args: network.live ? [vBNBAddress, WBNBAddress, VAIAddress] : [],
|
|
106
|
-
proxy: {
|
|
107
|
-
owner: proxyOwnerAddress,
|
|
108
|
-
proxyContract: "OptimizedTransparentProxy",
|
|
109
|
-
execute: {
|
|
110
|
-
methodName: "initialize",
|
|
111
|
-
args: network.live ? [accessControlManagerAddress] : [vBNBAddress],
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const { pythOracleAddress } = ADDRESSES[networkName];
|
|
117
|
-
|
|
118
|
-
await deploy("PythOracle", {
|
|
119
|
-
contract: network.live ? "PythOracle" : "MockPythOracle",
|
|
120
|
-
from: deployer,
|
|
121
|
-
log: true,
|
|
122
|
-
deterministicDeployment: false,
|
|
123
|
-
args: network.live ? [vBNBAddress, VAIAddress] : [],
|
|
124
|
-
proxy: {
|
|
125
|
-
owner: proxyOwnerAddress,
|
|
126
|
-
proxyContract: "OptimizedTransparentProxy",
|
|
127
|
-
execute: {
|
|
128
|
-
methodName: "initialize",
|
|
129
|
-
args: network.live ? [pythOracleAddress, accessControlManagerAddress] : [pythOracleAddress],
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
const { sidRegistryAddress } = ADDRESSES[networkName];
|
|
135
|
-
|
|
136
|
-
await deploy("BinanceOracle", {
|
|
137
|
-
contract: network.live ? "BinanceOracle" : "MockBinanceOracle",
|
|
138
|
-
from: deployer,
|
|
139
|
-
log: true,
|
|
140
|
-
deterministicDeployment: false,
|
|
141
|
-
args: network.live ? [vBNBAddress, VAIAddress] : [],
|
|
142
|
-
proxy: {
|
|
143
|
-
owner: proxyOwnerAddress,
|
|
144
|
-
proxyContract: "OptimizedTransparentProxy",
|
|
145
|
-
execute: {
|
|
146
|
-
methodName: "initialize",
|
|
147
|
-
args: network.live ? [sidRegistryAddress, accessControlManagerAddress] : [],
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
const resilientOracle = await hre.ethers.getContract("ResilientOracle");
|
|
153
|
-
const pythOracle = await hre.ethers.getContract("PythOracle");
|
|
154
|
-
const chainlinkOracle = await hre.ethers.getContract("ChainlinkOracle");
|
|
155
|
-
const binanceOracle = await hre.ethers.getContract("BinanceOracle");
|
|
156
|
-
const twapOracle = await hre.ethers.getContract("TwapOracle");
|
|
157
|
-
|
|
158
|
-
await accessControlManager?.giveCallPermission(chainlinkOracle.address, "setTokenConfig(TokenConfig)", deployer);
|
|
159
|
-
await accessControlManager?.giveCallPermission(pythOracle.address, "setTokenConfig(TokenConfig)", deployer);
|
|
160
|
-
await accessControlManager?.giveCallPermission(resilientOracle.address, "setTokenConfig(TokenConfig)", deployer);
|
|
161
|
-
|
|
162
|
-
const resilientOracleOwner = await resilientOracle.owner();
|
|
163
|
-
const pythOracleOwner = await pythOracle.owner();
|
|
164
|
-
const binanceOracleOwner = await binanceOracle.owner();
|
|
165
|
-
const chainlinkOracleOwner = await chainlinkOracle.owner();
|
|
166
|
-
const twapOracleOwner = await twapOracle.owner();
|
|
167
|
-
const boundValidatorOwner = await boundValidator.owner();
|
|
168
|
-
|
|
169
|
-
if (resilientOracleOwner === deployer) {
|
|
170
|
-
await resilientOracle.transferOwnership(ADDRESSES[networkName].timelock);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (pythOracleOwner === deployer) {
|
|
174
|
-
await pythOracle.transferOwnership(ADDRESSES[networkName].timelock);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (binanceOracleOwner === deployer) {
|
|
178
|
-
await binanceOracle.transferOwnership(ADDRESSES[networkName].timelock);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (chainlinkOracleOwner === deployer) {
|
|
182
|
-
await chainlinkOracle.transferOwnership(ADDRESSES[networkName].timelock);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (twapOracleOwner === deployer) {
|
|
186
|
-
await twapOracle.transferOwnership(ADDRESSES[networkName].timelock);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (boundValidatorOwner === deployer) {
|
|
190
|
-
await boundValidator.transferOwnership(ADDRESSES[networkName].timelock);
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
export default func;
|
|
195
|
-
export const tags = ["deploy"];
|