Contract 0xa560F3858f337BcCF47EF73cb11662Fe00EcbdC6

Contract Overview

Balance:
0 MATIC
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x7746ab191b6787438250eef94852a47108a7042aabf09f1605fe48f96ce0994e0x60806040239127652022-01-15 12:45:2813 days 6 hrs ago0x8e1d4ee6c2948316fe34b76613284eeea8f5aff0 IN  Create: Oracle0 MATIC0.0010162399981.999999998
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Oracle

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 3 : Oracle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "Ownable.sol";

contract Oracle is Ownable{
    mapping(string => uint) private prices;
    uint8 private _decimals = 18;
    
    function getPrice(string memory symbol) public view returns (uint) {
        return prices[symbol];
    }

    function setPrice(string memory symbol, uint price) public onlyOwner{
        prices[symbol] = price;
    }
    function setPrices(string[] memory symbolList, uint[] memory priceList) public onlyOwner{
        require(symbolList.length == priceList.length, "SymbolList and PriceList should be of same size");
        for (uint i = 0; i < symbolList.length; i++){
            setPrice(symbolList[i], priceList[i]);
        }
    }
    function decimals() public returns(uint8){
        return _decimals;
    }
}

File 2 of 3 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev 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.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 3 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

Settings
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "libraries": {
    "Oracle.sol": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract 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":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"symbol","type":"string"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"symbolList","type":"string[]"},{"internalType":"uint256[]","name":"priceList","type":"uint256[]"}],"name":"setPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526002805460ff1916601217905534801561001d57600080fd5b506100273361002c565b61007c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61075f8061008b6000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063524f38891161005b578063524f3889146100c4578063715018a6146100e55780638da5cb5b146100ed578063f2fde38b1461010857600080fd5b806322e01192146100825780632782274914610097578063313ce567146100aa575b600080fd5b610095610090366004610465565b61011b565b005b6100956100a5366004610539565b610173565b60025460405160ff90911681526020015b60405180910390f35b6100d76100d236600461060d565b610265565b6040519081526020016100bb565b61009561028d565b6000546040516001600160a01b0390911681526020016100bb565b61009561011636600461064a565b6102c3565b6000546001600160a01b0316331461014e5760405162461bcd60e51b81526004016101459061067a565b60405180910390fd5b8060018360405161015f91906106af565b908152604051908190036020019020555050565b6000546001600160a01b0316331461019d5760405162461bcd60e51b81526004016101459061067a565b80518251146102065760405162461bcd60e51b815260206004820152602f60248201527f53796d626f6c4c69737420616e642050726963654c6973742073686f756c642060448201526e6265206f662073616d652073697a6560881b6064820152608401610145565b60005b82518110156102605761024e838281518110610227576102276106ea565b6020026020010151838381518110610241576102416106ea565b602002602001015161011b565b8061025881610700565b915050610209565b505050565b600060018260405161027791906106af565b9081526020016040518091039020549050919050565b6000546001600160a01b031633146102b75760405162461bcd60e51b81526004016101459061067a565b6102c1600061035e565b565b6000546001600160a01b031633146102ed5760405162461bcd60e51b81526004016101459061067a565b6001600160a01b0381166103525760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610145565b61035b8161035e565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156103ed576103ed6103ae565b604052919050565b600082601f83011261040657600080fd5b813567ffffffffffffffff811115610420576104206103ae565b610433601f8201601f19166020016103c4565b81815284602083860101111561044857600080fd5b816020850160208301376000918101602001919091529392505050565b6000806040838503121561047857600080fd5b823567ffffffffffffffff81111561048f57600080fd5b61049b858286016103f5565b95602094909401359450505050565b600067ffffffffffffffff8211156104c4576104c46103ae565b5060051b60200190565b600082601f8301126104df57600080fd5b813560206104f46104ef836104aa565b6103c4565b82815260059290921b8401810191818101908684111561051357600080fd5b8286015b8481101561052e5780358352918301918301610517565b509695505050505050565b6000806040838503121561054c57600080fd5b823567ffffffffffffffff8082111561056457600080fd5b818501915085601f83011261057857600080fd5b813560206105886104ef836104aa565b82815260059290921b840181019181810190898411156105a757600080fd5b8286015b848110156105df578035868111156105c35760008081fd5b6105d18c86838b01016103f5565b8452509183019183016105ab565b50965050860135925050808211156105f657600080fd5b50610603858286016104ce565b9150509250929050565b60006020828403121561061f57600080fd5b813567ffffffffffffffff81111561063657600080fd5b610642848285016103f5565b949350505050565b60006020828403121561065c57600080fd5b81356001600160a01b038116811461067357600080fd5b9392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000825160005b818110156106d057602081860181015185830152016106b6565b818111156106df576000828501525b509190910192915050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561072257634e487b7160e01b600052601160045260246000fd5b506001019056fea26469706673582212209c402e5e1f97872800aca1c69dfd0c2924d59210876d50a65a6e8f8ae7dddacf64736f6c634300080a0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading