Gelato-automations/deployments/mainnet/PriceOracleResolver.json

388 lines
39 KiB
JSON
Raw Normal View History

2020-11-16 16:55:04 +00:00
{
"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
"bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b03191633178082556040516001600160a01b039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3610e07806100696000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80638f32d59b116100715780638f32d59b1461011c5780639d5f7df914610131578063b7b0045914610144578063e102c99614610164578063f2fde38b14610177578063feca9cc01461018a576100a9565b8063524f3889146100ae57806370b781e5146100d7578063715018a6146100ec5780638361d0eb146100f45780638da5cb5b14610107575b600080fd5b6100c16100bc366004610b04565b61019d565b6040516100ce9190610d72565b60405180910390f35b6100ea6100e5366004610b3f565b6102cf565b005b6100ea6103ef565b6100c1610102366004610ae3565b610492565b61010f6104ad565b6040516100ce9190610c97565b6101246104bc565b6040516100ce9190610cab565b61010f61013f366004610b04565b6104cd565b610157610152366004610b04565b6104f3565b6040516100ce9190610cb6565b6100c1610172366004610ae3565b610599565b6100ea610185366004610ae3565b6105ab565b6100ea610198366004610bdb565b610610565b6000806001836040516101b09190610c7b565b908152604051908190036020019020546001600160a01b03169050806101f15760405162461bcd60e51b81526004016101e890610d2b565b60405180910390fd5b60006060826001600160a01b031660028660405161020f9190610c7b565b90815260405190819003602001812061022791610c0b565b600060405180830381855afa9150503d8060008114610262576040519150601f19603f3d011682016040523d82523d6000602084013e610267565b606091505b5091509150816102b05760408051808201909152601d81527f50726963654f7261636c655265736f6c7665722e67657450726963653a00000060208201526102b0908290610622565b808060200190518101906102c49190610bf3565b93505050505b919050565b6102d76104bc565b610328576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60006001600160a01b03166001856040516103439190610c7b565b908152604051908190036020019020546001600160a01b0316146103795760405162461bcd60e51b81526004016101e890610ce9565b8260018560405161038a9190610c7b565b908152602001604051809103902060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081816002866040516103ce9190610c7b565b9081526040519081900360200190206103e89290916109b1565b5050505050565b6103f76104bc565b610448576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b031660009081526003602052604090205490565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b80516020818301810180516001825292820191909301209152546001600160a01b031681565b80516020818301810180516002808352938301948301949094209390528254604080516001831615610100026000190190921693909304601f81018390048302820183019093528281529291908301828280156105915780601f1061056657610100808354040283529160200191610591565b820191906000526020600020905b81548152906001019060200180831161057457829003601f168201915b505050505081565b60036020526000908152604090205481565b6105b36104bc565b610604576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61060d81610911565b50565b33600090815260036020526040902055565b602082518161062d57fe5b066004141561084a57602082015162461bcd60e51b6001600160e01b0319821614156107885760448301925081836040516020018083805190602001908083835b6020831061068d5780518252601f19909201916020918201910161066e565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106106d55780518252601f1990920191602091820191016106b6565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183529384905262461bcd60e51b84526004840181815282516024860152825192975095508594506044909301928601915080838360005b8381101561074d578181015183820152602001610735565b50505050905090810190601f16801561077a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b8160405160
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80638f32d59b116100715780638f32d59b1461011c5780639d5f7df914610131578063b7b0045914610144578063e102c99614610164578063f2fde38b14610177578063feca9cc01461018a576100a9565b8063524f3889146100ae57806370b781e5146100d7578063715018a6146100ec5780638361d0eb146100f45780638da5cb5b14610107575b600080fd5b6100c16100bc366004610b04565b61019d565b6040516100ce9190610d72565b60405180910390f35b6100ea6100e5366004610b3f565b6102cf565b005b6100ea6103ef565b6100c1610102366004610ae3565b610492565b61010f6104ad565b6040516100ce9190610c97565b6101246104bc565b6040516100ce9190610cab565b61010f61013f366004610b04565b6104cd565b610157610152366004610b04565b6104f3565b6040516100ce9190610cb6565b6100c1610172366004610ae3565b610599565b6100ea610185366004610ae3565b6105ab565b6100ea610198366004610bdb565b610610565b6000806001836040516101b09190610c7b565b908152604051908190036020019020546001600160a01b03169050806101f15760405162461bcd60e51b81526004016101e890610d2b565b60405180910390fd5b60006060826001600160a01b031660028660405161020f9190610c7b565b90815260405190819003602001812061022791610c0b565b600060405180830381855afa9150503d8060008114610262576040519150601f19603f3d011682016040523d82523d6000602084013e610267565b606091505b5091509150816102b05760408051808201909152601d81527f50726963654f7261636c655265736f6c7665722e67657450726963653a00000060208201526102b0908290610622565b808060200190518101906102c49190610bf3565b93505050505b919050565b6102d76104bc565b610328576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60006001600160a01b03166001856040516103439190610c7b565b908152604051908190036020019020546001600160a01b0316146103795760405162461bcd60e51b81526004016101e890610ce9565b8260018560405161038a9190610c7b565b908152602001604051809103902060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081816002866040516103ce9190610c7b565b9081526040519081900360200190206103e89290916109b1565b5050505050565b6103f76104bc565b610448576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6001600160a01b031660009081526003602052604090205490565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b80516020818301810180516001825292820191909301209152546001600160a01b031681565b80516020818301810180516002808352938301948301949094209390528254604080516001831615610100026000190190921693909304601f81018390048302820183019093528281529291908301828280156105915780601f1061056657610100808354040283529160200191610591565b820191906000526020600020905b81548152906001019060200180831161057457829003601f168201915b505050505081565b60036020526000908152604090205481565b6105b36104bc565b610604576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61060d81610911565b50565b33600090815260036020526040902055565b602082518161062d57fe5b066004141561084a57602082015162461bcd60e51b6001600160e01b0319821614156107885760448301925081836040516020018083805190602001908083835b6020831061068d5780518252601f19909201916020918201910161066e565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106106d55780518252601f1990920191602091820191016106b6565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183529384905262461bcd60e51b84526004840181815282516024860152825192975095508594506044909301928601915080838360005b8381101561074d578181015183820152602001610735565b50505050905090810190601f16801561077a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b816040516020018082805190602001908083835b602083106107bb5780518252601f19909201916020918201910161079c565b51815160001960209485036101000a0190811690199091161790526e2737a2b93937b929b2b632b1ba37b960891b939091019283526040
"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"
}
}
}
}