ETH Price: $1,791.63 (+13.60%)
Gas: 1.11 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Buyback173437972023-05-26 14:15:35697 days ago1685110535IN
PieDAO: DOUGH Buyback
0 ETH0.0090987649
Buyback173222782023-05-23 13:37:47700 days ago1684849067IN
PieDAO: DOUGH Buyback
0 ETH0.0093577946.15093544
Buyback173140892023-05-22 9:56:59701 days ago1684749419IN
PieDAO: DOUGH Buyback
0 ETH0.0054584730.17583666
Buyback173126422023-05-22 5:04:35701 days ago1684731875IN
PieDAO: DOUGH Buyback
0 ETH0.0050096626.98401619
Buyback173112162023-05-22 0:14:35702 days ago1684714475IN
PieDAO: DOUGH Buyback
0 ETH0.0052773228.4220611
Buyback173107802023-05-21 22:46:11702 days ago1684709171IN
PieDAO: DOUGH Buyback
0 ETH0.0050848628.11227487
Buyback173035822023-05-20 22:25:59703 days ago1684621559IN
PieDAO: DOUGH Buyback
0 ETH0.0057982532.0563608
Buyback173035022023-05-20 22:09:47703 days ago1684620587IN
PieDAO: DOUGH Buyback
0 ETH0.0061388730.27401889
Buyback173033932023-05-20 21:47:23703 days ago1684619243IN
PieDAO: DOUGH Buyback
0 ETH0.0086994648.09282059
Buyback173026982023-05-20 19:26:11703 days ago1684610771IN
PieDAO: DOUGH Buyback
0 ETH0.006286831.75716092
Buyback172996362023-05-20 9:05:47703 days ago1684573547IN
PieDAO: DOUGH Buyback
0 ETH0.0018342932.13039607
Buyback172996362023-05-20 9:05:47703 days ago1684573547IN
PieDAO: DOUGH Buyback
0 ETH0.0063610732.13039607
Buyback172942542023-05-19 14:53:47704 days ago1684508027IN
PieDAO: DOUGH Buyback
0 ETH0.0125111761.69553181
Buyback172941322023-05-19 14:29:23704 days ago1684506563IN
PieDAO: DOUGH Buyback
0 ETH0.0115378458.28224354
Buyback169397132023-03-30 11:16:59754 days ago1680175019IN
PieDAO: DOUGH Buyback
0 ETH0.0052336628.19211408
Buyback169080392023-03-26 0:28:23759 days ago1679790503IN
PieDAO: DOUGH Buyback
0 ETH0.0035562719.36410292
Buyback168139332023-03-12 19:09:35772 days ago1678648175IN
PieDAO: DOUGH Buyback
0 ETH0.0046175322.99830704
Buyback167751292023-03-07 8:06:23777 days ago1678176383IN
PieDAO: DOUGH Buyback
0 ETH0.0048267423.80178768
Buyback167749382023-03-07 7:27:35777 days ago1678174055IN
PieDAO: DOUGH Buyback
0 ETH0.0039221.11195789
Buyback167727402023-03-07 0:02:35778 days ago1678147355IN
PieDAO: DOUGH Buyback
0 ETH0.0013542442.83953721
Buyback167724952023-03-06 23:12:59778 days ago1678144379IN
PieDAO: DOUGH Buyback
0 ETH0.006275130.94581784
Buyback167302562023-03-01 0:37:47784 days ago1677631067IN
PieDAO: DOUGH Buyback
0 ETH0.0033796116.66567667
Buyback167002022023-02-24 19:15:11788 days ago1677266111IN
PieDAO: DOUGH Buyback
0 ETH0.0051094725.19602918
Buyback166998892023-02-24 18:11:59788 days ago1677262319IN
PieDAO: DOUGH Buyback
0 ETH0.0060625429.8975845
Buyback166995112023-02-24 16:55:35788 days ago1677257735IN
PieDAO: DOUGH Buyback
0 ETH0.0077850541.92793869
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Buyback

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : Buyback.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.7.6;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * @title Buyback contract
 * @notice Exchange a buyback token for another token depposited in the contract
 * @author jordaniza
 */
