@venusprotocol/oracle 1.10.0-dev.6 → 1.10.0-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/@chainlink/contracts/src/v0.8/interfaces/AggregatorInterface.sol/AggregatorInterface.dbg.json +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/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/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/SafeCast.sol/SafeCast.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +1 -1
- 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/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlManager.sol/AccessControlManager.dbg.json +1 -1
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol/AccessControlledV8.dbg.json +1 -1
- package/artifacts/@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.dbg.json +1 -1
- package/artifacts/build-info/{cdd56e5e725d884c2b45e24d2c35e787.json → 638cd69d02b98374ef5a7808334083e6.json} +1 -1
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.dbg.json +1 -1
- package/artifacts/contracts/interfaces/FeedRegistryInterface.sol/FeedRegistryInterface.dbg.json +1 -1
- package/artifacts/contracts/interfaces/IStETH.sol/IStETH.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/SIDRegistryInterface.sol/SIDRegistryInterface.dbg.json +1 -1
- package/artifacts/contracts/interfaces/VBep20Interface.sol/VBep20Interface.dbg.json +1 -1
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.dbg.json +1 -1
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/WstETHOracle.sol/WstETHOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/WstETHOracle.sol/WstETHOracle.json +20 -2
- package/artifacts/contracts/oracles/mocks/MockBinanceFeedRegistry.sol/MockBinanceFeedRegistry.dbg.json +1 -1
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/mocks/MockChainlinkOracle.sol/MockChainlinkOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/mocks/MockPythOracle.sol/MockPythOracle.dbg.json +1 -1
- package/artifacts/contracts/test/AccessControlManager.sol/AccessControlManagerScenario.dbg.json +1 -1
- package/artifacts/contracts/test/BEP20Harness.sol/BEP20Harness.dbg.json +1 -1
- package/artifacts/contracts/test/MockPyth.sol/MockPyth.dbg.json +1 -1
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockBoundValidator.dbg.json +1 -1
- package/artifacts/contracts/test/MockSimpleOracle.sol/MockSimpleOracle.dbg.json +1 -1
- package/artifacts/contracts/test/MockV3Aggregator.sol/MockV3Aggregator.dbg.json +1 -1
- package/artifacts/contracts/test/PancakePairHarness.sol/Math.dbg.json +1 -1
- package/artifacts/contracts/test/PancakePairHarness.sol/PancakePairHarness.dbg.json +1 -1
- package/artifacts/contracts/test/PancakePairHarness.sol/UQ112x112.dbg.json +1 -1
- package/artifacts/contracts/test/VBEP20Harness.sol/VBEP20Harness.dbg.json +1 -1
- package/contracts/oracles/WstETHOracle.sol +19 -7
- package/deployments/ethereum/{WstETHOracle.json → WstETHOracle_Equivalence.json} +38 -25
- package/deployments/ethereum/WstETHOracle_Equivalence_Implementation.json +229 -0
- package/deployments/ethereum/{WstETHOracle_Proxy.json → WstETHOracle_Equivalence_Proxy.json} +24 -24
- package/deployments/ethereum/WstETHOracle_NonEquivalence.json +303 -0
- package/deployments/ethereum/WstETHOracle_NonEquivalence_Implementation.json +229 -0
- package/deployments/ethereum/WstETHOracle_NonEquivalence_Proxy.json +213 -0
- package/deployments/ethereum/solcInputs/643c04e89f008dea200654c141acbf47.json +48 -0
- package/deployments/ethereum.json +523 -6
- package/deployments/ethereum_addresses.json +6 -3
- package/dist/deploy/3-vip-based-configuration.js +1 -1
- package/dist/deploy/3-vip-based-configuration.js.map +1 -1
- package/dist/deploy/4-deploy-wstETH-oracle.d.ts.map +1 -1
- package/dist/deploy/4-deploy-wstETH-oracle.js +14 -2
- package/dist/deploy/4-deploy-wstETH-oracle.js.map +1 -1
- package/dist/helpers/deploymentConfig.d.ts.map +1 -1
- package/dist/helpers/deploymentConfig.js +39 -0
- package/dist/helpers/deploymentConfig.js.map +1 -1
- package/dist/typechain-types/contracts/oracles/WstETHOracle.d.ts +9 -1
- package/dist/typechain-types/contracts/oracles/WstETHOracle.d.ts.map +1 -1
- package/dist/typechain-types/factories/contracts/oracles/WstETHOracle__factory.d.ts +17 -3
- package/dist/typechain-types/factories/contracts/oracles/WstETHOracle__factory.d.ts.map +1 -1
- package/dist/typechain-types/factories/contracts/oracles/WstETHOracle__factory.js +23 -5
- package/dist/typechain-types/factories/contracts/oracles/WstETHOracle__factory.js.map +1 -1
- package/package.json +1 -1
- package/deployments/ethereum/WstETHOracle_Implementation.json +0 -203
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"address": "0xC473E5c2bcB6A354389BB7cbC3912A71eF590c6f",
|
|
3
|
-
"abi": [
|
|
4
|
-
{
|
|
5
|
-
"inputs": [
|
|
6
|
-
{
|
|
7
|
-
"internalType": "address",
|
|
8
|
-
"name": "wstETHAddress",
|
|
9
|
-
"type": "address"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"internalType": "address",
|
|
13
|
-
"name": "wETHAddress",
|
|
14
|
-
"type": "address"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"internalType": "address",
|
|
18
|
-
"name": "stETHAddress",
|
|
19
|
-
"type": "address"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"internalType": "address",
|
|
23
|
-
"name": "resilientOracleAddress",
|
|
24
|
-
"type": "address"
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
"stateMutability": "nonpayable",
|
|
28
|
-
"type": "constructor"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"inputs": [],
|
|
32
|
-
"name": "ZeroAddressNotAllowed",
|
|
33
|
-
"type": "error"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"inputs": [],
|
|
37
|
-
"name": "RESILIENT_ORACLE",
|
|
38
|
-
"outputs": [
|
|
39
|
-
{
|
|
40
|
-
"internalType": "contract OracleInterface",
|
|
41
|
-
"name": "",
|
|
42
|
-
"type": "address"
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"stateMutability": "view",
|
|
46
|
-
"type": "function"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"inputs": [],
|
|
50
|
-
"name": "STETH",
|
|
51
|
-
"outputs": [
|
|
52
|
-
{
|
|
53
|
-
"internalType": "contract IStETH",
|
|
54
|
-
"name": "",
|
|
55
|
-
"type": "address"
|
|
56
|
-
}
|
|
57
|
-
],
|
|
58
|
-
"stateMutability": "view",
|
|
59
|
-
"type": "function"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"inputs": [],
|
|
63
|
-
"name": "WETH_ADDRESS",
|
|
64
|
-
"outputs": [
|
|
65
|
-
{
|
|
66
|
-
"internalType": "address",
|
|
67
|
-
"name": "",
|
|
68
|
-
"type": "address"
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
"stateMutability": "view",
|
|
72
|
-
"type": "function"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"inputs": [],
|
|
76
|
-
"name": "WSTETH_ADDRESS",
|
|
77
|
-
"outputs": [
|
|
78
|
-
{
|
|
79
|
-
"internalType": "address",
|
|
80
|
-
"name": "",
|
|
81
|
-
"type": "address"
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
|
-
"stateMutability": "view",
|
|
85
|
-
"type": "function"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"inputs": [
|
|
89
|
-
{
|
|
90
|
-
"internalType": "address",
|
|
91
|
-
"name": "asset",
|
|
92
|
-
"type": "address"
|
|
93
|
-
}
|
|
94
|
-
],
|
|
95
|
-
"name": "getPrice",
|
|
96
|
-
"outputs": [
|
|
97
|
-
{
|
|
98
|
-
"internalType": "uint256",
|
|
99
|
-
"name": "",
|
|
100
|
-
"type": "uint256"
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
"stateMutability": "view",
|
|
104
|
-
"type": "function"
|
|
105
|
-
}
|
|
106
|
-
],
|
|
107
|
-
"transactionHash": "0xd872c83d3b64651b8f881bec0b8c5b7a65dcb9fa006ef78a7b90deb20681b251",
|
|
108
|
-
"receipt": {
|
|
109
|
-
"to": null,
|
|
110
|
-
"from": "0x0Fd46ceD479C35d3116553Ae2DF190648CFD19Dd",
|
|
111
|
-
"contractAddress": "0xC473E5c2bcB6A354389BB7cbC3912A71eF590c6f",
|
|
112
|
-
"transactionIndex": 96,
|
|
113
|
-
"gasUsed": "274357",
|
|
114
|
-
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
115
|
-
"blockHash": "0x30395d2b0db59aa5c5b3cb9bab935cd9ef5420689c658e18e288ccb0f3e9b8cd",
|
|
116
|
-
"transactionHash": "0xd872c83d3b64651b8f881bec0b8c5b7a65dcb9fa006ef78a7b90deb20681b251",
|
|
117
|
-
"logs": [],
|
|
118
|
-
"blockNumber": 19075978,
|
|
119
|
-
"cumulativeGasUsed": "9956694",
|
|
120
|
-
"status": 1,
|
|
121
|
-
"byzantium": true
|
|
122
|
-
},
|
|
123
|
-
"args": [
|
|
124
|
-
"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
|
|
125
|
-
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
|
126
|
-
"0xae7ab96520de3a18e5e111b5eaab095312d7fe84",
|
|
127
|
-
"0xd2ce3fb018805ef92b8C5976cb31F84b4E295F94"
|
|
128
|
-
],
|
|
129
|
-
"numDeployments": 1,
|
|
130
|
-
"solcInputHash": "2675f6933965af498101c80cb5610aca",
|
|
131
|
-
"metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"wstETHAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"wETHAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"stETHAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"resilientOracleAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESILIENT_ORACLE\",\"outputs\":[{\"internalType\":\"contract OracleInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"STETH\",\"outputs\":[{\"internalType\":\"contract IStETH\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WETH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WSTETH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"getPrice(address)\":{\"params\":{\"asset\":\"Address of wstETH\"},\"returns\":{\"_0\":\"wstETH Price in USD scaled by 1e18\"}}},\"stateVariables\":{\"RESILIENT_ORACLE\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"STETH\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"WETH_ADDRESS\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"WSTETH_ADDRESS\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"title\":\"WstETHOracle\",\"version\":1},\"userdoc\":{\"errors\":{\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}]},\"kind\":\"user\",\"methods\":{\"RESILIENT_ORACLE()\":{\"notice\":\"Address of Resilient Oracle\"},\"STETH()\":{\"notice\":\"Address of stETH\"},\"WETH_ADDRESS()\":{\"notice\":\"Address of WETH\"},\"WSTETH_ADDRESS()\":{\"notice\":\"Address of wstETH\"},\"constructor\":{\"notice\":\"Constructor for the implementation contract.\"},\"getPrice(address)\":{\"notice\":\"Gets the price of wstETH asset\"}},\"notice\":\"This oracle fetches the price of wstETH asset\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/WstETHOracle.sol\":\"WstETHOracle\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@venusprotocol/solidity-utilities/contracts/constants.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\\nuint256 constant EXP_SCALE = 1e18;\\n\\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\\nuint256 constant MANTISSA_ONE = EXP_SCALE;\\n\\n/// @dev The approximate number of seconds per year\\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\\n\",\"keccak256\":\"0x0464dd1b882ea2925e06e967c025a232c824e9e4c7aee7b97cc255d040594a59\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xd55726634a83a862a9cef9d34c41694d3d0fea86cdbc57d6674af066792194b1\",\"license\":\"BSD-3-Clause\"},\"contracts/interfaces/IStETH.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface IStETH {\\n function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xc298a8004674ce23b9c3b8217285c3c3f926ee3148e58d0dd3863dc7ba9e13e6\",\"license\":\"BSD-3-Clause\"},\"contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x40031b19684ca0c912e794d08c2c0b0d8be77d3c1bdc937830a0658eff899650\",\"license\":\"BSD-3-Clause\"},\"contracts/oracles/WstETHOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport { OracleInterface } from \\\"../interfaces/OracleInterface.sol\\\";\\nimport { IStETH } from \\\"../interfaces/IStETH.sol\\\";\\nimport { ensureNonzeroAddress } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\nimport { EXP_SCALE } from \\\"@venusprotocol/solidity-utilities/contracts/constants.sol\\\";\\n\\n/**\\n * @title WstETHOracle\\n * @author Venus\\n * @notice This oracle fetches the price of wstETH asset\\n */\\ncontract WstETHOracle is OracleInterface {\\n /// @notice Address of stETH\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n IStETH public immutable STETH;\\n\\n /// @notice Address of wstETH\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable WSTETH_ADDRESS;\\n\\n /// @notice Address of WETH\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable WETH_ADDRESS;\\n\\n /// @notice Address of Resilient Oracle\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n OracleInterface public immutable RESILIENT_ORACLE;\\n\\n /// @notice Constructor for the implementation contract.\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address wstETHAddress, address wETHAddress, address stETHAddress, address resilientOracleAddress) {\\n ensureNonzeroAddress(wstETHAddress);\\n ensureNonzeroAddress(wETHAddress);\\n ensureNonzeroAddress(stETHAddress);\\n ensureNonzeroAddress(resilientOracleAddress);\\n WSTETH_ADDRESS = wstETHAddress;\\n WETH_ADDRESS = wETHAddress;\\n STETH = IStETH(stETHAddress);\\n RESILIENT_ORACLE = OracleInterface(resilientOracleAddress);\\n }\\n\\n /**\\n * @notice Gets the price of wstETH asset\\n * @param asset Address of wstETH\\n * @return wstETH Price in USD scaled by 1e18\\n */\\n function getPrice(address asset) public view returns (uint256) {\\n if (asset != WSTETH_ADDRESS) revert(\\\"wrong wstETH address\\\");\\n\\n // get stETH amount for 1 wstETH scaled by 1e18\\n uint256 stETHAmount = STETH.getPooledEthByShares(1 ether);\\n\\n // price is scaled 1e18 (oracle returns 36 - asset decimal scale)\\n uint256 wethUSDPrice = RESILIENT_ORACLE.getPrice(WETH_ADDRESS);\\n\\n // stETHAmount (for 1 wstETH) * wethUSDPrice (assuming 1stETH = 1 WETH) / 1e18\\n return (stETHAmount * wethUSDPrice) / EXP_SCALE;\\n }\\n}\\n\",\"keccak256\":\"0x27d0bee44b9f5568b77a463ccec06e8221c18f98245cd8ef641ba07857a9a3fd\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
|
|
132
|
-
"bytecode": "0x61010060405234801561001157600080fd5b5060405161054e38038061054e833981016040819052610030916100bc565b61003984610076565b61004283610076565b61004b82610076565b61005481610076565b6001600160a01b0393841660a05291831660c05282166080521660e052610110565b6001600160a01b03811661009d576040516342bcdf7f60e11b815260040160405180910390fd5b50565b80516001600160a01b03811681146100b757600080fd5b919050565b600080600080608085870312156100d257600080fd5b6100db856100a0565b93506100e9602086016100a0565b92506100f7604086016100a0565b9150610105606086016100a0565b905092959194509250565b60805160a05160c05160e0516103ec6101626000396000818160ed015261028c0152600081816061015261025e01526000818160a5015261013a01526000818161011401526101d401526103ec6000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063040141e51461005c57806336e6372f146100a057806341976e09146100c7578063a4edcd4c146100e8578063e00bfe501461010f575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6100da6100d536600461031e565b610136565b604051908152602001610097565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146101b45760405162461bcd60e51b815260206004820152601460248201527377726f6e6720777374455448206164647265737360601b604482015260640160405180910390fd5b604051630f451f7160e31b8152670de0b6b3a764000060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637a28fb8890602401602060405180830381865afa158015610223573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610247919061034e565b6040516341976e0960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301529192506000917f000000000000000000000000000000000000000000000000000000000000000016906341976e0990602401602060405180830381865afa1580156102d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f7919061034e565b9050670de0b6b3a764000061030c8284610367565b6103169190610394565b949350505050565b60006020828403121561033057600080fd5b81356001600160a01b038116811461034757600080fd5b9392505050565b60006020828403121561036057600080fd5b5051919050565b600081600019048311821515161561038f57634e487b7160e01b600052601160045260246000fd5b500290565b6000826103b157634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220a8f9a8f1a8608adeecb9b55d75b5323708d1dff1cb19eef13af1bd4ea11a34ab64736f6c634300080d0033",
|
|
133
|
-
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063040141e51461005c57806336e6372f146100a057806341976e09146100c7578063a4edcd4c146100e8578063e00bfe501461010f575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6100da6100d536600461031e565b610136565b604051908152602001610097565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316146101b45760405162461bcd60e51b815260206004820152601460248201527377726f6e6720777374455448206164647265737360601b604482015260640160405180910390fd5b604051630f451f7160e31b8152670de0b6b3a764000060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690637a28fb8890602401602060405180830381865afa158015610223573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610247919061034e565b6040516341976e0960e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301529192506000917f000000000000000000000000000000000000000000000000000000000000000016906341976e0990602401602060405180830381865afa1580156102d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f7919061034e565b9050670de0b6b3a764000061030c8284610367565b6103169190610394565b949350505050565b60006020828403121561033057600080fd5b81356001600160a01b038116811461034757600080fd5b9392505050565b60006020828403121561036057600080fd5b5051919050565b600081600019048311821515161561038f57634e487b7160e01b600052601160045260246000fd5b500290565b6000826103b157634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220a8f9a8f1a8608adeecb9b55d75b5323708d1dff1cb19eef13af1bd4ea11a34ab64736f6c634300080d0033",
|
|
134
|
-
"devdoc": {
|
|
135
|
-
"author": "Venus",
|
|
136
|
-
"kind": "dev",
|
|
137
|
-
"methods": {
|
|
138
|
-
"constructor": {
|
|
139
|
-
"custom:oz-upgrades-unsafe-allow": "constructor"
|
|
140
|
-
},
|
|
141
|
-
"getPrice(address)": {
|
|
142
|
-
"params": {
|
|
143
|
-
"asset": "Address of wstETH"
|
|
144
|
-
},
|
|
145
|
-
"returns": {
|
|
146
|
-
"_0": "wstETH Price in USD scaled by 1e18"
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
"stateVariables": {
|
|
151
|
-
"RESILIENT_ORACLE": {
|
|
152
|
-
"custom:oz-upgrades-unsafe-allow": "state-variable-immutable"
|
|
153
|
-
},
|
|
154
|
-
"STETH": {
|
|
155
|
-
"custom:oz-upgrades-unsafe-allow": "state-variable-immutable"
|
|
156
|
-
},
|
|
157
|
-
"WETH_ADDRESS": {
|
|
158
|
-
"custom:oz-upgrades-unsafe-allow": "state-variable-immutable"
|
|
159
|
-
},
|
|
160
|
-
"WSTETH_ADDRESS": {
|
|
161
|
-
"custom:oz-upgrades-unsafe-allow": "state-variable-immutable"
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
"title": "WstETHOracle",
|
|
165
|
-
"version": 1
|
|
166
|
-
},
|
|
167
|
-
"userdoc": {
|
|
168
|
-
"errors": {
|
|
169
|
-
"ZeroAddressNotAllowed()": [
|
|
170
|
-
{
|
|
171
|
-
"notice": "Thrown if the supplied address is a zero address where it is not allowed"
|
|
172
|
-
}
|
|
173
|
-
]
|
|
174
|
-
},
|
|
175
|
-
"kind": "user",
|
|
176
|
-
"methods": {
|
|
177
|
-
"RESILIENT_ORACLE()": {
|
|
178
|
-
"notice": "Address of Resilient Oracle"
|
|
179
|
-
},
|
|
180
|
-
"STETH()": {
|
|
181
|
-
"notice": "Address of stETH"
|
|
182
|
-
},
|
|
183
|
-
"WETH_ADDRESS()": {
|
|
184
|
-
"notice": "Address of WETH"
|
|
185
|
-
},
|
|
186
|
-
"WSTETH_ADDRESS()": {
|
|
187
|
-
"notice": "Address of wstETH"
|
|
188
|
-
},
|
|
189
|
-
"constructor": {
|
|
190
|
-
"notice": "Constructor for the implementation contract."
|
|
191
|
-
},
|
|
192
|
-
"getPrice(address)": {
|
|
193
|
-
"notice": "Gets the price of wstETH asset"
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
"notice": "This oracle fetches the price of wstETH asset",
|
|
197
|
-
"version": 1
|
|
198
|
-
},
|
|
199
|
-
"storageLayout": {
|
|
200
|
-
"storage": [],
|
|
201
|
-
"types": null
|
|
202
|
-
}
|
|
203
|
-
}
|