{ "address": "0x3F556E831FC7463aa0b716A454139f190882D477", "abi": [ { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "inputs": [ { "internalType": "string", "name": "_oracle", "type": "string" }, { "internalType": "address", "name": "_oracleAddress", "type": "address" }, { "internalType": "bytes", "name": "_oraclePayload", "type": "bytes" } ], "name": "addOracle", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_tester", "type": "address" } ], "name": "getMockPrice", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "_oracle", "type": "string" } ], "name": "getPrice", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isOwner", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "mockPrice", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "", "type": "string" } ], "name": "oracle", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "string", "name": "", "type": "string" } ], "name": "oraclePayload", "outputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_mockPrice", "type": "uint256" } ], "name": "setMockPrice", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "transactionHash": "0x0b155dac1767b64526f2a4807cd43fa343d637dc9879fb1d16584440ff07856e", "receipt": { "to": null, "from": "0xe1F076849B781b1395Fd332dC1758Dbc129be6EC", "contractAddress": "0x3F556E831FC7463aa0b716A454139f190882D477", "transactionIndex": 73, "gasUsed": "852374", "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000020000000000000000000000020000000000000000010800000000000000000000000000000000400020000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000010020000000000000000000000000000000000000000000000000000000000000000000", "blockHash": "0x6ddb1431c5fe095b505f074b818ad2641112835e6b46efa7c8ffa189aeef8f35", "transactionHash": "0x0b155dac1767b64526f2a4807cd43fa343d637dc9879fb1d16584440ff07856e", "logs": [ { "transactionIndex": 73, "blockNumber": 11270012, "transactionHash": "0x0b155dac1767b64526f2a4807cd43fa343d637dc9879fb1d16584440ff07856e", "address": "0x3F556E831FC7463aa0b716A454139f190882D477", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000e1f076849b781b1395fd332dc1758dbc129be6ec" ], "data": "0x", "logIndex": 114, "blockHash": "0x6ddb1431c5fe095b505f074b818ad2641112835e6b46efa7c8ffa189aeef8f35" } ], "blockNumber": 11270012, "cumulativeGasUsed": "5479445", "status": 1, "byzantium": true }, "args": [], "solcInputHash": "89383a6e8e4256890d851f32690baa57", "metadata": "{\"compiler\":{\"version\":\"0.7.4+commit.3f05b770\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_oracle\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_oracleAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_oraclePayload\",\"type\":\"bytes\"}],\"name\":\"addOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tester\",\"type\":\"address\"}],\"name\":\"getMockPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_oracle\",\"type\":\"string\"}],\"name\":\"getPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"mockPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"oracle\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"name\":\"oraclePayload\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_mockPrice\",\"type\":\"uint256\"}],\"name\":\"setMockPrice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Can be used to: - Query oracle address for Gelato Condition payloads on frontend - Test Conditions by using `getMockPrice(address _test)` as `oraclePayload`\",\"kind\":\"dev\",\"methods\":{\"addOracle(string,address,bytes)\":{\"details\":\"Only owner can call this, but existing oracle entries are immutable\",\"params\":{\"_oracle\":\"The descriptor of the oracle e.g. ETH/USD-Maker-v1\",\"_oracleAddress\":\"The address of the oracle contract\",\"_oraclePayload\":\"The payload with function selector for the oracle request.\"}},\"getMockPrice(address)\":{\"details\":\"Encode oracle=PriceOracleResolver and oraclePayload=getMockPrice(tester) to test your Conditions or Actions that make dynamic calls to price oracles.\",\"params\":{\"_tester\":\"The msg.sender during setMockPrice.\"},\"returns\":{\"_0\":\"The tester's mockPrice.\"}},\"getPrice(string)\":{\"details\":\"The oracle returndata must be formatted as a single uint256.\",\"params\":{\"_oracle\":\"The descriptor of our oracle e.g. ETH/USD-Maker-v1\"},\"returns\":{\"_0\":\"The uint256 oracle price\"}},\"isOwner()\":{\"details\":\"Returns true if the caller is the current owner.\"},\"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.\"},\"setMockPrice(uint256)\":{\"details\":\"Your mock prices cannot be overriden by someone else.\",\"params\":{\"_mockPrice\":\"The mock data you want to test against.\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"PriceOracleResolver\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addOracle(string,address,bytes)\":{\"notice\":\"Adds a new Oracle address\"},\"getMockPrice(address)\":{\"notice\":\"Use with setMockPrice for easy testing in production.\"},\"getPrice(string)\":{\"notice\":\"A generelized getter for a price supplied by an oracle contract.\"},\"setMockPrice(uint256)\":{\"notice\":\"Function that allows easy oracle data testing in production.\"}},\"notice\":\"Contract with convenience methods to retrieve oracle addresses or to mock test.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/contracts/resolvers/PriceOracleResolver.sol\":\"PriceOracleResolver\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/contracts/resolvers/PriceOracleResolver.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from \\\"../../vendor/Ownable.sol\\\";\\nimport {GelatoBytes} from \\\"../../lib/GelatoBytes.sol\\\";\\n\\n/// @title PriceOracleResolver\\n/// @notice Contract with convenience methods to retrieve oracle addresses or to mock test.\\n/// @dev Can be used to:\\n/// - Query oracle address for Gelato Condition payloads on frontend\\n/// - Test Conditions by using `getMockPrice(address _test)` as `oraclePayload`\\ncontract PriceOracleResolver is Ownable {\\n using GelatoBytes for bytes;\\n\\n mapping(string => address) public oracle;\\n mapping(string => bytes) public oraclePayload;\\n mapping(address => uint256) public mockPrice;\\n\\n /// @notice Adds a new Oracle address\\n /// @dev Only owner can call this, but existing oracle entries are immutable\\n /// @param _oracle The descriptor of the oracle e.g. ETH/USD-Maker-v1\\n /// @param _oracleAddress The address of the oracle contract\\n /// @param _oraclePayload The payload with function selector for the oracle request.\\n function addOracle(\\n string memory _oracle,\\n address _oracleAddress,\\n bytes calldata _oraclePayload\\n ) external onlyOwner {\\n require(\\n oracle[_oracle] == address(0),\\n \\\"PriceOracleResolver.addOracle: set\\\"\\n );\\n oracle[_oracle] = _oracleAddress;\\n oraclePayload[_oracle] = _oraclePayload;\\n }\\n\\n /// @notice Function that allows easy oracle data testing in production.\\n /// @dev Your mock prices cannot be overriden by someone else.\\n /// @param _mockPrice The mock data you want to test against.\\n function setMockPrice(uint256 _mockPrice) public {\\n mockPrice[msg.sender] = _mockPrice;\\n }\\n\\n /// @notice Use with setMockPrice for easy testing in production.\\n /// @dev Encode oracle=PriceOracleResolver and oraclePayload=getMockPrice(tester)\\n /// to test your Conditions or Actions that make dynamic calls to price oracles.\\n /// @param _tester The msg.sender during setMockPrice.\\n /// @return The tester's mockPrice.\\n function getMockPrice(address _tester) external view returns (uint256) {\\n return mockPrice[_tester];\\n }\\n\\n /// @notice A generelized getter for a price supplied by an oracle contract.\\n /// @dev The oracle returndata must be formatted as a single uint256.\\n /// @param _oracle The descriptor of our oracle e.g. ETH/USD-Maker-v1\\n /// @return The uint256 oracle price\\n function getPrice(string memory _oracle) external view returns (uint256) {\\n address oracleAddr = oracle[_oracle];\\n if (oracleAddr == address(0))\\n revert(\\\"PriceOracleResolver.getPrice: no oracle\\\");\\n (bool success, bytes memory returndata) = oracleAddr.staticcall(\\n oraclePayload[_oracle]\\n );\\n if (!success)\\n returndata.revertWithError(\\\"PriceOracleResolver.getPrice:\\\");\\n return abi.decode(returndata, (uint256));\\n }\\n}\\n\",\"keccak256\":\"0x2a4d5d6a985f08cf5dfcc6d62d6a7bccca444662f1c113bcfeee22da2e019d3e\",\"license\":\"UNLICENSED\"},\"contracts/lib/GelatoBytes.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity 0.7.4;\\n\\nlibrary GelatoBytes {\\n function calldataSliceSelector(bytes calldata _bytes)\\n internal\\n pure\\n returns (bytes4 selector)\\n {\\n selector =\\n _bytes[0] |\\n (bytes4(_bytes[1]) >> 8) |\\n (bytes4(_bytes[2]) >> 16) |\\n (bytes4(_bytes[3]) >> 24);\\n }\\n\\n function memorySliceSelector(bytes memory _bytes)\\n internal\\n pure\\n returns (bytes4 selector)\\n {\\n selector =\\n _bytes[0] |\\n (bytes4(_bytes[1]) >> 8) |\\n (bytes4(_bytes[2]) >> 16) |\\n (bytes4(_bytes[3]) >> 24);\\n }\\n\\n function revertWithError(bytes memory _bytes, string memory _tracingInfo)\\n internal\\n pure\\n {\\n // 68: 32-location, 32-length, 4-ErrorSelector, UTF-8 err\\n if (_bytes.length % 32 == 4) {\\n bytes4 selector;\\n assembly {\\n selector := mload(add(0x20, _bytes))\\n }\\n if (selector == 0x08c379a0) {\\n // Function selector for Error(string)\\n assembly {\\n _bytes := add(_bytes, 68)\\n }\\n revert(string(abi.encodePacked(_tracingInfo, string(_bytes))));\\n } else {\\n revert(\\n string(abi.encodePacked(_tracingInfo, \\\"NoErrorSelector\\\"))\\n );\\n }\\n } else {\\n revert(\\n string(abi.encodePacked(_tracingInfo, \\\"UnexpectedReturndata\\\"))\\n );\\n }\\n }\\n\\n function returnError(bytes memory _bytes, string memory _tracingInfo)\\n internal\\n pure\\n returns (string memory)\\n {\\n // 68: 32-location, 32-length, 4-ErrorSelector, UTF-8 err\\n if (_bytes.length % 32 == 4) {\\n bytes4 selector;\\n assembly {\\n selector := mload(add(0x20, _bytes))\\n }\\n if (selector == 0x08c379a0) {\\n // Function selector for Error(string)\\n assembly {\\n _bytes := add(_bytes, 68)\\n }\\n return string(abi.encodePacked(_tracingInfo, string(_bytes)));\\n } else {\\n return\\n string(abi.encodePacked(_tracingInfo, \\\"NoErrorSelector\\\"));\\n }\\n } else {\\n return\\n string(abi.encodePacked(_tracingInfo, \\\"UnexpectedReturndata\\\"));\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9038c820e041814ca2311bf582f2123171865b36c9438a7c6f85eb99406ec45c\",\"license\":\"UNLICENSED\"},\"contracts/vendor/Ownable.sol\":{\"content\":\"// \\\"SPDX-License-Identifier: MIT\\\"\\npragma solidity 0.7.4;\\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 * 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 Ownable {\\n address private _owner;\\n\\n event OwnershipTransferred(\\n address indexed previousOwner,\\n address indexed newOwner\\n );\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _owner = msg.sender;\\n emit OwnershipTransferred(address(0), _owner);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(isOwner(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the caller is the current owner.\\n */\\n function isOwner() public view returns (bool) {\\n return msg.sender == _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 emit OwnershipTransferred(_owner, address(0));\\n _owner = 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 _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n require(\\n newOwner != address(0),\\n \\\"Ownable: new owner is the zero address\\\"\\n );\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0xfb1bcba73ac1a8923c91f09e273fc38e5725390b37ed11df01b6d4735d621001\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b03191633178082556040516001600160a01b039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3610e07806100696000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80638f32d59b116100715780638f32d59b1461011c5780639d5f7df914610131578063b7b0045914610144578063e102c99614610164578063f2fde38b14610177578063feca9cc01461018a576100a9565b8063524f3889146100ae57806370b781e5146100d7578063715018a6146100ec5780638361d0eb146100f45780638da5cb5b14610107575b600080fd5b6100c16100bc366004610b04565b61019d565b6040516100ce9190610d72565b60405180910390f35b6100ea6100e5366004610b3f565b6102cf565b005b6100ea6103ef565b6100c1610102366004610ae3565b610492565b61010f6104ad565b6040516100ce9190610c97565b6101246104bc565b6040516100ce9190610cab565b61010f61013f366004610b04565b6104cd565b610157610152366004610b04565b6104f3565b6040516100ce9190610cb6565b6100c1610172366004610ae3565b610599565b6100ea610185366004610ae3565b6105ab565b6100ea610198366004610bdb565b610610565b6000806001836040516101b09190610c7b565b908152604051908190036020019020546001600160a01b03169050806101f15760405162461bcd60e51b81526004016101e890610d2b565b60405180910390fd5b60006060826001600160a01b031660028660405161020f9190610c7b565b90815260405190819003602001812061022791610c0b565b600060405180830381855afa9150503d8060008114610262576040519150601f19603f3d011682016040523d82523d6000602084013e610267565b606091505b5091509150816102b05760408051808201909152601d81527f50726963654f7261636c655265736f6c7665722e67657450726963653a00000060208201526102b0908290610622565b808060200190518101906102c49190610bf3565b93505050505b919050565b6102d76104bc565b610328576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60006001600160a01b03166001856040516103439190610c7b565b908152604051908190036020019020546001600160a01b0316146103795760405162461bcd60e51b81526004016101e890610ce9565b8260018560405161038a9190610c7b565b908152602001604051809103902060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081816002866040516103ce9190610c7b565b9081526040519081900360200190206103e89290916109b1565b5050505050565b6103f76104bc565b610448576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b031660009081526003602052604090205490565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b80516020818301810180516001825292820191909301209152546001600160a01b031681565b80516020818301810180516002808352938301948301949094209390528254604080516001831615610100026000190190921693909304601f81018390048302820183019093528281529291908301828280156105915780601f1061056657610100808354040283529160200191610591565b820191906000526020600020905b81548152906001019060200180831161057457829003601f168201915b505050505081565b60036020526000908152604090205481565b6105b36104bc565b610604576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61060d81610911565b50565b33600090815260036020526040902055565b602082518161062d57fe5b066004141561084a57602082015162461bcd60e51b6001600160e01b0319821614156107885760448301925081836040516020018083805190602001908083835b6020831061068d5780518252601f19909201916020918201910161066e565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106106d55780518252601f1990920191602091820191016106b6565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183529384905262461bcd60e51b84526004840181815282516024860152825192975095508594506044909301928601915080838360005b8381101561074d578181015183820152602001610735565b50505050905090810190601f16801561077a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b816040516020018082805190602001908083835b602083106107bb5780518252601f19909201916020918201910161079c565b51815160001960209485036101000a0190811690199091161790526e2737a2b93937b929b2b632b1ba37b960891b9390910192835260408051601019818603018152600f85019182905262461bcd60e51b90915260138401828152815160338601528151919650945084936053019250908501908083836000831561074d578181015183820152602001610735565b806040516020018082805190602001908083835b6020831061087d5780518252601f19909201916020918201910161085e565b51815160001960209485036101000a01908116901990911617905273556e657870656374656452657475726e6461746160601b9390910192835260408051600b19818603018152601485019182905262461bcd60e51b90915260188401828152815160388601528151919650945084936058019250908501908083836000831561074d578181015183820152602001610735565b6001600160a01b0381166109565760405162461bcd60e51b8152600401808060200182810382526026815260200180610dac6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826109e75760008555610a2d565b82601f10610a005782800160ff19823516178555610a2d565b82800160010185558215610a2d579182015b82811115610a2d578235825591602001919060010190610a12565b50610a39929150610a3d565b5090565b5b80821115610a395760008155600101610a3e565b80356001600160a01b03811681146102ca57600080fd5b600082601f830112610a79578081fd5b813567ffffffffffffffff80821115610a8e57fe5b604051601f8301601f191681016020018281118282101715610aac57fe5b604052828152925082848301602001861015610ac757600080fd5b8260208601602083013760006020848301015250505092915050565b600060208284031215610af4578081fd5b610afd82610a52565b9392505050565b600060208284031215610b15578081fd5b813567ffffffffffffffff811115610b2b578182fd5b610b3784828501610a69565b949350505050565b60008060008060608587031215610b54578283fd5b843567ffffffffffffffff80821115610b6b578485fd5b610b7788838901610a69565b9550610b8560208801610a52565b94506040870135915080821115610b9a578384fd5b818701915087601f830112610bad578384fd5b813581811115610bbb578485fd5b886020828501011115610bcc578485fd5b95989497505060200194505050565b600060208284031215610bec578081fd5b5035919050565b600060208284031215610c04578081fd5b5051919050565b6000808354600180821660008114610c2a5760018114610c4157610c70565b60ff198316865260028304607f1686019350610c70565b600283048786526020808720875b83811015610c685781548a820152908501908201610c4f565b505050860193505b509195945050505050565b60008251610c8d818460208701610d7b565b9190910192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602082528251806020840152610cd5816040850160208701610d7b565b601f01601f19169190910160400192915050565b60208082526022908201527f50726963654f7261636c655265736f6c7665722e6164644f7261636c653a2073604082015261195d60f21b606082015260800190565b60208082526027908201527f50726963654f7261636c655265736f6c7665722e67657450726963653a206e6f604082015266206f7261636c6560c81b606082015260800190565b90815260200190565b60005b83811015610d96578181015183820152602001610d7e565b83811115610da5576000848401525b5050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122044828f0928a0ddb612ff8245cf2d7c295ca1751d481949b3d59ae0f3b282e0d864736f6c63430007040033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80638f32d59b116100715780638f32d59b1461011c5780639d5f7df914610131578063b7b0045914610144578063e102c99614610164578063f2fde38b14610177578063feca9cc01461018a576100a9565b8063524f3889146100ae57806370b781e5146100d7578063715018a6146100ec5780638361d0eb146100f45780638da5cb5b14610107575b600080fd5b6100c16100bc366004610b04565b61019d565b6040516100ce9190610d72565b60405180910390f35b6100ea6100e5366004610b3f565b6102cf565b005b6100ea6103ef565b6100c1610102366004610ae3565b610492565b61010f6104ad565b6040516100ce9190610c97565b6101246104bc565b6040516100ce9190610cab565b61010f61013f366004610b04565b6104cd565b610157610152366004610b04565b6104f3565b6040516100ce9190610cb6565b6100c1610172366004610ae3565b610599565b6100ea610185366004610ae3565b6105ab565b6100ea610198366004610bdb565b610610565b6000806001836040516101b09190610c7b565b908152604051908190036020019020546001600160a01b03169050806101f15760405162461bcd60e51b81526004016101e890610d2b565b60405180910390fd5b60006060826001600160a01b031660028660405161020f9190610c7b565b90815260405190819003602001812061022791610c0b565b600060405180830381855afa9150503d8060008114610262576040519150601f19603f3d011682016040523d82523d6000602084013e610267565b606091505b5091509150816102b05760408051808201909152601d81527f50726963654f7261636c655265736f6c7665722e67657450726963653a00000060208201526102b0908290610622565b808060200190518101906102c49190610bf3565b93505050505b919050565b6102d76104bc565b610328576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60006001600160a01b03166001856040516103439190610c7b565b908152604051908190036020019020546001600160a01b0316146103795760405162461bcd60e51b81526004016101e890610ce9565b8260018560405161038a9190610c7b565b908152602001604051809103902060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081816002866040516103ce9190610c7b565b9081526040519081900360200190206103e89290916109b1565b5050505050565b6103f76104bc565b610448576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b031660009081526003602052604090205490565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b80516020818301810180516001825292820191909301209152546001600160a01b031681565b80516020818301810180516002808352938301948301949094209390528254604080516001831615610100026000190190921693909304601f81018390048302820183019093528281529291908301828280156105915780601f1061056657610100808354040283529160200191610591565b820191906000526020600020905b81548152906001019060200180831161057457829003601f168201915b505050505081565b60036020526000908152604090205481565b6105b36104bc565b610604576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61060d81610911565b50565b33600090815260036020526040902055565b602082518161062d57fe5b066004141561084a57602082015162461bcd60e51b6001600160e01b0319821614156107885760448301925081836040516020018083805190602001908083835b6020831061068d5780518252601f19909201916020918201910161066e565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106106d55780518252601f1990920191602091820191016106b6565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183529384905262461bcd60e51b84526004840181815282516024860152825192975095508594506044909301928601915080838360005b8381101561074d578181015183820152602001610735565b50505050905090810190601f16801561077a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b816040516020018082805190602001908083835b602083106107bb5780518252601f19909201916020918201910161079c565b51815160001960209485036101000a0190811690199091161790526e2737a2b93937b929b2b632b1ba37b960891b9390910192835260408051601019818603018152600f85019182905262461bcd60e51b90915260138401828152815160338601528151919650945084936053019250908501908083836000831561074d578181015183820152602001610735565b806040516020018082805190602001908083835b6020831061087d5780518252601f19909201916020918201910161085e565b51815160001960209485036101000a01908116901990911617905273556e657870656374656452657475726e6461746160601b9390910192835260408051600b19818603018152601485019182905262461bcd60e51b90915260188401828152815160388601528151919650945084936058019250908501908083836000831561074d578181015183820152602001610735565b6001600160a01b0381166109565760405162461bcd60e51b8152600401808060200182810382526026815260200180610dac6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826109e75760008555610a2d565b82601f10610a005782800160ff19823516178555610a2d565b82800160010185558215610a2d579182015b82811115610a2d578235825591602001919060010190610a12565b50610a39929150610a3d565b5090565b5b80821115610a395760008155600101610a3e565b80356001600160a01b03811681146102ca57600080fd5b600082601f830112610a79578081fd5b813567ffffffffffffffff80821115610a8e57fe5b604051601f8301601f191681016020018281118282101715610aac57fe5b604052828152925082848301602001861015610ac757600080fd5b8260208601602083013760006020848301015250505092915050565b600060208284031215610af4578081fd5b610afd82610a52565b9392505050565b600060208284031215610b15578081fd5b813567ffffffffffffffff811115610b2b578182fd5b610b3784828501610a69565b949350505050565b60008060008060608587031215610b54578283fd5b843567ffffffffffffffff80821115610b6b578485fd5b610b7788838901610a69565b9550610b8560208801610a52565b94506040870135915080821115610b9a578384fd5b818701915087601f830112610bad578384fd5b813581811115610bbb578485fd5b886020828501011115610bcc578485fd5b95989497505060200194505050565b600060208284031215610bec578081fd5b5035919050565b600060208284031215610c04578081fd5b5051919050565b6000808354600180821660008114610c2a5760018114610c4157610c70565b60ff198316865260028304607f1686019350610c70565b600283048786526020808720875b83811015610c685781548a820152908501908201610c4f565b505050860193505b509195945050505050565b60008251610c8d818460208701610d7b565b9190910192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602082528251806020840152610cd5816040850160208701610d7b565b601f01601f19169190910160400192915050565b60208082526022908201527f50726963654f7261636c655265736f6c7665722e6164644f7261636c653a2073604082015261195d60f21b606082015260800190565b60208082526027908201527f50726963654f7261636c655265736f6c7665722e67657450726963653a206e6f604082015266206f7261636c6560c81b606082015260800190565b90815260200190565b60005b83811015610d96578181015183820152602001610d7e565b83811115610da5576000848401525b5050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122044828f0928a0ddb612ff8245cf2d7c295ca1751d481949b3d59ae0f3b282e0d864736f6c63430007040033", "devdoc": { "details": "Can be used to: - Query oracle address for Gelato Condition payloads on frontend - Test Conditions by using `getMockPrice(address _test)` as `oraclePayload`", "kind": "dev", "methods": { "addOracle(string,address,bytes)": { "details": "Only owner can call this, but existing oracle entries are immutable", "params": { "_oracle": "The descriptor of the oracle e.g. ETH/USD-Maker-v1", "_oracleAddress": "The address of the oracle contract", "_oraclePayload": "The payload with function selector for the oracle request." } }, "getMockPrice(address)": { "details": "Encode oracle=PriceOracleResolver and oraclePayload=getMockPrice(tester) to test your Conditions or Actions that make dynamic calls to price oracles.", "params": { "_tester": "The msg.sender during setMockPrice." }, "returns": { "_0": "The tester's mockPrice." } }, "getPrice(string)": { "details": "The oracle returndata must be formatted as a single uint256.", "params": { "_oracle": "The descriptor of our oracle e.g. ETH/USD-Maker-v1" }, "returns": { "_0": "The uint256 oracle price" } }, "isOwner()": { "details": "Returns true if the caller is the current owner." }, "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." }, "setMockPrice(uint256)": { "details": "Your mock prices cannot be overriden by someone else.", "params": { "_mockPrice": "The mock data you want to test against." } }, "transferOwnership(address)": { "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." } }, "title": "PriceOracleResolver", "version": 1 }, "userdoc": { "kind": "user", "methods": { "addOracle(string,address,bytes)": { "notice": "Adds a new Oracle address" }, "getMockPrice(address)": { "notice": "Use with setMockPrice for easy testing in production." }, "getPrice(string)": { "notice": "A generelized getter for a price supplied by an oracle contract." }, "setMockPrice(uint256)": { "notice": "Function that allows easy oracle data testing in production." } }, "notice": "Contract with convenience methods to retrieve oracle addresses or to mock test.", "version": 1 }, "storageLayout": { "storage": [ { "astId": 5577, "contract": "contracts/contracts/resolvers/PriceOracleResolver.sol:PriceOracleResolver", "label": "_owner", "offset": 0, "slot": "0", "type": "t_address" }, { "astId": 3460, "contract": "contracts/contracts/resolvers/PriceOracleResolver.sol:PriceOracleResolver", "label": "oracle", "offset": 0, "slot": "1", "type": "t_mapping(t_string_memory_ptr,t_address)" }, { "astId": 3464, "contract": "contracts/contracts/resolvers/PriceOracleResolver.sol:PriceOracleResolver", "label": "oraclePayload", "offset": 0, "slot": "2", "type": "t_mapping(t_string_memory_ptr,t_bytes_storage)" }, { "astId": 3468, "contract": "contracts/contracts/resolvers/PriceOracleResolver.sol:PriceOracleResolver", "label": "mockPrice", "offset": 0, "slot": "3", "type": "t_mapping(t_address,t_uint256)" } ], "types": { "t_address": { "encoding": "inplace", "label": "address", "numberOfBytes": "20" }, "t_bytes_storage": { "encoding": "bytes", "label": "bytes", "numberOfBytes": "32" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => uint256)", "numberOfBytes": "32", "value": "t_uint256" }, "t_mapping(t_string_memory_ptr,t_address)": { "encoding": "mapping", "key": "t_string_memory_ptr", "label": "mapping(string => address)", "numberOfBytes": "32", "value": "t_address" }, "t_mapping(t_string_memory_ptr,t_bytes_storage)": { "encoding": "mapping", "key": "t_string_memory_ptr", "label": "mapping(string => bytes)", "numberOfBytes": "32", "value": "t_bytes_storage" }, "t_string_memory_ptr": { "encoding": "bytes", "label": "string", "numberOfBytes": "32" }, "t_uint256": { "encoding": "inplace", "label": "uint256", "numberOfBytes": "32" } } } }