S Price: $0.807773 (+0.73%)

Contract

0xC6a47895e29284ac769cc9b43A4f39Ad768d8837

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Use Twap95289292025-02-23 8:18:543 hrs ago1740298734IN
0xC6a47895...d768d8837
0 S0.0016559655.01
Set Use Twap93978912025-02-22 16:44:5019 hrs ago1740242690IN
0xC6a47895...d768d8837
0 S0.0016566855.01
Set Use Twap90953452025-02-21 9:23:532 days ago1740129833IN
0xC6a47895...d768d8837
0 S0.0023344877.55
Set Use Twap90952212025-02-21 9:23:142 days ago1740129794IN
0xC6a47895...d768d8837
0 S0.001897363
Set Use Instant ...87189512025-02-19 19:07:513 days ago1739992071IN
0xC6a47895...d768d8837
0 S0.0016562955.01
Set Use Twap86933402025-02-19 16:42:303 days ago1739983350IN
0xC6a47895...d768d8837
0 S0.0016559655.01
Set Use Twap84439502025-02-18 11:27:145 days ago1739878034IN
0xC6a47895...d768d8837
0 S0.0016566855.01
Set Use Twap83487972025-02-17 22:15:085 days ago1739830508IN
0xC6a47895...d768d8837
0 S0.0016559655.01
Set Granularity82996152025-02-17 16:19:065 days ago1739809146IN
0xC6a47895...d768d8837
0 S0.0016552555.01
Set Granularity82994352025-02-17 16:17:425 days ago1739809062IN
0xC6a47895...d768d8837
0 S0.0017376957.75
Set Use Twap82993512025-02-17 16:17:025 days ago1739809022IN
0xC6a47895...d768d8837
0 S0.0016566855.01
Set Use Instant ...82991792025-02-17 16:15:565 days ago1739808956IN
0xC6a47895...d768d8837
0 S0.0016556355.01

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OracleV2GSnake

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 6 : OracleV2GSnake.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./shadow/interfaces/IPool.sol";
import "./owner/Operator.sol";

contract OracleV2GSnake is Operator {
    using SafeMath for uint256;

    address public token0;
    address public token1;
    uint256 public granularityToUse = 1; // 1 observation every 30 minutes
    bool public useTwap = false;
    bool public useInstantPrice = true;
    IPool public pair;

    constructor(IPool _pair) public {
        pair = _pair;
        token0 = pair.token0();
        token1 = pair.token1();
        // uint256 reserve0;
        // uint256 reserve1;
        // (reserve0, reserve1, ) = pair.getReserves();
        // require(reserve0 != 0 && reserve1 != 0, "Oracle: No reserves");
    }

    function update() external {
        pair.sync();
    }

    function consult(
        address _token,
        uint256 _amountIn
    ) external view returns (uint256 amountOut) {
        if (_token == token0) {
            amountOut = _quote(_token, _amountIn, 12);
        } else {
            require(_token == token1, "Oracle: Invalid token");
            amountOut = _quote(_token, _amountIn, 12);
        }
    }

    function twap(
        address _token,
        uint256 _amountIn
    ) external view returns (uint256 amountOut) {
        if (_token == token0) {
            if (useTwap) {
                amountOut = _quote(_token, _amountIn, granularityToUse);
            } else {
                if (useInstantPrice) {
                    amountOut = _getAmountOut(_token, _amountIn);
                } else {
                    amountOut = _current(_token, _amountIn);
                }
            }
        } else {
            require(_token == token1, "Oracle: Invalid token");
            if (useTwap) {
                amountOut = _quote(_token, _amountIn, granularityToUse);
            } else {
                if (useInstantPrice) {
                    amountOut = _getAmountOut(_token, _amountIn);
                } else {
                    amountOut = _current(_token, _amountIn);
                }
            }
        }
    }

    // Note the window parameter is removed as its always 1 (30min), granularity at 12 for example is (12 * 30min) = 6 hours
    function _quote(
        address tokenIn,
        uint256 amountIn,
        uint256 granularity // number of observations to query
    ) internal view returns (uint256 amountOut) {
        uint256 observationLength = IPool(pair).observationLength();
        require(
            granularity <= observationLength,
            "Oracle: Not enough observations"
        );

        uint256 price = IPool(pair).quote(tokenIn, amountIn, granularity);
        amountOut = price;
    }

    // Note the window parameter is removed as its always 1 (30min), granularity at 12 for example is (12 * 30min) = 6 hours
    function _getAmountOut(
        address tokenIn,
        uint256 amountIn
    ) internal view returns (uint256 amountOut) {
        uint256 reserve0;
        uint256 reserve1;
        (reserve0, reserve1, ) = IPool(pair).getReserves();
        require(reserve0 != 0 && reserve1 != 0, "Oracle: No reserves");

        uint256 price = IPool(pair).getAmountOut(amountIn, tokenIn);
        amountOut = price;
    }

    // Note the window parameter is removed as its always 1 (30min), granularity at 12 for example is (12 * 30min) = 6 hours
    function _current(
        address tokenIn,
        uint256 amountIn
    ) internal view returns (uint256 amountOut) {
        uint256 observationLength = IPool(pair).observationLength();
        require(
            observationLength > 0,
            "Oracle: Not enough observations"
        );

        uint256 price = IPool(pair).current(tokenIn, amountIn);
        amountOut = price;
    }

    function setGranularity(uint256 _granularity) external onlyOperator {
        granularityToUse = _granularity;
    }

    function setUseTwap(bool _useTwap) external onlyOperator {
        useTwap = _useTwap;
    }

    function setUseInstantPrice(bool _useInstantPrice) external onlyOperator {
        useInstantPrice = _useInstantPrice;
    }
}

