ETH Price: $2,821.93 (-4.34%)
 

Overview

ETH Balance

Scroll LogoScroll LogoScroll Logo0 ETH

ETH Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Get Reward113636962024-11-24 12:56:08427 days ago1732452968IN
0xcee66179...9F4D9036D
0 ETH0.000013370.061812
Get Reward109948832024-11-11 4:16:11440 days ago1731298571IN
0xcee66179...9F4D9036D
0 ETH0.000011860.07
Withdraw109948542024-11-11 4:14:44440 days ago1731298484IN
0xcee66179...9F4D9036D
0 ETH0.000015380.07
Get Reward109502322024-11-09 14:46:13442 days ago1731163573IN
0xcee66179...9F4D9036D
0 ETH0.000010630.04893697
Get Reward109333122024-11-09 0:32:12442 days ago1731112332IN
0xcee66179...9F4D9036D
0 ETH0.000008330.07
Withdraw109332572024-11-09 0:29:22442 days ago1731112162IN
0xcee66179...9F4D9036D
0 ETH0.000011940.06
Withdraw109129642024-11-08 7:25:47443 days ago1731050747IN
0xcee66179...9F4D9036D
0 ETH0.000010140.06
Get Reward109011342024-11-07 21:14:10443 days ago1731014050IN
0xcee66179...9F4D9036D
0 ETH0.000016350.08
Withdraw109011272024-11-07 21:13:49443 days ago1731014029IN
0xcee66179...9F4D9036D
0 ETH0.000021430.08
Get Reward108940382024-11-07 15:17:19444 days ago1730992639IN
0xcee66179...9F4D9036D
0 ETH0.000012510.06
Withdraw108929852024-11-07 14:24:56444 days ago1730989496IN
0xcee66179...9F4D9036D
0 ETH0.000014160.07
Withdraw108929562024-11-07 14:23:29444 days ago1730989409IN
0xcee66179...9F4D9036D
0 ETH0.000015310.08
Get Reward108924892024-11-07 14:00:04444 days ago1730988004IN
0xcee66179...9F4D9036D
0 ETH0.000012190.07
Withdraw108917342024-11-07 13:22:17444 days ago1730985737IN
0xcee66179...9F4D9036D
0 ETH0.000013160.05
Deposit108898392024-11-07 11:47:33444 days ago1730980053IN
0xcee66179...9F4D9036D
0 ETH0.00001220.05
Deposit108880282024-11-07 10:16:46444 days ago1730974606IN
0xcee66179...9F4D9036D
0 ETH0.000014350.07
Deposit108878452024-11-07 10:07:36444 days ago1730974056IN
0xcee66179...9F4D9036D
0 ETH0.000017650.07
Get Reward108830822024-11-07 6:09:25444 days ago1730959765IN
0xcee66179...9F4D9036D
0 ETH0.000012760.1
Get Reward108689242024-11-06 18:12:30445 days ago1730916750IN
0xcee66179...9F4D9036D
0 ETH0.000011980.04883195
Withdraw108689152024-11-06 18:12:03445 days ago1730916723IN
0xcee66179...9F4D9036D
0 ETH0.000015230.05794623
Get Reward108636162024-11-06 13:47:09445 days ago1730900829IN
0xcee66179...9F4D9036D
0 ETH0.000013910.07
Get Reward108635862024-11-06 13:45:38445 days ago1730900738IN
0xcee66179...9F4D9036D
0 ETH0.00001530.08
Deposit108620722024-11-06 12:30:05445 days ago1730896205IN
0xcee66179...9F4D9036D
0 ETH0.000019580.08
Get Reward108472832024-11-06 0:13:21445 days ago1730852001IN
0xcee66179...9F4D9036D
0 ETH0.000010930.09
Get Reward108450492024-11-05 22:14:57445 days ago1730844897IN
0xcee66179...9F4D9036D
0 ETH0.000007090.05
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
75339132024-07-17 20:15:59556 days ago1721247359  Contract Creation0 ETH
Cross-Chain Transactions
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x0306B9A1...9DE24E5F6
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
Gauge

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 200 runs

Other Settings:
shanghai EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

import "./interfaces/IBribe.sol";
import "./interfaces/IPair.sol";
import "./interfaces/IRewarder.sol";
import "./Epoch.sol";

