Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
PriceFeed
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "./interfaces/IPriceFeed.sol"; contract PriceFeed is IPriceFeed { int256 public answer; uint80 public roundId; string public override description = "PriceFeed"; address public override aggregator; uint256 public decimals; address public gov; mapping (uint80 => int256) public answers; mapping (address => bool) public isAdmin; constructor() public { gov = msg.sender; isAdmin[msg.sender] = true; } function setAdmin(address _account, bool _isAdmin) public { require(msg.sender == gov, "PriceFeed: forbidden"); isAdmin[_account] = _isAdmin; } function latestAnswer() public override view returns (int256) { return answer; } function latestRound() public override view returns (uint80) { return roundId; } function setLatestAnswer(int256 _answer) public { require(isAdmin[msg.sender], "PriceFeed: forbidden"); roundId = roundId + 1; answer = _answer; answers[roundId] = _answer; } // returns roundId, answer, startedAt, updatedAt, answeredInRound function getRoundData(uint80 _roundId) public override view returns (uint80, int256, uint256, uint256, uint80) { return (_roundId, answers[_roundId], 0, 0, 0); } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IPriceFeed { function description() external view returns (string memory); function aggregator() external view returns (address); function latestAnswer() external view returns (int256); function latestRound() external view returns (uint80); function getRoundData(uint80 roundId) external view returns (uint80, int256, uint256, uint256, uint80); }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 14 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"aggregator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"answer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"","type":"uint80"}],"name":"answers","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getRoundData","outputs":[{"internalType":"uint80","name":"","type":"uint80"},{"internalType":"int256","name":"","type":"int256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gov","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRound","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roundId","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_isAdmin","type":"bool"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"int256","name":"_answer","type":"int256"}],"name":"setLatestAnswer","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040526009608081905268141c9a58d95199595960ba1b60a090815261002a916002919061006b565b5034801561003757600080fd5b50600580546001600160a01b031916339081179091556000908152600760205260409020805460ff191660011790556100fe565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106100ac57805160ff19168380011785556100d9565b828001600101855582156100d9579182015b828111156100d95782518255916020019190600101906100be565b506100e59291506100e9565b5090565b5b808211156100e557600081556001016100ea565b6105358061010d6000396000f3fe608060405234801561001057600080fd5b50600436106100af5760003560e01c806304ea97b0146100b457806312d43a51146100d3578063245a7bfc146100f757806324d7806c146100ff578063313ce567146101395780634b0bddd2146101535780634c295ca31461018157806350d25bcd146101a7578063668a0f02146101af5780637284e416146101d357806385bb7d69146102505780638cd221c9146102585780639a6fc8f514610260575b600080fd5b6100d1600480360360208110156100ca57600080fd5b50356102ca565b005b6100db61035d565b604080516001600160a01b039092168252519081900360200190f35b6100db61036c565b6101256004803603602081101561011557600080fd5b50356001600160a01b031661037b565b604080519115158252519081900360200190f35b610141610390565b60408051918252519081900360200190f35b6100d16004803603604081101561016957600080fd5b506001600160a01b0381351690602001351515610396565b6101416004803603602081101561019757600080fd5b50356001600160501b0316610417565b610141610429565b6101b761042f565b604080516001600160501b039092168252519081900360200190f35b6101db61043e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102155781810151838201526020016101fd565b50505050905090810190601f1680156102425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101416104c9565b6101b76104cf565b6102866004803603602081101561027657600080fd5b50356001600160501b03166104de565b60405180866001600160501b03168152602001858152602001848152602001838152602001826001600160501b031681526020019550505050505060405180910390f35b3360009081526007602052604090205460ff16610325576040805162461bcd60e51b8152602060048201526014602482015273283934b1b2a332b2b21d103337b93134b23232b760611b604482015290519081900360640190fd5b600180546001600160501b031981166001600160501b0391821683018216179182905560008381559116815260066020526040902055565b6005546001600160a01b031681565b6003546001600160a01b031681565b60076020526000908152604090205460ff1681565b60045481565b6005546001600160a01b031633146103ec576040805162461bcd60e51b8152602060048201526014602482015273283934b1b2a332b2b21d103337b93134b23232b760611b604482015290519081900360640190fd5b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b60066020526000908152604090205481565b60005490565b6001546001600160501b031690565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156104c15780601f10610496576101008083540402835291602001916104c1565b820191906000526020600020905b8154815290600101906020018083116104a457829003601f168201915b505050505081565b60005481565b6001546001600160501b031681565b6001600160501b03811660009081526006602052604081205491928190819056fea264697066735822122006cbb6eb9ec9fee30e41de5c903379b6a3f244fc512554c25aaad8f29e33b89064736f6c634300060c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100af5760003560e01c806304ea97b0146100b457806312d43a51146100d3578063245a7bfc146100f757806324d7806c146100ff578063313ce567146101395780634b0bddd2146101535780634c295ca31461018157806350d25bcd146101a7578063668a0f02146101af5780637284e416146101d357806385bb7d69146102505780638cd221c9146102585780639a6fc8f514610260575b600080fd5b6100d1600480360360208110156100ca57600080fd5b50356102ca565b005b6100db61035d565b604080516001600160a01b039092168252519081900360200190f35b6100db61036c565b6101256004803603602081101561011557600080fd5b50356001600160a01b031661037b565b604080519115158252519081900360200190f35b610141610390565b60408051918252519081900360200190f35b6100d16004803603604081101561016957600080fd5b506001600160a01b0381351690602001351515610396565b6101416004803603602081101561019757600080fd5b50356001600160501b0316610417565b610141610429565b6101b761042f565b604080516001600160501b039092168252519081900360200190f35b6101db61043e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102155781810151838201526020016101fd565b50505050905090810190601f1680156102425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101416104c9565b6101b76104cf565b6102866004803603602081101561027657600080fd5b50356001600160501b03166104de565b60405180866001600160501b03168152602001858152602001848152602001838152602001826001600160501b031681526020019550505050505060405180910390f35b3360009081526007602052604090205460ff16610325576040805162461bcd60e51b8152602060048201526014602482015273283934b1b2a332b2b21d103337b93134b23232b760611b604482015290519081900360640190fd5b600180546001600160501b031981166001600160501b0391821683018216179182905560008381559116815260066020526040902055565b6005546001600160a01b031681565b6003546001600160a01b031681565b60076020526000908152604090205460ff1681565b60045481565b6005546001600160a01b031633146103ec576040805162461bcd60e51b8152602060048201526014602482015273283934b1b2a332b2b21d103337b93134b23232b760611b604482015290519081900360640190fd5b6001600160a01b03919091166000908152600760205260409020805460ff1916911515919091179055565b60066020526000908152604090205481565b60005490565b6001546001600160501b031690565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156104c15780601f10610496576101008083540402835291602001916104c1565b820191906000526020600020905b8154815290600101906020018083116104a457829003601f168201915b505050505081565b60005481565b6001546001600160501b031681565b6001600160501b03811660009081526006602052604081205491928190819056fea264697066735822122006cbb6eb9ec9fee30e41de5c903379b6a3f244fc512554c25aaad8f29e33b89064736f6c634300060c0033
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.