@venusprotocol/oracle 1.6.10 → 1.6.11-dev.11
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/LICENSE +11 -0
- package/README.md +140 -0
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol/AggregatorInterface.dbg.json +1 -1
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.dbg.json +1 -1
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json +2 -2
- package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +2 -2
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +2 -2
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.json +2 -2
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.json +2 -2
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.json +2 -2
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
- 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/{contracts/Governance/AccessControlled.sol/AccessControlled.json → @venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol/AccessControlledV8.json} +3 -3
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.dbg.json +4 -0
- package/artifacts/{contracts/Governance/IAccessControlManager.sol/IAccessControlManager.json → @venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.json} +2 -2
- package/artifacts/build-info/2f9bd32d7afaff51cf1627ed4903b445.json +1 -0
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.dbg.json +1 -1
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json +8 -8
- package/artifacts/contracts/interfaces/FeedRegistryInterface.sol/FeedRegistryInterface.dbg.json +1 -1
- package/artifacts/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.dbg.json +1 -1
- package/artifacts/contracts/interfaces/OracleInterface.sol/OracleInterface.dbg.json +1 -1
- package/artifacts/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.dbg.json +1 -1
- package/artifacts/contracts/interfaces/OracleInterface.sol/TwapInterface.dbg.json +1 -1
- package/artifacts/contracts/interfaces/PublicResolverInterface.sol/PublicResolverInterface.dbg.json +1 -1
- package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.dbg.json +1 -1
- package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.dbg.json +1 -1
- package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.dbg.json +1 -1
- package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.json +2 -2
- package/artifacts/contracts/interfaces/SIDRegistryInterface.sol/SIDRegistryInterface.dbg.json +1 -1
- package/artifacts/contracts/interfaces/VBep20Interface.sol/VBep20Interface.dbg.json +1 -1
- package/artifacts/contracts/libraries/PancakeLibrary.sol/FixedPoint.dbg.json +1 -1
- package/artifacts/contracts/libraries/PancakeLibrary.sol/FixedPoint.json +2 -2
- package/artifacts/contracts/libraries/PancakeLibrary.sol/IPancakePair.dbg.json +1 -1
- package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.dbg.json +1 -1
- package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.json +2 -2
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.json +221 -3
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.dbg.json +1 -1
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.json +5 -5
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.json +7 -13
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.json +11 -5
- package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.json +24 -37
- package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.dbg.json +1 -1
- package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.json +2 -2
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.json +3 -22
- package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.json +2 -2
- package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.json +2 -2
- package/artifacts/contracts/oracles/mocks/MockTwapOracle.sol/MockTwapOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/mocks/MockTwapOracle.sol/MockTwapOracle.json +2 -2
- 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 +1 -1
- package/artifacts/contracts/test/BEP20Harness.sol/BEP20Harness.json +15 -2
- package/artifacts/contracts/test/MockPyth.sol/MockPyth.dbg.json +1 -1
- package/artifacts/contracts/test/MockPyth.sol/MockPyth.json +2 -2
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.dbg.json +1 -1
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.json +2 -2
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.json +2 -2
- package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.dbg.json +1 -1
- package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.json +2 -2
- package/artifacts/contracts/test/PancakePairHarness.sol/Math.dbg.json +1 -1
- package/artifacts/contracts/test/PancakePairHarness.sol/Math.json +2 -2
- package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.dbg.json +1 -1
- package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.json +2 -2
- package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.dbg.json +1 -1
- package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.json +2 -2
- package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.dbg.json +1 -1
- package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.json +15 -2
- package/contracts/ResilientOracle.sol +45 -37
- package/contracts/interfaces/PythInterface.sol +4 -1
- package/contracts/oracles/BinanceOracle.sol +65 -24
- package/contracts/oracles/BoundValidator.sol +51 -54
- package/contracts/oracles/ChainlinkOracle.sol +54 -54
- package/contracts/oracles/PythOracle.sol +48 -47
- package/contracts/oracles/TwapOracle.sol +85 -83
- package/contracts/oracles/mocks/MockBinanceFeedRegistry.sol +1 -1
- package/contracts/oracles/mocks/MockBinanceOracle.sol +1 -7
- package/contracts/oracles/mocks/MockPythOracle.sol +1 -1
- package/contracts/oracles/mocks/MockTwapOracle.sol +1 -1
- package/contracts/test/AccessControlManager.sol +6 -0
- package/contracts/test/BEP20Harness.sol +4 -0
- package/contracts/test/MockPyth.sol +9 -2
- package/deployments/bscmainnet/.chainId +1 -0
- package/deployments/bscmainnet/BinanceOracle.json +571 -0
- package/deployments/bscmainnet/BinanceOracle_Implementation.json +629 -0
- package/deployments/bscmainnet/BinanceOracle_Proxy.json +251 -0
- package/deployments/bscmainnet/BoundValidator.json +621 -0
- package/deployments/bscmainnet/BoundValidator_Implementation.json +706 -0
- package/deployments/bscmainnet/BoundValidator_Proxy.json +251 -0
- package/deployments/bscmainnet/ChainlinkOracle.json +691 -0
- package/deployments/bscmainnet/ChainlinkOracle_Implementation.json +820 -0
- package/deployments/bscmainnet/ChainlinkOracle_Proxy.json +251 -0
- package/deployments/bscmainnet/DefaultProxyAdmin.json +257 -0
- package/deployments/bscmainnet/PythOracle.json +688 -0
- package/deployments/bscmainnet/PythOracle_Implementation.json +804 -0
- package/deployments/bscmainnet/PythOracle_Proxy.json +265 -0
- package/deployments/bscmainnet/ResilientOracle.json +841 -0
- package/deployments/bscmainnet/ResilientOracle_Implementation.json +1044 -0
- package/deployments/bscmainnet/ResilientOracle_Proxy.json +251 -0
- package/deployments/bscmainnet/TwapOracle.json +887 -0
- package/deployments/bscmainnet/TwapOracle_Implementation.json +1111 -0
- package/deployments/bscmainnet/TwapOracle_Proxy.json +251 -0
- package/deployments/bscmainnet/solcInputs/0e89febeebc7444140de8e67c9067d2c.json +78 -0
- package/deployments/bscmainnet/solcInputs/aae9f1601b873a5a4704ede73ede10cb.json +135 -0
- package/deployments/bsctestnet/BinanceOracle.json +273 -31
- package/deployments/bsctestnet/BinanceOracle_Implementation.json +398 -28
- package/deployments/bsctestnet/BinanceOracle_Proxy.json +52 -28
- package/deployments/bsctestnet/BoundValidator.json +40 -40
- package/deployments/bsctestnet/BoundValidator_Implementation.json +43 -51
- package/deployments/bsctestnet/BoundValidator_Proxy.json +35 -35
- package/deployments/bsctestnet/ChainlinkOracle.json +57 -49
- package/deployments/bsctestnet/ChainlinkOracle_Implementation.json +46 -52
- package/deployments/bsctestnet/ChainlinkOracle_Proxy.json +50 -36
- package/deployments/bsctestnet/DefaultProxyAdmin.json +18 -18
- package/deployments/bsctestnet/PythOracle.json +52 -45
- package/deployments/bsctestnet/PythOracle_Implementation.json +53 -47
- package/deployments/bsctestnet/PythOracle_Proxy.json +41 -40
- package/deployments/bsctestnet/ResilientOracle.json +51 -42
- package/deployments/bsctestnet/ResilientOracle_Implementation.json +65 -68
- package/deployments/bsctestnet/ResilientOracle_Proxy.json +48 -34
- package/deployments/bsctestnet/TwapOracle.json +70 -83
- package/deployments/bsctestnet/TwapOracle_Implementation.json +84 -97
- package/deployments/bsctestnet/TwapOracle_Proxy.json +46 -46
- package/deployments/bsctestnet/solcInputs/131f58942628e21632de19506977a910.json +120 -0
- package/deployments/bsctestnet/solcInputs/144b49e8aec3add79553ba273ea32d00.json +72 -0
- package/deployments/bsctestnet/solcInputs/503f2e4e766f3be923fadf8030a5470f.json +78 -0
- package/deployments/bsctestnet/solcInputs/b39d33092f7dd383ae3a042566194132.json +75 -0
- package/dist/deploy/1-deploy-oracles.d.ts +5 -0
- package/dist/deploy/1-deploy-oracles.d.ts.map +1 -0
- package/{deploy → dist/deploy}/1-deploy-oracles.js +66 -24
- 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/{deploy → dist/deploy}/2-configure-feeds.js +139 -16
- 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 +158 -0
- package/dist/hardhat.config.js.map +1 -0
- package/package.json +26 -19
- package/artifacts/@openzeppelin/contracts/utils/math/SafeMath.sol/SafeMath.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/math/SafeMath.sol/SafeMath.json +0 -10
- package/artifacts/build-info/a47a69a8f108d3e7113faf89771988ff.json +0 -1
- package/artifacts/build-info/cc300b55b814df48229058e829c7c3c6.json +0 -1
- package/artifacts/build-info/de79b2637546f6f7d38c8f655549d9e2.json +0 -1
- package/artifacts/contracts/Governance/AccessControlManager.sol/AccessControlManager.dbg.json +0 -4
- package/artifacts/contracts/Governance/AccessControlManager.sol/AccessControlManager.json +0 -369
- package/artifacts/contracts/Governance/AccessControlled.sol/AccessControlled.dbg.json +0 -4
- package/artifacts/contracts/Governance/IAccessControlManager.sol/IAccessControlManager.dbg.json +0 -4
- package/artifacts/contracts/PriceOracle.sol/PriceOracle.dbg.json +0 -4
- package/artifacts/contracts/PriceOracle.sol/PriceOracle.json +0 -43
- package/contracts/Governance/AccessControlManager.sol +0 -99
- package/contracts/Governance/AccessControlled.sol +0 -75
- package/contracts/Governance/IAccessControlManager.sol +0 -22
- package/contracts/PriceOracle.sol +0 -16
- package/deploy/1-deploy-oracles.d.ts +0 -2
- package/deploy/1-deploy-oracles.d.ts.map +0 -1
- package/deploy/1-deploy-oracles.js.map +0 -1
- package/deploy/2-configure-feeds.d.ts +0 -2
- package/deploy/2-configure-feeds.d.ts.map +0 -1
- package/deploy/2-configure-feeds.js.map +0 -1
- package/deployments/bsctestnet/AccessControlManager.json +0 -563
- package/deployments/bsctestnet/solcInputs/30f2cb3e89e183b8669f05bddf9426d9.json +0 -183
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "AccessControlManager",
|
|
4
|
-
"sourceName": "contracts/Governance/AccessControlManager.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"inputs": [],
|
|
8
|
-
"stateMutability": "nonpayable",
|
|
9
|
-
"type": "constructor"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"anonymous": false,
|
|
13
|
-
"inputs": [
|
|
14
|
-
{
|
|
15
|
-
"indexed": false,
|
|
16
|
-
"internalType": "address",
|
|
17
|
-
"name": "account",
|
|
18
|
-
"type": "address"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"indexed": false,
|
|
22
|
-
"internalType": "address",
|
|
23
|
-
"name": "contractAddress",
|
|
24
|
-
"type": "address"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"indexed": false,
|
|
28
|
-
"internalType": "string",
|
|
29
|
-
"name": "functionSig",
|
|
30
|
-
"type": "string"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
"name": "PermissionGranted",
|
|
34
|
-
"type": "event"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"anonymous": false,
|
|
38
|
-
"inputs": [
|
|
39
|
-
{
|
|
40
|
-
"indexed": false,
|
|
41
|
-
"internalType": "address",
|
|
42
|
-
"name": "account",
|
|
43
|
-
"type": "address"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"indexed": false,
|
|
47
|
-
"internalType": "address",
|
|
48
|
-
"name": "contractAddress",
|
|
49
|
-
"type": "address"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"indexed": false,
|
|
53
|
-
"internalType": "string",
|
|
54
|
-
"name": "functionSig",
|
|
55
|
-
"type": "string"
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
"name": "PermissionRevoked",
|
|
59
|
-
"type": "event"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"anonymous": false,
|
|
63
|
-
"inputs": [
|
|
64
|
-
{
|
|
65
|
-
"indexed": true,
|
|
66
|
-
"internalType": "bytes32",
|
|
67
|
-
"name": "role",
|
|
68
|
-
"type": "bytes32"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"indexed": true,
|
|
72
|
-
"internalType": "bytes32",
|
|
73
|
-
"name": "previousAdminRole",
|
|
74
|
-
"type": "bytes32"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"indexed": true,
|
|
78
|
-
"internalType": "bytes32",
|
|
79
|
-
"name": "newAdminRole",
|
|
80
|
-
"type": "bytes32"
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
"name": "RoleAdminChanged",
|
|
84
|
-
"type": "event"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"anonymous": false,
|
|
88
|
-
"inputs": [
|
|
89
|
-
{
|
|
90
|
-
"indexed": true,
|
|
91
|
-
"internalType": "bytes32",
|
|
92
|
-
"name": "role",
|
|
93
|
-
"type": "bytes32"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"indexed": true,
|
|
97
|
-
"internalType": "address",
|
|
98
|
-
"name": "account",
|
|
99
|
-
"type": "address"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"indexed": true,
|
|
103
|
-
"internalType": "address",
|
|
104
|
-
"name": "sender",
|
|
105
|
-
"type": "address"
|
|
106
|
-
}
|
|
107
|
-
],
|
|
108
|
-
"name": "RoleGranted",
|
|
109
|
-
"type": "event"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"anonymous": false,
|
|
113
|
-
"inputs": [
|
|
114
|
-
{
|
|
115
|
-
"indexed": true,
|
|
116
|
-
"internalType": "bytes32",
|
|
117
|
-
"name": "role",
|
|
118
|
-
"type": "bytes32"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"indexed": true,
|
|
122
|
-
"internalType": "address",
|
|
123
|
-
"name": "account",
|
|
124
|
-
"type": "address"
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"indexed": true,
|
|
128
|
-
"internalType": "address",
|
|
129
|
-
"name": "sender",
|
|
130
|
-
"type": "address"
|
|
131
|
-
}
|
|
132
|
-
],
|
|
133
|
-
"name": "RoleRevoked",
|
|
134
|
-
"type": "event"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"inputs": [],
|
|
138
|
-
"name": "DEFAULT_ADMIN_ROLE",
|
|
139
|
-
"outputs": [
|
|
140
|
-
{
|
|
141
|
-
"internalType": "bytes32",
|
|
142
|
-
"name": "",
|
|
143
|
-
"type": "bytes32"
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
"stateMutability": "view",
|
|
147
|
-
"type": "function"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"inputs": [
|
|
151
|
-
{
|
|
152
|
-
"internalType": "bytes32",
|
|
153
|
-
"name": "role",
|
|
154
|
-
"type": "bytes32"
|
|
155
|
-
}
|
|
156
|
-
],
|
|
157
|
-
"name": "getRoleAdmin",
|
|
158
|
-
"outputs": [
|
|
159
|
-
{
|
|
160
|
-
"internalType": "bytes32",
|
|
161
|
-
"name": "",
|
|
162
|
-
"type": "bytes32"
|
|
163
|
-
}
|
|
164
|
-
],
|
|
165
|
-
"stateMutability": "view",
|
|
166
|
-
"type": "function"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"inputs": [
|
|
170
|
-
{
|
|
171
|
-
"internalType": "address",
|
|
172
|
-
"name": "contractAddress",
|
|
173
|
-
"type": "address"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"internalType": "string",
|
|
177
|
-
"name": "functionSig",
|
|
178
|
-
"type": "string"
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"internalType": "address",
|
|
182
|
-
"name": "accountToPermit",
|
|
183
|
-
"type": "address"
|
|
184
|
-
}
|
|
185
|
-
],
|
|
186
|
-
"name": "giveCallPermission",
|
|
187
|
-
"outputs": [],
|
|
188
|
-
"stateMutability": "nonpayable",
|
|
189
|
-
"type": "function"
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
"inputs": [
|
|
193
|
-
{
|
|
194
|
-
"internalType": "bytes32",
|
|
195
|
-
"name": "role",
|
|
196
|
-
"type": "bytes32"
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
"internalType": "address",
|
|
200
|
-
"name": "account",
|
|
201
|
-
"type": "address"
|
|
202
|
-
}
|
|
203
|
-
],
|
|
204
|
-
"name": "grantRole",
|
|
205
|
-
"outputs": [],
|
|
206
|
-
"stateMutability": "nonpayable",
|
|
207
|
-
"type": "function"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"inputs": [
|
|
211
|
-
{
|
|
212
|
-
"internalType": "address",
|
|
213
|
-
"name": "account",
|
|
214
|
-
"type": "address"
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
"internalType": "address",
|
|
218
|
-
"name": "contractAddress",
|
|
219
|
-
"type": "address"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
"internalType": "string",
|
|
223
|
-
"name": "functionSig",
|
|
224
|
-
"type": "string"
|
|
225
|
-
}
|
|
226
|
-
],
|
|
227
|
-
"name": "hasPermission",
|
|
228
|
-
"outputs": [
|
|
229
|
-
{
|
|
230
|
-
"internalType": "bool",
|
|
231
|
-
"name": "",
|
|
232
|
-
"type": "bool"
|
|
233
|
-
}
|
|
234
|
-
],
|
|
235
|
-
"stateMutability": "view",
|
|
236
|
-
"type": "function"
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
"inputs": [
|
|
240
|
-
{
|
|
241
|
-
"internalType": "bytes32",
|
|
242
|
-
"name": "role",
|
|
243
|
-
"type": "bytes32"
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
"internalType": "address",
|
|
247
|
-
"name": "account",
|
|
248
|
-
"type": "address"
|
|
249
|
-
}
|
|
250
|
-
],
|
|
251
|
-
"name": "hasRole",
|
|
252
|
-
"outputs": [
|
|
253
|
-
{
|
|
254
|
-
"internalType": "bool",
|
|
255
|
-
"name": "",
|
|
256
|
-
"type": "bool"
|
|
257
|
-
}
|
|
258
|
-
],
|
|
259
|
-
"stateMutability": "view",
|
|
260
|
-
"type": "function"
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
"inputs": [
|
|
264
|
-
{
|
|
265
|
-
"internalType": "address",
|
|
266
|
-
"name": "account",
|
|
267
|
-
"type": "address"
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
"internalType": "string",
|
|
271
|
-
"name": "functionSig",
|
|
272
|
-
"type": "string"
|
|
273
|
-
}
|
|
274
|
-
],
|
|
275
|
-
"name": "isAllowedToCall",
|
|
276
|
-
"outputs": [
|
|
277
|
-
{
|
|
278
|
-
"internalType": "bool",
|
|
279
|
-
"name": "",
|
|
280
|
-
"type": "bool"
|
|
281
|
-
}
|
|
282
|
-
],
|
|
283
|
-
"stateMutability": "view",
|
|
284
|
-
"type": "function"
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
"inputs": [
|
|
288
|
-
{
|
|
289
|
-
"internalType": "bytes32",
|
|
290
|
-
"name": "role",
|
|
291
|
-
"type": "bytes32"
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
"internalType": "address",
|
|
295
|
-
"name": "account",
|
|
296
|
-
"type": "address"
|
|
297
|
-
}
|
|
298
|
-
],
|
|
299
|
-
"name": "renounceRole",
|
|
300
|
-
"outputs": [],
|
|
301
|
-
"stateMutability": "nonpayable",
|
|
302
|
-
"type": "function"
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
"inputs": [
|
|
306
|
-
{
|
|
307
|
-
"internalType": "address",
|
|
308
|
-
"name": "contractAddress",
|
|
309
|
-
"type": "address"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
"internalType": "string",
|
|
313
|
-
"name": "functionSig",
|
|
314
|
-
"type": "string"
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
"internalType": "address",
|
|
318
|
-
"name": "accountToRevoke",
|
|
319
|
-
"type": "address"
|
|
320
|
-
}
|
|
321
|
-
],
|
|
322
|
-
"name": "revokeCallPermission",
|
|
323
|
-
"outputs": [],
|
|
324
|
-
"stateMutability": "nonpayable",
|
|
325
|
-
"type": "function"
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
"inputs": [
|
|
329
|
-
{
|
|
330
|
-
"internalType": "bytes32",
|
|
331
|
-
"name": "role",
|
|
332
|
-
"type": "bytes32"
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
"internalType": "address",
|
|
336
|
-
"name": "account",
|
|
337
|
-
"type": "address"
|
|
338
|
-
}
|
|
339
|
-
],
|
|
340
|
-
"name": "revokeRole",
|
|
341
|
-
"outputs": [],
|
|
342
|
-
"stateMutability": "nonpayable",
|
|
343
|
-
"type": "function"
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
"inputs": [
|
|
347
|
-
{
|
|
348
|
-
"internalType": "bytes4",
|
|
349
|
-
"name": "interfaceId",
|
|
350
|
-
"type": "bytes4"
|
|
351
|
-
}
|
|
352
|
-
],
|
|
353
|
-
"name": "supportsInterface",
|
|
354
|
-
"outputs": [
|
|
355
|
-
{
|
|
356
|
-
"internalType": "bool",
|
|
357
|
-
"name": "",
|
|
358
|
-
"type": "bool"
|
|
359
|
-
}
|
|
360
|
-
],
|
|
361
|
-
"stateMutability": "view",
|
|
362
|
-
"type": "function"
|
|
363
|
-
}
|
|
364
|
-
],
|
|
365
|
-
"bytecode": "0x608060405234801561001057600080fd5b5061001c600033610021565b6100cd565b61002b828261002f565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661002b576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556100893390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610b96806100dc6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c8063545f7a3211610071578063545f7a3214610142578063584f6b601461015557806382bfd0f01461016857806391d148541461017b578063a217fddf1461018e578063d547741f1461019657600080fd5b806301ffc9a7146100ae57806318c5e8ab146100d6578063248a9ca3146100e95780632f2ff15d1461011a57806336568abe1461012f575b600080fd5b6100c16100bc366004610793565b6101a9565b60405190151581526020015b60405180910390f35b6100c16100e4366004610822565b6101e0565b61010c6100f7366004610875565b60009081526020819052604090206001015490565b6040519081526020016100cd565b61012d61012836600461088e565b61026c565b005b61012d61013d36600461088e565b610296565b61012d6101503660046108ba565b610319565b61012d6101633660046108ba565b610396565b6100c161017636600461091f565b610404565b6100c161018936600461088e565b610448565b61010c600081565b61012d6101a436600461088e565b610471565b60006001600160e01b03198216637965db0b60e01b14806101da57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000803384846040516020016101f893929190610980565b60405160208183030381529060405280519060200120905061021a8186610448565b15610229576001915050610265565b6000848460405160200161023f93929190610980565b6040516020818303038152906040528051906020012090506102618186610448565b9150505b9392505050565b60008281526020819052604090206001015461028781610496565b61029183836104a3565b505050565b6001600160a01b038116331461030b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6103158282610527565b5050565b600084848460405160200161033093929190610980565b6040516020818303038152906040528051906020012090506103528183610471565b7f55426a61e90ac7d7d1fc886b67b420ade8c8b535e68d655394bc271e3a12b8e28286868660405161038794939291906109ac565b60405180910390a15050505050565b60008484846040516020016103ad93929190610980565b6040516020818303038152906040528051906020012090506103cf818361026c565b7f69c5ce2d658fea352a2464f87ffbe1f09746c918a91da0994044c3767d641b3f8286868660405161038794939291906109ac565b60008084848460405160200161041c93929190610980565b60405160208183030381529060405280519060200120905061043e8187610448565b9695505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008281526020819052604090206001015461048c81610496565b6102918383610527565b6104a0813361058c565b50565b6104ad8282610448565b610315576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556104e33390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6105318282610448565b15610315576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6105968282610448565b610315576105a3816105e5565b6105ae8360206105f7565b6040516020016105bf929190610a28565b60408051601f198184030181529082905262461bcd60e51b825261030291600401610a9d565b60606101da6001600160a01b03831660145b60606000610606836002610ae6565b610611906002610b05565b67ffffffffffffffff81111561062957610629610b1d565b6040519080825280601f01601f191660200182016040528015610653576020820181803683370190505b509050600360fc1b8160008151811061066e5761066e610b33565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061069d5761069d610b33565b60200101906001600160f81b031916908160001a90535060006106c1846002610ae6565b6106cc906001610b05565b90505b6001811115610744576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061070057610700610b33565b1a60f81b82828151811061071657610716610b33565b60200101906001600160f81b031916908160001a90535060049490941c9361073d81610b49565b90506106cf565b5083156102655760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610302565b6000602082840312156107a557600080fd5b81356001600160e01b03198116811461026557600080fd5b80356001600160a01b03811681146107d457600080fd5b919050565b60008083601f8401126107eb57600080fd5b50813567ffffffffffffffff81111561080357600080fd5b60208301915083602082850101111561081b57600080fd5b9250929050565b60008060006040848603121561083757600080fd5b610840846107bd565b9250602084013567ffffffffffffffff81111561085c57600080fd5b610868868287016107d9565b9497909650939450505050565b60006020828403121561088757600080fd5b5035919050565b600080604083850312156108a157600080fd5b823591506108b1602084016107bd565b90509250929050565b600080600080606085870312156108d057600080fd5b6108d9856107bd565b9350602085013567ffffffffffffffff8111156108f557600080fd5b610901878288016107d9565b90945092506109149050604086016107bd565b905092959194509250565b6000806000806060858703121561093557600080fd5b61093e856107bd565b935061094c602086016107bd565b9250604085013567ffffffffffffffff81111561096857600080fd5b610974878288016107d9565b95989497509550505050565b6bffffffffffffffffffffffff198460601b168152818360148301376000910160140190815292915050565b6001600160a01b0385811682528416602082015260606040820181905281018290526000828460808401376000608084840101526080601f19601f850116830101905095945050505050565b60005b83811015610a135781810151838201526020016109fb565b83811115610a22576000848401525b50505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351610a608160178501602088016109f8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351610a918160288401602088016109f8565b01602801949350505050565b6020815260008251806020840152610abc8160408501602087016109f8565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610b0057610b00610ad0565b500290565b60008219821115610b1857610b18610ad0565b500190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081610b5857610b58610ad0565b50600019019056fea264697066735822122089e24bfba6d98ecddc4c1bcd3af946da39806d3a209eb77adce285c86dcc4c2d64736f6c634300080d0033",
|
|
366
|
-
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063545f7a3211610071578063545f7a3214610142578063584f6b601461015557806382bfd0f01461016857806391d148541461017b578063a217fddf1461018e578063d547741f1461019657600080fd5b806301ffc9a7146100ae57806318c5e8ab146100d6578063248a9ca3146100e95780632f2ff15d1461011a57806336568abe1461012f575b600080fd5b6100c16100bc366004610793565b6101a9565b60405190151581526020015b60405180910390f35b6100c16100e4366004610822565b6101e0565b61010c6100f7366004610875565b60009081526020819052604090206001015490565b6040519081526020016100cd565b61012d61012836600461088e565b61026c565b005b61012d61013d36600461088e565b610296565b61012d6101503660046108ba565b610319565b61012d6101633660046108ba565b610396565b6100c161017636600461091f565b610404565b6100c161018936600461088e565b610448565b61010c600081565b61012d6101a436600461088e565b610471565b60006001600160e01b03198216637965db0b60e01b14806101da57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000803384846040516020016101f893929190610980565b60405160208183030381529060405280519060200120905061021a8186610448565b15610229576001915050610265565b6000848460405160200161023f93929190610980565b6040516020818303038152906040528051906020012090506102618186610448565b9150505b9392505050565b60008281526020819052604090206001015461028781610496565b61029183836104a3565b505050565b6001600160a01b038116331461030b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6103158282610527565b5050565b600084848460405160200161033093929190610980565b6040516020818303038152906040528051906020012090506103528183610471565b7f55426a61e90ac7d7d1fc886b67b420ade8c8b535e68d655394bc271e3a12b8e28286868660405161038794939291906109ac565b60405180910390a15050505050565b60008484846040516020016103ad93929190610980565b6040516020818303038152906040528051906020012090506103cf818361026c565b7f69c5ce2d658fea352a2464f87ffbe1f09746c918a91da0994044c3767d641b3f8286868660405161038794939291906109ac565b60008084848460405160200161041c93929190610980565b60405160208183030381529060405280519060200120905061043e8187610448565b9695505050505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b60008281526020819052604090206001015461048c81610496565b6102918383610527565b6104a0813361058c565b50565b6104ad8282610448565b610315576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556104e33390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6105318282610448565b15610315576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6105968282610448565b610315576105a3816105e5565b6105ae8360206105f7565b6040516020016105bf929190610a28565b60408051601f198184030181529082905262461bcd60e51b825261030291600401610a9d565b60606101da6001600160a01b03831660145b60606000610606836002610ae6565b610611906002610b05565b67ffffffffffffffff81111561062957610629610b1d565b6040519080825280601f01601f191660200182016040528015610653576020820181803683370190505b509050600360fc1b8160008151811061066e5761066e610b33565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061069d5761069d610b33565b60200101906001600160f81b031916908160001a90535060006106c1846002610ae6565b6106cc906001610b05565b90505b6001811115610744576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061070057610700610b33565b1a60f81b82828151811061071657610716610b33565b60200101906001600160f81b031916908160001a90535060049490941c9361073d81610b49565b90506106cf565b5083156102655760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610302565b6000602082840312156107a557600080fd5b81356001600160e01b03198116811461026557600080fd5b80356001600160a01b03811681146107d457600080fd5b919050565b60008083601f8401126107eb57600080fd5b50813567ffffffffffffffff81111561080357600080fd5b60208301915083602082850101111561081b57600080fd5b9250929050565b60008060006040848603121561083757600080fd5b610840846107bd565b9250602084013567ffffffffffffffff81111561085c57600080fd5b610868868287016107d9565b9497909650939450505050565b60006020828403121561088757600080fd5b5035919050565b600080604083850312156108a157600080fd5b823591506108b1602084016107bd565b90509250929050565b600080600080606085870312156108d057600080fd5b6108d9856107bd565b9350602085013567ffffffffffffffff8111156108f557600080fd5b610901878288016107d9565b90945092506109149050604086016107bd565b905092959194509250565b6000806000806060858703121561093557600080fd5b61093e856107bd565b935061094c602086016107bd565b9250604085013567ffffffffffffffff81111561096857600080fd5b610974878288016107d9565b95989497509550505050565b6bffffffffffffffffffffffff198460601b168152818360148301376000910160140190815292915050565b6001600160a01b0385811682528416602082015260606040820181905281018290526000828460808401376000608084840101526080601f19601f850116830101905095945050505050565b60005b83811015610a135781810151838201526020016109fb565b83811115610a22576000848401525b50505050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351610a608160178501602088016109f8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351610a918160288401602088016109f8565b01602801949350505050565b6020815260008251806020840152610abc8160408501602087016109f8565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610b0057610b00610ad0565b500290565b60008219821115610b1857610b18610ad0565b500190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081610b5857610b58610ad0565b50600019019056fea264697066735822122089e24bfba6d98ecddc4c1bcd3af946da39806d3a209eb77adce285c86dcc4c2d64736f6c634300080d0033",
|
|
367
|
-
"linkReferences": {},
|
|
368
|
-
"deployedLinkReferences": {}
|
|
369
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "PriceOracle",
|
|
4
|
-
"sourceName": "contracts/PriceOracle.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"inputs": [
|
|
8
|
-
{
|
|
9
|
-
"internalType": "address",
|
|
10
|
-
"name": "vToken",
|
|
11
|
-
"type": "address"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"name": "getUnderlyingPrice",
|
|
15
|
-
"outputs": [
|
|
16
|
-
{
|
|
17
|
-
"internalType": "uint256",
|
|
18
|
-
"name": "",
|
|
19
|
-
"type": "uint256"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"stateMutability": "view",
|
|
23
|
-
"type": "function"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"inputs": [
|
|
27
|
-
{
|
|
28
|
-
"internalType": "address",
|
|
29
|
-
"name": "vToken",
|
|
30
|
-
"type": "address"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
"name": "updatePrice",
|
|
34
|
-
"outputs": [],
|
|
35
|
-
"stateMutability": "nonpayable",
|
|
36
|
-
"type": "function"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
"bytecode": "0x",
|
|
40
|
-
"deployedBytecode": "0x",
|
|
41
|
-
"linkReferences": {},
|
|
42
|
-
"deployedLinkReferences": {}
|
|
43
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
-
pragma solidity 0.8.13;
|
|
3
|
-
import "@openzeppelin/contracts/access/AccessControl.sol";
|
|
4
|
-
import "./IAccessControlManager.sol";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @title Venus Access Control Contract
|
|
8
|
-
* @author 0xLucian
|
|
9
|
-
* @dev This contract is a wrapper of OpenZeppelin AccessControl
|
|
10
|
-
* extending it in a way to standartize access control
|
|
11
|
-
* within Venus Smart Contract Ecosystem
|
|
12
|
-
*/
|
|
13
|
-
contract AccessControlManager is AccessControl, IAccessControlManager {
|
|
14
|
-
/// @notice Emitted when an account is given a permission to a certain contract function
|
|
15
|
-
/// @dev If contract address is 0x000..0 this means that the account is a default admin of this function and
|
|
16
|
-
/// can call any contract function with this signature
|
|
17
|
-
event PermissionGranted(address account, address contractAddress, string functionSig);
|
|
18
|
-
|
|
19
|
-
/// @notice Emitted when an account is revoked a permission to a certain contract function
|
|
20
|
-
event PermissionRevoked(address account, address contractAddress, string functionSig);
|
|
21
|
-
|
|
22
|
-
constructor() {
|
|
23
|
-
// Grant the contract deployer the default admin role: it will be able
|
|
24
|
-
// to grant and revoke any roles
|
|
25
|
-
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @notice Gives a function call permission to one single account
|
|
30
|
-
* @dev this function can be called only from Role Admin or DEFAULT_ADMIN_ROLE
|
|
31
|
-
* @param contractAddress address of contract for which call permissions will be granted
|
|
32
|
-
* @dev if contractAddress is zero address, the account can access the specified function
|
|
33
|
-
* on **any** contract managed by this ACL
|
|
34
|
-
* @param functionSig signature e.g. "functionName(uint256,bool)"
|
|
35
|
-
* @param accountToPermit account that will be given access to the contract function
|
|
36
|
-
* @custom:event Emits a {RoleGranted} and {PermissionGranted} events.
|
|
37
|
-
*/
|
|
38
|
-
function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) public {
|
|
39
|
-
bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));
|
|
40
|
-
grantRole(role, accountToPermit);
|
|
41
|
-
emit PermissionGranted(accountToPermit, contractAddress, functionSig);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @notice Revokes an account's permission to a particular function call
|
|
46
|
-
* @dev this function can be called only from Role Admin or DEFAULT_ADMIN_ROLE
|
|
47
|
-
* May emit a {RoleRevoked} event.
|
|
48
|
-
* @param contractAddress address of contract for which call permissions will be revoked
|
|
49
|
-
* @param functionSig signature e.g. "functionName(uint256,bool)"
|
|
50
|
-
* @custom:event Emits {RoleRevoked} and {PermissionRevoked} events.
|
|
51
|
-
*/
|
|
52
|
-
function revokeCallPermission(
|
|
53
|
-
address contractAddress,
|
|
54
|
-
string calldata functionSig,
|
|
55
|
-
address accountToRevoke
|
|
56
|
-
) public {
|
|
57
|
-
bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));
|
|
58
|
-
revokeRole(role, accountToRevoke);
|
|
59
|
-
emit PermissionRevoked(accountToRevoke, contractAddress, functionSig);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @notice Verifies if the given account can call a contract's guarded function
|
|
64
|
-
* @dev Since restricted contracts using this function as a permission hook,
|
|
65
|
-
* we can get contracts address with msg.sender
|
|
66
|
-
* @param account for which call permissions will be checked
|
|
67
|
-
* @param functionSig restricted function signature e.g. "functionName(uint256,bool)"
|
|
68
|
-
* @return false if the user account cannot call the particular contract function
|
|
69
|
-
*
|
|
70
|
-
*/
|
|
71
|
-
function isAllowedToCall(address account, string calldata functionSig) public view returns (bool) {
|
|
72
|
-
bytes32 role = keccak256(abi.encodePacked(msg.sender, functionSig));
|
|
73
|
-
|
|
74
|
-
if (hasRole(role, account)) {
|
|
75
|
-
return true;
|
|
76
|
-
} else {
|
|
77
|
-
role = keccak256(abi.encodePacked(address(0), functionSig));
|
|
78
|
-
return hasRole(role, account);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @notice Verifies if the given account can call a contract's guarded function
|
|
84
|
-
* @dev This function is used as a view function to check permissions
|
|
85
|
-
* rather than contract hook for access restriction check.
|
|
86
|
-
* @param account for which call permissions will be checked against
|
|
87
|
-
* @param contractAddress address of the restricted contract
|
|
88
|
-
* @param functionSig signature of the restricted function e.g. "functionName(uint256,bool)"
|
|
89
|
-
* @return false if the user account cannot call the particular contract function
|
|
90
|
-
*/
|
|
91
|
-
function hasPermission(
|
|
92
|
-
address account,
|
|
93
|
-
address contractAddress,
|
|
94
|
-
string calldata functionSig
|
|
95
|
-
) public view returns (bool) {
|
|
96
|
-
bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));
|
|
97
|
-
return hasRole(role, account);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
-
pragma solidity 0.8.13;
|
|
3
|
-
|
|
4
|
-
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
5
|
-
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
|
|
6
|
-
|
|
7
|
-
import "./IAccessControlManager.sol";
|
|
8
|
-
|
|
9
|
-
abstract contract AccessControlled is Initializable, Ownable2StepUpgradeable {
|
|
10
|
-
/// @notice Access control manager contract
|
|
11
|
-
IAccessControlManager private _accessControlManager;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @dev This empty reserved space is put in place to allow future versions to add new
|
|
15
|
-
* variables without shifting down storage in the inheritance chain.
|
|
16
|
-
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
|
|
17
|
-
*/
|
|
18
|
-
uint256[49] private __gap;
|
|
19
|
-
|
|
20
|
-
/// @notice Emitted when access control manager contract address is changed
|
|
21
|
-
event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);
|
|
22
|
-
|
|
23
|
-
/// @notice Thrown when the action is prohibited by AccessControlManager
|
|
24
|
-
error Unauthorized(address sender, address calledContract, string methodSignature);
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @notice Sets the address of AccessControlManager
|
|
28
|
-
* @dev Admin function to set address of AccessControlManager
|
|
29
|
-
* @param accessControlManager_ The new address of the AccessControlManager
|
|
30
|
-
* @custom:event Emits NewAccessControlManager event
|
|
31
|
-
* @custom:access Only Governance
|
|
32
|
-
*/
|
|
33
|
-
function setAccessControlManager(address accessControlManager_) external onlyOwner {
|
|
34
|
-
_setAccessControlManager(accessControlManager_);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @notice Returns the address of the access control manager contract
|
|
39
|
-
*/
|
|
40
|
-
function accessControlManager() external view returns (IAccessControlManager) {
|
|
41
|
-
return _accessControlManager;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {
|
|
45
|
-
__Ownable2Step_init();
|
|
46
|
-
__AccessControlled_init_unchained(accessControlManager_);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {
|
|
50
|
-
_setAccessControlManager(accessControlManager_);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @dev Internal function to set address of AccessControlManager
|
|
55
|
-
* @param accessControlManager_ The new address of the AccessControlManager
|
|
56
|
-
*/
|
|
57
|
-
function _setAccessControlManager(address accessControlManager_) internal {
|
|
58
|
-
require(address(accessControlManager_) != address(0), "invalid acess control manager address");
|
|
59
|
-
address oldAccessControlManager = address(_accessControlManager);
|
|
60
|
-
_accessControlManager = IAccessControlManager(accessControlManager_);
|
|
61
|
-
emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* @notice Reverts if the call is not allowed by AccessControlManager
|
|
66
|
-
* @param signature Method signature
|
|
67
|
-
*/
|
|
68
|
-
function _checkAccessAllowed(string memory signature) internal view {
|
|
69
|
-
bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);
|
|
70
|
-
|
|
71
|
-
if (!isAllowedToCall) {
|
|
72
|
-
revert Unauthorized(msg.sender, address(this), signature);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
-
pragma solidity 0.8.13;
|
|
3
|
-
|
|
4
|
-
import "@openzeppelin/contracts/access/IAccessControl.sol";
|
|
5
|
-
|
|
6
|
-
interface IAccessControlManager is IAccessControl {
|
|
7
|
-
function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;
|
|
8
|
-
|
|
9
|
-
function revokeCallPermission(
|
|
10
|
-
address contractAddress,
|
|
11
|
-
string calldata functionSig,
|
|
12
|
-
address accountToRevoke
|
|
13
|
-
) external;
|
|
14
|
-
|
|
15
|
-
function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);
|
|
16
|
-
|
|
17
|
-
function hasPermission(
|
|
18
|
-
address account,
|
|
19
|
-
address contractAddress,
|
|
20
|
-
string calldata functionSig
|
|
21
|
-
) external view returns (bool);
|
|
22
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
-
// SPDX-FileCopyrightText: 2020 Compound Labs, Inc.
|
|
3
|
-
// SPDX-FileCopyrightText: 2022 Venus
|
|
4
|
-
pragma solidity 0.8.13;
|
|
5
|
-
|
|
6
|
-
abstract contract PriceOracle {
|
|
7
|
-
function updatePrice(address vToken) external virtual;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @notice Get the underlying price of a vToken asset
|
|
11
|
-
* @param vToken The vToken address to get the underlying price of
|
|
12
|
-
* @return The underlying asset price mantissa (scaled by 1e18).
|
|
13
|
-
* Zero means the price is unavailable.
|
|
14
|
-
*/
|
|
15
|
-
function getUnderlyingPrice(address vToken) external view virtual returns (uint256);
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"1-deploy-oracles.d.ts","sourceRoot":"","sources":["../../deploy/1-deploy-oracles.ts"],"names":[],"mappings":""}
|