contract Gauge is ReentrancyGuard, Ownable {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    bool public isForPair;

    IERC20 public rewardToken;
    IERC20 public _VE;
    IERC20 public TOKEN;

    address public DISTRIBUTION;
    address public gaugeRewarder;
    address public internal_bribe;
    address public external_bribe;

    uint256 public rewarderPid;
    uint256 public periodFinish;
    uint256 public rewardRate;
    uint256 public lastUpdateTime;
    uint256 public rewardPerTokenStored;

    uint256 public fees0;
    uint256 public fees1;

    mapping(address => uint256) public userRewardPerTokenPaid;
    mapping(address => uint256) public rewards;

    uint256 public _totalSupply;
    mapping(address => uint256) public _balances;

    event RewardAdded(uint256 reward);
    event Deposit(address indexed user, uint256 amount);
    event Withdraw(address indexed user, uint256 amount);
    event Harvest(address indexed user, uint256 reward);
    event ClaimFees(address indexed from, uint256 claimed0, uint256 claimed1);

    modifier updateReward(address account) {
        rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();
        if (account != address(0)) {
            rewards[account] = earned(account);
            userRewardPerTokenPaid[account] = rewardPerTokenStored;
        }
        _;
    }

    modifier onlyDistribution() {
        require(msg.sender == DISTRIBUTION, "Caller is not RewardsDistribution contract");
        _;
    }

    constructor(
        address _rewardToken,
        address _ve,
        address _token,
        address _distribution,
        address _internal_bribe,
        address _external_bribe,
        bool _isForPair
    ) {
        rewardToken = IERC20(_rewardToken); // main reward
        _VE = IERC20(_ve); // vested
        TOKEN = IERC20(_token); // underlying (LP)
        DISTRIBUTION = _distribution; // distro address (voter)

        internal_bribe = _internal_bribe; // lp fees goes here
        external_bribe = _external_bribe; // bribe fees goes here

        isForPair = _isForPair; // pair boolean, if false no claim_fees
    }

    ///@notice set distribution address (should be GaugeProxyL2)
    function setDistribution(address _distribution) external onlyOwner {
        require(_distribution != address(0), "zero addr");
        require(_distribution != DISTRIBUTION, "same addr");
        DISTRIBUTION = _distribution;
    }

    ///@notice set gauge rewarder address
    function setGaugeRewarder(address _gaugeRewarder) external onlyOwner {
        require(_gaugeRewarder != address(0), "zero addr");
        require(_gaugeRewarder != gaugeRewarder, "same addr");
        gaugeRewarder = _gaugeRewarder;
    }

    ///@notice set extra rewarder pid
    function setRewarderPid(uint256 _pid) external onlyOwner {
        require(_pid >= 0, "zero");
        require(_pid != rewarderPid, "same pid");
        rewarderPid = _pid;
    }

    ///@notice total supply held
    function totalSupply() public view returns (uint256) {
        return _totalSupply;
    }

    ///@notice balance of a user
    function balanceOf(address account) external view returns (uint256) {
        return _balances[account];
    }

    ///@notice last time reward
    function lastTimeRewardApplicable() public view returns (uint256) {
        return Math.min(block.timestamp, periodFinish);
    }

    ///@notice reward for a single token
    function rewardPerToken() public view returns (uint256) {
        if (_totalSupply == 0) {
            return rewardPerTokenStored;
        } else {
            return rewardPerTokenStored.add(lastTimeRewardApplicable().sub(lastUpdateTime).mul(rewardRate).mul(1e18).div(_totalSupply));
        }
    }

    ///@notice see earned rewards for user
    function earned(address account) public view returns (uint256) {
        return _balances[account].mul(rewardPerToken().sub(userRewardPerTokenPaid[account])).div(1e18).add(rewards[account]);
    }

    ///@notice get total reward for the duration
    function rewardForDuration() external view returns (uint256) {
        return rewardRate.mul(EPOCH_DURATION);
    }

    ///@notice deposit all TOKEN of msg.sender
    function depositAll() external {
        _deposit(TOKEN.balanceOf(msg.sender), msg.sender);
    }

    ///@notice deposit amount TOKEN
    function deposit(uint256 amount) external {
        _deposit(amount, msg.sender);
    }

    ///@notice deposit internal
    function _deposit(uint256 amount, address account) internal nonReentrant updateReward(account) {
        require(amount > 0, "deposit(Gauge): cannot stake 0");

        _balances[account] = _balances[account].add(amount);
        _totalSupply = _totalSupply.add(amount);

        TOKEN.safeTransferFrom(account, address(this), amount);

        if (address(gaugeRewarder) != address(0)) {
            IRewarder(gaugeRewarder).onReward(rewarderPid, account, account, 0, _balances[account]);
        }

        emit Deposit(account, amount);
    }

    ///@notice withdraw all token
    function withdrawAll() external {
        _withdraw(_balances[msg.sender]);
    }

    ///@notice withdraw a certain amount of TOKEN
    function withdraw(uint256 amount) external {
        _withdraw(amount);
    }

    ///@notice withdraw internal
    function _withdraw(uint256 amount) internal nonReentrant updateReward(msg.sender) {
        require(amount > 0, "Cannot withdraw 0");
        require(_totalSupply.sub(amount) >= 0, "supply < 0");
        require(_balances[msg.sender] > 0, "no balances");

        _totalSupply = _totalSupply.sub(amount);
        _balances[msg.sender] = _balances[msg.sender].sub(amount);

        if (address(gaugeRewarder) != address(0)) {
            IRewarder(gaugeRewarder).onReward(rewarderPid, msg.sender, msg.sender, 0, _balances[msg.sender]);
        }

        TOKEN.safeTransfer(msg.sender, amount);

        emit Withdraw(msg.sender, amount);
    }

    ///@notice withdraw all TOKEN and harvest rewardToken
    function withdrawAllAndHarvest() external {
        _withdraw(_balances[msg.sender]);
        getReward();
    }

    ///@notice User harvest function
    function getReward() public nonReentrant updateReward(msg.sender) {
        uint256 reward = rewards[msg.sender];
        if (reward > 0) {
            rewards[msg.sender] = 0;
            rewardToken.safeTransfer(msg.sender, reward);
            emit Harvest(msg.sender, reward);
        }

        if (gaugeRewarder != address(0)) {
            IRewarder(gaugeRewarder).onReward(rewarderPid, msg.sender, msg.sender, reward, _balances[msg.sender]);
        }
    }

    function _periodFinish() external view returns (uint256) {
        return periodFinish;
    }

    /// @dev Receive rewards from distribution
    function notifyRewardAmount(address token, uint256 reward) external nonReentrant onlyDistribution updateReward(address(0)) {
        require(token == address(rewardToken));
        rewardToken.safeTransferFrom(DISTRIBUTION, address(this), reward);

        if (block.timestamp >= periodFinish) {
            rewardRate = reward.div(EPOCH_DURATION);
        } else {
            uint256 remaining = periodFinish.sub(block.timestamp);
            uint256 leftover = remaining.mul(rewardRate);
            rewardRate = reward.add(leftover).div(EPOCH_DURATION);
        }

        // Ensure the provided reward amount is not more than the balance in the contract.
        // This keeps the reward rate in the right range, preventing overflows due to
        // very high values of rewardRate in the earned and rewardsPerToken functions;
        // Reward + leftover must be less than 2^256 / 10^18 to avoid overflow.
        uint256 balance = rewardToken.balanceOf(address(this));
        require(rewardRate <= balance.div(EPOCH_DURATION), "Provided reward too high");

        lastUpdateTime = block.timestamp;
        periodFinish = block.timestamp.add(EPOCH_DURATION);
        emit RewardAdded(reward);
    }

    function claimFees() external nonReentrant returns (uint256 claimed0, uint256 claimed1) {
        return _claimFees();
    }

    function _claimFees() internal returns (uint256 claimed0, uint256 claimed1) {
        if (!isForPair) {
            return (0, 0);
        }
        address _token = address(TOKEN);

        (claimed0, claimed1) = IPair(_token).claimFees();

        if (claimed0 != 0 || claimed1 != 0) {
            uint256 _fees0 = fees0 + claimed0;
            uint256 _fees1 = fees1 + claimed1;
            (address _token0, address _token1) = IPair(_token).tokens();

            if (_fees0 != 0) {
                fees0 = 0;
                IERC20(_token0).approve(internal_bribe, _fees0);
                IBribe(internal_bribe).notifyRewardAmount(_token0, _fees0);
            } else {
                fees0 = _fees0;
            }

            if (_fees1 != 0) {
                fees1 = 0;
                IERC20(_token1).approve(internal_bribe, _fees1);
                IBribe(internal_bribe).notifyRewardAmount(_token1, _fees1);
            } else {
                fees1 = _fees1;
            }

            emit ClaimFees(msg.sender, claimed0, claimed1);
        }
    }
}

