@venusprotocol/oracle 1.2.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/build-info/442613ba0e31d357bb61ad07d3e9ccb5.json +1 -0
- package/artifacts/build-info/e79aa95060bbee82bc36063535db4019.json +1 -0
- package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.dbg.json +4 -0
- package/artifacts/contracts/interfaces/PythInterface.sol/AbstractPyth.json +545 -0
- package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.dbg.json +1 -1
- package/artifacts/contracts/interfaces/PythInterface.sol/IPyth.json +130 -15
- package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.dbg.json +1 -1
- package/artifacts/contracts/interfaces/PythInterface.sol/PythStructs.json +2 -2
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/PythOracle.sol/PythOracle.json +2 -2
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.dbg.json +1 -1
- package/artifacts/contracts/oracles/mocks/MockBinanceOracle.sol/MockBinanceOracle.json +22 -3
- 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/test/MockPyth.sol/MockPyth.dbg.json +1 -1
- package/artifacts/contracts/test/MockPyth.sol/MockPyth.json +305 -212
- package/contracts/interfaces/PythInterface.sol +147 -75
- package/contracts/oracles/PythOracle.sol +1 -1
- package/contracts/oracles/mocks/MockBinanceOracle.sol +5 -1
- package/contracts/test/MockPyth.sol +90 -55
- package/deploy/oracles.d.ts +1 -0
- package/deploy/oracles.d.ts.map +1 -1
- package/deploy/oracles.js +16 -1
- package/deploy/oracles.js.map +1 -1
- package/deployments/localhost/.chainId +1 -0
- package/deployments/localhost/BinanceOracle.json +393 -0
- package/deployments/localhost/BinanceOracle_Implementation.json +305 -0
- package/deployments/localhost/BinanceOracle_Proxy.json +241 -0
- package/deployments/localhost/BoundValidator.json +457 -0
- package/deployments/localhost/BoundValidator_Implementation.json +428 -0
- package/deployments/localhost/BoundValidator_Proxy.json +237 -0
- package/deployments/localhost/ChainlinkOracle.json +370 -0
- package/deployments/localhost/ChainlinkOracle_Implementation.json +273 -0
- package/deployments/localhost/ChainlinkOracle_Proxy.json +237 -0
- package/deployments/localhost/DefaultProxyAdmin.json +257 -0
- package/deployments/localhost/PivotTwapOracle.json +393 -0
- package/deployments/localhost/PivotTwapOracle_Implementation.json +304 -0
- package/deployments/localhost/PivotTwapOracle_Proxy.json +241 -0
- package/deployments/localhost/PythOracle.json +393 -0
- package/deployments/localhost/PythOracle_Implementation.json +309 -0
- package/deployments/localhost/PythOracle_Proxy.json +241 -0
- package/deployments/localhost/ResilientOracle.json +700 -0
- package/deployments/localhost/ResilientOracle_Implementation.json +746 -0
- package/deployments/localhost/ResilientOracle_Proxy.json +241 -0
- package/deployments/localhost/solcInputs/0e89febeebc7444140de8e67c9067d2c.json +78 -0
- package/deployments/localhost/solcInputs/468ec7a31e2db8855c82fb8141193271.json +54 -0
- package/deployments/localhost/solcInputs/50629170e50dc9fec79dac585e95ac05.json +138 -0
- package/package.json +1 -1
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
|
|
3
|
+
"abi": [
|
|
4
|
+
{
|
|
5
|
+
"anonymous": false,
|
|
6
|
+
"inputs": [
|
|
7
|
+
{
|
|
8
|
+
"indexed": false,
|
|
9
|
+
"internalType": "uint8",
|
|
10
|
+
"name": "version",
|
|
11
|
+
"type": "uint8"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"name": "Initialized",
|
|
15
|
+
"type": "event"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"anonymous": false,
|
|
19
|
+
"inputs": [
|
|
20
|
+
{
|
|
21
|
+
"indexed": true,
|
|
22
|
+
"internalType": "address",
|
|
23
|
+
"name": "previousOwner",
|
|
24
|
+
"type": "address"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"indexed": true,
|
|
28
|
+
"internalType": "address",
|
|
29
|
+
"name": "newOwner",
|
|
30
|
+
"type": "address"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"name": "OwnershipTransferred",
|
|
34
|
+
"type": "event"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"anonymous": false,
|
|
38
|
+
"inputs": [
|
|
39
|
+
{
|
|
40
|
+
"indexed": true,
|
|
41
|
+
"internalType": "address",
|
|
42
|
+
"name": "asset",
|
|
43
|
+
"type": "address"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"indexed": true,
|
|
47
|
+
"internalType": "uint256",
|
|
48
|
+
"name": "upperBound",
|
|
49
|
+
"type": "uint256"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"indexed": true,
|
|
53
|
+
"internalType": "uint256",
|
|
54
|
+
"name": "lowerBound",
|
|
55
|
+
"type": "uint256"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"name": "ValidateConfigAdded",
|
|
59
|
+
"type": "event"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"inputs": [],
|
|
63
|
+
"name": "initialize",
|
|
64
|
+
"outputs": [],
|
|
65
|
+
"stateMutability": "nonpayable",
|
|
66
|
+
"type": "function"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"inputs": [],
|
|
70
|
+
"name": "owner",
|
|
71
|
+
"outputs": [
|
|
72
|
+
{
|
|
73
|
+
"internalType": "address",
|
|
74
|
+
"name": "",
|
|
75
|
+
"type": "address"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"stateMutability": "view",
|
|
79
|
+
"type": "function"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"inputs": [],
|
|
83
|
+
"name": "renounceOwnership",
|
|
84
|
+
"outputs": [],
|
|
85
|
+
"stateMutability": "nonpayable",
|
|
86
|
+
"type": "function"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"inputs": [
|
|
90
|
+
{
|
|
91
|
+
"components": [
|
|
92
|
+
{
|
|
93
|
+
"internalType": "address",
|
|
94
|
+
"name": "asset",
|
|
95
|
+
"type": "address"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"internalType": "uint256",
|
|
99
|
+
"name": "upperBoundRatio",
|
|
100
|
+
"type": "uint256"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"internalType": "uint256",
|
|
104
|
+
"name": "lowerBoundRatio",
|
|
105
|
+
"type": "uint256"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"internalType": "struct ValidateConfig",
|
|
109
|
+
"name": "config",
|
|
110
|
+
"type": "tuple"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"name": "setValidateConfig",
|
|
114
|
+
"outputs": [],
|
|
115
|
+
"stateMutability": "nonpayable",
|
|
116
|
+
"type": "function"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"inputs": [
|
|
120
|
+
{
|
|
121
|
+
"components": [
|
|
122
|
+
{
|
|
123
|
+
"internalType": "address",
|
|
124
|
+
"name": "asset",
|
|
125
|
+
"type": "address"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"internalType": "uint256",
|
|
129
|
+
"name": "upperBoundRatio",
|
|
130
|
+
"type": "uint256"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"internalType": "uint256",
|
|
134
|
+
"name": "lowerBoundRatio",
|
|
135
|
+
"type": "uint256"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"internalType": "struct ValidateConfig[]",
|
|
139
|
+
"name": "configs",
|
|
140
|
+
"type": "tuple[]"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"name": "setValidateConfigs",
|
|
144
|
+
"outputs": [],
|
|
145
|
+
"stateMutability": "nonpayable",
|
|
146
|
+
"type": "function"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"inputs": [
|
|
150
|
+
{
|
|
151
|
+
"internalType": "address",
|
|
152
|
+
"name": "newOwner",
|
|
153
|
+
"type": "address"
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"name": "transferOwnership",
|
|
157
|
+
"outputs": [],
|
|
158
|
+
"stateMutability": "nonpayable",
|
|
159
|
+
"type": "function"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"inputs": [
|
|
163
|
+
{
|
|
164
|
+
"internalType": "address",
|
|
165
|
+
"name": "",
|
|
166
|
+
"type": "address"
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
"name": "validateConfigs",
|
|
170
|
+
"outputs": [
|
|
171
|
+
{
|
|
172
|
+
"internalType": "address",
|
|
173
|
+
"name": "asset",
|
|
174
|
+
"type": "address"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"internalType": "uint256",
|
|
178
|
+
"name": "upperBoundRatio",
|
|
179
|
+
"type": "uint256"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"internalType": "uint256",
|
|
183
|
+
"name": "lowerBoundRatio",
|
|
184
|
+
"type": "uint256"
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"stateMutability": "view",
|
|
188
|
+
"type": "function"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"inputs": [
|
|
192
|
+
{
|
|
193
|
+
"internalType": "address",
|
|
194
|
+
"name": "vToken",
|
|
195
|
+
"type": "address"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"internalType": "uint256",
|
|
199
|
+
"name": "reporterPrice",
|
|
200
|
+
"type": "uint256"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"internalType": "uint256",
|
|
204
|
+
"name": "anchorPrice",
|
|
205
|
+
"type": "uint256"
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
"name": "validatePriceWithAnchorPrice",
|
|
209
|
+
"outputs": [
|
|
210
|
+
{
|
|
211
|
+
"internalType": "bool",
|
|
212
|
+
"name": "",
|
|
213
|
+
"type": "bool"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"stateMutability": "view",
|
|
217
|
+
"type": "function"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"transactionHash": "0x405be245ebecd2c92a49f06992da0d7a0060aee7606dcfe740a5ebcef6941eb3",
|
|
221
|
+
"receipt": {
|
|
222
|
+
"to": null,
|
|
223
|
+
"from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
|
224
|
+
"contractAddress": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
|
|
225
|
+
"transactionIndex": 0,
|
|
226
|
+
"gasUsed": "666628",
|
|
227
|
+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
228
|
+
"blockHash": "0xb494a5d05fe8d62d53624f680b9e2aea11570959bb1dd852ceea27acc1f23624",
|
|
229
|
+
"transactionHash": "0x405be245ebecd2c92a49f06992da0d7a0060aee7606dcfe740a5ebcef6941eb3",
|
|
230
|
+
"logs": [],
|
|
231
|
+
"blockNumber": 2,
|
|
232
|
+
"cumulativeGasUsed": "666628",
|
|
233
|
+
"status": 1,
|
|
234
|
+
"byzantium": true
|
|
235
|
+
},
|
|
236
|
+
"args": [],
|
|
237
|
+
"numDeployments": 1,
|
|
238
|
+
"solcInputHash": "50629170e50dc9fec79dac585e95ac05",
|
|
239
|
+
"metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"upperBound\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"lowerBound\",\"type\":\"uint256\"}],\"name\":\"ValidateConfigAdded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"upperBoundRatio\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lowerBoundRatio\",\"type\":\"uint256\"}],\"internalType\":\"struct ValidateConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"setValidateConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"upperBoundRatio\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lowerBoundRatio\",\"type\":\"uint256\"}],\"internalType\":\"struct ValidateConfig[]\",\"name\":\"configs\",\"type\":\"tuple[]\"}],\"name\":\"setValidateConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"validateConfigs\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"upperBoundRatio\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lowerBoundRatio\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"reporterPrice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"anchorPrice\",\"type\":\"uint256\"}],\"name\":\"validatePriceWithAnchorPrice\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setValidateConfig((address,uint256,uint256))\":{\"params\":{\"config\":\"config struct\"}},\"setValidateConfigs((address,uint256,uint256)[])\":{\"params\":{\"configs\":\"config array\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"validatePriceWithAnchorPrice(address,uint256,uint256)\":{\"params\":{\"reporterPrice\":\"the price to be tested\",\"vToken\":\"vToken address\"}}},\"version\":1},\"userdoc\":{\"events\":{\"ValidateConfigAdded(address,uint256,uint256)\":{\"notice\":\"Emit this event when new validate configs are added\"}},\"kind\":\"user\",\"methods\":{\"setValidateConfig((address,uint256,uint256))\":{\"notice\":\"Add single validation config\"},\"setValidateConfigs((address,uint256,uint256)[])\":{\"notice\":\"Add multiple validation configs at the same time\"},\"validateConfigs(address)\":{\"notice\":\"validation configs by asset\"},\"validatePriceWithAnchorPrice(address,uint256,uint256)\":{\"notice\":\"Test reported asset price against anchor price\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/oracles/BoundValidator.sol\":\"BoundValidator\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x247c62047745915c0af6b955470a72d1696ebad4352d7d3011aef1a2463cd888\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (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. Equivalent to `reinitializer(1)`.\\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 * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n * initialization step. This is essential to configure modules that are added through upgrades and that require\\n * initialization.\\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 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 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\",\"keccak256\":\"0x0203dcadc5737d9ef2c211d6fa15d18ebc3b30dfa51903b64870b01a062b0b4e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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}\\n\",\"keccak256\":\"0x611aa3f23e59cfdd1863c536776407b3e33d695152a266fa7cfb34440a29a8a3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"contracts/interfaces/BEP20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\ninterface BEP20Interface {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the token decimals.\\n */\\n function decimals() external view returns (uint8);\\n\\n /**\\n * @dev Returns the token symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the bep token owner.\\n */\\n function getOwner() external view returns (address);\\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 `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, 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 `sender` to `recipient` 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 sender,\\n address recipient,\\n uint256 amount\\n ) external returns (bool);\\n\\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\",\"keccak256\":\"0x53aa6d0be81f26e962567f29e9a17f1b73205997c38c6c298e243ef923554c34\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\npragma experimental ABIEncoderV2;\\n\\ninterface OracleInterface {\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address vToken) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address vToken,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x474f40570a75a85caa03217fdef1646e22361ad430b0a67f51b2c038668c3836\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\nimport \\\"./BEP20Interface.sol\\\";\\n\\ninterface VBep20Interface is BEP20Interface {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0xf65bba1e926855bbe2796e061755df640fbae160c0fcbcd996087a24d8049a81\",\"license\":\"UNLICENSED\"},\"contracts/oracles/BoundValidator.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\npragma experimental ABIEncoderV2;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\\\";\\nimport \\\"../interfaces/BEP20Interface.sol\\\";\\nimport \\\"../interfaces/VBep20Interface.sol\\\";\\nimport \\\"../interfaces/OracleInterface.sol\\\";\\n\\nstruct ValidateConfig {\\n /// @notice asset address\\n address asset;\\n /// @notice upper bound of deviation between reported price and anchor price,\\n /// beyond which the reported price will be invalidated\\n uint256 upperBoundRatio;\\n /// @notice lower bound of deviation between reported price and anchor price,\\n /// below which the reported price will be invalidated\\n uint256 lowerBoundRatio;\\n}\\n\\n// BoundValidator provides some common functions and can be used\\n// to wrap up other contracts to form pivot oracles\\ncontract BoundValidator is OwnableUpgradeable, BoundValidatorInterface {\\n /// @notice validation configs by asset\\n mapping(address => ValidateConfig) public validateConfigs;\\n\\n /// @notice Emit this event when new validate configs are added\\n event ValidateConfigAdded(address indexed asset, uint256 indexed upperBound, uint256 indexed lowerBound);\\n\\n function initialize() public initializer {\\n __Ownable_init();\\n }\\n\\n /**\\n * @notice Add multiple validation configs at the same time\\n * @param configs config array\\n */\\n function setValidateConfigs(ValidateConfig[] memory configs) external virtual onlyOwner {\\n require(configs.length > 0, \\\"invalid validate config length\\\");\\n for (uint8 i = 0; i < configs.length; i++) {\\n setValidateConfig(configs[i]);\\n }\\n }\\n\\n /**\\n * @notice Add single validation config\\n * @param config config struct\\n */\\n function setValidateConfig(ValidateConfig memory config) public virtual onlyOwner {\\n require(config.asset != address(0), \\\"asset can't be zero address\\\");\\n require(config.upperBoundRatio > 0 && config.lowerBoundRatio > 0, \\\"bound must be positive\\\");\\n require(config.upperBoundRatio > config.lowerBoundRatio, \\\"upper bound must be higher than lowner bound\\\");\\n validateConfigs[config.asset] = config;\\n emit ValidateConfigAdded(config.asset, config.upperBoundRatio, config.lowerBoundRatio);\\n }\\n\\n /**\\n * @notice Test reported asset price against anchor price\\n * @param vToken vToken address\\n * @param reporterPrice the price to be tested\\n */\\n function validatePriceWithAnchorPrice(\\n address vToken,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) public view virtual override returns (bool) {\\n address asset = VBep20Interface(vToken).underlying();\\n\\n require(validateConfigs[asset].upperBoundRatio != 0, \\\"validation config not exist\\\");\\n require(anchorPrice != 0, \\\"anchor price is not valid\\\");\\n return _isWithinAnchor(asset, reporterPrice, anchorPrice);\\n }\\n\\n /**\\n * @notice Test whether the reported price is within the predefined bounds\\n * @param asset asset address\\n * @param reporterPrice the price to be tested\\n * @param anchorPrice anchor price as testing anchor\\n */\\n function _isWithinAnchor(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) internal view returns (bool) {\\n if (reporterPrice > 0) {\\n uint256 anchorRatio = (anchorPrice * 100e16) / reporterPrice;\\n uint256 upperBoundAnchorRatio = validateConfigs[asset].upperBoundRatio;\\n uint256 lowerBoundAnchorRatio = validateConfigs[asset].lowerBoundRatio;\\n return anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio;\\n }\\n return false;\\n }\\n\\n // BoundValidator is to get inherited, so it's a good practice to add some storage gaps like\\n // OpenZepplin proposed in their contracts: https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x2673feca739760a049f743b37ff0ed43b00c5adb89a3d6859126a3107925c074\",\"license\":\"UNLICENSED\"}},\"version\":1}",
|
|
240
|
+
"bytecode": "0x608060405234801561001057600080fd5b50610b1a806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80639c3576151161005b5780639c357615146100e2578063af9e6c5b146100f5578063bca9e11614610108578063f2fde38b1461016657600080fd5b8063715018a61461008d5780638129fc1c146100975780638da5cb5b1461009f57806397c7033e146100bf575b600080fd5b610095610179565b005b61009561018d565b6033546040516001600160a01b0390911681526020015b60405180910390f35b6100d26100cd366004610826565b6102a3565b60405190151581526020016100b6565b6100956100f0366004610907565b6103da565b6100956101033660046109b7565b61047d565b6101416101163660046109d3565b6065602052600090815260409020805460018201546002909201546001600160a01b03909116919083565b604080516001600160a01b0390941684526020840192909252908201526060016100b6565b6100956101743660046109d3565b61061e565b610181610694565b61018b60006106ee565b565b600054610100900460ff16158080156101ad5750600054600160ff909116105b806101c75750303b1580156101c7575060005460ff166001145b61022f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610252576000805461ff0019166101001790555b61025a610740565b80156102a0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b600080846001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030891906109f0565b6001600160a01b038116600090815260656020526040812060010154919250036103745760405162461bcd60e51b815260206004820152601b60248201527f76616c69646174696f6e20636f6e666967206e6f7420657869737400000000006044820152606401610226565b826000036103c45760405162461bcd60e51b815260206004820152601960248201527f616e63686f72207072696365206973206e6f742076616c6964000000000000006044820152606401610226565b6103cf81858561076f565b9150505b9392505050565b6103e2610694565b60008151116104335760405162461bcd60e51b815260206004820152601e60248201527f696e76616c69642076616c696461746520636f6e666967206c656e67746800006044820152606401610226565b60005b81518160ff16101561047957610467828260ff168151811061045a5761045a610a0d565b602002602001015161047d565b8061047181610a39565b915050610436565b5050565b610485610694565b80516001600160a01b03166104dc5760405162461bcd60e51b815260206004820152601b60248201527f61737365742063616e2774206265207a65726f206164647265737300000000006044820152606401610226565b600081602001511180156104f4575060008160400151115b6105395760405162461bcd60e51b8152602060048201526016602482015275626f756e64206d75737420626520706f73697469766560501b6044820152606401610226565b80604001518160200151116105a55760405162461bcd60e51b815260206004820152602c60248201527f757070657220626f756e64206d75737420626520686967686572207468616e2060448201526b1b1bdddb995c88189bdd5b9960a21b6064820152608401610226565b80516001600160a01b039081166000908152606560209081526040808320855181546001600160a01b03191695169485178155918501516001830181905581860151600290930183905590519193909290917f28e2d96bdcf74fe6203e40d159d27ec2e15230239c0aee4a0a914196c550e6d19190a450565b610626610694565b6001600160a01b03811661068b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610226565b6102a0816106ee565b6033546001600160a01b0316331461018b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610226565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166107675760405162461bcd60e51b815260040161022690610a58565b61018b6107e1565b600082156107d75760008361078c84670de0b6b3a7640000610aa3565b6107969190610ac2565b6001600160a01b03861660009081526065602052604090206001810154600290910154919250908183118015906107cd5750808310155b93505050506103d3565b5060009392505050565b600054610100900460ff166108085760405162461bcd60e51b815260040161022690610a58565b61018b336106ee565b6001600160a01b03811681146102a057600080fd5b60008060006060848603121561083b57600080fd5b833561084681610811565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561089a5761089a61085b565b604052919050565b6000606082840312156108b457600080fd5b6040516060810181811067ffffffffffffffff821117156108d7576108d761085b565b60405290508082356108e881610811565b8082525060208301356020820152604083013560408201525092915050565b6000602080838503121561091a57600080fd5b823567ffffffffffffffff8082111561093257600080fd5b818501915085601f83011261094657600080fd5b8135818111156109585761095861085b565b610966848260051b01610871565b8181528481019250606091820284018501918883111561098557600080fd5b938501935b828510156109ab5761099c89866108a2565b8452938401939285019261098a565b50979650505050505050565b6000606082840312156109c957600080fd5b6103d383836108a2565b6000602082840312156109e557600080fd5b81356103d381610811565b600060208284031215610a0257600080fd5b81516103d381610811565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff8103610a4f57610a4f610a23565b60010192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000816000190483118215151615610abd57610abd610a23565b500290565b600082610adf57634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212208732aea9e4e8810a48ed3b5739b056009946f852c2627616cc2a2895d92d490a64736f6c634300080d0033",
|
|
241
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100885760003560e01c80639c3576151161005b5780639c357615146100e2578063af9e6c5b146100f5578063bca9e11614610108578063f2fde38b1461016657600080fd5b8063715018a61461008d5780638129fc1c146100975780638da5cb5b1461009f57806397c7033e146100bf575b600080fd5b610095610179565b005b61009561018d565b6033546040516001600160a01b0390911681526020015b60405180910390f35b6100d26100cd366004610826565b6102a3565b60405190151581526020016100b6565b6100956100f0366004610907565b6103da565b6100956101033660046109b7565b61047d565b6101416101163660046109d3565b6065602052600090815260409020805460018201546002909201546001600160a01b03909116919083565b604080516001600160a01b0390941684526020840192909252908201526060016100b6565b6100956101743660046109d3565b61061e565b610181610694565b61018b60006106ee565b565b600054610100900460ff16158080156101ad5750600054600160ff909116105b806101c75750303b1580156101c7575060005460ff166001145b61022f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610252576000805461ff0019166101001790555b61025a610740565b80156102a0576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b600080846001600160a01b0316636f307dc36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030891906109f0565b6001600160a01b038116600090815260656020526040812060010154919250036103745760405162461bcd60e51b815260206004820152601b60248201527f76616c69646174696f6e20636f6e666967206e6f7420657869737400000000006044820152606401610226565b826000036103c45760405162461bcd60e51b815260206004820152601960248201527f616e63686f72207072696365206973206e6f742076616c6964000000000000006044820152606401610226565b6103cf81858561076f565b9150505b9392505050565b6103e2610694565b60008151116104335760405162461bcd60e51b815260206004820152601e60248201527f696e76616c69642076616c696461746520636f6e666967206c656e67746800006044820152606401610226565b60005b81518160ff16101561047957610467828260ff168151811061045a5761045a610a0d565b602002602001015161047d565b8061047181610a39565b915050610436565b5050565b610485610694565b80516001600160a01b03166104dc5760405162461bcd60e51b815260206004820152601b60248201527f61737365742063616e2774206265207a65726f206164647265737300000000006044820152606401610226565b600081602001511180156104f4575060008160400151115b6105395760405162461bcd60e51b8152602060048201526016602482015275626f756e64206d75737420626520706f73697469766560501b6044820152606401610226565b80604001518160200151116105a55760405162461bcd60e51b815260206004820152602c60248201527f757070657220626f756e64206d75737420626520686967686572207468616e2060448201526b1b1bdddb995c88189bdd5b9960a21b6064820152608401610226565b80516001600160a01b039081166000908152606560209081526040808320855181546001600160a01b03191695169485178155918501516001830181905581860151600290930183905590519193909290917f28e2d96bdcf74fe6203e40d159d27ec2e15230239c0aee4a0a914196c550e6d19190a450565b610626610694565b6001600160a01b03811661068b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610226565b6102a0816106ee565b6033546001600160a01b0316331461018b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610226565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166107675760405162461bcd60e51b815260040161022690610a58565b61018b6107e1565b600082156107d75760008361078c84670de0b6b3a7640000610aa3565b6107969190610ac2565b6001600160a01b03861660009081526065602052604090206001810154600290910154919250908183118015906107cd5750808310155b93505050506103d3565b5060009392505050565b600054610100900460ff166108085760405162461bcd60e51b815260040161022690610a58565b61018b336106ee565b6001600160a01b03811681146102a057600080fd5b60008060006060848603121561083b57600080fd5b833561084681610811565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561089a5761089a61085b565b604052919050565b6000606082840312156108b457600080fd5b6040516060810181811067ffffffffffffffff821117156108d7576108d761085b565b60405290508082356108e881610811565b8082525060208301356020820152604083013560408201525092915050565b6000602080838503121561091a57600080fd5b823567ffffffffffffffff8082111561093257600080fd5b818501915085601f83011261094657600080fd5b8135818111156109585761095861085b565b610966848260051b01610871565b8181528481019250606091820284018501918883111561098557600080fd5b938501935b828510156109ab5761099c89866108a2565b8452938401939285019261098a565b50979650505050505050565b6000606082840312156109c957600080fd5b6103d383836108a2565b6000602082840312156109e557600080fd5b81356103d381610811565b600060208284031215610a0257600080fd5b81516103d381610811565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff8103610a4f57610a4f610a23565b60010192915050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000816000190483118215151615610abd57610abd610a23565b500290565b600082610adf57634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212208732aea9e4e8810a48ed3b5739b056009946f852c2627616cc2a2895d92d490a64736f6c634300080d0033",
|
|
242
|
+
"devdoc": {
|
|
243
|
+
"kind": "dev",
|
|
244
|
+
"methods": {
|
|
245
|
+
"owner()": {
|
|
246
|
+
"details": "Returns the address of the current owner."
|
|
247
|
+
},
|
|
248
|
+
"renounceOwnership()": {
|
|
249
|
+
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner."
|
|
250
|
+
},
|
|
251
|
+
"setValidateConfig((address,uint256,uint256))": {
|
|
252
|
+
"params": {
|
|
253
|
+
"config": "config struct"
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
"setValidateConfigs((address,uint256,uint256)[])": {
|
|
257
|
+
"params": {
|
|
258
|
+
"configs": "config array"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"transferOwnership(address)": {
|
|
262
|
+
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
|
|
263
|
+
},
|
|
264
|
+
"validatePriceWithAnchorPrice(address,uint256,uint256)": {
|
|
265
|
+
"params": {
|
|
266
|
+
"reporterPrice": "the price to be tested",
|
|
267
|
+
"vToken": "vToken address"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"version": 1
|
|
272
|
+
},
|
|
273
|
+
"userdoc": {
|
|
274
|
+
"events": {
|
|
275
|
+
"ValidateConfigAdded(address,uint256,uint256)": {
|
|
276
|
+
"notice": "Emit this event when new validate configs are added"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"kind": "user",
|
|
280
|
+
"methods": {
|
|
281
|
+
"setValidateConfig((address,uint256,uint256))": {
|
|
282
|
+
"notice": "Add single validation config"
|
|
283
|
+
},
|
|
284
|
+
"setValidateConfigs((address,uint256,uint256)[])": {
|
|
285
|
+
"notice": "Add multiple validation configs at the same time"
|
|
286
|
+
},
|
|
287
|
+
"validateConfigs(address)": {
|
|
288
|
+
"notice": "validation configs by asset"
|
|
289
|
+
},
|
|
290
|
+
"validatePriceWithAnchorPrice(address,uint256,uint256)": {
|
|
291
|
+
"notice": "Test reported asset price against anchor price"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
"version": 1
|
|
295
|
+
},
|
|
296
|
+
"storageLayout": {
|
|
297
|
+
"storage": [
|
|
298
|
+
{
|
|
299
|
+
"astId": 138,
|
|
300
|
+
"contract": "contracts/oracles/BoundValidator.sol:BoundValidator",
|
|
301
|
+
"label": "_initialized",
|
|
302
|
+
"offset": 0,
|
|
303
|
+
"slot": "0",
|
|
304
|
+
"type": "t_uint8"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"astId": 141,
|
|
308
|
+
"contract": "contracts/oracles/BoundValidator.sol:BoundValidator",
|
|
309
|
+
"label": "_initializing",
|
|
310
|
+
"offset": 1,
|
|
311
|
+
"slot": "0",
|
|
312
|
+
"type": "t_bool"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"astId": 693,
|
|
316
|
+
"contract": "contracts/oracles/BoundValidator.sol:BoundValidator",
|
|
317
|
+
"label": "__gap",
|
|
318
|
+
"offset": 0,
|
|
319
|
+
"slot": "1",
|
|
320
|
+
"type": "t_array(t_uint256)50_storage"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"astId": 10,
|
|
324
|
+
"contract": "contracts/oracles/BoundValidator.sol:BoundValidator",
|
|
325
|
+
"label": "_owner",
|
|
326
|
+
"offset": 0,
|
|
327
|
+
"slot": "51",
|
|
328
|
+
"type": "t_address"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"astId": 130,
|
|
332
|
+
"contract": "contracts/oracles/BoundValidator.sol:BoundValidator",
|
|
333
|
+
"label": "__gap",
|
|
334
|
+
"offset": 0,
|
|
335
|
+
"slot": "52",
|
|
336
|
+
"type": "t_array(t_uint256)49_storage"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"astId": 5208,
|
|
340
|
+
"contract": "contracts/oracles/BoundValidator.sol:BoundValidator",
|
|
341
|
+
"label": "validateConfigs",
|
|
342
|
+
"offset": 0,
|
|
343
|
+
"slot": "101",
|
|
344
|
+
"type": "t_mapping(t_address,t_struct(ValidateConfig)5198_storage)"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"astId": 5423,
|
|
348
|
+
"contract": "contracts/oracles/BoundValidator.sol:BoundValidator",
|
|
349
|
+
"label": "__gap",
|
|
350
|
+
"offset": 0,
|
|
351
|
+
"slot": "102",
|
|
352
|
+
"type": "t_array(t_uint256)49_storage"
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
"types": {
|
|
356
|
+
"t_address": {
|
|
357
|
+
"encoding": "inplace",
|
|
358
|
+
"label": "address",
|
|
359
|
+
"numberOfBytes": "20"
|
|
360
|
+
},
|
|
361
|
+
"t_array(t_uint256)49_storage": {
|
|
362
|
+
"base": "t_uint256",
|
|
363
|
+
"encoding": "inplace",
|
|
364
|
+
"label": "uint256[49]",
|
|
365
|
+
"numberOfBytes": "1568"
|
|
366
|
+
},
|
|
367
|
+
"t_array(t_uint256)50_storage": {
|
|
368
|
+
"base": "t_uint256",
|
|
369
|
+
"encoding": "inplace",
|
|
370
|
+
"label": "uint256[50]",
|
|
371
|
+
"numberOfBytes": "1600"
|
|
372
|
+
},
|
|
373
|
+
"t_bool": {
|
|
374
|
+
"encoding": "inplace",
|
|
375
|
+
"label": "bool",
|
|
376
|
+
"numberOfBytes": "1"
|
|
377
|
+
},
|
|
378
|
+
"t_mapping(t_address,t_struct(ValidateConfig)5198_storage)": {
|
|
379
|
+
"encoding": "mapping",
|
|
380
|
+
"key": "t_address",
|
|
381
|
+
"label": "mapping(address => struct ValidateConfig)",
|
|
382
|
+
"numberOfBytes": "32",
|
|
383
|
+
"value": "t_struct(ValidateConfig)5198_storage"
|
|
384
|
+
},
|
|
385
|
+
"t_struct(ValidateConfig)5198_storage": {
|
|
386
|
+
"encoding": "inplace",
|
|
387
|
+
"label": "struct ValidateConfig",
|
|
388
|
+
"members": [
|
|
389
|
+
{
|
|
390
|
+
"astId": 5191,
|
|
391
|
+
"contract": "contracts/oracles/BoundValidator.sol:BoundValidator",
|
|
392
|
+
"label": "asset",
|
|
393
|
+
"offset": 0,
|
|
394
|
+
"slot": "0",
|
|
395
|
+
"type": "t_address"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"astId": 5194,
|
|
399
|
+
"contract": "contracts/oracles/BoundValidator.sol:BoundValidator",
|
|
400
|
+
"label": "upperBoundRatio",
|
|
401
|
+
"offset": 0,
|
|
402
|
+
"slot": "1",
|
|
403
|
+
"type": "t_uint256"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"astId": 5197,
|
|
407
|
+
"contract": "contracts/oracles/BoundValidator.sol:BoundValidator",
|
|
408
|
+
"label": "lowerBoundRatio",
|
|
409
|
+
"offset": 0,
|
|
410
|
+
"slot": "2",
|
|
411
|
+
"type": "t_uint256"
|
|
412
|
+
}
|
|
413
|
+
],
|
|
414
|
+
"numberOfBytes": "96"
|
|
415
|
+
},
|
|
416
|
+
"t_uint256": {
|
|
417
|
+
"encoding": "inplace",
|
|
418
|
+
"label": "uint256",
|
|
419
|
+
"numberOfBytes": "32"
|
|
420
|
+
},
|
|
421
|
+
"t_uint8": {
|
|
422
|
+
"encoding": "inplace",
|
|
423
|
+
"label": "uint8",
|
|
424
|
+
"numberOfBytes": "1"
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|