Contract Address Details

0x71046b955Cdd96bC54aCa5E66fd69cfb5780f3BB

Contract Name
StdReferenceProxy
Creator
0x9dfb1c–257d3d at 0x97a57a–217981
Balance
0 CELO ( )
Tokens
Fetching tokens...
Transactions
Transfers
Gas Used
Last Balance Update
11518948
This contract has been verified via Sourcify. View contract in Sourcify repository
Contract name:
StdReferenceProxy




Optimization enabled
false
Compiler version
v0.8.3+commit.8d00100c




EVM Version
istanbul




Verified at
2021-12-15 18:45:34.243228Z

contracts/StdReferenceProxy.sol

pragma solidity 0.8.3;
pragma abicoder v2;
/*
* @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) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
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.
*/
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() {
_setOwner(_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 {
_setOwner(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");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, 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
view
virtual
override
returns (ReferenceData memory);
function getReferenceDataBulk(
string[] memory _bases,
string[] memory _quotes
) public view override 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) {
ref = _ref;
}
/// @notice Updates standard reference implementation. Only callable by the owner.
/// @param _ref Address of the new standard reference contract
function setRef(IStdReference _ref) public onlyOwner {
ref = _ref;
}
/// @notice Returns the price data for the given base/quote pair. Revert if not available.
/// @param base The base symbol of the token pair
/// @param quote The quote symbol of the token pair
function getReferenceData(string memory base, string memory quote)
public
view
override
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"}]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063715018a61161005b578063715018a6146100ec5780638da5cb5b146100f6578063e42a071b14610114578063f2fde38b146101445761007d565b806321a78f681461008257806365555bcc146100a05780636bc855cc146100d0575b600080fd5b61008a610160565b6040516100979190610c42565b60405180910390f35b6100ba60048036038101906100b591906109a7565b610186565b6040516100c79190610cf4565b60405180910390f35b6100ea60048036038101906100e5919061097e565b610243565b005b6100f4610303565b005b6100fe61038b565b60405161010b9190610c05565b60405180910390f35b61012e60048036038101906101299190610912565b6103b4565b60405161013b9190610c20565b60405180910390f35b61015e600480360381019061015991906108e9565b610576565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61018e61073a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166365555bcc84846040518363ffffffff1660e01b81526004016101eb929190610c5d565b60606040518083038186803b15801561020357600080fd5b505afa158015610217573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023b9190610a13565b905092915050565b61024b61066e565b73ffffffffffffffffffffffffffffffffffffffff1661026961038b565b73ffffffffffffffffffffffffffffffffffffffff16146102bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102b690610cd4565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61030b61066e565b73ffffffffffffffffffffffffffffffffffffffff1661032961038b565b73ffffffffffffffffffffffffffffffffffffffff161461037f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161037690610cd4565b60405180910390fd5b6103896000610676565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606081518351146103fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f190610c94565b60405180910390fd5b60008351905060008167ffffffffffffffff811115610442577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561047b57816020015b61046861073a565b8152602001906001900390816104605790505b50905060005b8281101561056a576105138682815181106104c5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151868381518110610506577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151610186565b82828151811061054c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250808061056290610ecb565b915050610481565b50809250505092915050565b61057e61066e565b73ffffffffffffffffffffffffffffffffffffffff1661059c61038b565b73ffffffffffffffffffffffffffffffffffffffff16146105f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e990610cd4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065990610cb4565b60405180910390fd5b61066b81610676565b50565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60405180606001604052806000815260200160008152602001600081525090565b600061076e61076984610d34565b610d0f565b9050808382526020820190508260005b858110156107ae5781358501610794888261084a565b84526020840193506020830192505060018101905061077e565b5050509392505050565b60006107cb6107c684610d60565b610d0f565b9050828152602081018484840111156107e357600080fd5b6107ee848285610e58565b509392505050565b60008135905061080581611024565b92915050565b600082601f83011261081c57600080fd5b813561082c84826020860161075b565b91505092915050565b6000813590506108448161103b565b92915050565b600082601f83011261085b57600080fd5b813561086b8482602086016107b8565b91505092915050565b60006060828403121561088657600080fd5b6108906060610d0f565b905060006108a0848285016108d4565b60008301525060206108b4848285016108d4565b60208301525060406108c8848285016108d4565b60408301525092915050565b6000815190506108e381611052565b92915050565b6000602082840312156108fb57600080fd5b6000610909848285016107f6565b91505092915050565b6000806040838503121561092557600080fd5b600083013567ffffffffffffffff81111561093f57600080fd5b61094b8582860161080b565b925050602083013567ffffffffffffffff81111561096857600080fd5b6109748582860161080b565b9150509250929050565b60006020828403121561099057600080fd5b600061099e84828501610835565b91505092915050565b600080604083850312156109ba57600080fd5b600083013567ffffffffffffffff8111156109d457600080fd5b6109e08582860161084a565b925050602083013567ffffffffffffffff8111156109fd57600080fd5b610a098582860161084a565b9150509250929050565b600060608284031215610a2557600080fd5b6000610a3384828501610874565b91505092915050565b6000610a488383610b72565b60608301905092915050565b610a5d81610de6565b82525050565b6000610a6e82610da1565b610a788185610dc4565b9350610a8383610d91565b8060005b83811015610ab4578151610a9b8882610a3c565b9750610aa683610db7565b925050600181019050610a87565b5085935050505092915050565b610aca81610e34565b82525050565b6000610adb82610dac565b610ae58185610dd5565b9350610af5818560208601610e67565b610afe81610f72565b840191505092915050565b6000610b16601083610dd5565b9150610b2182610f83565b602082019050919050565b6000610b39602683610dd5565b9150610b4482610fac565b604082019050919050565b6000610b5c602083610dd5565b9150610b6782610ffb565b602082019050919050565b606082016000820151610b886000850182610bf6565b506020820151610b9b6020850182610bf6565b506040820151610bae6040850182610bf6565b50505050565b606082016000820151610bca6000850182610bf6565b506020820151610bdd6020850182610bf6565b506040820151610bf06040850182610bf6565b50505050565b610bff81610e2a565b82525050565b6000602082019050610c1a6000830184610a54565b92915050565b60006020820190508181036000830152610c3a8184610a63565b905092915050565b6000602082019050610c576000830184610ac1565b92915050565b60006040820190508181036000830152610c778185610ad0565b90508181036020830152610c8b8184610ad0565b90509392505050565b60006020820190508181036000830152610cad81610b09565b9050919050565b60006020820190508181036000830152610ccd81610b2c565b9050919050565b60006020820190508181036000830152610ced81610b4f565b9050919050565b6000606082019050610d096000830184610bb4565b92915050565b6000610d19610d2a565b9050610d258282610e9a565b919050565b6000604051905090565b600067ffffffffffffffff821115610d4f57610d4e610f43565b5b602082029050602081019050919050565b600067ffffffffffffffff821115610d7b57610d7a610f43565b5b610d8482610f72565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000610df182610e0a565b9050919050565b6000610e0382610de6565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000610e3f82610e46565b9050919050565b6000610e5182610e0a565b9050919050565b82818337600083830152505050565b60005b83811015610e85578082015181840152602081019050610e6a565b83811115610e94576000848401525b50505050565b610ea382610f72565b810181811067ffffffffffffffff82111715610ec257610ec1610f43565b5b80604052505050565b6000610ed682610e2a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610f0957610f08610f14565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f4241445f494e5055545f4c454e47544800000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b61102d81610de6565b811461103857600080fd5b50565b61104481610df8565b811461104f57600080fd5b50565b61105b81610e2a565b811461106657600080fd5b5056fea2646970667358221220f032e662868136b0c971e92953b33d75f80a96ae6339ea58b569e6d5051f130964736f6c63430008030033