File 2 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 6 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 4 of 6 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

File 5 of 6 : Operator.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract Operator is Context, Ownable {
    address private _operator;

    event OperatorTransferred(address indexed previousOperator, address indexed newOperator);

    constructor() {
        _operator = _msgSender();
        emit OperatorTransferred(address(0), _operator);
    }

    function operator() public view returns (address) {
        return _operator;
    }

    modifier onlyOperator() {
        require(_operator == msg.sender, "operator: caller is not the operator");
        _;
    }

    function isOperator() public view returns (bool) {
        return _msgSender() == _operator;
    }

    function transferOperator(address newOperator_) public onlyOwner {
        _transferOperator(newOperator_);
    }

    function _transferOperator(address newOperator_) internal {
        require(newOperator_ != address(0), "operator: zero address given for new operator");
        emit OperatorTransferred(address(0), newOperator_);
        _operator = newOperator_;
    }

    function _renounceOperator() public onlyOwner {
        emit OperatorTransferred(_operator, address(0));
        _operator = address(0);
    }
}

File 6 of 6 : IPool.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.26;

interface IPool {
    error NOT_AUTHORIZED();
    error UNSTABLE_RATIO();
    /// @dev safe transfer failed
    error STF();
    error OVERFLOW();
    /// @dev skim disabled
    error SD();
    /// @dev insufficient liquidity minted
    error ILM();
    /// @dev insufficient liquidity burned
    error ILB();
    /// @dev insufficient output amount
    error IOA();
    /// @dev insufficient input amount
    error IIA();
    error IL();
    error IT();
    error K();

