Address Details
contract

0xDA7a001b254CD22e46d3eAB04d937489c93174C3

Contract Name
StdReferenceProxy
Creator
0x6a885b–d7e2b9 at 0xf371c1–5d20b8
Balance
0 CELO ( )
Locked CELO Balance
0.00 CELO
Voting CELO Balance
0.00 CELO
Pending Unlocked Gold
0.00 CELO
Tokens
Fetching tokens...
Transactions
1 Transactions
Transfers
0 Transfers
Gas Used
27,721
Last Balance Update
25159395
This contract has been partially verified via Sourcify. View contract in Sourcify repository
Contract name:
StdReferenceProxy




Optimization enabled
true
Compiler version
v0.6.11+commit.5ef660b1




Optimization runs
200
EVM Version
istanbul




Verified at
2022-01-10T06:14:48.054063Z

browser/StdReferenceProxy.sol

// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.6.11;
pragma experimental ABIEncoderV2;

/*
 * @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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

/**
 * @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.
 */
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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

interface IStdReference {
    /// A structure returned whenever someone requests for standard reference data.
    struct ReferenceData {
        uint256 rate; // base/quote exchange rate, multiplied by 1e18.
        uint256 lastUpdatedBase; // UNIX epoch of the last time when base price gets updated.
        uint256 lastUpdatedQuote; // UNIX epoch of the last time when quote price gets updated.
    }

    /// Returns the price data for the given base/quote pair. Revert if not available.
    function getReferenceData(string memory _base, string memory _quote)
        external
        view
        returns (ReferenceData memory);

    /// Similar to getReferenceData, but with multiple base/quote pairs at once.
    function getReferenceDataBulk(string[] memory _bases, string[] memory _quotes)
        external
        view
        returns (ReferenceData[] memory);
}

abstract contract StdReferenceBase is IStdReference {
    function getReferenceData(string memory _base, string memory _quote)
        public
        virtual
        override
        view
        returns (ReferenceData memory);

    function getReferenceDataBulk(string[] memory _bases, string[] memory _quotes)
        public
        override
        view
        returns (ReferenceData[] memory)
    {
        require(_bases.length == _quotes.length, "BAD_INPUT_LENGTH");
        uint256 len = _bases.length;
        ReferenceData[] memory results = new ReferenceData[](len);
        for (uint256 idx = 0; idx < len; idx++) {
            results[idx] = getReferenceData(_bases[idx], _quotes[idx]);
        }
        return results;
    }
}