contract Buyback is Ownable, Pausable, ReentrancyGuard  {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    /* ========== Variables ========== */

    /** @notice the token that is being bought by the DAO, must have 18 decimals */
    IERC20 public immutable tokenIn;

    /** @notice the token that the user will receive in exchange for tokenIn */
    IERC20 public immutable tokenOut;

    /** 
     * @notice decimals of the tokenIn
     * @dev this must be set to 18 for calculations to work effectively
     */
    uint8 public immutable tokenInDecimals;

    /** @notice decimals of the tokenOut */
    uint8 public immutable tokenOutDecimals;

    /**
     * @notice the current price the DAO will offer for one tokenIn token
     * @param value price expressed to 6 figures of precision.
     * @param deadline latest block.timestamp where the price will be considered valid
     */
    struct Price {
        /*
         *  Price is expressed as x * 10 ** 6
         *  Where x price of 1 buy token
         *  Example: DOUGH is 0.04 USDC
         *  value: 40_000
         */
        uint64 value;
        uint192 deadline;
    }
    Price public price;

    /** @dev divisor after multiplying by price.value */
    uint256 private constant BASE_UNIT = 10**6;

    /* ========== Constructor ========== */

    constructor(
        IERC20 _tokenIn,
        IERC20 _tokenOut,
        uint8 _tokenOutDecimals
    ) {
        require(
            address(_tokenIn) != address(0) && address(_tokenOut) != address(0),
            "Cannot set tokens to zero address"
        );
        tokenIn = _tokenIn;
        tokenOut = _tokenOut;
        tokenOutDecimals = _tokenOutDecimals;
        // we force 18 decimals here because it reduces complexity in price calcs
        tokenInDecimals = 18;
    }

    /* ========== Admin Setters ========== */

    /**
     * @notice prevents external methods being executed until `unpause` is called
     */
    function pause() external onlyOwner {
        _pause();
    }

    /**
     * @notice if the contract is paused, calling this will resume calling external methods
     */
    function unpause() external onlyOwner {
        _unpause();
    }

    /**
     * @notice sets the price for the tokenIn in terms of the tokenOut
     * @param _price 1_000_000 = 1 unit of tokenOut for 1 unit of tokenIn
     * @param _deadline the timestamp after which the price will be considered invalid
     */
    function setPrice(uint64 _price, uint192 _deadline)
        external
        onlyOwner
        whenNotPaused
    {
        require(_price > 0, "Price cannot be zero");
        require(_deadline > block.timestamp, "Invalid deadline");
        price = Price({value: _price, deadline: _deadline});
        emit PriceUpdated(_price, _deadline);
    }

    /* ========== Buyback Mutative Methods ========== */

    /**
     * @notice tops up the contract with tokenOut
     * @dev anyone can call this function
     * @param _quantity the number of tokens to deposit
     */
    function deposit(uint256 _quantity) external whenNotPaused {
        tokenOut.safeTransferFrom(msg.sender, address(this), _quantity);
        emit Deposited(tokenOut, _quantity);
    }

    /**
     * @notice exchanges tokenIn for the tokenOut at the price determined by the contract
     * @dev override to add additional access control restrictions (ie.e whitelisting)
     * @param _tokenInQty number of DOUGH to exchange
     */
    function buyback(uint256 _tokenInQty, address _receiver)
        external
        virtual
        nonReentrant
        whenNotPaused
        returns (bool)
    {
        return _buyback(_tokenInQty, _receiver);
    }

    /**
     * @notice internal method that actions the buyback
     * @dev add reentrancy modifiers to external functions calling this method
     * @dev if _tokenOut balance is too low, will buy what we can at current prices
     * @param _tokenInQty number of tokenIn to exchange
     * @param _receiver address to send tokenOut tokens to
     * @return success     
     */
    function _buyback(uint256 _tokenInQty, address _receiver)
        internal
        returns (bool)
    {
        require(price.deadline > block.timestamp, "Price has expired");

        (uint256 quoteTokenIn, uint256 quoteTokenOut) = getBuybackQuote(
            _tokenInQty
        );
        require(quoteTokenIn > 0, "Nothing to buyback");

        // tokenIn must be approved before executing the Tx
        tokenIn.safeTransferFrom(msg.sender, address(this), quoteTokenIn);
        tokenOut.safeTransfer(_receiver, quoteTokenOut);

        // log the original caller with tx.origin
        emit BuybackProcessed(_receiver, quoteTokenIn, quoteTokenOut);

        return true;
    }

    /**
     * @notice withdraw any tokens in this contract
     * @param _token address of the token to withdraw
     * @param _quantity number of the tokens to withdraw
     */
    function withdraw(IERC20 _token, uint256 _quantity)
        external
        onlyOwner
    {
        _token.safeTransfer(msg.sender, _quantity);
        emit Withdrawn(_token, _quantity);
    }

    /* ========== Getters ========== */

    /**
     * @notice computes quantity of exchangeToken that will be exchanged for a given quantity of DOUGH
     * @param _tokenInQty how many tokens to quote for
     * @return quoteTokenIn how many tokens the contract will buy (will be < tokenInQty if balance is too low)
     * @return quoteTokenOut how many tokenOut the user will receive
     */
    function getBuybackQuote(uint256 _tokenInQty)
        public
        view
        returns (uint256 quoteTokenIn, uint256 quoteTokenOut)
    {
        // check that we have enough tokens to fulfil the entire order, if not quote for what we can
        uint256 maxTokenIn = maxAvailableToBuy();
        quoteTokenIn = maxTokenIn < _tokenInQty ? maxTokenIn : _tokenInQty;
        quoteTokenOut = (quoteTokenIn.mul(price.value)  // price in tokenOut
            .div(BASE_UNIT))                              // scale by price precision 
            .div(_differenceInTokenDecimals());           // reduce decimals to tokenOut.decimals (if needed)
    }

    /**
     * @notice calculates the maximum amount of tokenIn for balance of tokenOut, given price
     * @dev rounding errors in tests have maxed out at about $15 USD
     * @dev if the token balance is >2**238 this function may cause overflow exceptions until tokens withdrawn
     */
    function maxAvailableToBuy() public view returns (uint256) {
        require(price.value > 0, "Price is not set");
        uint256 balance = tokenOut.balanceOf(address(this));
        return
            balance
            .mul(_differenceInTokenDecimals()) // scale up to 18 decimals
            .mul(BASE_UNIT)                    // add 6 decimals of precision
            .div(price.value);                 // price in tokenIn
    }

    /**
     * @notice different token decimals require adjusting so we can normalise calculations
     * @dev this will only work when tokenInDecimals >= tokenOutDecimals, so we force 18 decimals for tokenIn
     */
    function _differenceInTokenDecimals() internal view returns (uint256) {
        return uint256(10)**(tokenInDecimals - tokenOutDecimals);
    }

    /* ========== Events ========== */

    /** @notice emitted when the Price changes */
    event PriceUpdated(uint64 price, uint192 deadline);

    /** @notice emitted when a buyback is actioned */
    event BuybackProcessed(
        address indexed seller,
        uint256 tokenInBought,
        uint256 tokenOutSold
    );

    /** @notice emitted when tokens are withdrawn from the contract by the owner */
    event Withdrawn(IERC20 indexed token, uint256 quantity);

    /** @notice emitted whenever someone uses the deposit helper function to increase the token balance */
    event Deposited(IERC20 indexed token, uint256 quantity);
}

