@venusprotocol/oracle 1.6.10 → 1.6.11-dev.10
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 +117 -0
- 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/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol/AggregatorInterface.dbg.json +0 -4
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol/AggregatorInterface.json +0 -138
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.dbg.json +0 -4
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.json +0 -249
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol/AggregatorV3Interface.dbg.json +0 -4
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol/AggregatorV3Interface.json +0 -122
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.json +0 -215
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.json +0 -183
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json +0 -297
- package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.json +0 -194
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.json +0 -233
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +0 -30
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +0 -30
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +0 -10
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.json +0 -10
- 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/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.json +0 -10
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.json +0 -115
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.json +0 -76
- package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.json +0 -24
- package/artifacts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.json +0 -63
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.json +0 -10
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +0 -4
- package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.json +0 -24
- 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/AccessControlled.sol/AccessControlled.json +0 -181
- package/artifacts/contracts/Governance/IAccessControlManager.sol/IAccessControlManager.dbg.json +0 -4
- package/artifacts/contracts/Governance/IAccessControlManager.sol/IAccessControlManager.json +0 -282
- package/artifacts/contracts/PriceOracle.sol/PriceOracle.dbg.json +0 -4
- package/artifacts/contracts/PriceOracle.sol/PriceOracle.json +0 -43
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.dbg.json +0 -4
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json +0 -617
- package/artifacts/contracts/interfaces/FeedRegistryInterface.sol/FeedRegistryInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/FeedRegistryInterface.sol/FeedRegistryInterface.json +0 -79
- package/artifacts/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/OracleInterface.sol/BoundValidatorInterface.json +0 -40
- package/artifacts/contracts/interfaces/OracleInterface.sol/OracleInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/OracleInterface.sol/OracleInterface.json +0 -30
- package/artifacts/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/OracleInterface.sol/ResilientOracleInterface.json +0 -43
- package/artifacts/contracts/interfaces/OracleInterface.sol/TwapInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/OracleInterface.sol/TwapInterface.json +0 -49
- package/artifacts/contracts/interfaces/PublicResolverInterface.sol/PublicResolverInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/PublicResolverInterface.sol/PublicResolverInterface.json +0 -30
- package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.dbg.json +0 -4
- package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.json +0 -545
- package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.dbg.json +0 -4
- package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.json +0 -446
- package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.dbg.json +0 -4
- package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.json +0 -10
- package/artifacts/contracts/interfaces/SIDRegistryInterface.sol/SIDRegistryInterface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/SIDRegistryInterface.sol/SIDRegistryInterface.json +0 -30
- package/artifacts/contracts/interfaces/VBep20Interface.sol/VBep20Interface.dbg.json +0 -4
- package/artifacts/contracts/interfaces/VBep20Interface.sol/VBep20Interface.json +0 -246
- package/artifacts/contracts/libraries/PancakeLibrary.sol/FixedPoint.dbg.json +0 -4
- package/artifacts/contracts/libraries/PancakeLibrary.sol/FixedPoint.json +0 -10
- package/artifacts/contracts/libraries/PancakeLibrary.sol/IPancakePair.dbg.json +0 -4
- package/artifacts/contracts/libraries/PancakeLibrary.sol/IPancakePair.json +0 -60
- package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.dbg.json +0 -4
- package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.json +0 -10
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.json +0 -124
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.dbg.json +0 -4
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.json +0 -392
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.json +0 -468
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.json +0 -439
- package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.json +0 -676
- package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.dbg.json +0 -4
- package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.json +0 -116
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.json +0 -163
- package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.json +0 -144
- package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.json +0 -163
- package/artifacts/contracts/oracles/mocks/MockTwapOracle.sol/MockTwapOracle.dbg.json +0 -4
- package/artifacts/contracts/oracles/mocks/MockTwapOracle.sol/MockTwapOracle.json +0 -163
- package/artifacts/contracts/test/BEP20Harness.sol/BEP20Harness.dbg.json +0 -4
- package/artifacts/contracts/test/BEP20Harness.sol/BEP20Harness.json +0 -315
- package/artifacts/contracts/test/MockPyth.sol/MockPyth.dbg.json +0 -4
- package/artifacts/contracts/test/MockPyth.sol/MockPyth.json +0 -684
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.dbg.json +0 -4
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.json +0 -95
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.dbg.json +0 -4
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.json +0 -72
- package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.dbg.json +0 -4
- package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.json +0 -306
- package/artifacts/contracts/test/PancakePairHarness.sol/Math.dbg.json +0 -4
- package/artifacts/contracts/test/PancakePairHarness.sol/Math.json +0 -10
- package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.dbg.json +0 -4
- package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.json +0 -158
- package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.dbg.json +0 -4
- package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.json +0 -10
- package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.dbg.json +0 -4
- package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.json +0 -333
- 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,158 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "PancakePairHarness",
|
|
4
|
-
"sourceName": "contracts/test/PancakePairHarness.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"inputs": [],
|
|
8
|
-
"name": "currentBlockTimestamp",
|
|
9
|
-
"outputs": [
|
|
10
|
-
{
|
|
11
|
-
"internalType": "uint32",
|
|
12
|
-
"name": "",
|
|
13
|
-
"type": "uint32"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"stateMutability": "view",
|
|
17
|
-
"type": "function"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"inputs": [],
|
|
21
|
-
"name": "getReserves",
|
|
22
|
-
"outputs": [
|
|
23
|
-
{
|
|
24
|
-
"internalType": "uint112",
|
|
25
|
-
"name": "_reserve0",
|
|
26
|
-
"type": "uint112"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"internalType": "uint112",
|
|
30
|
-
"name": "_reserve1",
|
|
31
|
-
"type": "uint112"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"internalType": "uint32",
|
|
35
|
-
"name": "_blockTimestampLast",
|
|
36
|
-
"type": "uint32"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
"stateMutability": "view",
|
|
40
|
-
"type": "function"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"inputs": [
|
|
44
|
-
{
|
|
45
|
-
"internalType": "address",
|
|
46
|
-
"name": "_token0",
|
|
47
|
-
"type": "address"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"internalType": "address",
|
|
51
|
-
"name": "_token1",
|
|
52
|
-
"type": "address"
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
"name": "initialize",
|
|
56
|
-
"outputs": [],
|
|
57
|
-
"stateMutability": "nonpayable",
|
|
58
|
-
"type": "function"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"inputs": [],
|
|
62
|
-
"name": "kLast",
|
|
63
|
-
"outputs": [
|
|
64
|
-
{
|
|
65
|
-
"internalType": "uint256",
|
|
66
|
-
"name": "",
|
|
67
|
-
"type": "uint256"
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"stateMutability": "view",
|
|
71
|
-
"type": "function"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"inputs": [],
|
|
75
|
-
"name": "price0CumulativeLast",
|
|
76
|
-
"outputs": [
|
|
77
|
-
{
|
|
78
|
-
"internalType": "uint256",
|
|
79
|
-
"name": "",
|
|
80
|
-
"type": "uint256"
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
"stateMutability": "view",
|
|
84
|
-
"type": "function"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"inputs": [],
|
|
88
|
-
"name": "price1CumulativeLast",
|
|
89
|
-
"outputs": [
|
|
90
|
-
{
|
|
91
|
-
"internalType": "uint256",
|
|
92
|
-
"name": "",
|
|
93
|
-
"type": "uint256"
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
"stateMutability": "view",
|
|
97
|
-
"type": "function"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"inputs": [],
|
|
101
|
-
"name": "token0",
|
|
102
|
-
"outputs": [
|
|
103
|
-
{
|
|
104
|
-
"internalType": "address",
|
|
105
|
-
"name": "",
|
|
106
|
-
"type": "address"
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
"stateMutability": "view",
|
|
110
|
-
"type": "function"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"inputs": [],
|
|
114
|
-
"name": "token1",
|
|
115
|
-
"outputs": [
|
|
116
|
-
{
|
|
117
|
-
"internalType": "address",
|
|
118
|
-
"name": "",
|
|
119
|
-
"type": "address"
|
|
120
|
-
}
|
|
121
|
-
],
|
|
122
|
-
"stateMutability": "view",
|
|
123
|
-
"type": "function"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"inputs": [
|
|
127
|
-
{
|
|
128
|
-
"internalType": "uint256",
|
|
129
|
-
"name": "balance0",
|
|
130
|
-
"type": "uint256"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"internalType": "uint256",
|
|
134
|
-
"name": "balance1",
|
|
135
|
-
"type": "uint256"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"internalType": "uint112",
|
|
139
|
-
"name": "_reserve0",
|
|
140
|
-
"type": "uint112"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"internalType": "uint112",
|
|
144
|
-
"name": "_reserve1",
|
|
145
|
-
"type": "uint112"
|
|
146
|
-
}
|
|
147
|
-
],
|
|
148
|
-
"name": "update",
|
|
149
|
-
"outputs": [],
|
|
150
|
-
"stateMutability": "nonpayable",
|
|
151
|
-
"type": "function"
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
"bytecode": "0x608060405234801561001057600080fd5b506104e4806100206000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80635a3d5493116100665780635a3d5493146101585780637464fc3d14610161578063abf812721461016a578063d21220a714610187578063d9fc83c61461019a57600080fd5b80630902f1ac146100985780630dfe1681146100d8578063485cc955146101035780635909c0d514610141575b600080fd5b600254604080516001600160701b038084168252600160701b8404166020820152600160e01b90920463ffffffff16908201526060015b60405180910390f35b6000546100eb906001600160a01b031681565b6040516001600160a01b0390911681526020016100cf565b61013f610111366004610391565b600080546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055565b005b61014a60035481565b6040519081526020016100cf565b61014a60045481565b61014a60055481565b6101726101ad565b60405163ffffffff90911681526020016100cf565b6001546100eb906001600160a01b031681565b61013f6101a83660046103db565b6101c3565b60006101be64010000000042610437565b905090565b6001600160701b0384118015906101e157506001600160701b038311155b6102275760405162461bcd60e51b815260206004820152601360248201527250616e63616b6556323a204f564552464c4f5760681b604482015260640160405180910390fd5b600061023864010000000042610437565b60025490915063ffffffff600160e01b909104811682039081161580159061026857506001600160701b03841615155b801561027c57506001600160701b03831615155b156102e7578063ffffffff166102a4856102958661033a565b6001600160e01b031690610359565b600380546001600160e01b03929092169290920201905563ffffffff81166102cf846102958761033a565b600480546001600160e01b0392909216929092020190555b506002805463ffffffff909216600160e01b026001600160e01b036001600160701b03968716600160701b026001600160e01b031990941696909716959095179190911794909416929092179092555050565b6000610353600160701b6001600160701b03841661044b565b92915050565b600061036e6001600160701b03831684610488565b9392505050565b80356001600160a01b038116811461038c57600080fd5b919050565b600080604083850312156103a457600080fd5b6103ad83610375565b91506103bb60208401610375565b90509250929050565b80356001600160701b038116811461038c57600080fd5b600080600080608085870312156103f157600080fd5b8435935060208501359250610408604086016103c4565b9150610416606086016103c4565b905092959194509250565b634e487b7160e01b600052601260045260246000fd5b60008261044657610446610421565b500690565b60006001600160e01b038281168482168115158284048211161561047f57634e487b7160e01b600052601160045260246000fd5b02949350505050565b60006001600160e01b03838116806104a2576104a2610421565b9216919091049291505056fea2646970667358221220f004ca14fe33dd19fbd8c35a6fb88523d1e18a170538bdd7d6cb8410862c876364736f6c634300080d0033",
|
|
155
|
-
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c80635a3d5493116100665780635a3d5493146101585780637464fc3d14610161578063abf812721461016a578063d21220a714610187578063d9fc83c61461019a57600080fd5b80630902f1ac146100985780630dfe1681146100d8578063485cc955146101035780635909c0d514610141575b600080fd5b600254604080516001600160701b038084168252600160701b8404166020820152600160e01b90920463ffffffff16908201526060015b60405180910390f35b6000546100eb906001600160a01b031681565b6040516001600160a01b0390911681526020016100cf565b61013f610111366004610391565b600080546001600160a01b039384166001600160a01b03199182161790915560018054929093169116179055565b005b61014a60035481565b6040519081526020016100cf565b61014a60045481565b61014a60055481565b6101726101ad565b60405163ffffffff90911681526020016100cf565b6001546100eb906001600160a01b031681565b61013f6101a83660046103db565b6101c3565b60006101be64010000000042610437565b905090565b6001600160701b0384118015906101e157506001600160701b038311155b6102275760405162461bcd60e51b815260206004820152601360248201527250616e63616b6556323a204f564552464c4f5760681b604482015260640160405180910390fd5b600061023864010000000042610437565b60025490915063ffffffff600160e01b909104811682039081161580159061026857506001600160701b03841615155b801561027c57506001600160701b03831615155b156102e7578063ffffffff166102a4856102958661033a565b6001600160e01b031690610359565b600380546001600160e01b03929092169290920201905563ffffffff81166102cf846102958761033a565b600480546001600160e01b0392909216929092020190555b506002805463ffffffff909216600160e01b026001600160e01b036001600160701b03968716600160701b026001600160e01b031990941696909716959095179190911794909416929092179092555050565b6000610353600160701b6001600160701b03841661044b565b92915050565b600061036e6001600160701b03831684610488565b9392505050565b80356001600160a01b038116811461038c57600080fd5b919050565b600080604083850312156103a457600080fd5b6103ad83610375565b91506103bb60208401610375565b90509250929050565b80356001600160701b038116811461038c57600080fd5b600080600080608085870312156103f157600080fd5b8435935060208501359250610408604086016103c4565b9150610416606086016103c4565b905092959194509250565b634e487b7160e01b600052601260045260246000fd5b60008261044657610446610421565b500690565b60006001600160e01b038281168482168115158284048211161561047f57634e487b7160e01b600052601160045260246000fd5b02949350505050565b60006001600160e01b03838116806104a2576104a2610421565b9216919091049291505056fea2646970667358221220f004ca14fe33dd19fbd8c35a6fb88523d1e18a170538bdd7d6cb8410862c876364736f6c634300080d0033",
|
|
156
|
-
"linkReferences": {},
|
|
157
|
-
"deployedLinkReferences": {}
|
|
158
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "UQ112x112",
|
|
4
|
-
"sourceName": "contracts/test/PancakePairHarness.sol",
|
|
5
|
-
"abi": [],
|
|
6
|
-
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122065dd1aba8b49cec425c48656322d3b21fbfb833a258afc914ec218340bb70b9464736f6c634300080d0033",
|
|
7
|
-
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122065dd1aba8b49cec425c48656322d3b21fbfb833a258afc914ec218340bb70b9464736f6c634300080d0033",
|
|
8
|
-
"linkReferences": {},
|
|
9
|
-
"deployedLinkReferences": {}
|
|
10
|
-
}
|
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "VBEP20Harness",
|
|
4
|
-
"sourceName": "contracts/test/VBEP20Harness.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"inputs": [
|
|
8
|
-
{
|
|
9
|
-
"internalType": "string",
|
|
10
|
-
"name": "name_",
|
|
11
|
-
"type": "string"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"internalType": "string",
|
|
15
|
-
"name": "symbol_",
|
|
16
|
-
"type": "string"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"internalType": "uint8",
|
|
20
|
-
"name": "decimals",
|
|
21
|
-
"type": "uint8"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"internalType": "address",
|
|
25
|
-
"name": "underlying_",
|
|
26
|
-
"type": "address"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"stateMutability": "nonpayable",
|
|
30
|
-
"type": "constructor"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"anonymous": false,
|
|
34
|
-
"inputs": [
|
|
35
|
-
{
|
|
36
|
-
"indexed": true,
|
|
37
|
-
"internalType": "address",
|
|
38
|
-
"name": "owner",
|
|
39
|
-
"type": "address"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"indexed": true,
|
|
43
|
-
"internalType": "address",
|
|
44
|
-
"name": "spender",
|
|
45
|
-
"type": "address"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"indexed": false,
|
|
49
|
-
"internalType": "uint256",
|
|
50
|
-
"name": "value",
|
|
51
|
-
"type": "uint256"
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
"name": "Approval",
|
|
55
|
-
"type": "event"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"anonymous": false,
|
|
59
|
-
"inputs": [
|
|
60
|
-
{
|
|
61
|
-
"indexed": true,
|
|
62
|
-
"internalType": "address",
|
|
63
|
-
"name": "from",
|
|
64
|
-
"type": "address"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"indexed": true,
|
|
68
|
-
"internalType": "address",
|
|
69
|
-
"name": "to",
|
|
70
|
-
"type": "address"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"indexed": false,
|
|
74
|
-
"internalType": "uint256",
|
|
75
|
-
"name": "value",
|
|
76
|
-
"type": "uint256"
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
"name": "Transfer",
|
|
80
|
-
"type": "event"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"inputs": [
|
|
84
|
-
{
|
|
85
|
-
"internalType": "address",
|
|
86
|
-
"name": "owner",
|
|
87
|
-
"type": "address"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"internalType": "address",
|
|
91
|
-
"name": "spender",
|
|
92
|
-
"type": "address"
|
|
93
|
-
}
|
|
94
|
-
],
|
|
95
|
-
"name": "allowance",
|
|
96
|
-
"outputs": [
|
|
97
|
-
{
|
|
98
|
-
"internalType": "uint256",
|
|
99
|
-
"name": "",
|
|
100
|
-
"type": "uint256"
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
"stateMutability": "view",
|
|
104
|
-
"type": "function"
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"inputs": [
|
|
108
|
-
{
|
|
109
|
-
"internalType": "address",
|
|
110
|
-
"name": "spender",
|
|
111
|
-
"type": "address"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"internalType": "uint256",
|
|
115
|
-
"name": "amount",
|
|
116
|
-
"type": "uint256"
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
"name": "approve",
|
|
120
|
-
"outputs": [
|
|
121
|
-
{
|
|
122
|
-
"internalType": "bool",
|
|
123
|
-
"name": "",
|
|
124
|
-
"type": "bool"
|
|
125
|
-
}
|
|
126
|
-
],
|
|
127
|
-
"stateMutability": "nonpayable",
|
|
128
|
-
"type": "function"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"inputs": [
|
|
132
|
-
{
|
|
133
|
-
"internalType": "address",
|
|
134
|
-
"name": "account",
|
|
135
|
-
"type": "address"
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
|
-
"name": "balanceOf",
|
|
139
|
-
"outputs": [
|
|
140
|
-
{
|
|
141
|
-
"internalType": "uint256",
|
|
142
|
-
"name": "",
|
|
143
|
-
"type": "uint256"
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
"stateMutability": "view",
|
|
147
|
-
"type": "function"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"inputs": [],
|
|
151
|
-
"name": "decimals",
|
|
152
|
-
"outputs": [
|
|
153
|
-
{
|
|
154
|
-
"internalType": "uint8",
|
|
155
|
-
"name": "",
|
|
156
|
-
"type": "uint8"
|
|
157
|
-
}
|
|
158
|
-
],
|
|
159
|
-
"stateMutability": "view",
|
|
160
|
-
"type": "function"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"inputs": [],
|
|
164
|
-
"name": "decimalsInternal",
|
|
165
|
-
"outputs": [
|
|
166
|
-
{
|
|
167
|
-
"internalType": "uint8",
|
|
168
|
-
"name": "",
|
|
169
|
-
"type": "uint8"
|
|
170
|
-
}
|
|
171
|
-
],
|
|
172
|
-
"stateMutability": "view",
|
|
173
|
-
"type": "function"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"inputs": [
|
|
177
|
-
{
|
|
178
|
-
"internalType": "address",
|
|
179
|
-
"name": "spender",
|
|
180
|
-
"type": "address"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"internalType": "uint256",
|
|
184
|
-
"name": "subtractedValue",
|
|
185
|
-
"type": "uint256"
|
|
186
|
-
}
|
|
187
|
-
],
|
|
188
|
-
"name": "decreaseAllowance",
|
|
189
|
-
"outputs": [
|
|
190
|
-
{
|
|
191
|
-
"internalType": "bool",
|
|
192
|
-
"name": "",
|
|
193
|
-
"type": "bool"
|
|
194
|
-
}
|
|
195
|
-
],
|
|
196
|
-
"stateMutability": "nonpayable",
|
|
197
|
-
"type": "function"
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
"inputs": [
|
|
201
|
-
{
|
|
202
|
-
"internalType": "address",
|
|
203
|
-
"name": "spender",
|
|
204
|
-
"type": "address"
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
"internalType": "uint256",
|
|
208
|
-
"name": "addedValue",
|
|
209
|
-
"type": "uint256"
|
|
210
|
-
}
|
|
211
|
-
],
|
|
212
|
-
"name": "increaseAllowance",
|
|
213
|
-
"outputs": [
|
|
214
|
-
{
|
|
215
|
-
"internalType": "bool",
|
|
216
|
-
"name": "",
|
|
217
|
-
"type": "bool"
|
|
218
|
-
}
|
|
219
|
-
],
|
|
220
|
-
"stateMutability": "nonpayable",
|
|
221
|
-
"type": "function"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"inputs": [],
|
|
225
|
-
"name": "name",
|
|
226
|
-
"outputs": [
|
|
227
|
-
{
|
|
228
|
-
"internalType": "string",
|
|
229
|
-
"name": "",
|
|
230
|
-
"type": "string"
|
|
231
|
-
}
|
|
232
|
-
],
|
|
233
|
-
"stateMutability": "view",
|
|
234
|
-
"type": "function"
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
"inputs": [],
|
|
238
|
-
"name": "symbol",
|
|
239
|
-
"outputs": [
|
|
240
|
-
{
|
|
241
|
-
"internalType": "string",
|
|
242
|
-
"name": "",
|
|
243
|
-
"type": "string"
|
|
244
|
-
}
|
|
245
|
-
],
|
|
246
|
-
"stateMutability": "view",
|
|
247
|
-
"type": "function"
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
"inputs": [],
|
|
251
|
-
"name": "totalSupply",
|
|
252
|
-
"outputs": [
|
|
253
|
-
{
|
|
254
|
-
"internalType": "uint256",
|
|
255
|
-
"name": "",
|
|
256
|
-
"type": "uint256"
|
|
257
|
-
}
|
|
258
|
-
],
|
|
259
|
-
"stateMutability": "view",
|
|
260
|
-
"type": "function"
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
"inputs": [
|
|
264
|
-
{
|
|
265
|
-
"internalType": "address",
|
|
266
|
-
"name": "to",
|
|
267
|
-
"type": "address"
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
"internalType": "uint256",
|
|
271
|
-
"name": "amount",
|
|
272
|
-
"type": "uint256"
|
|
273
|
-
}
|
|
274
|
-
],
|
|
275
|
-
"name": "transfer",
|
|
276
|
-
"outputs": [
|
|
277
|
-
{
|
|
278
|
-
"internalType": "bool",
|
|
279
|
-
"name": "",
|
|
280
|
-
"type": "bool"
|
|
281
|
-
}
|
|
282
|
-
],
|
|
283
|
-
"stateMutability": "nonpayable",
|
|
284
|
-
"type": "function"
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
"inputs": [
|
|
288
|
-
{
|
|
289
|
-
"internalType": "address",
|
|
290
|
-
"name": "from",
|
|
291
|
-
"type": "address"
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
"internalType": "address",
|
|
295
|
-
"name": "to",
|
|
296
|
-
"type": "address"
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
"internalType": "uint256",
|
|
300
|
-
"name": "amount",
|
|
301
|
-
"type": "uint256"
|
|
302
|
-
}
|
|
303
|
-
],
|
|
304
|
-
"name": "transferFrom",
|
|
305
|
-
"outputs": [
|
|
306
|
-
{
|
|
307
|
-
"internalType": "bool",
|
|
308
|
-
"name": "",
|
|
309
|
-
"type": "bool"
|
|
310
|
-
}
|
|
311
|
-
],
|
|
312
|
-
"stateMutability": "nonpayable",
|
|
313
|
-
"type": "function"
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
"inputs": [],
|
|
317
|
-
"name": "underlying",
|
|
318
|
-
"outputs": [
|
|
319
|
-
{
|
|
320
|
-
"internalType": "address",
|
|
321
|
-
"name": "",
|
|
322
|
-
"type": "address"
|
|
323
|
-
}
|
|
324
|
-
],
|
|
325
|
-
"stateMutability": "view",
|
|
326
|
-
"type": "function"
|
|
327
|
-
}
|
|
328
|
-
],
|
|
329
|
-
"bytecode": "0x60806040526005805460ff191660121790553480156200001e57600080fd5b5060405162000bdd38038062000bdd833981016040819052620000419162000224565b838383828281600390805190602001906200005e929190620000b1565b50805162000074906004906020840190620000b1565b5050600580546001600160a01b03909616610100026001600160a81b031990961660ff909316929092179490941790555062000304945050505050565b828054620000bf90620002c8565b90600052602060002090601f016020900481019282620000e357600085556200012e565b82601f10620000fe57805160ff19168380011785556200012e565b828001600101855582156200012e579182015b828111156200012e57825182559160200191906001019062000111565b506200013c92915062000140565b5090565b5b808211156200013c576000815560010162000141565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200017f57600080fd5b81516001600160401b03808211156200019c576200019c62000157565b604051601f8301601f19908116603f01168101908282118183101715620001c757620001c762000157565b81604052838152602092508683858801011115620001e457600080fd5b600091505b83821015620002085785820183015181830184015290820190620001e9565b838211156200021a5760008385830101525b9695505050505050565b600080600080608085870312156200023b57600080fd5b84516001600160401b03808211156200025357600080fd5b62000261888389016200016d565b955060208701519150808211156200027857600080fd5b5062000287878288016200016d565b935050604085015160ff811681146200029f57600080fd5b60608601519092506001600160a01b0381168114620002bd57600080fd5b939692955090935050565b600181811c90821680620002dd57607f821691505b602082108103620002fe57634e487b7160e01b600052602260045260246000fd5b50919050565b6108c980620003146000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80634511bf6b1161008c57806395d89b411161006657806395d89b41146101cc578063a457c2d7146101d4578063a9059cbb146101e7578063dd62ed3e146101fa57600080fd5b80634511bf6b146101665780636f307dc31461017357806370a08231146101a357600080fd5b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461011557806323b872dd14610127578063313ce5671461013a5780633950935114610153575b600080fd5b6100dc61020d565b6040516100e99190610707565b60405180910390f35b610105610100366004610778565b61029f565b60405190151581526020016100e9565b6002545b6040519081526020016100e9565b6101056101353660046107a2565b6102b7565b60055460ff165b60405160ff90911681526020016100e9565b610105610161366004610778565b6102db565b6005546101419060ff1681565b60055461018b9061010090046001600160a01b031681565b6040516001600160a01b0390911681526020016100e9565b6101196101b13660046107de565b6001600160a01b031660009081526020819052604090205490565b6100dc6102fd565b6101056101e2366004610778565b61030c565b6101056101f5366004610778565b61038c565b610119610208366004610800565b61039a565b60606003805461021c90610833565b80601f016020809104026020016040519081016040528092919081815260200182805461024890610833565b80156102955780601f1061026a57610100808354040283529160200191610295565b820191906000526020600020905b81548152906001019060200180831161027857829003601f168201915b5050505050905090565b6000336102ad8185856103c5565b5060019392505050565b6000336102c58582856104e9565b6102d0858585610563565b506001949350505050565b6000336102ad8185856102ee838361039a565b6102f8919061086d565b6103c5565b60606004805461021c90610833565b6000338161031a828661039a565b90508381101561037f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6102d082868684036103c5565b6000336102ad818585610563565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166104275760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610376565b6001600160a01b0382166104885760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610376565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006104f5848461039a565b9050600019811461055d57818110156105505760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610376565b61055d84848484036103c5565b50505050565b6001600160a01b0383166105c75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610376565b6001600160a01b0382166106295760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610376565b6001600160a01b038316600090815260208190526040902054818110156106a15760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610376565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361055d565b600060208083528351808285015260005b8181101561073457858101830151858201604001528201610718565b81811115610746576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461077357600080fd5b919050565b6000806040838503121561078b57600080fd5b6107948361075c565b946020939093013593505050565b6000806000606084860312156107b757600080fd5b6107c08461075c565b92506107ce6020850161075c565b9150604084013590509250925092565b6000602082840312156107f057600080fd5b6107f98261075c565b9392505050565b6000806040838503121561081357600080fd5b61081c8361075c565b915061082a6020840161075c565b90509250929050565b600181811c9082168061084757607f821691505b60208210810361086757634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561088e57634e487b7160e01b600052601160045260246000fd5b50019056fea26469706673582212203c73320d4f9132c6dd396092fa77e182e171eeea78d16d4751c2a3c52fd9034b64736f6c634300080d0033",
|
|
330
|
-
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80634511bf6b1161008c57806395d89b411161006657806395d89b41146101cc578063a457c2d7146101d4578063a9059cbb146101e7578063dd62ed3e146101fa57600080fd5b80634511bf6b146101665780636f307dc31461017357806370a08231146101a357600080fd5b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461011557806323b872dd14610127578063313ce5671461013a5780633950935114610153575b600080fd5b6100dc61020d565b6040516100e99190610707565b60405180910390f35b610105610100366004610778565b61029f565b60405190151581526020016100e9565b6002545b6040519081526020016100e9565b6101056101353660046107a2565b6102b7565b60055460ff165b60405160ff90911681526020016100e9565b610105610161366004610778565b6102db565b6005546101419060ff1681565b60055461018b9061010090046001600160a01b031681565b6040516001600160a01b0390911681526020016100e9565b6101196101b13660046107de565b6001600160a01b031660009081526020819052604090205490565b6100dc6102fd565b6101056101e2366004610778565b61030c565b6101056101f5366004610778565b61038c565b610119610208366004610800565b61039a565b60606003805461021c90610833565b80601f016020809104026020016040519081016040528092919081815260200182805461024890610833565b80156102955780601f1061026a57610100808354040283529160200191610295565b820191906000526020600020905b81548152906001019060200180831161027857829003601f168201915b5050505050905090565b6000336102ad8185856103c5565b5060019392505050565b6000336102c58582856104e9565b6102d0858585610563565b506001949350505050565b6000336102ad8185856102ee838361039a565b6102f8919061086d565b6103c5565b60606004805461021c90610833565b6000338161031a828661039a565b90508381101561037f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6102d082868684036103c5565b6000336102ad818585610563565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166104275760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610376565b6001600160a01b0382166104885760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610376565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006104f5848461039a565b9050600019811461055d57818110156105505760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610376565b61055d84848484036103c5565b50505050565b6001600160a01b0383166105c75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610376565b6001600160a01b0382166106295760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610376565b6001600160a01b038316600090815260208190526040902054818110156106a15760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610376565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a361055d565b600060208083528351808285015260005b8181101561073457858101830151858201604001528201610718565b81811115610746576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461077357600080fd5b919050565b6000806040838503121561078b57600080fd5b6107948361075c565b946020939093013593505050565b6000806000606084860312156107b757600080fd5b6107c08461075c565b92506107ce6020850161075c565b9150604084013590509250925092565b6000602082840312156107f057600080fd5b6107f98261075c565b9392505050565b6000806040838503121561081357600080fd5b61081c8361075c565b915061082a6020840161075c565b90509250929050565b600181811c9082168061084757607f821691505b60208210810361086757634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561088e57634e487b7160e01b600052601160045260246000fd5b50019056fea26469706673582212203c73320d4f9132c6dd396092fa77e182e171eeea78d16d4751c2a3c52fd9034b64736f6c634300080d0033",
|
|
331
|
-
"linkReferences": {},
|
|
332
|
-
"deployedLinkReferences": {}
|
|
333
|
-
}
|
|
@@ -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
|
-
}
|