// 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);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^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() {
        _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 making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.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 Address for address;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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'
        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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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");

        (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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// 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;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

// 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 11 of 14 : Epoch.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

uint256 constant EPOCH_DURATION = 7 days;

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IBribe {
    struct Reward {
        uint256 periodFinish;
        uint256 rewardsPerEpoch;
        uint256 lastUpdateTime;
    }

    function _deposit(uint256 amount, uint256 tokenId) external;

    function _withdraw(uint256 amount, uint256 tokenId) external;

    function addReward(address) external;

    function balanceOfAt(uint256 tokenId, uint256 _timestamp) external view returns (uint256);

    function earned(uint256 tokenId, address _rewardToken) external view returns (uint256);

    function emergencyRecoverERC20(address tokenAddress, uint256 tokenAmount) external;

    function firstBribeTimestamp() external view returns (uint256);

    function getEpochStart() external view returns (uint256);

    function getNextEpochStart() external view returns (uint256);

    function getRewardForOwner(uint256 tokenId, address[] memory tokens) external;

    function notifyRewardAmount(address token, uint256 amount) external;

    function recoverERC20AndUpdateData(address tokenAddress, uint256 tokenAmount) external;

    function rewardData(address _token, uint256 _timestamp) external view returns (Reward memory);

    function rewardTokens(uint256 _index) external view returns (address);

    function rewardsListLength() external view returns (uint256);

    function setMinter(address _minter) external;

    function setOwner(address _owner) external;

    function setVoter(address _voter) external;

    function totalSupplyAt(uint256 _timestamp) external view returns (uint256);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IPair {

    function metadata() external view returns (uint256 dec0, uint256 dec1, uint256 r0, uint256 r1, bool st, address t0, address t1);

    function claimFees() external returns (uint256, uint256);

    function tokens() external view returns (address, address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function transferFrom(address src, address dst, uint256 amount) external returns (bool);

    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;

    function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external;

    function burn(address to) external returns (uint256 amount0, uint256 amount1);

    function mint(address to) external returns (uint256 liquidity);

    function getReserves() external view returns (uint256 _reserve0, uint256 _reserve1, uint256 _blockTimestampLast);

    function getAmountOut(uint256, address) external view returns (uint256);

    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function totalSupply() external view returns (uint256);

    function decimals() external view returns (uint8);

    function claimable0(address _user) external view returns (uint256);

    function claimable1(address _user) external view returns (uint256);

    function stable() external view returns (bool);

    function pairFee() external view returns (uint256);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IRewarder {
    function onReward(uint256 pid, address user, address recipient, uint256 amount, uint256 newLpAmount) external;
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"address","name":"_ve","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_distribution","type":"address"},{"internalType":"address","name":"_internal_bribe","type":"address"},{"internalType":"address","name":"_external_bribe","type":"address"},{"internalType":"bool","name":"_isForPair","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimed0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimed1","type":"uint256"}],"name":"ClaimFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"Harvest","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":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DISTRIBUTION","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_VE","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_balances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimFees","outputs":[{"internalType":"uint256","name":"claimed0","type":"uint256"},{"internalType":"uint256","name":"claimed1","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"external_bribe","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fees0","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fees1","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gaugeRewarder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"internal_bribe","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isForPair","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardForDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewarderPid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_distribution","type":"address"}],"name":"setDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_gaugeRewarder","type":"address"}],"name":"setGaugeRewarder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"setRewarderPid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAllAndHarvest","outputs":[],"stateMutability":"nonpayable","type":"function"}]

0x608060405234801562000010575f80fd5b5060405162001cf038038062001cf083398101604081905262000033916200013f565b60015f556200004233620000d2565b600280546001600160a01b03199081166001600160a01b03998a16179091556003805482169789169790971790965560048054871695881695909517909455600580548616938716939093179092556007805485169186169190911790556008805490931693169290921790556001805460ff60a01b1916600160a01b92151592909202919091179055620001d6565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b80516001600160a01b03811681146200013a575f80fd5b919050565b5f805f805f805f60e0888a03121562000156575f80fd5b620001618862000123565b9650620001716020890162000123565b9550620001816040890162000123565b9450620001916060890162000123565b9350620001a16080890162000123565b9250620001b160a0890162000123565b915060c08801518015158114620001c6575f80fd5b8091505092959891949750929550565b611b0c80620001e45f395ff3fe608060405234801561000f575f80fd5b506004361061023e575f3560e01c806382bfefc811610135578063c8f33c91116100b4578063e574821311610079578063e574821314610495578063ebe2b12b146104b9578063f2fde38b146104c2578063f7c618c1146104d5578063f97d2114146104e8575f80fd5b8063c8f33c9114610456578063cd3daf9d1461045f578063d294f09314610467578063de5f626814610484578063df136d651461048c575f80fd5b80638f67b013116100fa5780638f67b0131461040b57806393f1c442146104145780639f6d7d5b1461041d578063b66503cf14610430578063b6b55f2514610443575f80fd5b806382bfefc8146103ad578063853828b6146103c0578063863e2442146103c85780638b876347146103db5780638da5cb5b146103fa575f80fd5b80636e9852f2116101c1578063770f857111610186578063770f8571146103635780637b0a47ee146103765780637c91e4eb1461037f5780637f6990151461039257806380faa57d146103a5575f80fd5b80636e9852f2146102f95780636ebcf6071461030157806370a082311461032057806370b15e6d14610348578063715018a61461035b575f80fd5b80632e1a7d4d116102075780632e1a7d4d146102c25780633d18b912146102d75780633eaaf86b146102df5780634c02a21c146102e85780636946a235146102f1575f80fd5b80628cc2621461024257806303fbf83a146102685780630700037d146102935780631407c664146102b257806318160ddd146102ba575b5f80fd5b6102556102503660046118dc565b6104fb565b6040519081526020015b60405180910390f35b60085461027b906001600160a01b031681565b6040516001600160a01b03909116815260200161025f565b6102556102a13660046118dc565b60116020525f908152604090205481565b600a54610255565b601254610255565b6102d56102d03660046118f7565b610577565b005b6102d5610583565b61025560125481565b610255600f5481565b6102556106ed565b6102d5610704565b61025561030f3660046118dc565b60136020525f908152604090205481565b61025561032e3660046118dc565b6001600160a01b03165f9081526013602052604090205490565b6102d56103563660046118f7565b610724565b6102d561077b565b60075461027b906001600160a01b031681565b610255600b5481565b60055461027b906001600160a01b031681565b6102d56103a03660046118dc565b61078c565b610255610842565b60045461027b906001600160a01b031681565b6102d561084f565b60065461027b906001600160a01b031681565b6102556103e93660046118dc565b60106020525f908152604090205481565b6001546001600160a01b031661027b565b61025560095481565b610255600e5481565b60035461027b906001600160a01b031681565b6102d561043e36600461190e565b610867565b6102d56104513660046118f7565b610aed565b610255600c5481565b610255610af7565b61046f610b40565b6040805192835260208301919091520161025f565b6102d5610b63565b610255600d5481565b6001546104a990600160a01b900460ff1681565b604051901515815260200161025f565b610255600a5481565b6102d56104d03660046118dc565b610bda565b60025461027b906001600160a01b031681565b6102d56104f63660046118dc565b610c50565b6001600160a01b0381165f908152601160209081526040808320546010909252822054610571919061056b90670de0b6b3a7640000906105659061054790610541610af7565b90610d06565b6001600160a01b0388165f9081526013602052604090205490610d18565b90610d23565b90610d2e565b92915050565b61058081610d39565b50565b61058b610f84565b33610594610af7565b600d5561059f610842565b600c556001600160a01b038116156105e5576105ba816104fb565b6001600160a01b0382165f90815260116020908152604080832093909355600d546010909152919020555b335f90815260116020526040902054801561065857335f81815260116020526040812055600254610622916001600160a01b039091169083610fdb565b60405181815233907fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba9060200160405180910390a25b6006546001600160a01b0316156106e057600654600954335f81815260136020526040908190205490516344af0fa760e01b81526001600160a01b03909416936344af0fa7936106b2939092909182918891600401611938565b5f604051808303815f87803b1580156106c9575f80fd5b505af11580156106db573d5f803e3d5ffd5b505050505b50506106eb60015f55565b565b600b545f906106ff9062093a80610d18565b905090565b335f9081526013602052604090205461071c90610d39565b6106eb610583565b61072c611043565b61073a565b60405180910390fd5b60095481036107765760405162461bcd60e51b81526020600482015260086024820152671cd85b59481c1a5960c21b6044820152606401610731565b600955565b610783611043565b6106eb5f61109d565b610794611043565b6001600160a01b0381166107d65760405162461bcd60e51b81526020600482015260096024820152683d32b9379030b2323960b91b6044820152606401610731565b6005546001600160a01b03908116908216036108205760405162461bcd60e51b815260206004820152600960248201526839b0b6b29030b2323960b91b6044820152606401610731565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b5f6106ff42600a546110ee565b335f908152601360205260409020546106eb90610d39565b61086f610f84565b6005546001600160a01b031633146108dc5760405162461bcd60e51b815260206004820152602a60248201527f43616c6c6572206973206e6f742052657761726473446973747269627574696f6044820152691b8818dbdb9d1c9858dd60b21b6064820152608401610731565b5f6108e5610af7565b600d556108f0610842565b600c556001600160a01b038116156109365761090b816104fb565b6001600160a01b0382165f90815260116020908152604080832093909355600d546010909152919020555b6002546001600160a01b0384811691161461094f575f80fd5b60055460025461096d916001600160a01b0391821691163085611103565b600a54421061098b576109838262093a80610d23565b600b556109cb565b600a545f9061099a9042610d06565b90505f6109b2600b5483610d1890919063ffffffff16565b90506109c562093a806105658684610d2e565b600b5550505b6002546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa158015610a11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a359190611967565b9050610a448162093a80610d23565b600b541115610a955760405162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f206869676800000000000000006044820152606401610731565b42600c819055610aa89062093a80610d2e565b600a556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a15050610ae960015f55565b5050565b6105808133611141565b5f6012545f03610b085750600d5490565b6106ff610b37601254610565670de0b6b3a7640000610b31600b54610b31600c54610541610842565b90610d18565b600d5490610d2e565b5f80610b4a610f84565b610b52611329565b91509150610b5f60015f55565b9091565b600480546040516370a0823160e01b815233928101929092526106eb916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610bb0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bd49190611967565b33611141565b610be2611043565b6001600160a01b038116610c475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610731565b6105808161109d565b610c58611043565b6001600160a01b038116610c9a5760405162461bcd60e51b81526020600482015260096024820152683d32b9379030b2323960b91b6044820152606401610731565b6006546001600160a01b0390811690821603610ce45760405162461bcd60e51b815260206004820152600960248201526839b0b6b29030b2323960b91b6044820152606401610731565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b5f610d118284611992565b9392505050565b5f610d1182846119a5565b5f610d1182846119bc565b5f610d1182846119db565b610d41610f84565b33610d4a610af7565b600d55610d55610842565b600c556001600160a01b03811615610d9b57610d70816104fb565b6001600160a01b0382165f90815260116020908152604080832093909355600d546010909152919020555b5f8211610dde5760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b6044820152606401610731565b6012545f90610ded9084610d06565b1015610e285760405162461bcd60e51b815260206004820152600a6024820152690737570706c79203c20360b41b6044820152606401610731565b335f90815260136020526040902054610e715760405162461bcd60e51b815260206004820152600b60248201526a6e6f2062616c616e63657360a81b6044820152606401610731565b601254610e7e9083610d06565b601255335f90815260136020526040902054610e9a9083610d06565b335f908152601360205260409020556006546001600160a01b031615610f2e57600654600954335f818152601360205260408082205490516344af0fa760e01b81526001600160a01b03909516946344af0fa794610f0094909390928392600401611938565b5f604051808303815f87803b158015610f17575f80fd5b505af1158015610f29573d5f803e3d5ffd5b505050505b600454610f45906001600160a01b03163384610fdb565b60405182815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a25061058060015f55565b60025f5403610fd55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610731565b60025f55565b6040516001600160a01b03831660248201526044810182905261103e90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261166b565b505050565b6001546001600160a01b031633146106eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610731565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f8183106110fc5781610d11565b5090919050565b6040516001600160a01b038085166024830152831660448201526064810182905261113b9085906323b872dd60e01b90608401611007565b50505050565b611149610f84565b80611152610af7565b600d5561115d610842565b600c556001600160a01b038116156111a357611178816104fb565b6001600160a01b0382165f90815260116020908152604080832093909355600d546010909152919020555b5f83116111f25760405162461bcd60e51b815260206004820152601e60248201527f6465706f736974284761756765293a2063616e6e6f74207374616b65203000006044820152606401610731565b6001600160a01b0382165f908152601360205260409020546112149084610d2e565b6001600160a01b0383165f908152601360205260409020556012546112399084610d2e565b601255600454611254906001600160a01b0316833086611103565b6006546001600160a01b0316156112dc576006546009546001600160a01b038481165f908152601360205260408082205490516344af0fa760e01b815292909416936344af0fa7936112ae93909288928392600401611938565b5f604051808303815f87803b1580156112c5575f80fd5b505af11580156112d7573d5f803e3d5ffd5b505050505b816001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8460405161131791815260200190565b60405180910390a250610ae960015f55565b6001545f908190600160a01b900460ff1661134657505f91829150565b600480546040805163d294f09360e01b815281516001600160a01b0390931693849363d294f093938383019390929082900301815f875af115801561138d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113b191906119ee565b9093509150821515806113c357508115155b15611666575f83600e546113d791906119db565b90505f83600f546113e891906119db565b90505f80846001600160a01b0316639d63848a6040518163ffffffff1660e01b81526004016040805180830381865afa158015611427573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061144b9190611a10565b91509150835f14611535575f600e5560075460405163095ea7b360e01b81526001600160a01b039182166004820152602481018690529083169063095ea7b3906044016020604051808303815f875af11580156114aa573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114ce9190611a48565b5060075460405163b66503cf60e01b81526001600160a01b038481166004830152602482018790529091169063b66503cf906044015f604051808303815f87803b15801561151a575f80fd5b505af115801561152c573d5f803e3d5ffd5b5050505061153b565b600e8490555b8215611620575f600f5560075460405163095ea7b360e01b81526001600160a01b039182166004820152602481018590529082169063095ea7b3906044016020604051808303815f875af1158015611595573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115b99190611a48565b5060075460405163b66503cf60e01b81526001600160a01b038381166004830152602482018690529091169063b66503cf906044015f604051808303815f87803b158015611605575f80fd5b505af1158015611617573d5f803e3d5ffd5b50505050611626565b600f8390555b604080518881526020810188905233917fbc567d6cbad26368064baa0ab5a757be46aae4d70f707f9203d9d9b6c8ccbfa3910160405180910390a2505050505b509091565b5f6116bf826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661173e9092919063ffffffff16565b905080515f14806116df5750808060200190518101906116df9190611a48565b61103e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610731565b606061174c84845f85611754565b949350505050565b6060824710156117b55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610731565b5f80866001600160a01b031685876040516117d09190611a89565b5f6040518083038185875af1925050503d805f811461180a576040519150601f19603f3d011682016040523d82523d5f602084013e61180f565b606091505b50915091506118208783838761182b565b979650505050505050565b606083156118995782515f03611892576001600160a01b0385163b6118925760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610731565b508161174c565b61174c83838151156118ae5781518083602001fd5b8060405162461bcd60e51b81526004016107319190611aa4565b6001600160a01b0381168114610580575f80fd5b5f602082840312156118ec575f80fd5b8135610d11816118c8565b5f60208284031215611907575f80fd5b5035919050565b5f806040838503121561191f575f80fd5b823561192a816118c8565b946020939093013593505050565b9485526001600160a01b0393841660208601529190921660408401526060830191909152608082015260a00190565b5f60208284031215611977575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156105715761057161197e565b80820281158282048414176105715761057161197e565b5f826119d657634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156105715761057161197e565b5f80604083850312156119ff575f80fd5b505080516020909101519092909150565b5f8060408385031215611a21575f80fd5b8251611a2c816118c8565b6020840151909250611a3d816118c8565b809150509250929050565b5f60208284031215611a58575f80fd5b81518015158114610d11575f80fd5b5f5b83811015611a81578181015183820152602001611a69565b50505f910152565b5f8251611a9a818460208701611a67565b9190910192915050565b602081525f8251806020840152611ac2816040850160208701611a67565b601f01601f1916919091016040019291505056fea2646970667358221220aaf1d216fc2355536c0370a39dd78f326dc4cb0fe089ff085a4aa47210394d7664736f6c634300081700330000000000000000000000001a2fcb585b327fadec91f55d45829472b15f17a4000000000000000000000000c91d42e81586e493daf46e7ce279fdd7de334639000000000000000000000000b0a7cb220b586d4ae97133eff3d22e1c8559099c00000000000000000000000060c4bfbc017fc720af6e1084b4ff94753e24f0dc00000000000000000000000006f09be34298ff2402ec54af24c3e77e2840e8c6000000000000000000000000df30de0b83b92d233eee5b82481bf5a12cb5d1d10000000000000000000000000000000000000000000000000000000000000001

Deployed Bytecode

0x608060405234801561000f575f80fd5b506004361061023e575f3560e01c806382bfefc811610135578063c8f33c91116100b4578063e574821311610079578063e574821314610495578063ebe2b12b146104b9578063f2fde38b146104c2578063f7c618c1146104d5578063f97d2114146104e8575f80fd5b8063c8f33c9114610456578063cd3daf9d1461045f578063d294f09314610467578063de5f626814610484578063df136d651461048c575f80fd5b80638f67b013116100fa5780638f67b0131461040b57806393f1c442146104145780639f6d7d5b1461041d578063b66503cf14610430578063b6b55f2514610443575f80fd5b806382bfefc8146103ad578063853828b6146103c0578063863e2442146103c85780638b876347146103db5780638da5cb5b146103fa575f80fd5b80636e9852f2116101c1578063770f857111610186578063770f8571146103635780637b0a47ee146103765780637c91e4eb1461037f5780637f6990151461039257806380faa57d146103a5575f80fd5b80636e9852f2146102f95780636ebcf6071461030157806370a082311461032057806370b15e6d14610348578063715018a61461035b575f80fd5b80632e1a7d4d116102075780632e1a7d4d146102c25780633d18b912146102d75780633eaaf86b146102df5780634c02a21c146102e85780636946a235146102f1575f80fd5b80628cc2621461024257806303fbf83a146102685780630700037d146102935780631407c664146102b257806318160ddd146102ba575b5f80fd5b6102556102503660046118dc565b6104fb565b6040519081526020015b60405180910390f35b60085461027b906001600160a01b031681565b6040516001600160a01b03909116815260200161025f565b6102556102a13660046118dc565b60116020525f908152604090205481565b600a54610255565b601254610255565b6102d56102d03660046118f7565b610577565b005b6102d5610583565b61025560125481565b610255600f5481565b6102556106ed565b6102d5610704565b61025561030f3660046118dc565b60136020525f908152604090205481565b61025561032e3660046118dc565b6001600160a01b03165f9081526013602052604090205490565b6102d56103563660046118f7565b610724565b6102d561077b565b60075461027b906001600160a01b031681565b610255600b5481565b60055461027b906001600160a01b031681565b6102d56103a03660046118dc565b61078c565b610255610842565b60045461027b906001600160a01b031681565b6102d561084f565b60065461027b906001600160a01b031681565b6102556103e93660046118dc565b60106020525f908152604090205481565b6001546001600160a01b031661027b565b61025560095481565b610255600e5481565b60035461027b906001600160a01b031681565b6102d561043e36600461190e565b610867565b6102d56104513660046118f7565b610aed565b610255600c5481565b610255610af7565b61046f610b40565b6040805192835260208301919091520161025f565b6102d5610b63565b610255600d5481565b6001546104a990600160a01b900460ff1681565b604051901515815260200161025f565b610255600a5481565b6102d56104d03660046118dc565b610bda565b60025461027b906001600160a01b031681565b6102d56104f63660046118dc565b610c50565b6001600160a01b0381165f908152601160209081526040808320546010909252822054610571919061056b90670de0b6b3a7640000906105659061054790610541610af7565b90610d06565b6001600160a01b0388165f9081526013602052604090205490610d18565b90610d23565b90610d2e565b92915050565b61058081610d39565b50565b61058b610f84565b33610594610af7565b600d5561059f610842565b600c556001600160a01b038116156105e5576105ba816104fb565b6001600160a01b0382165f90815260116020908152604080832093909355600d546010909152919020555b335f90815260116020526040902054801561065857335f81815260116020526040812055600254610622916001600160a01b039091169083610fdb565b60405181815233907fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba9060200160405180910390a25b6006546001600160a01b0316156106e057600654600954335f81815260136020526040908190205490516344af0fa760e01b81526001600160a01b03909416936344af0fa7936106b2939092909182918891600401611938565b5f604051808303815f87803b1580156106c9575f80fd5b505af11580156106db573d5f803e3d5ffd5b505050505b50506106eb60015f55565b565b600b545f906106ff9062093a80610d18565b905090565b335f9081526013602052604090205461071c90610d39565b6106eb610583565b61072c611043565b61073a565b60405180910390fd5b60095481036107765760405162461bcd60e51b81526020600482015260086024820152671cd85b59481c1a5960c21b6044820152606401610731565b600955565b610783611043565b6106eb5f61109d565b610794611043565b6001600160a01b0381166107d65760405162461bcd60e51b81526020600482015260096024820152683d32b9379030b2323960b91b6044820152606401610731565b6005546001600160a01b03908116908216036108205760405162461bcd60e51b815260206004820152600960248201526839b0b6b29030b2323960b91b6044820152606401610731565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b5f6106ff42600a546110ee565b335f908152601360205260409020546106eb90610d39565b61086f610f84565b6005546001600160a01b031633146108dc5760405162461bcd60e51b815260206004820152602a60248201527f43616c6c6572206973206e6f742052657761726473446973747269627574696f6044820152691b8818dbdb9d1c9858dd60b21b6064820152608401610731565b5f6108e5610af7565b600d556108f0610842565b600c556001600160a01b038116156109365761090b816104fb565b6001600160a01b0382165f90815260116020908152604080832093909355600d546010909152919020555b6002546001600160a01b0384811691161461094f575f80fd5b60055460025461096d916001600160a01b0391821691163085611103565b600a54421061098b576109838262093a80610d23565b600b556109cb565b600a545f9061099a9042610d06565b90505f6109b2600b5483610d1890919063ffffffff16565b90506109c562093a806105658684610d2e565b600b5550505b6002546040516370a0823160e01b81523060048201525f916001600160a01b0316906370a0823190602401602060405180830381865afa158015610a11573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a359190611967565b9050610a448162093a80610d23565b600b541115610a955760405162461bcd60e51b815260206004820152601860248201527f50726f76696465642072657761726420746f6f206869676800000000000000006044820152606401610731565b42600c819055610aa89062093a80610d2e565b600a556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a15050610ae960015f55565b5050565b6105808133611141565b5f6012545f03610b085750600d5490565b6106ff610b37601254610565670de0b6b3a7640000610b31600b54610b31600c54610541610842565b90610d18565b600d5490610d2e565b5f80610b4a610f84565b610b52611329565b91509150610b5f60015f55565b9091565b600480546040516370a0823160e01b815233928101929092526106eb916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610bb0573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bd49190611967565b33611141565b610be2611043565b6001600160a01b038116610c475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610731565b6105808161109d565b610c58611043565b6001600160a01b038116610c9a5760405162461bcd60e51b81526020600482015260096024820152683d32b9379030b2323960b91b6044820152606401610731565b6006546001600160a01b0390811690821603610ce45760405162461bcd60e51b815260206004820152600960248201526839b0b6b29030b2323960b91b6044820152606401610731565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b5f610d118284611992565b9392505050565b5f610d1182846119a5565b5f610d1182846119bc565b5f610d1182846119db565b610d41610f84565b33610d4a610af7565b600d55610d55610842565b600c556001600160a01b03811615610d9b57610d70816104fb565b6001600160a01b0382165f90815260116020908152604080832093909355600d546010909152919020555b5f8211610dde5760405162461bcd60e51b8152602060048201526011602482015270043616e6e6f74207769746864726177203607c1b6044820152606401610731565b6012545f90610ded9084610d06565b1015610e285760405162461bcd60e51b815260206004820152600a6024820152690737570706c79203c20360b41b6044820152606401610731565b335f90815260136020526040902054610e715760405162461bcd60e51b815260206004820152600b60248201526a6e6f2062616c616e63657360a81b6044820152606401610731565b601254610e7e9083610d06565b601255335f90815260136020526040902054610e9a9083610d06565b335f908152601360205260409020556006546001600160a01b031615610f2e57600654600954335f818152601360205260408082205490516344af0fa760e01b81526001600160a01b03909516946344af0fa794610f0094909390928392600401611938565b5f604051808303815f87803b158015610f17575f80fd5b505af1158015610f29573d5f803e3d5ffd5b505050505b600454610f45906001600160a01b03163384610fdb565b60405182815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a25061058060015f55565b60025f5403610fd55760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610731565b60025f55565b6040516001600160a01b03831660248201526044810182905261103e90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261166b565b505050565b6001546001600160a01b031633146106eb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610731565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f8183106110fc5781610d11565b5090919050565b6040516001600160a01b038085166024830152831660448201526064810182905261113b9085906323b872dd60e01b90608401611007565b50505050565b611149610f84565b80611152610af7565b600d5561115d610842565b600c556001600160a01b038116156111a357611178816104fb565b6001600160a01b0382165f90815260116020908152604080832093909355600d546010909152919020555b5f83116111f25760405162461bcd60e51b815260206004820152601e60248201527f6465706f736974284761756765293a2063616e6e6f74207374616b65203000006044820152606401610731565b6001600160a01b0382165f908152601360205260409020546112149084610d2e565b6001600160a01b0383165f908152601360205260409020556012546112399084610d2e565b601255600454611254906001600160a01b0316833086611103565b6006546001600160a01b0316156112dc576006546009546001600160a01b038481165f908152601360205260408082205490516344af0fa760e01b815292909416936344af0fa7936112ae93909288928392600401611938565b5f604051808303815f87803b1580156112c5575f80fd5b505af11580156112d7573d5f803e3d5ffd5b505050505b816001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8460405161131791815260200190565b60405180910390a250610ae960015f55565b6001545f908190600160a01b900460ff1661134657505f91829150565b600480546040805163d294f09360e01b815281516001600160a01b0390931693849363d294f093938383019390929082900301815f875af115801561138d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906113b191906119ee565b9093509150821515806113c357508115155b15611666575f83600e546113d791906119db565b90505f83600f546113e891906119db565b90505f80846001600160a01b0316639d63848a6040518163ffffffff1660e01b81526004016040805180830381865afa158015611427573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061144b9190611a10565b91509150835f14611535575f600e5560075460405163095ea7b360e01b81526001600160a01b039182166004820152602481018690529083169063095ea7b3906044016020604051808303815f875af11580156114aa573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114ce9190611a48565b5060075460405163b66503cf60e01b81526001600160a01b038481166004830152602482018790529091169063b66503cf906044015f604051808303815f87803b15801561151a575f80fd5b505af115801561152c573d5f803e3d5ffd5b5050505061153b565b600e8490555b8215611620575f600f5560075460405163095ea7b360e01b81526001600160a01b039182166004820152602481018590529082169063095ea7b3906044016020604051808303815f875af1158015611595573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115b99190611a48565b5060075460405163b66503cf60e01b81526001600160a01b038381166004830152602482018690529091169063b66503cf906044015f604051808303815f87803b158015611605575f80fd5b505af1158015611617573d5f803e3d5ffd5b50505050611626565b600f8390555b604080518881526020810188905233917fbc567d6cbad26368064baa0ab5a757be46aae4d70f707f9203d9d9b6c8ccbfa3910160405180910390a2505050505b509091565b5f6116bf826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661173e9092919063ffffffff16565b905080515f14806116df5750808060200190518101906116df9190611a48565b61103e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610731565b606061174c84845f85611754565b949350505050565b6060824710156117b55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610731565b5f80866001600160a01b031685876040516117d09190611a89565b5f6040518083038185875af1925050503d805f811461180a576040519150601f19603f3d011682016040523d82523d5f602084013e61180f565b606091505b50915091506118208783838761182b565b979650505050505050565b606083156118995782515f03611892576001600160a01b0385163b6118925760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610731565b508161174c565b61174c83838151156118ae5781518083602001fd5b8060405162461bcd60e51b81526004016107319190611aa4565b6001600160a01b0381168114610580575f80fd5b5f602082840312156118ec575f80fd5b8135610d11816118c8565b5f60208284031215611907575f80fd5b5035919050565b5f806040838503121561191f575f80fd5b823561192a816118c8565b946020939093013593505050565b9485526001600160a01b0393841660208601529190921660408401526060830191909152608082015260a00190565b5f60208284031215611977575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b818103818111156105715761057161197e565b80820281158282048414176105715761057161197e565b5f826119d657634e487b7160e01b5f52601260045260245ffd5b500490565b808201808211156105715761057161197e565b5f80604083850312156119ff575f80fd5b505080516020909101519092909150565b5f8060408385031215611a21575f80fd5b8251611a2c816118c8565b6020840151909250611a3d816118c8565b809150509250929050565b5f60208284031215611a58575f80fd5b81518015158114610d11575f80fd5b5f5b83811015611a81578181015183820152602001611a69565b50505f910152565b5f8251611a9a818460208701611a67565b9190910192915050565b602081525f8251806020840152611ac2816040850160208701611a67565b601f01601f1916919091016040019291505056fea2646970667358221220aaf1d216fc2355536c0370a39dd78f326dc4cb0fe089ff085a4aa47210394d7664736f6c63430008170033

Block Transaction Gas Used Reward
view all blocks sequenced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
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  ]
[ 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.