@venusprotocol/oracle 1.6.0 → 1.6.2
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 +107 -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 +4 -0
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.json +215 -0
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.json +183 -0
- package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +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 +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +30 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +30 -0
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.dbg.json +1 -1
- package/artifacts/@openzeppelin/contracts/utils/math/SafeMath.sol/SafeMath.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 +4 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.json +115 -0
- package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +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/build-info/a47a69a8f108d3e7113faf89771988ff.json +1 -0
- package/artifacts/contracts/Governance/AccessControlManager.sol/AccessControlManager.dbg.json +4 -0
- package/artifacts/contracts/Governance/AccessControlManager.sol/AccessControlManager.json +369 -0
- package/artifacts/contracts/Governance/AccessControlled.sol/AccessControlled.dbg.json +4 -0
- package/artifacts/contracts/Governance/AccessControlled.sol/AccessControlled.json +181 -0
- package/artifacts/contracts/Governance/IAccessControlManager.sol/IAccessControlManager.dbg.json +4 -0
- package/artifacts/contracts/Governance/IAccessControlManager.sol/IAccessControlManager.json +282 -0
- package/artifacts/contracts/PriceOracle.sol/PriceOracle.dbg.json +1 -1
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.dbg.json +1 -1
- package/artifacts/contracts/ResilientOracle.sol/ResilientOracle.json +130 -2
- 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 +4 -0
- package/artifacts/contracts/interfaces/PublicResolverInterface.sol/PublicResolverInterface.json +30 -0
- 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 +4 -0
- package/artifacts/contracts/interfaces/SIDRegistryInterface.sol/SIDRegistryInterface.json +30 -0
- 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/IPancakePair.dbg.json +1 -1
- package/artifacts/contracts/libraries/PancakeLibrary.sol/PancakeOracleLibrary.dbg.json +1 -1
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/BinanceOracle.sol/BinanceOracle.json +37 -6
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.dbg.json +1 -1
- package/artifacts/contracts/oracles/BoundValidator.sol/BoundValidator.json +131 -2
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/ChainlinkOracle.sol/ChainlinkOracle.json +122 -6
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.json +130 -2
- package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/TwapOracle.sol/TwapOracle.json +132 -3
- 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/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/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/Governance/AccessControlManager.sol +99 -0
- package/contracts/Governance/AccessControlled.sol +75 -0
- package/contracts/Governance/IAccessControlManager.sol +22 -0
- package/contracts/ResilientOracle.sol +44 -14
- package/contracts/interfaces/PublicResolverInterface.sol +7 -0
- package/contracts/interfaces/SIDRegistryInterface.sol +7 -0
- package/contracts/oracles/BinanceOracle.sol +35 -7
- package/contracts/oracles/BoundValidator.sol +36 -8
- package/contracts/oracles/ChainlinkOracle.sol +31 -21
- package/contracts/oracles/PythOracle.sol +23 -8
- package/contracts/oracles/TwapOracle.sol +41 -11
- package/deploy/1-deploy-oracles.ts +149 -0
- package/deploy/2-configure-feeds.ts +208 -0
- package/deployments/bsctestnet/AccessControlManager.json +563 -0
- package/deployments/bsctestnet/BinanceOracle.json +66 -40
- package/deployments/bsctestnet/BinanceOracle_Implementation.json +84 -38
- package/deployments/bsctestnet/BinanceOracle_Proxy.json +34 -34
- package/deployments/bsctestnet/BoundValidator.json +177 -39
- package/deployments/bsctestnet/BoundValidator_Implementation.json +248 -40
- package/deployments/bsctestnet/BoundValidator_Proxy.json +51 -37
- package/deployments/bsctestnet/ChainlinkOracle.json +161 -50
- package/deployments/bsctestnet/ChainlinkOracle_Implementation.json +239 -47
- package/deployments/bsctestnet/ChainlinkOracle_Proxy.json +44 -44
- package/deployments/bsctestnet/DefaultProxyAdmin.json +18 -18
- package/deployments/bsctestnet/PythOracle.json +178 -45
- package/deployments/bsctestnet/PythOracle_Implementation.json +246 -43
- package/deployments/bsctestnet/PythOracle_Proxy.json +53 -43
- package/deployments/bsctestnet/ResilientOracle.json +167 -48
- package/deployments/bsctestnet/ResilientOracle_Implementation.json +254 -51
- package/deployments/bsctestnet/ResilientOracle_Proxy.json +42 -46
- package/deployments/bsctestnet/TwapOracle.json +178 -40
- package/deployments/bsctestnet/TwapOracle_Implementation.json +270 -58
- package/deployments/bsctestnet/TwapOracle_Proxy.json +51 -37
- package/deployments/bsctestnet/solcInputs/{6153c675ce838eebb6442d63350712be.json → 30f2cb3e89e183b8669f05bddf9426d9.json} +46 -7
- package/package.json +3 -2
- package/artifacts/build-info/1d7bedd9b14544f287811332b9a539d7.json +0 -1
- package/artifacts/build-info/57da5d39a9f98618d0dcf1f6d4ff6b0d.json +0 -1
- package/artifacts/build-info/f6af69795174616b8b4a6373f9f1c538.json +0 -1
- 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 +0 -128
- 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 +0 -139
- package/deploy/2-configure-feeds.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"address": "
|
|
2
|
+
"address": "0xCEE187C42cF060486d0960102BaeA96e24870150",
|
|
3
3
|
"abi": [
|
|
4
4
|
{
|
|
5
5
|
"anonymous": false,
|
|
@@ -126,10 +126,10 @@
|
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
"inputs": [],
|
|
129
|
-
"name": "
|
|
129
|
+
"name": "getFeedRegistryAddress",
|
|
130
130
|
"outputs": [
|
|
131
131
|
{
|
|
132
|
-
"internalType": "
|
|
132
|
+
"internalType": "address",
|
|
133
133
|
"name": "",
|
|
134
134
|
"type": "address"
|
|
135
135
|
}
|
|
@@ -159,8 +159,8 @@
|
|
|
159
159
|
{
|
|
160
160
|
"inputs": [
|
|
161
161
|
{
|
|
162
|
-
"internalType": "
|
|
163
|
-
"name": "
|
|
162
|
+
"internalType": "address",
|
|
163
|
+
"name": "_sidRegistryAddress",
|
|
164
164
|
"type": "address"
|
|
165
165
|
}
|
|
166
166
|
],
|
|
@@ -169,6 +169,19 @@
|
|
|
169
169
|
"stateMutability": "nonpayable",
|
|
170
170
|
"type": "function"
|
|
171
171
|
},
|
|
172
|
+
{
|
|
173
|
+
"inputs": [],
|
|
174
|
+
"name": "sidRegistryAddress",
|
|
175
|
+
"outputs": [
|
|
176
|
+
{
|
|
177
|
+
"internalType": "address",
|
|
178
|
+
"name": "",
|
|
179
|
+
"type": "address"
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"stateMutability": "view",
|
|
183
|
+
"type": "function"
|
|
184
|
+
},
|
|
172
185
|
{
|
|
173
186
|
"inputs": [],
|
|
174
187
|
"name": "vBnb",
|
|
@@ -182,6 +195,19 @@
|
|
|
182
195
|
"stateMutability": "view",
|
|
183
196
|
"type": "function"
|
|
184
197
|
},
|
|
198
|
+
{
|
|
199
|
+
"inputs": [],
|
|
200
|
+
"name": "vai",
|
|
201
|
+
"outputs": [
|
|
202
|
+
{
|
|
203
|
+
"internalType": "address",
|
|
204
|
+
"name": "",
|
|
205
|
+
"type": "address"
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"stateMutability": "view",
|
|
209
|
+
"type": "function"
|
|
210
|
+
},
|
|
185
211
|
{
|
|
186
212
|
"inputs": [
|
|
187
213
|
{
|
|
@@ -204,60 +230,60 @@
|
|
|
204
230
|
"type": "constructor"
|
|
205
231
|
}
|
|
206
232
|
],
|
|
207
|
-
"transactionHash": "
|
|
233
|
+
"transactionHash": "0xa23d36338a5916778c0dbb21e72daf70568790054640dcd9cffcf588d79c1c1e",
|
|
208
234
|
"receipt": {
|
|
209
235
|
"to": null,
|
|
210
|
-
"from": "
|
|
211
|
-
"contractAddress": "
|
|
212
|
-
"transactionIndex":
|
|
213
|
-
"gasUsed": "
|
|
214
|
-
"logsBloom": "
|
|
215
|
-
"blockHash": "
|
|
216
|
-
"transactionHash": "
|
|
236
|
+
"from": "0x8BDA9f9E1fEF0DFd404Fef338D9fE4c543d172e1",
|
|
237
|
+
"contractAddress": "0xCEE187C42cF060486d0960102BaeA96e24870150",
|
|
238
|
+
"transactionIndex": 0,
|
|
239
|
+
"gasUsed": "648397",
|
|
240
|
+
"logsBloom": "0x00000000000000000000000000000000400000000000000000000000100000000000020000000000000000000000000000000000000000000000000040000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000000100000000400008000000000000000000000002000000000000020000000000000000000040000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
241
|
+
"blockHash": "0x1f15749e14e6b6dfb15975ce4fbd161371f2fd67d6cf2ad5b2f39f1e1baaa6ad",
|
|
242
|
+
"transactionHash": "0xa23d36338a5916778c0dbb21e72daf70568790054640dcd9cffcf588d79c1c1e",
|
|
217
243
|
"logs": [
|
|
218
244
|
{
|
|
219
|
-
"transactionIndex":
|
|
220
|
-
"blockNumber":
|
|
221
|
-
"transactionHash": "
|
|
222
|
-
"address": "
|
|
245
|
+
"transactionIndex": 0,
|
|
246
|
+
"blockNumber": 28099637,
|
|
247
|
+
"transactionHash": "0xa23d36338a5916778c0dbb21e72daf70568790054640dcd9cffcf588d79c1c1e",
|
|
248
|
+
"address": "0xCEE187C42cF060486d0960102BaeA96e24870150",
|
|
223
249
|
"topics": [
|
|
224
250
|
"0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b",
|
|
225
|
-
"
|
|
251
|
+
"0x000000000000000000000000642a61aae9d8a8664b57b719cdc5bf6cf1947edf"
|
|
226
252
|
],
|
|
227
253
|
"data": "0x",
|
|
228
|
-
"logIndex":
|
|
229
|
-
"blockHash": "
|
|
254
|
+
"logIndex": 0,
|
|
255
|
+
"blockHash": "0x1f15749e14e6b6dfb15975ce4fbd161371f2fd67d6cf2ad5b2f39f1e1baaa6ad"
|
|
230
256
|
},
|
|
231
257
|
{
|
|
232
|
-
"transactionIndex":
|
|
233
|
-
"blockNumber":
|
|
234
|
-
"transactionHash": "
|
|
235
|
-
"address": "
|
|
258
|
+
"transactionIndex": 0,
|
|
259
|
+
"blockNumber": 28099637,
|
|
260
|
+
"transactionHash": "0xa23d36338a5916778c0dbb21e72daf70568790054640dcd9cffcf588d79c1c1e",
|
|
261
|
+
"address": "0xCEE187C42cF060486d0960102BaeA96e24870150",
|
|
236
262
|
"topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"],
|
|
237
263
|
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
|
|
238
|
-
"logIndex":
|
|
239
|
-
"blockHash": "
|
|
264
|
+
"logIndex": 1,
|
|
265
|
+
"blockHash": "0x1f15749e14e6b6dfb15975ce4fbd161371f2fd67d6cf2ad5b2f39f1e1baaa6ad"
|
|
240
266
|
},
|
|
241
267
|
{
|
|
242
|
-
"transactionIndex":
|
|
243
|
-
"blockNumber":
|
|
244
|
-
"transactionHash": "
|
|
245
|
-
"address": "
|
|
268
|
+
"transactionIndex": 0,
|
|
269
|
+
"blockNumber": 28099637,
|
|
270
|
+
"transactionHash": "0xa23d36338a5916778c0dbb21e72daf70568790054640dcd9cffcf588d79c1c1e",
|
|
271
|
+
"address": "0xCEE187C42cF060486d0960102BaeA96e24870150",
|
|
246
272
|
"topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"],
|
|
247
|
-
"data": "
|
|
248
|
-
"logIndex":
|
|
249
|
-
"blockHash": "
|
|
273
|
+
"data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000038b507cf36fcfb55aac365e32ba3946ad82713fe",
|
|
274
|
+
"logIndex": 2,
|
|
275
|
+
"blockHash": "0x1f15749e14e6b6dfb15975ce4fbd161371f2fd67d6cf2ad5b2f39f1e1baaa6ad"
|
|
250
276
|
}
|
|
251
277
|
],
|
|
252
|
-
"blockNumber":
|
|
253
|
-
"cumulativeGasUsed": "
|
|
278
|
+
"blockNumber": 28099637,
|
|
279
|
+
"cumulativeGasUsed": "648397",
|
|
254
280
|
"status": 1,
|
|
255
281
|
"byzantium": true
|
|
256
282
|
},
|
|
257
283
|
"args": [
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
"
|
|
284
|
+
"0x642A61aae9D8a8664B57B719CDc5bF6cf1947eDf",
|
|
285
|
+
"0x38b507Cf36FCFB55aaC365e32Ba3946AD82713FE",
|
|
286
|
+
"0xc4d66de8000000000000000000000000ffb52185b56603e0fd71de9de4f6f902f05eea23"
|
|
261
287
|
],
|
|
262
288
|
"numDeployments": 1,
|
|
263
289
|
"solcInputHash": "0e89febeebc7444140de8e67c9067d2c",
|
|
@@ -266,9 +292,9 @@
|
|
|
266
292
|
"deployedBytecode": "0x6080604052600436106100435760003560e01c80633659cfe61461005a5780634f1ef2861461007a5780635c60da1b1461008d578063f851a440146100cb57610052565b36610052576100506100e0565b005b6100506100e0565b34801561006657600080fd5b5061005061007536600461076c565b6100fa565b610050610088366004610787565b61015e565b34801561009957600080fd5b506100a26101ec565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100d757600080fd5b506100a2610244565b6100e86102f1565b6100f86100f36103e2565b610422565b565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614156101565761015381604051806020016040528060008152506000610446565b50565b6101536100e0565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614156101e4576101df8383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610446915050565b505050565b6101df6100e0565b60003373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161415610239576102346103e2565b905090565b6102416100e0565b90565b60003373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016141561023957507f000000000000000000000000000000000000000000000000000000000000000090565b60606102ce83836040518060600160405280602781526020016108a460279139610471565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614156100f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b60006102347f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b3660008037600080366000845af43d6000803e808015610441573d6000f35b3d6000fd5b61044f83610599565b60008251118061045c5750805b156101df5761046b83836102a9565b50505050565b606073ffffffffffffffffffffffffffffffffffffffff84163b610517576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e7472616374000000000000000000000000000000000000000000000000000060648201526084016103d9565b6000808573ffffffffffffffffffffffffffffffffffffffff168560405161053f9190610836565b600060405180830381855af49150503d806000811461057a576040519150601f19603f3d011682016040523d82523d6000602084013e61057f565b606091505b509150915061058f8282866105e6565b9695505050505050565b6105a281610639565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606083156105f55750816102ce565b8251156106055782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103d99190610852565b73ffffffffffffffffffffffffffffffffffffffff81163b6106dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e74726163740000000000000000000000000000000000000060648201526084016103d9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b803573ffffffffffffffffffffffffffffffffffffffff8116811461076757600080fd5b919050565b60006020828403121561077e57600080fd5b6102ce82610743565b60008060006040848603121561079c57600080fd5b6107a584610743565b9250602084013567ffffffffffffffff808211156107c257600080fd5b818601915086601f8301126107d657600080fd5b8135818111156107e557600080fd5b8760208285010111156107f757600080fd5b6020830194508093505050509250925092565b60005b8381101561082557818101518382015260200161080d565b8381111561046b5750506000910152565b6000825161084881846020870161080a565b9190910192915050565b602081526000825180602084015261087181604085016020870161080a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212206f70214c51cdd41c05ba0ffeb72b309ca3c8be178fd6e73c12162330799984f364736f6c634300080a0033",
|
|
267
293
|
"execute": {
|
|
268
294
|
"methodName": "initialize",
|
|
269
|
-
"args": ["
|
|
295
|
+
"args": ["0xfFB52185b56603e0fd71De9de4F6f902f05EEA23"]
|
|
270
296
|
},
|
|
271
|
-
"implementation": "
|
|
297
|
+
"implementation": "0x642A61aae9D8a8664B57B719CDc5bF6cf1947eDf",
|
|
272
298
|
"devdoc": {
|
|
273
299
|
"details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.",
|
|
274
300
|
"kind": "dev",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"address": "
|
|
2
|
+
"address": "0x642A61aae9D8a8664B57B719CDc5bF6cf1947eDf",
|
|
3
3
|
"abi": [
|
|
4
4
|
{
|
|
5
5
|
"inputs": [
|
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
"internalType": "address",
|
|
8
8
|
"name": "vBnbAddress",
|
|
9
9
|
"type": "address"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"internalType": "address",
|
|
13
|
+
"name": "vaiAddress",
|
|
14
|
+
"type": "address"
|
|
10
15
|
}
|
|
11
16
|
],
|
|
12
17
|
"stateMutability": "nonpayable",
|
|
@@ -27,10 +32,10 @@
|
|
|
27
32
|
},
|
|
28
33
|
{
|
|
29
34
|
"inputs": [],
|
|
30
|
-
"name": "
|
|
35
|
+
"name": "getFeedRegistryAddress",
|
|
31
36
|
"outputs": [
|
|
32
37
|
{
|
|
33
|
-
"internalType": "
|
|
38
|
+
"internalType": "address",
|
|
34
39
|
"name": "",
|
|
35
40
|
"type": "address"
|
|
36
41
|
}
|
|
@@ -60,8 +65,8 @@
|
|
|
60
65
|
{
|
|
61
66
|
"inputs": [
|
|
62
67
|
{
|
|
63
|
-
"internalType": "
|
|
64
|
-
"name": "
|
|
68
|
+
"internalType": "address",
|
|
69
|
+
"name": "_sidRegistryAddress",
|
|
65
70
|
"type": "address"
|
|
66
71
|
}
|
|
67
72
|
],
|
|
@@ -70,6 +75,19 @@
|
|
|
70
75
|
"stateMutability": "nonpayable",
|
|
71
76
|
"type": "function"
|
|
72
77
|
},
|
|
78
|
+
{
|
|
79
|
+
"inputs": [],
|
|
80
|
+
"name": "sidRegistryAddress",
|
|
81
|
+
"outputs": [
|
|
82
|
+
{
|
|
83
|
+
"internalType": "address",
|
|
84
|
+
"name": "",
|
|
85
|
+
"type": "address"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"stateMutability": "view",
|
|
89
|
+
"type": "function"
|
|
90
|
+
},
|
|
73
91
|
{
|
|
74
92
|
"inputs": [],
|
|
75
93
|
"name": "vBnb",
|
|
@@ -82,48 +100,67 @@
|
|
|
82
100
|
],
|
|
83
101
|
"stateMutability": "view",
|
|
84
102
|
"type": "function"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"inputs": [],
|
|
106
|
+
"name": "vai",
|
|
107
|
+
"outputs": [
|
|
108
|
+
{
|
|
109
|
+
"internalType": "address",
|
|
110
|
+
"name": "",
|
|
111
|
+
"type": "address"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"stateMutability": "view",
|
|
115
|
+
"type": "function"
|
|
85
116
|
}
|
|
86
117
|
],
|
|
87
|
-
"transactionHash": "
|
|
118
|
+
"transactionHash": "0x902fe24cb26a046e6bedf0e965757b543b18e1500f6c2fbf185d25a97f736455",
|
|
88
119
|
"receipt": {
|
|
89
120
|
"to": null,
|
|
90
|
-
"from": "
|
|
91
|
-
"contractAddress": "
|
|
92
|
-
"transactionIndex":
|
|
93
|
-
"gasUsed": "
|
|
94
|
-
"logsBloom": "
|
|
95
|
-
"blockHash": "
|
|
96
|
-
"transactionHash": "
|
|
121
|
+
"from": "0x8BDA9f9E1fEF0DFd404Fef338D9fE4c543d172e1",
|
|
122
|
+
"contractAddress": "0x642A61aae9D8a8664B57B719CDc5bF6cf1947eDf",
|
|
123
|
+
"transactionIndex": 1,
|
|
124
|
+
"gasUsed": "672271",
|
|
125
|
+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000080000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
126
|
+
"blockHash": "0x3bddefc72b877721ce2bcf1d1dc3be6c7a7173cd42f0998cd38411dfe54972f3",
|
|
127
|
+
"transactionHash": "0x902fe24cb26a046e6bedf0e965757b543b18e1500f6c2fbf185d25a97f736455",
|
|
97
128
|
"logs": [
|
|
98
129
|
{
|
|
99
|
-
"transactionIndex":
|
|
100
|
-
"blockNumber":
|
|
101
|
-
"transactionHash": "
|
|
102
|
-
"address": "
|
|
130
|
+
"transactionIndex": 1,
|
|
131
|
+
"blockNumber": 28099636,
|
|
132
|
+
"transactionHash": "0x902fe24cb26a046e6bedf0e965757b543b18e1500f6c2fbf185d25a97f736455",
|
|
133
|
+
"address": "0x642A61aae9D8a8664B57B719CDc5bF6cf1947eDf",
|
|
103
134
|
"topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"],
|
|
104
135
|
"data": "0x00000000000000000000000000000000000000000000000000000000000000ff",
|
|
105
|
-
"logIndex":
|
|
106
|
-
"blockHash": "
|
|
136
|
+
"logIndex": 1,
|
|
137
|
+
"blockHash": "0x3bddefc72b877721ce2bcf1d1dc3be6c7a7173cd42f0998cd38411dfe54972f3"
|
|
107
138
|
}
|
|
108
139
|
],
|
|
109
|
-
"blockNumber":
|
|
110
|
-
"cumulativeGasUsed": "
|
|
140
|
+
"blockNumber": 28099636,
|
|
141
|
+
"cumulativeGasUsed": "745968",
|
|
111
142
|
"status": 1,
|
|
112
143
|
"byzantium": true
|
|
113
144
|
},
|
|
114
|
-
"args": ["0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c"],
|
|
145
|
+
"args": ["0x2E7222e51c0f6e98610A1543Aa3836E092CDe62c", "0x5fFbE5302BadED40941A403228E6AD03f93752d9"],
|
|
115
146
|
"numDeployments": 1,
|
|
116
|
-
"solcInputHash": "
|
|
117
|
-
"metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vBnbAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"feedRegistry\",\"outputs\":[{\"internalType\":\"contract FeedRegistryInterface\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract VBep20Interface\",\"name\":\"vToken\",\"type\":\"address\"}],\"name\":\"getUnderlyingPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract FeedRegistryInterface\",\"name\":\"feed\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vBnb\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\",\"params\":{\"vBnbAddress\":\"The address of the vBNB\"}},\"getUnderlyingPrice(address)\":{\"params\":{\"vToken\":\"Address of the vToken\"},\"returns\":{\"_0\":\"Price in USD\"}},\"initialize(address)\":{\"params\":{\"feed\":\"Address of binance oracle feed registry.\"}}},\"stateVariables\":{\"vBnb\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructor for the implementation contract. Sets immutable variables.\"},\"getUnderlyingPrice(address)\":{\"notice\":\"Gets the price of a vToken from the binance oracle\"},\"initialize(address)\":{\"notice\":\"Sets the contracts required to fetch prices\"},\"vBnb()\":{\"notice\":\"vBNB address\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/BinanceOracle.sol\":\"BinanceOracle\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x037c334add4b033ad3493038c25be1682d78c00992e1acb0e2795caff3925271\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"contracts/interfaces/FeedRegistryInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface FeedRegistryInterface {\\n function latestRoundDataByName(\\n string memory base,\\n string memory quote\\n )\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n\\n function decimalsByName(string memory base, string memory quote) external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x326a2ae7b1ecfc3671ff569363a39c35f7430b13c545d388a0d9d8e29dd5bdb3\",\"license\":\"BSD-3-Clause\"},\"contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x3f845cd51b2d82f7932ac6c0ab714df97f733b01ce50f6fb0adb4c28447d4618\",\"license\":\"BSD-3-Clause\"},\"contracts/oracles/BinanceOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"../interfaces/FeedRegistryInterface.sol\\\";\\nimport \\\"../interfaces/VBep20Interface.sol\\\";\\n\\ncontract BinanceOracle is Initializable {\\n FeedRegistryInterface public feedRegistry;\\n\\n /// @notice vBNB address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vBnb;\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @param vBnbAddress The address of the vBNB\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address vBnbAddress) {\\n require(vBnbAddress != address(0), \\\"can't be zero address\\\");\\n vBnb = vBnbAddress;\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Sets the contracts required to fetch prices\\n * @param feed Address of binance oracle feed registry.\\n */\\n function initialize(FeedRegistryInterface feed) public initializer {\\n feedRegistry = feed;\\n }\\n\\n /**\\n * @notice Gets the price of a vToken from the binance oracle\\n * @param vToken Address of the vToken\\n * @return Price in USD\\n */\\n function getUnderlyingPrice(VBep20Interface vToken) public view returns (uint256) {\\n string memory symbol;\\n uint256 decimals;\\n\\n // VBNB token doesn't have `underlying` method\\n if (address(vToken) == vBnb) {\\n symbol = \\\"BNB\\\";\\n decimals = 18;\\n } else {\\n IERC20Metadata underlyingToken = IERC20Metadata(vToken.underlying());\\n symbol = underlyingToken.symbol();\\n decimals = underlyingToken.decimals();\\n }\\n\\n if (keccak256(bytes(symbol)) == keccak256(bytes(\\\"WBNB\\\"))) {\\n symbol = \\\"BNB\\\";\\n }\\n\\n (, int256 answer, , , ) = feedRegistry.latestRoundDataByName(symbol, \\\"USD\\\");\\n\\n uint256 decimalDelta = feedRegistry.decimalsByName(symbol, \\\"USD\\\");\\n return (uint256(answer) * (10 ** (18 - decimalDelta))) * (10 ** (18 - decimals));\\n }\\n}\\n\",\"keccak256\":\"0x56fc62f711205b053d773001f8dc6afb74b37c36452e382d14c9b94b36b405b6\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
|
|
118
|
-
"bytecode": "
|
|
119
|
-
"deployedBytecode": "
|
|
147
|
+
"solcInputHash": "30f2cb3e89e183b8669f05bddf9426d9",
|
|
148
|
+
"metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vBnbAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"vaiAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"getFeedRegistryAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract VBep20Interface\",\"name\":\"vToken\",\"type\":\"address\"}],\"name\":\"getUnderlyingPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sidRegistryAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"sidRegistryAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vBnb\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vai\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\",\"params\":{\"vBnbAddress\":\"The address of the vBNB\",\"vaiAddress\":\"The address of the VAI\"}},\"getFeedRegistryAddress()\":{\"returns\":{\"_0\":\"feedRegistryAddress Address of binance oracle feed registry.\"}},\"getUnderlyingPrice(address)\":{\"params\":{\"vToken\":\"Address of the vToken\"},\"returns\":{\"_0\":\"Price in USD\"}},\"initialize(address)\":{\"params\":{\"_sidRegistryAddress\":\"Address of SID registry\"}}},\"stateVariables\":{\"vBnb\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"vai\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Constructor for the implementation contract. Sets immutable variables.\"},\"getFeedRegistryAddress()\":{\"notice\":\"Uses Space ID to fetch the feed registry address\"},\"getUnderlyingPrice(address)\":{\"notice\":\"Gets the price of a vToken from the binance oracle\"},\"initialize(address)\":{\"notice\":\"Sets the contracts required to fetch prices\"},\"vBnb()\":{\"notice\":\"vBNB address\"},\"vai()\":{\"notice\":\"VAI address\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/BinanceOracle.sol\":\"BinanceOracle\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x037c334add4b033ad3493038c25be1682d78c00992e1acb0e2795caff3925271\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2edcb41c121abc510932e8d83ff8b82cf9cdde35e7c297622f5c29ef0af25183\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"contracts/interfaces/FeedRegistryInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\ninterface FeedRegistryInterface {\\n function latestRoundDataByName(\\n string memory base,\\n string memory quote\\n )\\n external\\n view\\n returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);\\n\\n function decimalsByName(string memory base, string memory quote) external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x326a2ae7b1ecfc3671ff569363a39c35f7430b13c545d388a0d9d8e29dd5bdb3\",\"license\":\"BSD-3-Clause\"},\"contracts/interfaces/PublicResolverInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\n// SPDX-FileCopyrightText: 2022 Venus\\npragma solidity 0.8.13;\\n\\ninterface PublicResolverInterface {\\n function addr(bytes32 node) external view returns (address payable);\\n}\\n\",\"keccak256\":\"0xdacc261d23a3170a731f5a22377b452f227ebd0e54c7356278b271b55f82455d\",\"license\":\"BSD-3-Clause\"},\"contracts/interfaces/SIDRegistryInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\n// SPDX-FileCopyrightText: 2022 Venus\\npragma solidity 0.8.13;\\n\\ninterface SIDRegistryInterface {\\n function resolver(bytes32 node) external view returns (address);\\n}\\n\",\"keccak256\":\"0x62bc5b95d657a1a8c64a1231510c3e8da7b6a71cb4bde7cd624854cd46f08a49\",\"license\":\"BSD-3-Clause\"},\"contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x3f845cd51b2d82f7932ac6c0ab714df97f733b01ce50f6fb0adb4c28447d4618\",\"license\":\"BSD-3-Clause\"},\"contracts/oracles/BinanceOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.13;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"../interfaces/VBep20Interface.sol\\\";\\nimport \\\"../interfaces/SIDRegistryInterface.sol\\\";\\nimport \\\"../interfaces/FeedRegistryInterface.sol\\\";\\nimport \\\"../interfaces/PublicResolverInterface.sol\\\";\\n\\ncontract BinanceOracle is Initializable {\\n address public sidRegistryAddress;\\n\\n /// @notice vBNB address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vBnb;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @param vBnbAddress The address of the vBNB\\n /// @param vaiAddress The address of the VAI\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(address vBnbAddress, address vaiAddress) {\\n require(vBnbAddress != address(0), \\\"vBNB can't be zero address\\\");\\n require(vaiAddress != address(0), \\\"VAI can't be zero address\\\");\\n vBnb = vBnbAddress;\\n vai = vaiAddress;\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Sets the contracts required to fetch prices\\n * @param _sidRegistryAddress Address of SID registry\\n */\\n function initialize(address _sidRegistryAddress) public initializer {\\n sidRegistryAddress = _sidRegistryAddress;\\n }\\n\\n /**\\n * @notice Uses Space ID to fetch the feed registry address\\n * @return feedRegistryAddress Address of binance oracle feed registry.\\n */\\n function getFeedRegistryAddress() public view returns (address) {\\n bytes32 nodeHash = 0x94fe3821e0768eb35012484db4df61890f9a6ca5bfa984ef8ff717e73139faff;\\n\\n SIDRegistryInterface sidRegistry = SIDRegistryInterface(sidRegistryAddress);\\n address publicResolverAddress = sidRegistry.resolver(nodeHash);\\n PublicResolverInterface publicResolver = PublicResolverInterface(publicResolverAddress);\\n\\n return publicResolver.addr(nodeHash);\\n }\\n\\n /**\\n * @notice Gets the price of a vToken from the binance oracle\\n * @param vToken Address of the vToken\\n * @return Price in USD\\n */\\n function getUnderlyingPrice(VBep20Interface vToken) public view returns (uint256) {\\n string memory symbol;\\n uint256 decimals;\\n\\n // VBNB token doesn't have `underlying` method\\n if (address(vToken) == vBnb) {\\n symbol = \\\"BNB\\\";\\n decimals = 18;\\n } else if (address(vToken) == vai) {\\n symbol = \\\"VAI\\\";\\n decimals = 18;\\n } else {\\n IERC20Metadata underlyingToken = IERC20Metadata(vToken.underlying());\\n symbol = underlyingToken.symbol();\\n decimals = underlyingToken.decimals();\\n }\\n\\n if (keccak256(bytes(symbol)) == keccak256(bytes(\\\"WBNB\\\"))) {\\n symbol = \\\"BNB\\\";\\n }\\n\\n FeedRegistryInterface feedRegistry = FeedRegistryInterface(getFeedRegistryAddress());\\n\\n (, int256 answer, , , ) = feedRegistry.latestRoundDataByName(symbol, \\\"USD\\\");\\n\\n uint256 decimalDelta = feedRegistry.decimalsByName(symbol, \\\"USD\\\");\\n return (uint256(answer) * (10 ** (18 - decimalDelta))) * (10 ** (18 - decimals));\\n }\\n}\\n\",\"keccak256\":\"0xab6ef5a906cfe291db3f5ee5f827b3d09fe7e8de7fbe8b3f804ef65f00dda431\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
|
|
149
|
+
"bytecode": "0x60c060405234801561001057600080fd5b50604051610cdf380380610cdf83398101604081905261002f916101da565b6001600160a01b03821661008a5760405162461bcd60e51b815260206004820152601a60248201527f76424e422063616e2774206265207a65726f206164647265737300000000000060448201526064015b60405180910390fd5b6001600160a01b0381166100e05760405162461bcd60e51b815260206004820152601960248201527f5641492063616e2774206265207a65726f2061646472657373000000000000006044820152606401610081565b6001600160a01b03808316608052811660a0526100fb610102565b505061020d565b600054610100900460ff161561016a5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401610081565b60005460ff90811610156101bc576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b03811681146101d557600080fd5b919050565b600080604083850312156101ed57600080fd5b6101f6836101be565b9150610204602084016101be565b90509250929050565b60805160a051610aa161023e6000396000818160d101526103cc01526000818160a201526103700152610aa16000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063475e7de5146100675780635ba3792d1461009d57806399fe040e146100c4578063b62e4c92146100cc578063c4d66de8146100f3578063fc57d4df14610108575b600080fd5b600054610080906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100807f000000000000000000000000000000000000000000000000000000000000000081565b610080610129565b6100807f000000000000000000000000000000000000000000000000000000000000000081565b61010661010136600461071c565b610238565b005b61011b61011636600461071c565b610368565b604051908152602001610094565b60008054604051630178b8bf60e01b81527f94fe3821e0768eb35012484db4df61890f9a6ca5bfa984ef8ff717e73139faff60048201819052916201000090046001600160a01b03169083908290630178b8bf90602401602060405180830381865afa15801561019d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c19190610740565b604051631d9dabef60e11b81526004810185905290915081906001600160a01b03821690633b3b57de90602401602060405180830381865afa15801561020b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061022f9190610740565b94505050505090565b600054610100900460ff16158080156102585750600054600160ff909116105b806102725750303b158015610272575060005460ff166001145b6102d95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff1916600117905580156102fc576000805461ff0019166101001790555b6000805462010000600160b01b031916620100006001600160a01b038516021790558015610364576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6000606060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316036103ca57505060408051808201909152600381526221272160e91b6020820152601261055d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b03160361042657505060408051808201909152600381526256414960e81b6020820152601261055d565b6000846001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610466573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048a9190610740565b9050806001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156104ca573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104f291908101906107a3565b9250806001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610532573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105569190610845565b60ff169150505b6040805180820190915260048152632ba1272160e11b6020918201528251908301207f95a8318495ccc03d10cce56573b91a66a3b235a7a84e6cbaccd62d888d3e4f19016105c4576040518060400160405280600381526020016221272160e91b81525091505b60006105ce610129565b90506000816001600160a01b031663bfda5e71856040518263ffffffff1660e01b81526004016105fe9190610868565b60a060405180830381865afa15801561061b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063f91906108dd565b5050509150506000826001600160a01b0316636e91995a866040518263ffffffff1660e01b81526004016106739190610868565b602060405180830381865afa158015610690573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b49190610845565b60ff1690506106c4846012610943565b6106cf90600a610a40565b6106da826012610943565b6106e590600a610a40565b6106ef9084610a4c565b6106f99190610a4c565b979650505050505050565b6001600160a01b038116811461071957600080fd5b50565b60006020828403121561072e57600080fd5b813561073981610704565b9392505050565b60006020828403121561075257600080fd5b815161073981610704565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561078e578181015183820152602001610776565b8381111561079d576000848401525b50505050565b6000602082840312156107b557600080fd5b815167ffffffffffffffff808211156107cd57600080fd5b818401915084601f8301126107e157600080fd5b8151818111156107f3576107f361075d565b604051601f8201601f19908116603f0116810190838211818310171561081b5761081b61075d565b8160405282815287602084870101111561083457600080fd5b6106f9836020830160208801610773565b60006020828403121561085757600080fd5b815160ff8116811461073957600080fd5b6040815260008251806040840152610887816060850160208701610773565b601f19601f82011683019050606083820301602084015260036060820152621554d160ea1b608082015260a0810191505092915050565b805169ffffffffffffffffffff811681146108d857600080fd5b919050565b600080600080600060a086880312156108f557600080fd5b6108fe866108be565b9450602086015193506040860151925060608601519150610921608087016108be565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b6000828210156109555761095561092d565b500390565b600181815b8085111561099557816000190482111561097b5761097b61092d565b8085161561098857918102915b93841c939080029061095f565b509250929050565b6000826109ac57506001610a3a565b816109b957506000610a3a565b81600181146109cf57600281146109d9576109f5565b6001915050610a3a565b60ff8411156109ea576109ea61092d565b50506001821b610a3a565b5060208310610133831016604e8410600b8410161715610a18575081810a610a3a565b610a22838361095a565b8060001904821115610a3657610a3661092d565b0290505b92915050565b6000610739838361099d565b6000816000190483118215151615610a6657610a6661092d565b50029056fea264697066735822122068fefea2c8a8c140d98a81d480a20b06adc587bc45e84dff015dc66941c9b56d64736f6c634300080d0033",
|
|
150
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c8063475e7de5146100675780635ba3792d1461009d57806399fe040e146100c4578063b62e4c92146100cc578063c4d66de8146100f3578063fc57d4df14610108575b600080fd5b600054610080906201000090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100807f000000000000000000000000000000000000000000000000000000000000000081565b610080610129565b6100807f000000000000000000000000000000000000000000000000000000000000000081565b61010661010136600461071c565b610238565b005b61011b61011636600461071c565b610368565b604051908152602001610094565b60008054604051630178b8bf60e01b81527f94fe3821e0768eb35012484db4df61890f9a6ca5bfa984ef8ff717e73139faff60048201819052916201000090046001600160a01b03169083908290630178b8bf90602401602060405180830381865afa15801561019d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c19190610740565b604051631d9dabef60e11b81526004810185905290915081906001600160a01b03821690633b3b57de90602401602060405180830381865afa15801561020b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061022f9190610740565b94505050505090565b600054610100900460ff16158080156102585750600054600160ff909116105b806102725750303b158015610272575060005460ff166001145b6102d95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff1916600117905580156102fc576000805461ff0019166101001790555b6000805462010000600160b01b031916620100006001600160a01b038516021790558015610364576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6000606060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b0316036103ca57505060408051808201909152600381526221272160e91b6020820152601261055d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b03160361042657505060408051808201909152600381526256414960e81b6020820152601261055d565b6000846001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610466573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048a9190610740565b9050806001600160a01b03166395d89b416040518163ffffffff1660e01b8152600401600060405180830381865afa1580156104ca573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104f291908101906107a3565b9250806001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610532573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105569190610845565b60ff169150505b6040805180820190915260048152632ba1272160e11b6020918201528251908301207f95a8318495ccc03d10cce56573b91a66a3b235a7a84e6cbaccd62d888d3e4f19016105c4576040518060400160405280600381526020016221272160e91b81525091505b60006105ce610129565b90506000816001600160a01b031663bfda5e71856040518263ffffffff1660e01b81526004016105fe9190610868565b60a060405180830381865afa15801561061b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063f91906108dd565b5050509150506000826001600160a01b0316636e91995a866040518263ffffffff1660e01b81526004016106739190610868565b602060405180830381865afa158015610690573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b49190610845565b60ff1690506106c4846012610943565b6106cf90600a610a40565b6106da826012610943565b6106e590600a610a40565b6106ef9084610a4c565b6106f99190610a4c565b979650505050505050565b6001600160a01b038116811461071957600080fd5b50565b60006020828403121561072e57600080fd5b813561073981610704565b9392505050565b60006020828403121561075257600080fd5b815161073981610704565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561078e578181015183820152602001610776565b8381111561079d576000848401525b50505050565b6000602082840312156107b557600080fd5b815167ffffffffffffffff808211156107cd57600080fd5b818401915084601f8301126107e157600080fd5b8151818111156107f3576107f361075d565b604051601f8201601f19908116603f0116810190838211818310171561081b5761081b61075d565b8160405282815287602084870101111561083457600080fd5b6106f9836020830160208801610773565b60006020828403121561085757600080fd5b815160ff8116811461073957600080fd5b6040815260008251806040840152610887816060850160208701610773565b601f19601f82011683019050606083820301602084015260036060820152621554d160ea1b608082015260a0810191505092915050565b805169ffffffffffffffffffff811681146108d857600080fd5b919050565b600080600080600060a086880312156108f557600080fd5b6108fe866108be565b9450602086015193506040860151925060608601519150610921608087016108be565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b6000828210156109555761095561092d565b500390565b600181815b8085111561099557816000190482111561097b5761097b61092d565b8085161561098857918102915b93841c939080029061095f565b509250929050565b6000826109ac57506001610a3a565b816109b957506000610a3a565b81600181146109cf57600281146109d9576109f5565b6001915050610a3a565b60ff8411156109ea576109ea61092d565b50506001821b610a3a565b5060208310610133831016604e8410600b8410161715610a18575081810a610a3a565b610a22838361095a565b8060001904821115610a3657610a3661092d565b0290505b92915050565b6000610739838361099d565b6000816000190483118215151615610a6657610a6661092d565b50029056fea264697066735822122068fefea2c8a8c140d98a81d480a20b06adc587bc45e84dff015dc66941c9b56d64736f6c634300080d0033",
|
|
120
151
|
"devdoc": {
|
|
121
152
|
"kind": "dev",
|
|
122
153
|
"methods": {
|
|
123
154
|
"constructor": {
|
|
124
155
|
"custom:oz-upgrades-unsafe-allow": "constructor",
|
|
125
156
|
"params": {
|
|
126
|
-
"vBnbAddress": "The address of the vBNB"
|
|
157
|
+
"vBnbAddress": "The address of the vBNB",
|
|
158
|
+
"vaiAddress": "The address of the VAI"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"getFeedRegistryAddress()": {
|
|
162
|
+
"returns": {
|
|
163
|
+
"_0": "feedRegistryAddress Address of binance oracle feed registry."
|
|
127
164
|
}
|
|
128
165
|
},
|
|
129
166
|
"getUnderlyingPrice(address)": {
|
|
@@ -136,13 +173,16 @@
|
|
|
136
173
|
},
|
|
137
174
|
"initialize(address)": {
|
|
138
175
|
"params": {
|
|
139
|
-
"
|
|
176
|
+
"_sidRegistryAddress": "Address of SID registry"
|
|
140
177
|
}
|
|
141
178
|
}
|
|
142
179
|
},
|
|
143
180
|
"stateVariables": {
|
|
144
181
|
"vBnb": {
|
|
145
182
|
"custom:oz-upgrades-unsafe-allow": "state-variable-immutable"
|
|
183
|
+
},
|
|
184
|
+
"vai": {
|
|
185
|
+
"custom:oz-upgrades-unsafe-allow": "state-variable-immutable"
|
|
146
186
|
}
|
|
147
187
|
},
|
|
148
188
|
"version": 1
|
|
@@ -153,6 +193,9 @@
|
|
|
153
193
|
"constructor": {
|
|
154
194
|
"notice": "Constructor for the implementation contract. Sets immutable variables."
|
|
155
195
|
},
|
|
196
|
+
"getFeedRegistryAddress()": {
|
|
197
|
+
"notice": "Uses Space ID to fetch the feed registry address"
|
|
198
|
+
},
|
|
156
199
|
"getUnderlyingPrice(address)": {
|
|
157
200
|
"notice": "Gets the price of a vToken from the binance oracle"
|
|
158
201
|
},
|
|
@@ -161,6 +204,9 @@
|
|
|
161
204
|
},
|
|
162
205
|
"vBnb()": {
|
|
163
206
|
"notice": "vBNB address"
|
|
207
|
+
},
|
|
208
|
+
"vai()": {
|
|
209
|
+
"notice": "VAI address"
|
|
164
210
|
}
|
|
165
211
|
},
|
|
166
212
|
"version": 1
|
|
@@ -168,7 +214,7 @@
|
|
|
168
214
|
"storageLayout": {
|
|
169
215
|
"storage": [
|
|
170
216
|
{
|
|
171
|
-
"astId":
|
|
217
|
+
"astId": 347,
|
|
172
218
|
"contract": "contracts/oracles/BinanceOracle.sol:BinanceOracle",
|
|
173
219
|
"label": "_initialized",
|
|
174
220
|
"offset": 0,
|
|
@@ -176,7 +222,7 @@
|
|
|
176
222
|
"type": "t_uint8"
|
|
177
223
|
},
|
|
178
224
|
{
|
|
179
|
-
"astId":
|
|
225
|
+
"astId": 350,
|
|
180
226
|
"contract": "contracts/oracles/BinanceOracle.sol:BinanceOracle",
|
|
181
227
|
"label": "_initializing",
|
|
182
228
|
"offset": 1,
|
|
@@ -184,25 +230,25 @@
|
|
|
184
230
|
"type": "t_bool"
|
|
185
231
|
},
|
|
186
232
|
{
|
|
187
|
-
"astId":
|
|
233
|
+
"astId": 7034,
|
|
188
234
|
"contract": "contracts/oracles/BinanceOracle.sol:BinanceOracle",
|
|
189
|
-
"label": "
|
|
235
|
+
"label": "sidRegistryAddress",
|
|
190
236
|
"offset": 2,
|
|
191
237
|
"slot": "0",
|
|
192
|
-
"type": "
|
|
238
|
+
"type": "t_address"
|
|
193
239
|
}
|
|
194
240
|
],
|
|
195
241
|
"types": {
|
|
242
|
+
"t_address": {
|
|
243
|
+
"encoding": "inplace",
|
|
244
|
+
"label": "address",
|
|
245
|
+
"numberOfBytes": "20"
|
|
246
|
+
},
|
|
196
247
|
"t_bool": {
|
|
197
248
|
"encoding": "inplace",
|
|
198
249
|
"label": "bool",
|
|
199
250
|
"numberOfBytes": "1"
|
|
200
251
|
},
|
|
201
|
-
"t_contract(FeedRegistryInterface)4357": {
|
|
202
|
-
"encoding": "inplace",
|
|
203
|
-
"label": "contract FeedRegistryInterface",
|
|
204
|
-
"numberOfBytes": "20"
|
|
205
|
-
},
|
|
206
252
|
"t_uint8": {
|
|
207
253
|
"encoding": "inplace",
|
|
208
254
|
"label": "uint8",
|