contract StdReferenceProxy is Ownable, StdReferenceBase {
    IStdReference public ref;

    constructor(IStdReference _ref) public {
        ref = _ref;
    }

    /// Updates standard reference implementation. Only callable by the owner.
    function setRef(IStdReference _ref) public onlyOwner {
        ref = _ref;
    }

    /// Returns the price data for the given base/quote pair. Revert if not available.
    function getReferenceData(string memory _base, string memory _quote)
        public
        override
        view
        returns (ReferenceData memory)
    {
        return ref.getReferenceData(_base, _quote);
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_ref","internalType":"contract IStdReference"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IStdReference.ReferenceData","components":[{"type":"uint256","name":"rate","internalType":"uint256"},{"type":"uint256","name":"lastUpdatedBase","internalType":"uint256"},{"type":"uint256","name":"lastUpdatedQuote","internalType":"uint256"}]}],"name":"getReferenceData","inputs":[{"type":"string","name":"_base","internalType":"string"},{"type":"string","name":"_quote","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct IStdReference.ReferenceData[]","components":[{"type":"uint256","name":"rate","internalType":"uint256"},{"type":"uint256","name":"lastUpdatedBase","internalType":"uint256"},{"type":"uint256","name":"lastUpdatedQuote","internalType":"uint256"}]}],"name":"getReferenceDataBulk","inputs":[{"type":"string[]","name":"_bases","internalType":"string[]"},{"type":"string[]","name":"_quotes","internalType":"string[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IStdReference"}],"name":"ref","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRef","inputs":[{"type":"address","name":"_ref","internalType":"contract IStdReference"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
              

Contract Creation Code

Verify & Publish
0x608060405234801561001057600080fd5b5060405161096738038061096783398101604081905261002f916100b5565b60006100426001600160e01b036100b116565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180546001600160a01b0319166001600160a01b03929092169190911790556100e3565b3390565b6000602082840312156100c6578081fd5b81516001600160a01b03811681146100dc578182fd5b9392505050565b610875806100f26000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063715018a61161005b578063715018a6146100d55780638da5cb5b146100dd578063e42a071b146100e5578063f2fde38b146101055761007d565b806321a78f681461008257806365555bcc146100a05780636bc855cc146100c0575b600080fd5b61008a610118565b60405161009791906106bd565b60405180910390f35b6100b36100ae3660046105c5565b610127565b60405161009791906107f2565b6100d36100ce366004610541565b6101ba565b005b6100d361021a565b61008a610299565b6100f86100f3366004610564565b6102a8565b60405161009791906106d1565b6100d3610113366004610541565b610386565b6001546001600160a01b031681565b61012f610440565b60015460405163195556f360e21b81526001600160a01b03909116906365555bcc90610161908690869060040161071f565b60606040518083038186803b15801561017957600080fd5b505afa15801561018d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b1919061061c565b90505b92915050565b6101c261043c565b6000546001600160a01b039081169116146101f85760405162461bcd60e51b81526004016101ef906107bd565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61022261043c565b6000546001600160a01b0390811691161461024f5760405162461bcd60e51b81526004016101ef906107bd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b606081518351146102cb5760405162461bcd60e51b81526004016101ef9061074d565b825160608167ffffffffffffffff811180156102e657600080fd5b5060405190808252806020026020018201604052801561032057816020015b61030d610440565b8152602001906001900390816103055790505b50905060005b8281101561037d5761035e86828151811061033d57fe5b602002602001015186838151811061035157fe5b6020026020010151610127565b82828151811061036a57fe5b6020908102919091010152600101610326565b50949350505050565b61038e61043c565b6000546001600160a01b039081169116146103bb5760405162461bcd60e51b81526004016101ef906107bd565b6001600160a01b0381166103e15760405162461bcd60e51b81526004016101ef90610777565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b60405180606001604052806000815260200160008152602001600081525090565b600082601f830112610471578081fd5b813567ffffffffffffffff811115610487578182fd5b60206104968182840201610800565b828152925080830184820160005b848110156104cd576104bb888584358a01016104d8565b835291830191908301906001016104a4565b505050505092915050565b600082601f8301126104e8578081fd5b813567ffffffffffffffff8111156104fe578182fd5b610511601f8201601f1916602001610800565b915080825283602082850101111561052857600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215610552578081fd5b813561055d81610827565b9392505050565b60008060408385031215610576578081fd5b823567ffffffffffffffff8082111561058d578283fd5b61059986838701610461565b935060208501359150808211156105ae578283fd5b506105bb85828601610461565b9150509250929050565b600080604083850312156105d7578182fd5b823567ffffffffffffffff808211156105ee578384fd5b6105fa868387016104d8565b9350602085013591508082111561060f578283fd5b506105bb858286016104d8565b60006060828403121561062d578081fd5b6106376060610800565b8251815260208301516020820152604083015160408201528091505092915050565b60008151808452815b8181101561067e57602081850181015186830182015201610662565b8181111561068f5782602083870101525b50601f01601f19169290920160200192915050565b8051825260208082015190830152604090810151910152565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b81811015610713576107008385516106a4565b92840192606092909201916001016106ed565b50909695505050505050565b6000604082526107326040830185610659565b82810360208401526107448185610659565b95945050505050565b60208082526010908201526f0848288be929ca0aaa8be988a9c8ea8960831b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b606081016101b482846106a4565b60405181810167ffffffffffffffff8111828210171561081f57600080fd5b604052919050565b6001600160a01b038116811461083c57600080fd5b5056fea26469706673582212209eefd9a35c715d63a2495dda784e00be232e9d323660430832b0104b4ee8144b64736f6c634300060b0033000000000000000000000000f43ab8df063ff2d9a1e66ea6547fec160c28c2e4

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063715018a61161005b578063715018a6146100d55780638da5cb5b146100dd578063e42a071b146100e5578063f2fde38b146101055761007d565b806321a78f681461008257806365555bcc146100a05780636bc855cc146100c0575b600080fd5b61008a610118565b60405161009791906106bd565b60405180910390f35b6100b36100ae3660046105c5565b610127565b60405161009791906107f2565b6100d36100ce366004610541565b6101ba565b005b6100d361021a565b61008a610299565b6100f86100f3366004610564565b6102a8565b60405161009791906106d1565b6100d3610113366004610541565b610386565b6001546001600160a01b031681565b61012f610440565b60015460405163195556f360e21b81526001600160a01b03909116906365555bcc90610161908690869060040161071f565b60606040518083038186803b15801561017957600080fd5b505afa15801561018d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b1919061061c565b90505b92915050565b6101c261043c565b6000546001600160a01b039081169116146101f85760405162461bcd60e51b81526004016101ef906107bd565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61022261043c565b6000546001600160a01b0390811691161461024f5760405162461bcd60e51b81526004016101ef906107bd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b606081518351146102cb5760405162461bcd60e51b81526004016101ef9061074d565b825160608167ffffffffffffffff811180156102e657600080fd5b5060405190808252806020026020018201604052801561032057816020015b61030d610440565b8152602001906001900390816103055790505b50905060005b8281101561037d5761035e86828151811061033d57fe5b602002602001015186838151811061035157fe5b6020026020010151610127565b82828151811061036a57fe5b6020908102919091010152600101610326565b50949350505050565b61038e61043c565b6000546001600160a01b039081169116146103bb5760405162461bcd60e51b81526004016101ef906107bd565b6001600160a01b0381166103e15760405162461bcd60e51b81526004016101ef90610777565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b60405180606001604052806000815260200160008152602001600081525090565b600082601f830112610471578081fd5b813567ffffffffffffffff811115610487578182fd5b60206104968182840201610800565b828152925080830184820160005b848110156104cd576104bb888584358a01016104d8565b835291830191908301906001016104a4565b505050505092915050565b600082601f8301126104e8578081fd5b813567ffffffffffffffff8111156104fe578182fd5b610511601f8201601f1916602001610800565b915080825283602082850101111561052857600080fd5b8060208401602084013760009082016020015292915050565b600060208284031215610552578081fd5b813561055d81610827565b9392505050565b60008060408385031215610576578081fd5b823567ffffffffffffffff8082111561058d578283fd5b61059986838701610461565b935060208501359150808211156105ae578283fd5b506105bb85828601610461565b9150509250929050565b600080604083850312156105d7578182fd5b823567ffffffffffffffff808211156105ee578384fd5b6105fa868387016104d8565b9350602085013591508082111561060f578283fd5b506105bb858286016104d8565b60006060828403121561062d578081fd5b6106376060610800565b8251815260208301516020820152604083015160408201528091505092915050565b60008151808452815b8181101561067e57602081850181015186830182015201610662565b8181111561068f5782602083870101525b50601f01601f19169290920160200192915050565b8051825260208082015190830152604090810151910152565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b81811015610713576107008385516106a4565b92840192606092909201916001016106ed565b50909695505050505050565b6000604082526107326040830185610659565b82810360208401526107448185610659565b95945050505050565b60208082526010908201526f0848288be929ca0aaa8be988a9c8ea8960831b604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b606081016101b482846106a4565b60405181810167ffffffffffffffff8111828210171561081f57600080fd5b604052919050565b6001600160a01b038116811461083c57600080fd5b5056fea26469706673582212209eefd9a35c715d63a2495dda784e00be232e9d323660430832b0104b4ee8144b64736f6c634300060b0033