Overview
POL Balance
0 POL
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
TellorPriceFeed
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "./interfaces/IPriceFeed.sol"; import "./interfaces/ITokenPriceFeed.sol"; interface ITellorFeed { function getCurrentValue(bytes32 _queryId) external view returns (bytes calldata _value); } contract TellorPriceFeed is IPriceFeed { ITellorFeed public immutable oracle; address public immutable override token; bytes32 public immutable queryId; constructor( address _oracle, address _token, bytes32 _queryId ) { require(_oracle != address(0x0), "e2637b _oracle must not be address 0x0"); require(_token != address(0x0), "e2637b _token must not be address 0x0"); require(_queryId.length > 0, "e2637b _queryId must not be 0 length"); token = _token; oracle = ITellorFeed(_oracle); queryId = _queryId; } function price() public view virtual override returns (uint256) { return uint256(bytes32(oracle.getCurrentValue(queryId))); } function pricePoint() public view override returns (uint256) { return price(); } function emitPriceSignal() public override { emit PriceUpdate(token, price(), price()); } }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface IOwnable { /** * @dev Returns the address of the current owner. */ function owner() external view returns (address); /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) external; }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface IPriceFeed { function token() external view returns (address); function price() external view returns (uint256); function pricePoint() external view returns (uint256); function emitPriceSignal() external; event PriceUpdate(address token, uint256 price, uint256 average); }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "./IOwnable.sol"; interface ITokenPriceFeed is IOwnable { struct TokenInfo { address priceFeed; uint256 mcr; uint256 mrf; // Maximum Redemption Fee } function tokenPriceFeed(address) external view returns (address); function tokenPrice(address _token) external view returns (uint256); function mcr(address _token) external view returns (uint256); function mrf(address _token) external view returns (uint256); function setTokenPriceFeed( address _token, address _priceFeed, uint256 _mcr, uint256 _maxRedemptionFeeBasisPoints ) external; function emitPriceUpdate( address _token, uint256 _priceAverage, uint256 _pricePoint ) external; event NewTokenPriceFeed(address _token, address _priceFeed, string _name, string _symbol, uint256 _mcr, uint256 _mrf); event PriceUpdate(address token, uint256 priceAverage, uint256 pricePoint); }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "london", "remappings": [], "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"bytes32","name":"_queryId","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"average","type":"uint256"}],"name":"PriceUpdate","type":"event"},{"inputs":[],"name":"emitPriceSignal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"contract ITellorFeed","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"queryId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60e060405234801561001057600080fd5b5060405161055738038061055783398101604081905261002f91610134565b6001600160a01b0383166100995760405162461bcd60e51b815260206004820152602660248201527f653236333762205f6f7261636c65206d757374206e6f7420626520616464726560448201526507373203078360d41b60648201526084015b60405180910390fd5b6001600160a01b0382166100fd5760405162461bcd60e51b815260206004820152602560248201527f653236333762205f746f6b656e206d757374206e6f7420626520616464726573604482015264073203078360dc1b6064820152608401610090565b6001600160a01b0391821660a052911660805260c052610170565b80516001600160a01b038116811461012f57600080fd5b919050565b60008060006060848603121561014957600080fd5b61015284610118565b925061016060208501610118565b9150604084015190509250925092565b60805160a05160c0516103a66101b160003960008181606c015261013f01526000818160ff015261021001526000818160a6015261016801526103a66000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80633f1be4d4146100675780637dc0d1d0146100a1578063a013991c146100e0578063a035b1fe146100e8578063ab96f86a146100f0578063fc0c546a146100fa575b600080fd5b61008e7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100c87f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610098565b61008e610121565b61008e610130565b6100f86101ed565b005b6100c87f000000000000000000000000000000000000000000000000000000000000000081565b600061012b610130565b905090565b60405163adf1639d60e01b81527f000000000000000000000000000000000000000000000000000000000000000060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063adf1639d90602401600060405180830381865afa1580156101b7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101df919081019061027f565b6101e890610349565b919050565b7fac7b695c6873047ad50339f850f4ae3f6b8f6ef63ed1a8b22f7d36a1c6bd46f37f0000000000000000000000000000000000000000000000000000000000000000610237610130565b61023f610130565b604080516001600160a01b03909416845260208401929092529082015260600160405180910390a1565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561029257600080fd5b825167ffffffffffffffff808211156102aa57600080fd5b818501915085601f8301126102be57600080fd5b8151818111156102d0576102d0610269565b604051601f8201601f19908116603f011681019083821181831017156102f8576102f8610269565b81604052828152888684870101111561031057600080fd5b600093505b828410156103325784840186015181850187015292850192610315565b600086848301015280965050505050505092915050565b8051602080830151919081101561036a576000198160200360031b1b821691505b5091905056fea2646970667358221220e9fe65ad3dace6411dc505b4273ed0ebdfee29bc379dc1b19a67cd6b2c41074364736f6c634300081100330000000000000000000000008f55d884cad66b79e1a131f6bcb0e66f4fd84d5b00000000000000000000000035b2ece5b1ed6a7a99b83508f8ceeab8661e063212906c5e9178631dba86f1f750f7ab7451c61e6357160eb890029b9eac1fb235
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80633f1be4d4146100675780637dc0d1d0146100a1578063a013991c146100e0578063a035b1fe146100e8578063ab96f86a146100f0578063fc0c546a146100fa575b600080fd5b61008e7f12906c5e9178631dba86f1f750f7ab7451c61e6357160eb890029b9eac1fb23581565b6040519081526020015b60405180910390f35b6100c87f0000000000000000000000008f55d884cad66b79e1a131f6bcb0e66f4fd84d5b81565b6040516001600160a01b039091168152602001610098565b61008e610121565b61008e610130565b6100f86101ed565b005b6100c87f00000000000000000000000035b2ece5b1ed6a7a99b83508f8ceeab8661e063281565b600061012b610130565b905090565b60405163adf1639d60e01b81527f12906c5e9178631dba86f1f750f7ab7451c61e6357160eb890029b9eac1fb23560048201526000907f0000000000000000000000008f55d884cad66b79e1a131f6bcb0e66f4fd84d5b6001600160a01b03169063adf1639d90602401600060405180830381865afa1580156101b7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101df919081019061027f565b6101e890610349565b919050565b7fac7b695c6873047ad50339f850f4ae3f6b8f6ef63ed1a8b22f7d36a1c6bd46f37f00000000000000000000000035b2ece5b1ed6a7a99b83508f8ceeab8661e0632610237610130565b61023f610130565b604080516001600160a01b03909416845260208401929092529082015260600160405180910390a1565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561029257600080fd5b825167ffffffffffffffff808211156102aa57600080fd5b818501915085601f8301126102be57600080fd5b8151818111156102d0576102d0610269565b604051601f8201601f19908116603f011681019083821181831017156102f8576102f8610269565b81604052828152888684870101111561031057600080fd5b600093505b828410156103325784840186015181850187015292850192610315565b600086848301015280965050505050505092915050565b8051602080830151919081101561036a576000198160200360031b1b821691505b5091905056fea2646970667358221220e9fe65ad3dace6411dc505b4273ed0ebdfee29bc379dc1b19a67cd6b2c41074364736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008f55d884cad66b79e1a131f6bcb0e66f4fd84d5b00000000000000000000000035b2ece5b1ed6a7a99b83508f8ceeab8661e063212906c5e9178631dba86f1f750f7ab7451c61e6357160eb890029b9eac1fb235
-----Decoded View---------------
Arg [0] : _oracle (address): 0x8f55D884CAD66B79e1a131f6bCB0e66f4fD84d5B
Arg [1] : _token (address): 0x35b2ECE5B1eD6a7a99b83508F8ceEAB8661E0632
Arg [2] : _queryId (bytes32): 0x12906c5e9178631dba86f1f750f7ab7451c61e6357160eb890029b9eac1fb235
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000008f55d884cad66b79e1a131f6bcb0e66f4fd84d5b
Arg [1] : 00000000000000000000000035b2ece5b1ed6a7a99b83508f8ceeab8661e0632
Arg [2] : 12906c5e9178631dba86f1f750f7ab7451c61e6357160eb890029b9eac1fb235
Deployed Bytecode Sourcemap
259:884:3:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;384:32;;;;;;;;160:25:4;;;148:2;133:18;384:32:3;;;;;;;;302:35;;;;;;;;-1:-1:-1;;;;;379:32:4;;;361:51;;349:2;334:18;302:35:3;196:222:4;956:86:3;;;:::i;821:131::-;;;:::i;1046:95::-;;;:::i;:::-;;341:39;;;;;956:86;1008:7;1030;:5;:7::i;:::-;1023:14;;956:86;:::o;821:131::-;914:31;;-1:-1:-1;;;914:31:3;;937:7;914:31;;;160:25:4;876:7:3;;914:6;-1:-1:-1;;;;;914:22:3;;;;133:18:4;;914:31:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;914:31:3;;;;;;;;;;;;:::i;:::-;906:40;;;:::i;:::-;898:49;821:131;-1:-1:-1;821:131:3:o;1046:95::-;1100:36;1112:5;1119:7;:5;:7::i;:::-;1128;:5;:7::i;:::-;1100:36;;;-1:-1:-1;;;;;2513:32:4;;;2495:51;;2577:2;2562:18;;2555:34;;;;2605:18;;;2598:34;2483:2;2468:18;1100:36:3;;;;;;;1046:95::o;813:127:4:-;874:10;869:3;865:20;862:1;855:31;905:4;902:1;895:15;929:4;926:1;919:15;945:1041;1024:6;1055:2;1098;1086:9;1077:7;1073:23;1069:32;1066:52;;;1114:1;1111;1104:12;1066:52;1147:9;1141:16;1176:18;1217:2;1209:6;1206:14;1203:34;;;1233:1;1230;1223:12;1203:34;1271:6;1260:9;1256:22;1246:32;;1316:7;1309:4;1305:2;1301:13;1297:27;1287:55;;1338:1;1335;1328:12;1287:55;1367:2;1361:9;1389:2;1385;1382:10;1379:36;;;1395:18;;:::i;:::-;1470:2;1464:9;1438:2;1524:13;;-1:-1:-1;;1520:22:4;;;1544:2;1516:31;1512:40;1500:53;;;1568:18;;;1588:22;;;1565:46;1562:72;;;1614:18;;:::i;:::-;1654:10;1650:2;1643:22;1689:2;1681:6;1674:18;1729:7;1724:2;1719;1715;1711:11;1707:20;1704:33;1701:53;;;1750:1;1747;1740:12;1701:53;1772:1;1763:10;;1782:129;1796:2;1793:1;1790:9;1782:129;;;1884:10;;;1880:19;;1874:26;1853:14;;;1849:23;;1842:59;1807:10;;;;1782:129;;;1953:1;1948:2;1943;1935:6;1931:15;1927:24;1920:35;1974:6;1964:16;;;;;;;;945:1041;;;;:::o;1991:297::-;2109:12;;2156:4;2145:16;;;2139:23;;2109:12;2174:16;;2171:111;;;2268:1;2264:6;2254;2248:4;2244:17;2241:1;2237:25;2233:38;2226:5;2222:50;2213:59;;2171:111;;1991:297;;;:::o
Swarm Source
ipfs://e9fe65ad3dace6411dc505b4273ed0ebdfee29bc379dc1b19a67cd6b2c410743
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.