File 2 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), 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 {
        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;
    }
}

File 3 of 9 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 4 of 9 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 5 of 9 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
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) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        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) {
        // 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) {
        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) {
        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) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @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) {
        require(b <= a, "SafeMath: subtraction overflow");
        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) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @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. 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) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        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) {
        require(b > 0, "SafeMath: modulo by zero");
        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) {
        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.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * 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) {
        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) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 6 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 7 of 9 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 8 of 9 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 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;
    }
}

File 9 of 9 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IERC20","name":"_tokenIn","type":"address"},{"internalType":"contract IERC20","name":"_tokenOut","type":"address"},{"internalType":"uint8","name":"_tokenOutDecimals","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenInBought","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenOutSold","type":"uint256"}],"name":"BuybackProcessed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"Deposited","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"price","type":"uint64"},{"indexed":false,"internalType":"uint192","name":"deadline","type":"uint192"}],"name":"PriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"uint256","name":"_tokenInQty","type":"uint256"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"buyback","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenInQty","type":"uint256"}],"name":"getBuybackQuote","outputs":[{"internalType":"uint256","name":"quoteTokenIn","type":"uint256"},{"internalType":"uint256","name":"quoteTokenOut","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxAvailableToBuy","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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price","outputs":[{"internalType":"uint64","name":"value","type":"uint64"},{"internalType":"uint192","name":"deadline","type":"uint192"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"_price","type":"uint64"},{"internalType":"uint192","name":"_deadline","type":"uint192"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenIn","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenInDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenOut","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenOutDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_quantity","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101006040523480156200001257600080fd5b50604051620021c1380380620021c1833981810160405260608110156200003857600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505060006200006f6200028a60201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35060008060146101000a81548160ff02191690831515021790555060018081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015620001995750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b620001f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180620021a06021913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1660601b815250508060ff1660e08160ff1660f81b81525050601260ff1660c08160ff1660f81b8152505050505062000292565b600033905090565b60805160601c60a05160601c60c05160f81c60e05160f81c611ea9620002f7600039806108ff5280611378525080610aca5280611399525080610c9b5280610ce25280610d535280610f2a528061190652508061093952806118ba5250611ea96000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c80638456cb59116100a2578063d0202d3b11610071578063d0202d3b14610314578063d1ffa52914610348578063ec2538bb146103ac578063f2fde38b146103ca578063f3fef3a31461040e5761010b565b80638456cb591461025f5780638da5cb5b14610269578063a035b1fe1461029d578063b6b55f25146102e65761010b565b80635c975abb116100de5780635c975abb146101e05780636daf390b14610200578063715018a61461023457806371c12d6b1461023e5761010b565b8063258d29c1146101105780632988633f146101595780633f4ba83a146101b5578063440291ca146101bf575b600080fd5b61013c6004803603602081101561012657600080fd5b810190808035906020019092919050505061045c565b604051808381526020018281526020019250505060405180910390f35b6101b36004803603604081101561016f57600080fd5b81019080803567ffffffffffffffff169060200190929190803577ffffffffffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104e8565b005b6101bd610844565b005b6101c76108fd565b604051808260ff16815260200191505060405180910390f35b6101e8610921565b60405180821515815260200191505060405180910390f35b610208610937565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61023c61095b565b005b610246610ac8565b604051808260ff16815260200191505060405180910390f35b610267610aec565b005b610271610ba5565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102a5610bce565b604051808367ffffffffffffffff1681526020018277ffffffffffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b610312600480360360208110156102fc57600080fd5b8101908080359060200190929190505050610c18565b005b61031c610d51565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103946004803603604081101561035e57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d75565b60405180821515815260200191505060405180910390f35b6103b4610e8c565b6040518082815260200191505060405180910390f35b61040c600480360360208110156103e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611056565b005b61045a6004803603604081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611248565b005b6000806000610469610e8c565b9050838110610478578361047a565b805b92506104e0610487611374565b6104d2620f42406104c4600260000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16886113c490919063ffffffff16565b61144a90919063ffffffff16565b61144a90919063ffffffff16565b915050915091565b6104f06114d3565b73ffffffffffffffffffffffffffffffffffffffff1661050e610ba5565b73ffffffffffffffffffffffffffffffffffffffff1614610597576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61059f610921565b15610612576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60008267ffffffffffffffff1611610692576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f50726963652063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b428177ffffffffffffffffffffffffffffffffffffffffffffffff1611610721576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f496e76616c696420646561646c696e650000000000000000000000000000000081525060200191505060405180910390fd5b60405180604001604052808367ffffffffffffffff1681526020018277ffffffffffffffffffffffffffffffffffffffffffffffff16815250600260008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548177ffffffffffffffffffffffffffffffffffffffffffffffff021916908377ffffffffffffffffffffffffffffffffffffffffffffffff1602179055509050507fa38f29fd27436ed852e8ca25eee145cac64affe3f7c6bc6c09b85bf02f28cb898282604051808367ffffffffffffffff1681526020018277ffffffffffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b61084c6114d3565b73ffffffffffffffffffffffffffffffffffffffff1661086a610ba5565b73ffffffffffffffffffffffffffffffffffffffff16146108f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6108fb6114db565b565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008060149054906101000a900460ff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6109636114d3565b73ffffffffffffffffffffffffffffffffffffffff16610981610ba5565b73ffffffffffffffffffffffffffffffffffffffff1614610a0a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b7f000000000000000000000000000000000000000000000000000000000000000081565b610af46114d3565b73ffffffffffffffffffffffffffffffffffffffff16610b12610ba5565b73ffffffffffffffffffffffffffffffffffffffff1614610b9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610ba36115c5565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60028060000160009054906101000a900467ffffffffffffffff16908060000160089054906101000a900477ffffffffffffffffffffffffffffffffffffffffffffffff16905082565b610c20610921565b15610c93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610ce03330837f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166116b1909392919063ffffffff16565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4826040518082815260200191505060405180910390a250565b7f000000000000000000000000000000000000000000000000000000000000000081565b600060026001541415610df0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002600181905550610e00610921565b15610e73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610e7d8383611772565b90506001808190555092915050565b600080600260000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1611610f26576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5072696365206973206e6f74207365740000000000000000000000000000000081525060200191505060405180910390fd5b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610faf57600080fd5b505afa158015610fc3573d6000803e3d6000fd5b505050506040513d6020811015610fd957600080fd5b81019080805190602001909291905050509050611050600260000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16611042620f4240611034611025611374565b866113c490919063ffffffff16565b6113c490919063ffffffff16565b61144a90919063ffffffff16565b91505090565b61105e6114d3565b73ffffffffffffffffffffffffffffffffffffffff1661107c610ba5565b73ffffffffffffffffffffffffffffffffffffffff1614611105576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561118b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611ddd6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6112506114d3565b73ffffffffffffffffffffffffffffffffffffffff1661126e610ba5565b73ffffffffffffffffffffffffffffffffffffffff16146112f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61132233828473ffffffffffffffffffffffffffffffffffffffff166119ac9092919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a25050565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000000360ff16600a0a905090565b6000808314156113d75760009050611444565b60008284029050828482816113e857fe5b041461143f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611e296021913960400191505060405180910390fd5b809150505b92915050565b60008082116114c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b8183816114ca57fe5b04905092915050565b600033905090565b6114e3610921565b611555576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6115986114d3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6115cd610921565b15611640576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116846114d3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b61176c846323b872dd60e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611a4e565b50505050565b600042600260000160089054906101000a900477ffffffffffffffffffffffffffffffffffffffffffffffff1677ffffffffffffffffffffffffffffffffffffffffffffffff161161182c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f507269636520686173206578706972656400000000000000000000000000000081525060200191505060405180910390fd5b6000806118388561045c565b91509150600082116118b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e6f7468696e6720746f206275796261636b000000000000000000000000000081525060200191505060405180910390fd5b6118ff3330847f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166116b1909392919063ffffffff16565b61194a84827f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166119ac9092919063ffffffff16565b8373ffffffffffffffffffffffffffffffffffffffff167f840f6b22bacac5a7ec150e55e4101f796377c95c8b315bbfd6c943958d5a83f88383604051808381526020018281526020019250505060405180910390a260019250505092915050565b611a498363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611a4e565b505050565b6000611ab0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611b3d9092919063ffffffff16565b9050600081511115611b3857808060200190516020811015611ad157600080fd5b8101908080519060200190929190505050611b37576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611e4a602a913960400191505060405180910390fd5b5b505050565b6060611b4c8484600085611b55565b90509392505050565b606082471015611bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611e036026913960400191505060405180910390fd5b611bb985611cfd565b611c2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b60208310611c7a5780518252602082019150602081019050602083039250611c57565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611cdc576040519150601f19603f3d011682016040523d82523d6000602084013e611ce1565b606091505b5091509150611cf1828286611d10565b92505050949350505050565b600080823b905060008111915050919050565b60608315611d2057829050611dd5565b600083511115611d335782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d9a578082015181840152602081019050611d7f565b50505050905090810190601f168015611dc75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220b224594d7480b79d8ecc554dad96d4ab56ab7ddb60a0e5cca9dcd8180c2f5ee364736f6c6343000706003343616e6e6f742073657420746f6b656e7320746f207a65726f2061646472657373000000000000000000000000ad32a8e6220741182940c5abf610bde99e737b2d000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000006

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80638456cb59116100a2578063d0202d3b11610071578063d0202d3b14610314578063d1ffa52914610348578063ec2538bb146103ac578063f2fde38b146103ca578063f3fef3a31461040e5761010b565b80638456cb591461025f5780638da5cb5b14610269578063a035b1fe1461029d578063b6b55f25146102e65761010b565b80635c975abb116100de5780635c975abb146101e05780636daf390b14610200578063715018a61461023457806371c12d6b1461023e5761010b565b8063258d29c1146101105780632988633f146101595780633f4ba83a146101b5578063440291ca146101bf575b600080fd5b61013c6004803603602081101561012657600080fd5b810190808035906020019092919050505061045c565b604051808381526020018281526020019250505060405180910390f35b6101b36004803603604081101561016f57600080fd5b81019080803567ffffffffffffffff169060200190929190803577ffffffffffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104e8565b005b6101bd610844565b005b6101c76108fd565b604051808260ff16815260200191505060405180910390f35b6101e8610921565b60405180821515815260200191505060405180910390f35b610208610937565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61023c61095b565b005b610246610ac8565b604051808260ff16815260200191505060405180910390f35b610267610aec565b005b610271610ba5565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102a5610bce565b604051808367ffffffffffffffff1681526020018277ffffffffffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b610312600480360360208110156102fc57600080fd5b8101908080359060200190929190505050610c18565b005b61031c610d51565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103946004803603604081101561035e57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d75565b60405180821515815260200191505060405180910390f35b6103b4610e8c565b6040518082815260200191505060405180910390f35b61040c600480360360208110156103e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611056565b005b61045a6004803603604081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611248565b005b6000806000610469610e8c565b9050838110610478578361047a565b805b92506104e0610487611374565b6104d2620f42406104c4600260000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16886113c490919063ffffffff16565b61144a90919063ffffffff16565b61144a90919063ffffffff16565b915050915091565b6104f06114d3565b73ffffffffffffffffffffffffffffffffffffffff1661050e610ba5565b73ffffffffffffffffffffffffffffffffffffffff1614610597576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61059f610921565b15610612576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60008267ffffffffffffffff1611610692576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f50726963652063616e6e6f74206265207a65726f00000000000000000000000081525060200191505060405180910390fd5b428177ffffffffffffffffffffffffffffffffffffffffffffffff1611610721576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f496e76616c696420646561646c696e650000000000000000000000000000000081525060200191505060405180910390fd5b60405180604001604052808367ffffffffffffffff1681526020018277ffffffffffffffffffffffffffffffffffffffffffffffff16815250600260008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548177ffffffffffffffffffffffffffffffffffffffffffffffff021916908377ffffffffffffffffffffffffffffffffffffffffffffffff1602179055509050507fa38f29fd27436ed852e8ca25eee145cac64affe3f7c6bc6c09b85bf02f28cb898282604051808367ffffffffffffffff1681526020018277ffffffffffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b61084c6114d3565b73ffffffffffffffffffffffffffffffffffffffff1661086a610ba5565b73ffffffffffffffffffffffffffffffffffffffff16146108f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6108fb6114db565b565b7f000000000000000000000000000000000000000000000000000000000000000681565b60008060149054906101000a900460ff16905090565b7f000000000000000000000000ad32a8e6220741182940c5abf610bde99e737b2d81565b6109636114d3565b73ffffffffffffffffffffffffffffffffffffffff16610981610ba5565b73ffffffffffffffffffffffffffffffffffffffff1614610a0a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b7f000000000000000000000000000000000000000000000000000000000000001281565b610af46114d3565b73ffffffffffffffffffffffffffffffffffffffff16610b12610ba5565b73ffffffffffffffffffffffffffffffffffffffff1614610b9b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610ba36115c5565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60028060000160009054906101000a900467ffffffffffffffff16908060000160089054906101000a900477ffffffffffffffffffffffffffffffffffffffffffffffff16905082565b610c20610921565b15610c93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610ce03330837f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff166116b1909392919063ffffffff16565b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4826040518082815260200191505060405180910390a250565b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b600060026001541415610df0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002600181905550610e00610921565b15610e73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610e7d8383611772565b90506001808190555092915050565b600080600260000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1611610f26576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5072696365206973206e6f74207365740000000000000000000000000000000081525060200191505060405180910390fd5b60007f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610faf57600080fd5b505afa158015610fc3573d6000803e3d6000fd5b505050506040513d6020811015610fd957600080fd5b81019080805190602001909291905050509050611050600260000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16611042620f4240611034611025611374565b866113c490919063ffffffff16565b6113c490919063ffffffff16565b61144a90919063ffffffff16565b91505090565b61105e6114d3565b73ffffffffffffffffffffffffffffffffffffffff1661107c610ba5565b73ffffffffffffffffffffffffffffffffffffffff1614611105576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561118b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611ddd6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6112506114d3565b73ffffffffffffffffffffffffffffffffffffffff1661126e610ba5565b73ffffffffffffffffffffffffffffffffffffffff16146112f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61132233828473ffffffffffffffffffffffffffffffffffffffff166119ac9092919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a25050565b60007f00000000000000000000000000000000000000000000000000000000000000067f00000000000000000000000000000000000000000000000000000000000000120360ff16600a0a905090565b6000808314156113d75760009050611444565b60008284029050828482816113e857fe5b041461143f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611e296021913960400191505060405180910390fd5b809150505b92915050565b60008082116114c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b8183816114ca57fe5b04905092915050565b600033905090565b6114e3610921565b611555576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b60008060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6115986114d3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6115cd610921565b15611640576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116846114d3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b61176c846323b872dd60e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611a4e565b50505050565b600042600260000160089054906101000a900477ffffffffffffffffffffffffffffffffffffffffffffffff1677ffffffffffffffffffffffffffffffffffffffffffffffff161161182c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f507269636520686173206578706972656400000000000000000000000000000081525060200191505060405180910390fd5b6000806118388561045c565b91509150600082116118b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e6f7468696e6720746f206275796261636b000000000000000000000000000081525060200191505060405180910390fd5b6118ff3330847f000000000000000000000000ad32a8e6220741182940c5abf610bde99e737b2d73ffffffffffffffffffffffffffffffffffffffff166116b1909392919063ffffffff16565b61194a84827f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff166119ac9092919063ffffffff16565b8373ffffffffffffffffffffffffffffffffffffffff167f840f6b22bacac5a7ec150e55e4101f796377c95c8b315bbfd6c943958d5a83f88383604051808381526020018281526020019250505060405180910390a260019250505092915050565b611a498363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611a4e565b505050565b6000611ab0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611b3d9092919063ffffffff16565b9050600081511115611b3857808060200190516020811015611ad157600080fd5b8101908080519060200190929190505050611b37576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611e4a602a913960400191505060405180910390fd5b5b505050565b6060611b4c8484600085611b55565b90509392505050565b606082471015611bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611e036026913960400191505060405180910390fd5b611bb985611cfd565b611c2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b60208310611c7a5780518252602082019150602081019050602083039250611c57565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611cdc576040519150601f19603f3d011682016040523d82523d6000602084013e611ce1565b606091505b5091509150611cf1828286611d10565b92505050949350505050565b600080823b905060008111915050919050565b60608315611d2057829050611dd5565b600083511115611d335782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d9a578082015181840152602081019050611d7f565b50505050905090810190601f168015611dc75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220b224594d7480b79d8ecc554dad96d4ab56ab7ddb60a0e5cca9dcd8180c2f5ee364736f6c63430007060033

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

000000000000000000000000ad32a8e6220741182940c5abf610bde99e737b2d000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000000000006

-----Decoded View---------------
Arg [0] : _tokenIn (address): 0xad32A8e6220741182940c5aBF610bDE99E737b2D
Arg [1] : _tokenOut (address): 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arg [2] : _tokenOutDecimals (uint8): 6

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000ad32a8e6220741182940c5abf610bde99e737b2d
Arg [1] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000006


Block Transaction Difficulty 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
Loading...
Loading
[ 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.