    event Mint(address indexed sender, uint256 amount0, uint256 amount1);
    event Burn(
        address indexed sender,
        uint256 amount0,
        uint256 amount1,
        address indexed to
    );
    event Swap(
        address indexed sender,
        uint256 amount0In,
        uint256 amount1In,
        uint256 amount0Out,
        uint256 amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

        /// @notice Same as prices with with an additional window argument.
    ///         Window = 2 means 2 * 30min (or 1 hr) between observations
    /// @param tokenIn .
    /// @param amountIn .
    /// @param points .
    /// @param window .
    /// @return Array of TWAP prices
    function sample(
        address tokenIn,
        uint256 amountIn,
        uint256 points,
        uint256 window
    ) external view returns (uint256[] memory);

    function observations(uint256 index) external view returns (uint256 timestamp, uint256 reserve0Cumulative, uint256 reserve1Cumulative);

    function current(address tokenIn, uint256 amountIn) external view returns (uint256 amountOut);

    /// @notice Provides twap price with user configured granularity, up to the full window size
    /// @param tokenIn .
    /// @param amountIn .
    /// @param granularity .
    /// @return amountOut .
    function quote(address tokenIn, uint256 amountIn, uint256 granularity) external view returns (uint256 amountOut);

    /// @notice Get the number of observations recorded
    function observationLength() external view returns (uint256);

    /// @notice Address of token in the pool with the lower address value
    function token0() external view returns (address);

    /// @notice Address of token in the poool with the higher address value
    function token1() external view returns (address);

    /// @notice initialize the pool, called only once programatically
    function initialize(
        address _token0,
        address _token1,
        bool _stable
    ) external;

    /// @notice calculate the current reserves of the pool and their last 'seen' timestamp
    /// @return _reserve0 amount of token0 in reserves
    /// @return _reserve1 amount of token1 in reserves
    /// @return _blockTimestampLast the timestamp when the pool was last updated
    function getReserves()
        external
        view
        returns (
            uint112 _reserve0,
            uint112 _reserve1,
            uint32 _blockTimestampLast
        );

    /// @notice mint the pair tokens (LPs)
    /// @param to where to mint the LP tokens to
    /// @return liquidity amount of LP tokens to mint
    function mint(address to) external returns (uint256 liquidity);

    /// @notice burn the pair tokens (LPs)
    /// @param to where to send the underlying
    /// @return amount0 amount of amount0
    /// @return amount1 amount of amount1
    function burn(
        address to
    ) external returns (uint256 amount0, uint256 amount1);

    /// @notice direct swap through the pool
    function swap(
        uint256 amount0Out,
        uint256 amount1Out,
        address to,
        bytes calldata data
    ) external;

    /// @notice force balances to match reserves, can be used to harvest rebases from rebasing tokens or other external factors
    /// @param to where to send the excess tokens to
    function skim(address to) external;

    /// @notice force reserves to match balances, prevents skim excess if skim is enabled
    function sync() external;

    /// @notice set the pair fees contract address
    function setFeeRecipient(address _pairFees) external;

    /// @notice set the feesplit variable
    function setFeeSplit(uint256 _feeSplit) external;

    /// @notice sets the swap fee of the pair
    /// @dev max of 10_000 (10%)
    /// @param _fee the fee
    function setFee(uint256 _fee) external;

    /// @notice 'mint' the fees as LP tokens
    /// @dev this is used for protocol/voter fees
    function mintFee() external;

    /// @notice calculates the amount of tokens to receive post swap
    /// @param amountIn the token amount
    /// @param tokenIn the address of the token
    function getAmountOut(
        uint256 amountIn,
        address tokenIn
    ) external view returns (uint256 amountOut);

    /// @notice returns various metadata about the pair
    function metadata()
        external
        view
        returns (
            uint256 _decimals0,
            uint256 _decimals1,
            uint256 _reserve0,
            uint256 _reserve1,
            bool _stable,
            address _token0,
            address _token1
        );

    /// @notice returns the feeSplit of the pair
    function feeSplit() external view returns (uint256);

    /// @notice returns the fee of the pair
    function fee() external view returns (uint256);

    /// @notice returns the feeRecipient of the pair
    function feeRecipient() external view returns (address);

}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IPool","name":"_pair","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOperator","type":"address"},{"indexed":true,"internalType":"address","name":"newOperator","type":"address"}],"name":"OperatorTransferred","type":"event"},{"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":"_renounceOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"}],"name":"consult","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"granularityToUse","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pair","outputs":[{"internalType":"contract IPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_granularity","type":"uint256"}],"name":"setGranularity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_useInstantPrice","type":"bool"}],"name":"setUseInstantPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_useTwap","type":"bool"}],"name":"setUseTwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token0","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token1","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOperator_","type":"address"}],"name":"transferOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"}],"name":"twap","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"update","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"useInstantPrice","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"useTwap","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405260016004556005805461ffff191661010017905534801561002457600080fd5b50604051610f6d380380610f6d83398101604081905261004391610240565b61004c336101d8565b600180546001600160a01b031916339081179091556040516000907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908290a380600560026101000a8154816001600160a01b0302191690836001600160a01b03160217905550600560029054906101000a90046001600160a01b03166001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015610106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012a9190610240565b600280546001600160a01b0319166001600160a01b039283161790556005546040805163d21220a760e01b81529051620100009092049092169163d21220a79160048083019260209291908290030181865afa15801561018e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b29190610240565b600380546001600160a01b0319166001600160a01b039290921691909117905550610264565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461023d57600080fd5b50565b60006020828403121561025257600080fd5b815161025d81610228565b9392505050565b610cfa806102736000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c80636808a128116100ad578063a8aa1b3111610071578063a8aa1b3114610234578063c6af81d91461024d578063d21220a714610260578063d5000cdf14610273578063f2fde38b1461028557600080fd5b80636808a128146101f8578063715018a61461020b5780638a27f103146102135780638da5cb5b1461021b578063a2e620451461022c57600080fd5b80633ddac953116100f45780633ddac953146101915780634456eda2146101b2578063570ca735146101d1578063588ff2d2146101e2578063625b3672146101eb57600080fd5b806306b5d2d0146101265780630dfe16811461013b57806329605e771461016b5780633b5fce921461017e575b600080fd5b610139610134366004610b5d565b610298565b005b60025461014e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610139610179366004610ba2565b6102e5565b61013961018c366004610bbd565b6102f9565b6101a461019f366004610bd6565b610328565b604051908152602001610162565b6001546001600160a01b031633145b6040519015158152602001610162565b6001546001600160a01b031661014e565b6101a460045481565b6005546101c19060ff1681565b6101a4610206366004610bd6565b6103be565b6101396104a4565b6101396104b8565b6000546001600160a01b031661014e565b61013961050a565b60055461014e906201000090046001600160a01b031681565b61013961025b366004610b5d565b610574565b60035461014e906001600160a01b031681565b6005546101c190610100900460ff1681565b610139610293366004610ba2565b6105b1565b6001546001600160a01b031633146102cb5760405162461bcd60e51b81526004016102c290610c00565b60405180910390fd5b600580549115156101000261ff0019909216919091179055565b6102ed610627565b6102f681610681565b50565b6001546001600160a01b031633146103235760405162461bcd60e51b81526004016102c290610c00565b600455565b6002546000906001600160a01b03908116908416036103545761034d8383600c610745565b90506103b8565b6003546001600160a01b038481169116146103a95760405162461bcd60e51b815260206004820152601560248201527427b930b1b6329d1024b73b30b634b2103a37b5b2b760591b60448201526064016102c2565b6103b58383600c610745565b90505b92915050565b6002546000906001600160a01b03908116908416036104135760055460ff16156103ef5761034d8383600454610745565b600554610100900460ff16156104095761034d838361089f565b61034d83836109bc565b6003546001600160a01b038481169116146104685760405162461bcd60e51b815260206004820152601560248201527427b930b1b6329d1024b73b30b634b2103a37b5b2b760591b60448201526064016102c2565b60055460ff16156104805761034d8383600454610745565b600554610100900460ff161561049a5761034d838361089f565b6103b583836109bc565b6104ac610627565b6104b66000610b0d565b565b6104c0610627565b6001546040516000916001600160a01b0316907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908390a3600180546001600160a01b0319169055565b600560029054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561055a57600080fd5b505af115801561056e573d6000803e3d6000fd5b50505050565b6001546001600160a01b0316331461059e5760405162461bcd60e51b81526004016102c290610c00565b6005805460ff1916911515919091179055565b6105b9610627565b6001600160a01b03811661061e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102c2565b6102f681610b0d565b6000546001600160a01b031633146104b65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c2565b6001600160a01b0381166106ed5760405162461bcd60e51b815260206004820152602d60248201527f6f70657261746f723a207a65726f206164647265737320676976656e20666f7260448201526c103732bb9037b832b930ba37b960991b60648201526084016102c2565b6040516001600160a01b038216906000907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908290a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080600560029054906101000a90046001600160a01b03166001600160a01b031663ebeb31db6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bf9190610c44565b9050808311156108115760405162461bcd60e51b815260206004820152601f60248201527f4f7261636c653a204e6f7420656e6f756768206f62736572766174696f6e730060448201526064016102c2565b600554604051639e8cc04b60e01b81526001600160a01b03878116600483015260248201879052604482018690526000926201000090041690639e8cc04b906064015b602060405180830381865afa158015610871573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108959190610c44565b9695505050505050565b6000806000600560029054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156108f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091b9190610c74565b506001600160701b039182169350169050811580159061093a57508015155b61097c5760405162461bcd60e51b81526020600482015260136024820152724f7261636c653a204e6f20726573657276657360681b60448201526064016102c2565b6005546040516378a051ad60e11b8152600481018690526001600160a01b038781166024830152600092620100009004169063f140a35a90604401610854565b600080600560029054906101000a90046001600160a01b03166001600160a01b031663ebeb31db6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a369190610c44565b905060008111610a885760405162461bcd60e51b815260206004820152601f60248201527f4f7261636c653a204e6f7420656e6f756768206f62736572766174696f6e730060448201526064016102c2565b6005546040516328bd9fc160e11b81526001600160a01b03868116600483015260248201869052600092620100009004169063517b3f8290604401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190610c44565b95945050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215610b6f57600080fd5b81358015158114610b7f57600080fd5b9392505050565b80356001600160a01b0381168114610b9d57600080fd5b919050565b600060208284031215610bb457600080fd5b6103b582610b86565b600060208284031215610bcf57600080fd5b5035919050565b60008060408385031215610be957600080fd5b610bf283610b86565b946020939093013593505050565b60208082526024908201527f6f70657261746f723a2063616c6c6572206973206e6f7420746865206f70657260408201526330ba37b960e11b606082015260800190565b600060208284031215610c5657600080fd5b5051919050565b80516001600160701b0381168114610b9d57600080fd5b600080600060608486031215610c8957600080fd5b610c9284610c5d565b9250610ca060208501610c5d565b9150604084015163ffffffff81168114610cb957600080fd5b80915050925092509256fea2646970667358221220a7c5cff98c0fea9e03d3e0928beafc137faa401dc4c0975c3552242668a8016064736f6c634300081a0033000000000000000000000000b901d7316447c84f4417b8a8268e2822095051e6

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101215760003560e01c80636808a128116100ad578063a8aa1b3111610071578063a8aa1b3114610234578063c6af81d91461024d578063d21220a714610260578063d5000cdf14610273578063f2fde38b1461028557600080fd5b80636808a128146101f8578063715018a61461020b5780638a27f103146102135780638da5cb5b1461021b578063a2e620451461022c57600080fd5b80633ddac953116100f45780633ddac953146101915780634456eda2146101b2578063570ca735146101d1578063588ff2d2146101e2578063625b3672146101eb57600080fd5b806306b5d2d0146101265780630dfe16811461013b57806329605e771461016b5780633b5fce921461017e575b600080fd5b610139610134366004610b5d565b610298565b005b60025461014e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610139610179366004610ba2565b6102e5565b61013961018c366004610bbd565b6102f9565b6101a461019f366004610bd6565b610328565b604051908152602001610162565b6001546001600160a01b031633145b6040519015158152602001610162565b6001546001600160a01b031661014e565b6101a460045481565b6005546101c19060ff1681565b6101a4610206366004610bd6565b6103be565b6101396104a4565b6101396104b8565b6000546001600160a01b031661014e565b61013961050a565b60055461014e906201000090046001600160a01b031681565b61013961025b366004610b5d565b610574565b60035461014e906001600160a01b031681565b6005546101c190610100900460ff1681565b610139610293366004610ba2565b6105b1565b6001546001600160a01b031633146102cb5760405162461bcd60e51b81526004016102c290610c00565b60405180910390fd5b600580549115156101000261ff0019909216919091179055565b6102ed610627565b6102f681610681565b50565b6001546001600160a01b031633146103235760405162461bcd60e51b81526004016102c290610c00565b600455565b6002546000906001600160a01b03908116908416036103545761034d8383600c610745565b90506103b8565b6003546001600160a01b038481169116146103a95760405162461bcd60e51b815260206004820152601560248201527427b930b1b6329d1024b73b30b634b2103a37b5b2b760591b60448201526064016102c2565b6103b58383600c610745565b90505b92915050565b6002546000906001600160a01b03908116908416036104135760055460ff16156103ef5761034d8383600454610745565b600554610100900460ff16156104095761034d838361089f565b61034d83836109bc565b6003546001600160a01b038481169116146104685760405162461bcd60e51b815260206004820152601560248201527427b930b1b6329d1024b73b30b634b2103a37b5b2b760591b60448201526064016102c2565b60055460ff16156104805761034d8383600454610745565b600554610100900460ff161561049a5761034d838361089f565b6103b583836109bc565b6104ac610627565b6104b66000610b0d565b565b6104c0610627565b6001546040516000916001600160a01b0316907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908390a3600180546001600160a01b0319169055565b600560029054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561055a57600080fd5b505af115801561056e573d6000803e3d6000fd5b50505050565b6001546001600160a01b0316331461059e5760405162461bcd60e51b81526004016102c290610c00565b6005805460ff1916911515919091179055565b6105b9610627565b6001600160a01b03811661061e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102c2565b6102f681610b0d565b6000546001600160a01b031633146104b65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102c2565b6001600160a01b0381166106ed5760405162461bcd60e51b815260206004820152602d60248201527f6f70657261746f723a207a65726f206164647265737320676976656e20666f7260448201526c103732bb9037b832b930ba37b960991b60648201526084016102c2565b6040516001600160a01b038216906000907f74da04524d50c64947f5dd5381ef1a4dca5cba8ed1d816243f9e48aa0b5617ed908290a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080600560029054906101000a90046001600160a01b03166001600160a01b031663ebeb31db6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bf9190610c44565b9050808311156108115760405162461bcd60e51b815260206004820152601f60248201527f4f7261636c653a204e6f7420656e6f756768206f62736572766174696f6e730060448201526064016102c2565b600554604051639e8cc04b60e01b81526001600160a01b03878116600483015260248201879052604482018690526000926201000090041690639e8cc04b906064015b602060405180830381865afa158015610871573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108959190610c44565b9695505050505050565b6000806000600560029054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156108f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091b9190610c74565b506001600160701b039182169350169050811580159061093a57508015155b61097c5760405162461bcd60e51b81526020600482015260136024820152724f7261636c653a204e6f20726573657276657360681b60448201526064016102c2565b6005546040516378a051ad60e11b8152600481018690526001600160a01b038781166024830152600092620100009004169063f140a35a90604401610854565b600080600560029054906101000a90046001600160a01b03166001600160a01b031663ebeb31db6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a369190610c44565b905060008111610a885760405162461bcd60e51b815260206004820152601f60248201527f4f7261636c653a204e6f7420656e6f756768206f62736572766174696f6e730060448201526064016102c2565b6005546040516328bd9fc160e11b81526001600160a01b03868116600483015260248201869052600092620100009004169063517b3f8290604401602060405180830381865afa158015610ae0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b049190610c44565b95945050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215610b6f57600080fd5b81358015158114610b7f57600080fd5b9392505050565b80356001600160a01b0381168114610b9d57600080fd5b919050565b600060208284031215610bb457600080fd5b6103b582610b86565b600060208284031215610bcf57600080fd5b5035919050565b60008060408385031215610be957600080fd5b610bf283610b86565b946020939093013593505050565b60208082526024908201527f6f70657261746f723a2063616c6c6572206973206e6f7420746865206f70657260408201526330ba37b960e11b606082015260800190565b600060208284031215610c5657600080fd5b5051919050565b80516001600160701b0381168114610b9d57600080fd5b600080600060608486031215610c8957600080fd5b610c9284610c5d565b9250610ca060208501610c5d565b9150604084015163ffffffff81168114610cb957600080fd5b80915050925092509256fea2646970667358221220a7c5cff98c0fea9e03d3e0928beafc137faa401dc4c0975c3552242668a8016064736f6c634300081a0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000b901d7316447c84f4417b8a8268e2822095051e6

-----Decoded View---------------
Arg [0] : _pair (address): 0xb901D7316447C84f4417b8a8268E2822095051E6

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000b901d7316447c84f4417b8a8268e2822095051e6


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

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.