FRAX Price: $0.91 (-10.11%)

Contract

0x0fC884C7a3d32Ea0e9fA5b7d95572262E98BB62E

Overview

FRAX Balance | FXTL Balance

0 FRAX | 17,237 FXTL

FRAX Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Get Reward302855272026-01-02 19:22:4522 days ago1767381765IN
0x0fC884C7...2E98BB62E
0 FRAX0.000009250.0012
Get Reward302531732026-01-02 1:24:1723 days ago1767317057IN
0x0fC884C7...2E98BB62E
0 FRAX0.000002590.001
Get Reward302357512026-01-01 15:43:3323 days ago1767282213IN
0x0fC884C7...2E98BB62E
0 FRAX0.00000420.001
Get Reward300512022025-12-28 9:11:5528 days ago1766913115IN
0x0fC884C7...2E98BB62E
0 FRAX0.000002420.0012
Withdraw300511262025-12-28 9:09:2328 days ago1766912963IN
0x0fC884C7...2E98BB62E
0 FRAX0.000002540.001
Get Reward300511182025-12-28 9:09:0728 days ago1766912947IN
0x0fC884C7...2E98BB62E
0 FRAX0.000002540.001
Get Reward290991422025-12-06 8:16:3550 days ago1765008995IN
0x0fC884C7...2E98BB62E
0 FRAX0.000001880.001
Withdraw282743502025-11-17 6:03:3169 days ago1763359411IN
0x0fC884C7...2E98BB62E
0 FRAX0.000006140.001
Get Reward277613582025-11-05 9:03:4781 days ago1762333427IN
0x0fC884C7...2E98BB62E
0 FRAX0.000036050.0012
Get Reward277303222025-11-04 15:49:1581 days ago1762271355IN
0x0fC884C7...2E98BB62E
0 FRAX0.000103360.001
Get Reward276303692025-11-02 8:17:2984 days ago1762071449IN
0x0fC884C7...2E98BB62E
0 FRAX0.000005860.00010062
Get Reward276300282025-11-02 8:06:0784 days ago1762070767IN
0x0fC884C7...2E98BB62E
0 FRAX0.000005920.00010095
Get Reward276216102025-11-02 3:25:3184 days ago1762053931IN
0x0fC884C7...2E98BB62E
0 FRAX0.000005920.00010027
Withdraw274719112025-10-29 16:15:3387 days ago1761754533IN
0x0fC884C7...2E98BB62E
0 FRAX0.000083360.001
Withdraw271473442025-10-22 3:56:3995 days ago1761105399IN
0x0fC884C7...2E98BB62E
0 FRAX0.000008580.00019946
Get Reward271459582025-10-22 3:10:2795 days ago1761102627IN
0x0fC884C7...2E98BB62E
0 FRAX0.000008430.00019942
Get Reward268944322025-10-16 7:26:15101 days ago1760599575IN
0x0fC884C7...2E98BB62E
0 FRAX0.000011320.00010106
Get Reward267635202025-10-13 6:42:31104 days ago1760337751IN
0x0fC884C7...2E98BB62E
0 FRAX0.000010130.00010222
Get Reward265251412025-10-07 18:16:33109 days ago1759860993IN
0x0fC884C7...2E98BB62E
0 FRAX0.000057420.00010025
Get Reward259717852025-09-24 22:51:21122 days ago1758754281IN
0x0fC884C7...2E98BB62E
0 FRAX0.000012650.00120384
Withdraw259717402025-09-24 22:49:51122 days ago1758754191IN
0x0fC884C7...2E98BB62E
0 FRAX0.000012840.0015038
Get Reward259716562025-09-24 22:47:03122 days ago1758754023IN
0x0fC884C7...2E98BB62E
0 FRAX0.000013030.00325096
Get Reward257608262025-09-20 1:39:23127 days ago1758332363IN
0x0fC884C7...2E98BB62E
0 FRAX0.000015140.00636331
Get Reward255534082025-09-15 6:25:27132 days ago1757917527IN
0x0fC884C7...2E98BB62E
0 FRAX0.000011640.0012
Withdraw254303392025-09-12 10:03:09135 days ago1757671389IN
0x0fC884C7...2E98BB62E
0 FRAX0.00002320.00000385
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
126150242024-11-19 18:25:59431 days ago1732040759  Contract Creation0 FRAX

Cross-Chain Transactions
Loading...
Loading

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

Contract Name:
LeafGauge

Compiler Version
v0.8.27+commit.40a35a09

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.8.19 <0.9.0;

import {Math} from "@openzeppelin5/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin5/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin5/contracts/token/ERC20/utils/SafeERC20.sol";
import {ReentrancyGuard} from "@openzeppelin5/contracts/utils/ReentrancyGuard.sol";

import {IReward} from "../interfaces/rewards/IReward.sol";
import {ILeafGauge} from "../interfaces/gauges/ILeafGauge.sol";
import {IPool} from "../interfaces/pools/IPool.sol";
import {ILeafVoter} from "../interfaces/voter/ILeafVoter.sol";
import {VelodromeTimeLibrary} from "../libraries/VelodromeTimeLibrary.sol";

import {ILeafMessageBridge} from "../interfaces/bridge/ILeafMessageBridge.sol";

/*

██╗   ██╗███████╗██╗      ██████╗ ██████╗ ██████╗  ██████╗ ███╗   ███╗███████╗
██║   ██║██╔════╝██║     ██╔═══██╗██╔══██╗██╔══██╗██╔═══██╗████╗ ████║██╔════╝
██║   ██║█████╗  ██║     ██║   ██║██║  ██║██████╔╝██║   ██║██╔████╔██║█████╗
╚██╗ ██╔╝██╔══╝  ██║     ██║   ██║██║  ██║██╔══██╗██║   ██║██║╚██╔╝██║██╔══╝
 ╚████╔╝ ███████╗███████╗╚██████╔╝██████╔╝██║  ██║╚██████╔╝██║ ╚═╝ ██║███████╗
  ╚═══╝  ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚═╝     ╚═╝╚══════╝

███████╗██╗   ██╗██████╗ ███████╗██████╗  ██████╗██╗  ██╗ █████╗ ██╗███╗   ██╗
██╔════╝██║   ██║██╔══██╗██╔════╝██╔══██╗██╔════╝██║  ██║██╔══██╗██║████╗  ██║
███████╗██║   ██║██████╔╝█████╗  ██████╔╝██║     ███████║███████║██║██╔██╗ ██║
╚════██║██║   ██║██╔═══╝ ██╔══╝  ██╔══██╗██║     ██╔══██║██╔══██║██║██║╚██╗██║
███████║╚██████╔╝██║     ███████╗██║  ██║╚██████╗██║  ██║██║  ██║██║██║ ╚████║
╚══════╝ ╚═════╝ ╚═╝     ╚══════╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝

██╗     ███████╗ █████╗ ███████╗ ██████╗  █████╗ ██╗   ██╗ ██████╗ ███████╗
██║     ██╔════╝██╔══██╗██╔════╝██╔════╝ ██╔══██╗██║   ██║██╔════╝ ██╔════╝
██║     █████╗  ███████║█████╗  ██║  ███╗███████║██║   ██║██║  ███╗█████╗
██║     ██╔══╝  ██╔══██║██╔══╝  ██║   ██║██╔══██║██║   ██║██║   ██║██╔══╝
███████╗███████╗██║  ██║██║     ╚██████╔╝██║  ██║╚██████╔╝╚██████╔╝███████╗
╚══════╝╚══════╝╚═╝  ╚═╝╚═╝      ╚═════╝ ╚═╝  ╚═╝ ╚═════╝  ╚═════╝ ╚══════╝

*/

/// @title Velodrome Superchain Leaf Gauge Contracts
/// @notice Leaf gauge contract for distribution of emissions by address
contract LeafGauge is ILeafGauge, ReentrancyGuard {
    using SafeERC20 for IERC20;

    /// @inheritdoc ILeafGauge
    address public immutable stakingToken;
    /// @inheritdoc ILeafGauge
    address public immutable rewardToken;
    /// @inheritdoc ILeafGauge
    address public immutable feesVotingReward;
    /// @inheritdoc ILeafGauge
    address public immutable voter;
    /// @inheritdoc ILeafGauge
    address public immutable bridge;

    /// @inheritdoc ILeafGauge
    bool public immutable isPool;

    uint256 internal constant WEEK = VelodromeTimeLibrary.WEEK; // rewards are released over 7 days
    uint256 internal constant PRECISION = 10 ** 18;

    /// @inheritdoc ILeafGauge
    uint256 public periodFinish;
    /// @inheritdoc ILeafGauge
    uint256 public rewardRate;
    /// @inheritdoc ILeafGauge
    uint256 public lastUpdateTime;
    /// @inheritdoc ILeafGauge
    uint256 public rewardPerTokenStored;
    /// @inheritdoc ILeafGauge
    uint256 public totalSupply;
    /// @inheritdoc ILeafGauge
    mapping(address => uint256) public balanceOf;
    /// @inheritdoc ILeafGauge
    mapping(address => uint256) public userRewardPerTokenPaid;
    /// @inheritdoc ILeafGauge
    mapping(address => uint256) public rewards;
    /// @inheritdoc ILeafGauge
    mapping(uint256 => uint256) public rewardRateByEpoch;

    /// @inheritdoc ILeafGauge
    uint256 public fees0;
    /// @inheritdoc ILeafGauge
    uint256 public fees1;

    constructor(
        address _stakingToken,
        address _feesVotingReward,
        address _rewardToken,
        address _voter,
        address _bridge,
        bool _isPool
    ) {
        stakingToken = _stakingToken;
        feesVotingReward = _feesVotingReward;
        rewardToken = _rewardToken;
        voter = _voter;
        bridge = _bridge;
        isPool = _isPool;
    }

    function _claimFees() internal returns (uint256 claimed0, uint256 claimed1) {
        if (!isPool) {
            return (0, 0);
        }
        (claimed0, claimed1) = IPool(stakingToken).claimFees();
        if (claimed0 > 0 || claimed1 > 0) {
            uint256 _fees0 = fees0 + claimed0;
            uint256 _fees1 = fees1 + claimed1;
            (address _token0, address _token1) = IPool(stakingToken).tokens();
            if (_fees0 > WEEK) {
                fees0 = 0;
                IERC20(_token0).safeIncreaseAllowance(feesVotingReward, _fees0);
                IReward(feesVotingReward).notifyRewardAmount(_token0, _fees0);
            } else {
                fees0 = _fees0;
            }
            if (_fees1 > WEEK) {
                fees1 = 0;
                IERC20(_token1).safeIncreaseAllowance(feesVotingReward, _fees1);
                IReward(feesVotingReward).notifyRewardAmount(_token1, _fees1);
            } else {
                fees1 = _fees1;
            }

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

    /// @inheritdoc ILeafGauge
    function rewardPerToken() public view returns (uint256) {
        if (totalSupply == 0) {
            return rewardPerTokenStored;
        }
        return rewardPerTokenStored
            + ((lastTimeRewardApplicable() - lastUpdateTime) * rewardRate * PRECISION) / totalSupply;
    }

    /// @inheritdoc ILeafGauge
    function lastTimeRewardApplicable() public view returns (uint256) {
        return Math.min(block.timestamp, periodFinish);
    }

    /// @inheritdoc ILeafGauge
    function getReward(address _account) external nonReentrant {
        if (msg.sender != _account && msg.sender != voter) revert NotAuthorized();

        _updateRewards(_account);

        uint256 reward = rewards[_account];
        if (reward > 0) {
            rewards[_account] = 0;
            IERC20(rewardToken).safeTransfer(_account, reward);
            emit ClaimRewards(_account, reward);
        }
    }

    /// @inheritdoc ILeafGauge
    function earned(address _account) public view returns (uint256) {
        return (balanceOf[_account] * (rewardPerToken() - userRewardPerTokenPaid[_account])) / PRECISION
            + rewards[_account];
    }

    /// @inheritdoc ILeafGauge
    function deposit(uint256 _amount) external {
        _depositFor(_amount, msg.sender);
    }

    /// @inheritdoc ILeafGauge
    function deposit(uint256 _amount, address _recipient) external {
        _depositFor(_amount, _recipient);
    }

    function _depositFor(uint256 _amount, address _recipient) internal nonReentrant {
        if (_amount == 0) revert ZeroAmount();
        if (!ILeafVoter(voter).isAlive(address(this))) revert NotAlive();

        _updateRewards(_recipient);

        IERC20(stakingToken).safeTransferFrom(msg.sender, address(this), _amount);
        totalSupply += _amount;
        balanceOf[_recipient] += _amount;

        emit Deposit(msg.sender, _recipient, _amount);
    }

    /// @inheritdoc ILeafGauge
    function withdraw(uint256 _amount) external nonReentrant {
        _updateRewards(msg.sender);

        totalSupply -= _amount;
        balanceOf[msg.sender] -= _amount;
        IERC20(stakingToken).safeTransfer(msg.sender, _amount);

        emit Withdraw(msg.sender, _amount);
    }

    function _updateRewards(address _account) internal {
        rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();
        rewards[_account] = earned(_account);
        userRewardPerTokenPaid[_account] = rewardPerTokenStored;
    }

    /// @inheritdoc ILeafGauge
    function left() external view returns (uint256) {
        if (block.timestamp >= periodFinish) return 0;
        uint256 _remaining = periodFinish - block.timestamp;
        return _remaining * rewardRate;
    }

    /// @inheritdoc ILeafGauge
    function notifyRewardAmount(uint256 _amount) external nonReentrant {
        if (msg.sender != ILeafMessageBridge(bridge).module()) revert NotModule();
        if (_amount == 0) revert ZeroAmount();
        _claimFees();
        _notifyRewardAmount(_amount);
    }

    /// @inheritdoc ILeafGauge
    function notifyRewardWithoutClaim(uint256 _amount) external nonReentrant {
        if (msg.sender != ILeafMessageBridge(bridge).module()) revert NotModule();
        if (_amount == 0) revert ZeroAmount();
        _notifyRewardAmount(_amount);
    }

    function _notifyRewardAmount(uint256 _amount) internal {
        rewardPerTokenStored = rewardPerToken();
        uint256 timeUntilNext = VelodromeTimeLibrary.epochNext(block.timestamp) - block.timestamp;

        if (block.timestamp >= periodFinish) {
            IERC20(rewardToken).safeTransferFrom(msg.sender, address(this), _amount);
            rewardRate = _amount / timeUntilNext;
        } else {
            uint256 _remaining = periodFinish - block.timestamp;
            uint256 _leftover = _remaining * rewardRate;
            IERC20(rewardToken).safeTransferFrom(msg.sender, address(this), _amount);
            rewardRate = (_amount + _leftover) / timeUntilNext;
        }
        rewardRateByEpoch[VelodromeTimeLibrary.epochStart(block.timestamp)] = rewardRate;
        if (rewardRate == 0) revert ZeroRewardRate();

        // 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 = IERC20(rewardToken).balanceOf(address(this));
        if (rewardRate > balance / timeUntilNext) revert RewardRateTooHigh();

        lastUpdateTime = block.timestamp;
        periodFinish = block.timestamp + timeUntilNext;
        emit NotifyReward(msg.sender, _amount);
    }
}

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

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    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.
     */
    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.
     */
    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.
     */
    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.
     */
    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 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 towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (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 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                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.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 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.

            uint256 twos = denominator & (0 - denominator);
            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 (unsignedRoundsUp(rounding) && 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
     * towards zero.
     *
     * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

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

pragma solidity ^0.8.20;

/**
 * @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 value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

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

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../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 An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @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.encodeCall(token.transfer, (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.encodeCall(token.transferFrom, (from, to, 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);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @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.encodeCall(token.approve, (spender, value));

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

    /**
     * @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);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @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(token).code.length > 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @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;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    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
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // 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
pragma solidity ^0.8.0;

interface IReward {
    error InvalidReward();
    error NotAuthorized();
    error NotGauge();
    error NotEscrowToken();
    error NotSingleToken();
    error NotVotingEscrow();
    error NotWhitelisted();
    error ZeroAmount();

    event Deposit(uint256 indexed _tokenId, uint256 _amount);
    event Withdraw(uint256 indexed _tokenId, uint256 _amount);
    event NotifyReward(address indexed _sender, address indexed _reward, uint256 indexed _epoch, uint256 _amount);
    event ClaimRewards(address indexed _sender, address indexed _reward, uint256 _amount);

    /// @notice A checkpoint for marking balance
    struct Checkpoint {
        uint256 timestamp;
        uint256 balanceOf;
    }

    /// @notice A checkpoint for marking supply
    struct SupplyCheckpoint {
        uint256 timestamp;
        uint256 supply;
    }

    /// @notice Epoch duration constant (7 days)
    function DURATION() external view returns (uint256);

    /// @notice Address of LeafVoter.sol
    function voter() external view returns (address);

    /// @dev Address which has permission to externally call _deposit() & _withdraw()
    function authorized() external view returns (address);

    /// @notice Total amount currently deposited via _deposit()
    function totalSupply() external view returns (uint256);

    /// @notice Current amount deposited by tokenId
    function balanceOf(uint256 tokenId) external view returns (uint256);

    /// @notice Amount of tokens to reward depositors for a given epoch
    /// @param token Address of token to reward
    /// @param epochStart Startime of rewards epoch
    /// @return Amount of token
    function tokenRewardsPerEpoch(address token, uint256 epochStart) external view returns (uint256);

    /// @notice Most recent timestamp a veNFT has claimed their rewards
    /// @param  token Address of token rewarded
    /// @param tokenId veNFT unique identifier
    /// @return Timestamp
    function lastEarn(address token, uint256 tokenId) external view returns (uint256);

    /// @notice List of reward tokens
    /// @param _index Index of reward token
    /// @return Address of reward token
    function rewards(uint256 _index) external view returns (address);

    /// @notice True if a token is or has been an active reward token, else false
    function isReward(address token) external view returns (bool);

    /// @notice The number of checkpoints for each tokenId deposited
    function numCheckpoints(uint256 tokenId) external view returns (uint256);

    /// @notice The total number of checkpoints
    function supplyNumCheckpoints() external view returns (uint256);

    /// @notice Deposit an amount into the rewards contract to earn future rewards associated to a veNFT
    /// @dev Internal notation used as only callable internally by `authorized.module()`.
    /// @param amount Vote weight to deposit
    /// @param tokenId Token ID of weight to deposit
    /// @param timestamp Timestamp of deposit
    function _deposit(uint256 amount, uint256 tokenId, uint256 timestamp) external;

    /// @notice Withdraw an amount from the rewards contract associated to a veNFT
    /// @dev Internal notation used as only callable internally by `authorized.module()`.
    /// @param amount Vote weight to withdraw
    /// @param tokenId Token ID of weight to withdraw
    /// @param timestamp Timestamp of withdraw
    function _withdraw(uint256 amount, uint256 tokenId, uint256 timestamp) external;

    /// @notice Claim the rewards earned by a veNFT staker
    /// @param _recipient  Address of reward recipient
    /// @param _tokenId  Unique identifier of the veNFT
    /// @param _tokens   Array of tokens to claim rewards of
    function getReward(address _recipient, uint256 _tokenId, address[] memory _tokens) external;

    /// @notice Add rewards for stakers to earn
    /// @param token    Address of token to reward
    /// @param amount   Amount of token to transfer to rewards
    function notifyRewardAmount(address token, uint256 amount) external;

    /// @notice Determine the prior balance for an account as of a block number
    /// @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
    /// @param tokenId      The token of the NFT to check
    /// @param timestamp    The timestamp to get the balance at
    /// @return The balance the account had as of the given block
    function getPriorBalanceIndex(uint256 tokenId, uint256 timestamp) external view returns (uint256);

    /// @notice Determine the prior index of supply staked by of a timestamp
    /// @dev Timestamp must be <= current timestamp
    /// @param timestamp The timestamp to get the index at
    /// @return Index of supply checkpoint
    function getPriorSupplyIndex(uint256 timestamp) external view returns (uint256);

    /// @notice Get number of rewards tokens
    function rewardsListLength() external view returns (uint256);

    /// @notice Calculate how much in rewards are earned for a specific token and veNFT
    /// @param token Address of token to fetch rewards of
    /// @param tokenId Unique identifier of the veNFT
    /// @return Amount of token earned in rewards
    function earned(address token, uint256 tokenId) external view returns (uint256);

    function checkpoints(uint256 tokenId, uint256 index) external view returns (uint256 timestamp, uint256 balanceOf);

    function supplyCheckpoints(uint256 index) external view returns (uint256 timestamp, uint256 supply);
}

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

interface ILeafGauge {
    error NotAlive();
    error NotAuthorized();
    error NotModule();
    error RewardRateTooHigh();
    error ZeroAmount();
    error ZeroRewardRate();

    event Deposit(address indexed _sender, address indexed _to, uint256 _amount);
    event Withdraw(address indexed _sender, uint256 _amount);
    event NotifyReward(address indexed _sender, uint256 _amount);
    event ClaimFees(address indexed _sender, uint256 _claimed0, uint256 _claimed1);
    event ClaimRewards(address indexed _sender, uint256 _amount);

    /// @notice Address of the pool LP token which is deposited (staked) for rewards
    function stakingToken() external view returns (address);

    /// @notice Address of the token (VELO v2) rewarded to stakers
    function rewardToken() external view returns (address);

    /// @notice Address of the FeesVotingReward contract linked to the gauge
    function feesVotingReward() external view returns (address);

    /// @notice Address of Velodrome v2 Voter
    function voter() external view returns (address);

    /// @notice Address of Velodrome v2 Bridge
    function bridge() external view returns (address);

    /// @notice Returns if gauge is linked to a legitimate Velodrome pool
    function isPool() external view returns (bool);

    /// @notice Timestamp end of current rewards period
    function periodFinish() external view returns (uint256);

    /// @notice Current reward rate of rewardToken to distribute per second
    function rewardRate() external view returns (uint256);

    /// @notice Most recent timestamp contract has updated state
    function lastUpdateTime() external view returns (uint256);

    /// @notice Most recent stored value of rewardPerToken
    function rewardPerTokenStored() external view returns (uint256);

    /// @notice Amount of stakingToken deposited for rewards
    function totalSupply() external view returns (uint256);

    /// @notice Get the amount of stakingToken deposited by an account
    function balanceOf(address) external view returns (uint256);

    /// @notice Cached rewardPerTokenStored for an account based on their most recent action
    function userRewardPerTokenPaid(address) external view returns (uint256);

    /// @notice Cached amount of rewardToken earned for an account
    function rewards(address) external view returns (uint256);

    /// @notice View to see the rewardRate given the timestamp of the start of the epoch
    function rewardRateByEpoch(uint256) external view returns (uint256);

    /// @notice Cached amount of fees generated from the Pool linked to the Gauge of token0
    function fees0() external view returns (uint256);

    /// @notice Cached amount of fees generated from the Pool linked to the Gauge of token1
    function fees1() external view returns (uint256);

    /// @notice Get the current reward rate per unit of stakingToken deposited
    function rewardPerToken() external view returns (uint256 _rewardPerToken);

    /// @notice Returns the last time the reward was modified or periodFinish if the reward has ended
    function lastTimeRewardApplicable() external view returns (uint256 _time);

    /// @notice Returns accrued balance to date from last claim / first deposit.
    function earned(address _account) external view returns (uint256 _earned);

    /// @notice Total amount of rewardToken to distribute for the current rewards period
    function left() external view returns (uint256 _left);

    /// @notice Retrieve rewards for an address.
    /// @dev Throws if not called by same address or voter.
    /// @param _account .
    function getReward(address _account) external;

    /// @notice Deposit LP tokens into gauge for msg.sender
    /// @param _amount .
    function deposit(uint256 _amount) external;

    /// @notice Deposit LP tokens into gauge for any user
    /// @param _amount .
    /// @param _recipient Recipient to give balance to
    function deposit(uint256 _amount, address _recipient) external;

    /// @notice Withdraw LP tokens for user
    /// @param _amount .
    function withdraw(uint256 _amount) external;

    /// @notice Notifies gauge of gauge rewards. Assumes gauge reward tokens is 18 decimals.
    /// @dev If not 18 decimals, rewardRate may have rounding issues.
    /// @param amount Amount of rewards to be deposited into gauge
    function notifyRewardAmount(uint256 amount) external;

    /// @notice Notifies gauge of gauge rewards without distributing its fees.
    /// @dev Assumes gauge reward tokens is 18 decimals.
    ///      If not 18 decimals, rewardRate may have rounding issues.
    /// @param amount Amount of rewards to be deposited into gauge
    function notifyRewardWithoutClaim(uint256 amount) external;
}

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

interface IPool {
    error DepositsNotEqual();
    error BelowMinimumK();
    error FactoryAlreadySet();
    error InsufficientLiquidity();
    error InsufficientLiquidityMinted();
    error InsufficientLiquidityBurned();
    error InsufficientOutputAmount();
    error InsufficientInputAmount();
    error IsPaused();
    error InvalidTo();
    error K();

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

    // Struct to capture time period obervations every 30 minutes, used for local oracles
    struct Observation {
        uint256 timestamp;
        uint256 reserve0Cumulative;
        uint256 reserve1Cumulative;
    }

    /// @notice Returns the decimal (dec), reserves (r), stable (st), and tokens (t) of token0 and token1
    function metadata()
        external
        view
        returns (uint256 dec0, uint256 dec1, uint256 r0, uint256 r1, bool st, address t0, address t1);

    /// @notice Claim accumulated but unclaimed fees (claimable0 and claimable1)
    function claimFees() external returns (uint256, uint256);

    /// @notice Returns [token0, token1]
    function tokens() external view returns (address, address);

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

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

    /// @notice Address of linked PoolFees.sol
    function poolFees() external view returns (address);

    /// @notice Address of PoolFactory that created this contract
    function factory() external view returns (address);

    /// @notice Capture oracle reading every 30 minutes (1800 seconds)
    function periodSize() external view returns (uint256);

    /// @notice Amount of token0 in pool
    function reserve0() external view returns (uint256);

    /// @notice Amount of token1 in pool
    function reserve1() external view returns (uint256);

    /// @notice Timestamp of last update to pool
    function blockTimestampLast() external view returns (uint256);

    /// @notice Cumulative of reserve0 factoring in time elapsed
    function reserve0CumulativeLast() external view returns (uint256);

    /// @notice Cumulative of reserve1 factoring in time elapsed
    function reserve1CumulativeLast() external view returns (uint256);

    /// @notice Accumulated fees of token0 (global)
    function index0() external view returns (uint256);

    /// @notice Accumulated fees of token1 (global)
    function index1() external view returns (uint256);

    /// @notice Get an LP's relative index0 to index0
    function supplyIndex0(address) external view returns (uint256);

    /// @notice Get an LP's relative index1 to index1
    function supplyIndex1(address) external view returns (uint256);

    /// @notice Amount of unclaimed, but claimable tokens from fees of token0 for an LP
    function claimable0(address) external view returns (uint256);

    /// @notice Amount of unclaimed, but claimable tokens from fees of token1 for an LP
    function claimable1(address) external view returns (uint256);

    /// @notice Returns the value of K in the Pool, based on its reserves.
    function getK() external returns (uint256);

    /// @notice Set pool name
    ///         Only callable by Voter.emergencyCouncil()
    /// @param __name String of new name
    function setName(string calldata __name) external;

    /// @notice Set pool symbol
    ///         Only callable by Voter.emergencyCouncil()
    /// @param __symbol String of new symbol
    function setSymbol(string calldata __symbol) external;

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

    /// @notice Get the value of the most recent observation
    function lastObservation() external view returns (Observation memory);

    /// @notice True if pool is stable, false if volatile
    function stable() external view returns (bool);

    /// @notice Produces the cumulative price using counterfactuals to save gas and avoid a call to sync.
    function currentCumulativePrices()
        external
        view
        returns (uint256 reserve0Cumulative, uint256 reserve1Cumulative, uint256 blockTimestamp);

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

    /// @notice Returns a memory set of TWAP prices
    ///         Same as calling sample(tokenIn, amountIn, points, 1)
    /// @param tokenIn .
    /// @param amountIn .
    /// @param points Number of points to return
    /// @return Array of TWAP prices
    function prices(address tokenIn, uint256 amountIn, uint256 points) external view returns (uint256[] memory);

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

    /// @notice This low-level function should be called from a contract which performs important safety checks
    /// @param amount0Out   Amount of token0 to send to `to`
    /// @param amount1Out   Amount of token1 to send to `to`
    /// @param to           Address to recieve the swapped output
    /// @param data         Additional calldata for flashloans
    function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external;

    /// @notice This low-level function should be called from a contract which performs important safety checks
    ///         standard uniswap v2 implementation
    /// @param to Address to receive token0 and token1 from burning the pool token
    /// @return amount0 Amount of token0 returned
    /// @return amount1 Amount of token1 returned
    function burn(address to) external returns (uint256 amount0, uint256 amount1);

    /// @notice This low-level function should be called by addLiquidity functions in Router.sol, which performs important safety checks
    ///         standard uniswap v2 implementation
    /// @param to           Address to receive the minted LP token
    /// @return liquidity   Amount of LP token minted
    function mint(address to) external returns (uint256 liquidity);

    /// @notice Update reserves and, on the first call per block, price accumulators
    /// @return _reserve0 .
    /// @return _reserve1 .
    /// @return _blockTimestampLast .
    function getReserves() external view returns (uint256 _reserve0, uint256 _reserve1, uint256 _blockTimestampLast);

    /// @notice Get the amount of tokenOut given the amount of tokenIn
    /// @param amountIn Amount of token in
    /// @param tokenIn  Address of token
    /// @return Amount out
    function getAmountOut(uint256 amountIn, address tokenIn) external view returns (uint256);

    /// @notice Force balances to match reserves
    /// @param to Address to receive any skimmed rewards
    function skim(address to) external;

    /// @notice Force reserves to match balances
    function sync() external;

    /// @notice Called on pool creation by PoolFactory
    /// @param _token0 Address of token0
    /// @param _token1 Address of token1
    /// @param _stable True if stable, false if volatile
    function initialize(address _token0, address _token1, bool _stable) external;
}

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

interface ILeafVoter {
    error NotAGauge();
    error ZeroAddress();
    error NotAuthorized();
    error GaugeAlreadyKilled();
    error GaugeAlreadyRevived();

    event GaugeCreated(
        address indexed poolFactory,
        address indexed votingRewardsFactory,
        address indexed gaugeFactory,
        address pool,
        address incentiveVotingReward,
        address feeVotingReward,
        address gauge
    );
    event GaugeKilled(address indexed gauge);
    event GaugeRevived(address indexed gauge);
    event WhitelistToken(address indexed token, bool indexed _bool);

    /// @notice Address of bridge contract used to forward x-chain messages
    function bridge() external view returns (address);

    /// @dev Pool => Gauge
    function gauges(address _pool) external view returns (address);

    /// @dev Gauge => Pool
    function poolForGauge(address _gauge) external view returns (address);

    /// @dev Gauge => Fees Voting Reward
    function gaugeToFees(address _gauge) external view returns (address);

    /// @dev Gauge => Incentives Voting Reward
    function gaugeToIncentive(address _gauge) external view returns (address);

    /// @notice Check if a given address is a gauge
    /// @param _gauge The address to be checked
    /// @return Whether the address is a gauge or not
    function isGauge(address _gauge) external view returns (bool);

    /// @notice Check if a given gauge is alive
    /// @param _gauge The address of the gauge to be checked
    /// @return Whether the gauge is alive or not
    function isAlive(address _gauge) external view returns (bool);

    /// @notice Returns the number of times a token has been whitelisted
    /// @param _token Address of token to view whitelist count
    /// @return Number of times token has been whitelisted
    function whitelistTokenCount(address _token) external view returns (uint256);

    /// @notice Get all Whitelisted Tokens approved by the Voter
    /// @return Array of Whitelisted Token addresses
    function whitelistedTokens() external view returns (address[] memory);

    /// @notice Paginated view of all Whitelisted Tokens
    /// @dev    Should not assume the last Token returned is at index matching given `_end`,
    ///         because if `_end` exceeds `length`, implementation defaults to `length`
    /// @param _start Index of first Token to be fetched
    /// @param _end End index for pagination
    /// @return _tokens Array of whitelisted tokens
    function whitelistedTokens(uint256 _start, uint256 _end) external view returns (address[] memory _tokens);

    /// @notice Check if a given token is whitelisted
    /// @param _token The address of the token to be checked
    /// @return Whether the token is whitelisted or not
    function isWhitelistedToken(address _token) external view returns (bool);

    /// @notice Get the length of the whitelistedTokens array
    function whitelistedTokensLength() external view returns (uint256);

    /// @notice Create a new gauge
    /// @dev Only callable by Message Bridge
    /// @param _poolFactory .
    /// @param _pool .
    /// @param _votingRewardsFactory .
    /// @param _gaugeFactory .
    function createGauge(address _poolFactory, address _pool, address _votingRewardsFactory, address _gaugeFactory)
        external
        returns (address _gauge);

    /// @notice Kills a gauge. The gauge will not receive any new emissions and cannot be deposited into.
    ///         Can still withdraw from gauge.
    /// @dev Only callable by Message Bridge
    ///      Throws if gauge already killed.
    /// @param _gauge .
    function killGauge(address _gauge) external;

    /// @notice Revives a killed gauge. Gauge will be able to receive emissions and deposits again.
    /// @dev Only callable by Message Bridge
    ///      Throws if gauge is not killed.
    /// @param _gauge .
    function reviveGauge(address _gauge) external;

    /// @notice Claim emissions from gauges.
    /// @param _gauges Array of gauges to collect emissions from.
    function claimRewards(address[] memory _gauges) external;
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19 <0.9.0;

library VelodromeTimeLibrary {
    uint256 internal constant WEEK = 7 days;

    /// @dev Returns start of epoch based on current timestamp
    function epochStart(uint256 timestamp) internal pure returns (uint256) {
        unchecked {
            return timestamp - (timestamp % WEEK);
        }
    }

    /// @dev Returns start of next epoch / end of current epoch
    function epochNext(uint256 timestamp) internal pure returns (uint256) {
        unchecked {
            return timestamp - (timestamp % WEEK) + WEEK;
        }
    }

    /// @dev Returns start of voting window
    function epochVoteStart(uint256 timestamp) internal pure returns (uint256) {
        unchecked {
            return timestamp - (timestamp % WEEK) + 1 hours;
        }
    }

    /// @dev Returns end of voting window / beginning of unrestricted voting window
    function epochVoteEnd(uint256 timestamp) internal pure returns (uint256) {
        unchecked {
            return timestamp - (timestamp % WEEK) + WEEK - 1 hours;
        }
    }
}

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

interface ILeafMessageBridge {
    error ZeroAddress();

    event ModuleSet(address indexed _sender, address indexed _module);

    /// @notice Returns the address of the xERC20 token that is bridged by this contract
    function xerc20() external view returns (address);

    /// @notice Returns the address of the module contract that is allowed to send messages x-chain
    function module() external view returns (address);

    /// @notice Returns the address of the voter contract
    /// @dev Used to verify the sender of a message
    function voter() external view returns (address);

    /// @notice Sets the address of the module contract that is allowed to send messages x-chain
    /// @dev Module handles x-chain messages
    /// @param _module The address of the new module contract
    function setModule(address _module) external;
}

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

pragma solidity ^0.8.20;

/**
 * @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 v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) 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 FailedInnerCall();
        }
    }
}

Settings
{
  "remappings": [
    "@openzeppelin5/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/src/=lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "createX/=lib/createX/src/",
    "@nomad-xyz/=lib/ExcessivelySafeCall/",
    "@hyperlane/=node_modules/@hyperlane-xyz/",
    "@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
    "@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/",
    "ExcessivelySafeCall/=lib/ExcessivelySafeCall/src/",
    "forge-gas-snapshot/=lib/forge-gas-snapshot/src/",
    "openzeppelin/=lib/createX/lib/openzeppelin-contracts/contracts/",
    "solady/=lib/createX/lib/solady/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"address","name":"_feesVotingReward","type":"address"},{"internalType":"address","name":"_rewardToken","type":"address"},{"internalType":"address","name":"_voter","type":"address"},{"internalType":"address","name":"_bridge","type":"address"},{"internalType":"bool","name":"_isPool","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"NotAlive","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"NotModule","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"RewardRateTooHigh","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"inputs":[],"name":"ZeroRewardRate","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","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":"_sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ClaimRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"NotifyReward","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bridge","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","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":"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":"feesVotingReward","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isPool","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":[],"name":"left","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"notifyRewardWithoutClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"periodFinish","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewardRateByEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"voter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

0x61014060405234801561001157600080fd5b506040516118b93803806118b983398101604081905261003091610082565b60016000556001600160a01b0395861660805293851660c05291841660a052831660e052909116610100521515610120526100ff565b80516001600160a01b038116811461007d57600080fd5b919050565b60008060008060008060c0878903121561009b57600080fd5b6100a487610066565b95506100b260208801610066565b94506100c060408801610066565b93506100ce60608801610066565b92506100dc60808801610066565b915060a087015180151581146100f157600080fd5b809150509295509295509295565b60805160a05160c05160e05161010051610120516116f46101c5600039600081816103a70152610a180152600081816103de015281816105b1015261085d015260008181610270015281816106f20152610fe70152600081816101f801528181610baa01528181610bf501528181610c7b0152610cc601526000818161040e0152818161077b01528181610da901528181610e140152610eba0152600081816102d30152818161053e01528181610a4601528181610b08015261108d01526116f46000f3fe608060405234801561001057600080fd5b50600436106101a85760003560e01c806380faa57d116100f9578063cd3daf9d11610097578063e2e1c6db11610071578063e2e1c6db146103a2578063e78cea92146103d9578063ebe2b12b14610400578063f7c618c11461040957600080fd5b8063cd3daf9d1461037e578063dcdc18dc14610386578063df136d651461039957600080fd5b806394af5b63116100d357806394af5b631461032f578063b6b55f251461034f578063c00007b014610362578063c8f33c911461037557600080fd5b806380faa57d146102fe5780638b8763471461030657806393f1c4421461032657600080fd5b80633c6b16ab116101665780636e553f65116101405780636e553f651461029b57806370a08231146102ae57806372f702f3146102ce5780637b0a47ee146102f557600080fd5b80633c6b16ab1461025857806346c96aac1461026b5780634c02a21c1461029257600080fd5b80628cc262146101ad5780630700037d146101d35780630fe2f711146101f357806316e640481461023257806318160ddd1461023a5780632e1a7d4d14610243575b600080fd5b6101c06101bb366004611509565b610430565b6040519081526020015b60405180910390f35b6101c06101e1366004611509565b60086020526000908152604090205481565b61021a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101ca565b6101c06104ad565b6101c060055481565b610256610251366004611526565b6104e4565b005b610256610266366004611526565b6105a7565b61021a7f000000000000000000000000000000000000000000000000000000000000000081565b6101c0600b5481565b6102566102a936600461153f565b6106a0565b6101c06102bc366004611509565b60066020526000908152604090205481565b61021a7f000000000000000000000000000000000000000000000000000000000000000081565b6101c060025481565b6101c06106ae565b6101c0610314366004611509565b60076020526000908152604090205481565b6101c0600a5481565b6101c061033d366004611526565b60096020526000908152604090205481565b61025661035d366004611526565b6106c1565b610256610370366004611509565b6106cb565b6101c060035481565b6101c06107f1565b610256610394366004611526565b610853565b6101c060045481565b6103c97f000000000000000000000000000000000000000000000000000000000000000081565b60405190151581526020016101ca565b61021a7f000000000000000000000000000000000000000000000000000000000000000081565b6101c060015481565b61021a7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b0381166000908152600860209081526040808320546007909252822054670de0b6b3a7640000906104666107f1565b6104709190611585565b6001600160a01b0385166000908152600660205260409020546104939190611598565b61049d91906115af565b6104a791906115d1565b92915050565b600060015442106104be5750600090565b6000426001546104ce9190611585565b9050600254816104de9190611598565b91505090565b6104ec610938565b6104f533610962565b80600560008282546105079190611585565b9091555050336000908152600660205260408120805483929061052b908490611585565b9091555061056590506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836109af565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a26105a46001600055565b50565b6105af610938565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b86d52986040518163ffffffff1660e01b8152600401602060405180830381865afa15801561060d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063191906115e4565b6001600160a01b0316336001600160a01b03161461066257604051634dd0641d60e11b815260040160405180910390fd5b8060000361068357604051631f2a200560e01b815260040160405180910390fd5b61068b610a13565b505061069681610d71565b6105a46001600055565b6106aa8282610fa9565b5050565b60006106bc42600154611143565b905090565b6105a48133610fa9565b6106d3610938565b336001600160a01b038216148015906107155750336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614155b156107335760405163ea8e4eb560e01b815260040160405180910390fd5b61073c81610962565b6001600160a01b03811660009081526008602052604090205480156107e6576001600160a01b038083166000908152600860205260408120556107a2907f00000000000000000000000000000000000000000000000000000000000000001683836109af565b816001600160a01b03167f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc67826040516107dd91815260200190565b60405180910390a25b506105a46001600055565b6000600554600003610804575060045490565b600554670de0b6b3a764000060025460035461081e6106ae565b6108289190611585565b6108329190611598565b61083c9190611598565b61084691906115af565b6004546106bc91906115d1565b61085b610938565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b86d52986040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd91906115e4565b6001600160a01b0316336001600160a01b03161461090e57604051634dd0641d60e11b815260040160405180910390fd5b8060000361092f57604051631f2a200560e01b815260040160405180910390fd5b61069681610d71565b60026000540361095b57604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b61096a6107f1565b6004556109756106ae565b60035561098181610430565b6001600160a01b03909116600090815260086020908152604080832093909355600454600790915291902055565b6040516001600160a01b03838116602483015260448201839052610a0e91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061115b565b505050565b6000807f0000000000000000000000000000000000000000000000000000000000000000610a445750600091829150565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d294f0936040518163ffffffff1660e01b815260040160408051808303816000875af1158015610aa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac79190611601565b909250905081151580610ada5750600081115b15610d6d57600082600a54610aef91906115d1565b9050600082600b54610b0191906115d1565b90506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639d63848a6040518163ffffffff1660e01b81526004016040805180830381865afa158015610b63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b879190611625565b9150915062093a80841115610c56576000600a55610bcf6001600160a01b0383167f0000000000000000000000000000000000000000000000000000000000000000866111c3565b60405163b66503cf60e01b81526001600160a01b038381166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063b66503cf90604401600060405180830381600087803b158015610c3957600080fd5b505af1158015610c4d573d6000803e3d6000fd5b50505050610c5c565b600a8490555b62093a80831115610d27576000600b55610ca06001600160a01b0382167f0000000000000000000000000000000000000000000000000000000000000000856111c3565b60405163b66503cf60e01b81526001600160a01b038281166004830152602482018590527f0000000000000000000000000000000000000000000000000000000000000000169063b66503cf90604401600060405180830381600087803b158015610d0a57600080fd5b505af1158015610d1e573d6000803e3d6000fd5b50505050610d2d565b600b8390555b604080518781526020810187905233917fbc567d6cbad26368064baa0ab5a757be46aae4d70f707f9203d9d9b6c8ccbfa3910160405180910390a2505050505b9091565b610d796107f1565b6004556000610d914262093a80808206820301611585565b90506001544210610de357610dd16001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085611253565b610ddb81836115af565b600255610e57565b600042600154610df39190611585565b9050600060025482610e059190611598565b9050610e3c6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333087611253565b82610e4782866115d1565b610e5191906115af565b60025550505b60025460096000610e6d4262093a808106900390565b815260200190815260200160002081905550600254600003610ea2576040516307ced7af60e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2d9190611654565b9050610f3982826115af565b6002541115610f5b57604051633c6be1b360e01b815260040160405180910390fd5b426003819055610f6c9083906115d1565b60015560405183815233907f095667752957714306e1a6ad83495404412df6fdb932fca6dc849a7ee910d4c19060200160405180910390a2505050565b610fb1610938565b81600003610fd257604051631f2a200560e01b815260040160405180910390fd5b604051631703e5f960e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690631703e5f990602401602060405180830381865afa158015611036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105a919061166d565b611077576040516310f3d9c960e01b815260040160405180910390fd5b61108081610962565b6110b56001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085611253565b81600560008282546110c791906115d1565b90915550506001600160a01b038116600090815260066020526040812080548492906110f49084906115d1565b90915550506040518281526001600160a01b0382169033907f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f629060200160405180910390a36106aa6001600055565b60008183106111525781611154565b825b9392505050565b60006111706001600160a01b0384168361128c565b90508051600014158015611195575080806020019051810190611193919061166d565b155b15610a0e57604051635274afe760e01b81526001600160a01b03841660048201526024015b60405180910390fd5b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015611213573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112379190611654565b905061124d848461124885856115d1565b61129a565b50505050565b6040516001600160a01b03848116602483015283811660448301526064820183905261124d9186918216906323b872dd906084016109dc565b60606111548383600061132a565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526112eb84826113c7565b61124d576040516001600160a01b0384811660248301526000604483015261132091869182169063095ea7b3906064016109dc565b61124d848261115b565b60608147101561134f5760405163cd78605960e01b81523060048201526024016111ba565b600080856001600160a01b0316848660405161136b919061168f565b60006040518083038185875af1925050503d80600081146113a8576040519150601f19603f3d011682016040523d82523d6000602084013e6113ad565b606091505b50915091506113bd86838361146f565b9695505050505050565b6000806000846001600160a01b0316846040516113e4919061168f565b6000604051808303816000865af19150503d8060008114611421576040519150601f19603f3d011682016040523d82523d6000602084013e611426565b606091505b5091509150818015611450575080511580611450575080806020019051810190611450919061166d565b801561146657506000856001600160a01b03163b115b95945050505050565b6060826114845761147f826114cb565b611154565b815115801561149b57506001600160a01b0384163b155b156114c457604051639996b31560e01b81526001600160a01b03851660048201526024016111ba565b5080611154565b8051156114db5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b03811681146105a457600080fd5b60006020828403121561151b57600080fd5b8135611154816114f4565b60006020828403121561153857600080fd5b5035919050565b6000806040838503121561155257600080fd5b823591506020830135611564816114f4565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156104a7576104a761156f565b80820281158282048414176104a7576104a761156f565b6000826115cc57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156104a7576104a761156f565b6000602082840312156115f657600080fd5b8151611154816114f4565b6000806040838503121561161457600080fd5b505080516020909101519092909150565b6000806040838503121561163857600080fd5b8251611643816114f4565b6020840151909250611564816114f4565b60006020828403121561166657600080fd5b5051919050565b60006020828403121561167f57600080fd5b8151801515811461115457600080fd5b6000825160005b818110156116b05760208186018101518583015201611696565b50600092019182525091905056fea26469706673582212205db372a127289fa0b41418e440cce660876cad53a2c58cea91fc8dd7bff52f5564736f6c634300081b00330000000000000000000000009067fb6aefa1b3dbe64b0e290c17a19b050e3f15000000000000000000000000b837edcf60c1cb6df49111df7fd28611b33213450000000000000000000000007f9adfbd38b669f03d1d11000bc76b9aaea28a8100000000000000000000000097cdbce21b6fd0585d29e539b1b99dad328a1123000000000000000000000000f278761576f45472bdd721eaca19317ce159c0110000000000000000000000000000000000000000000000000000000000000001

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101a85760003560e01c806380faa57d116100f9578063cd3daf9d11610097578063e2e1c6db11610071578063e2e1c6db146103a2578063e78cea92146103d9578063ebe2b12b14610400578063f7c618c11461040957600080fd5b8063cd3daf9d1461037e578063dcdc18dc14610386578063df136d651461039957600080fd5b806394af5b63116100d357806394af5b631461032f578063b6b55f251461034f578063c00007b014610362578063c8f33c911461037557600080fd5b806380faa57d146102fe5780638b8763471461030657806393f1c4421461032657600080fd5b80633c6b16ab116101665780636e553f65116101405780636e553f651461029b57806370a08231146102ae57806372f702f3146102ce5780637b0a47ee146102f557600080fd5b80633c6b16ab1461025857806346c96aac1461026b5780634c02a21c1461029257600080fd5b80628cc262146101ad5780630700037d146101d35780630fe2f711146101f357806316e640481461023257806318160ddd1461023a5780632e1a7d4d14610243575b600080fd5b6101c06101bb366004611509565b610430565b6040519081526020015b60405180910390f35b6101c06101e1366004611509565b60086020526000908152604090205481565b61021a7f000000000000000000000000b837edcf60c1cb6df49111df7fd28611b332134581565b6040516001600160a01b0390911681526020016101ca565b6101c06104ad565b6101c060055481565b610256610251366004611526565b6104e4565b005b610256610266366004611526565b6105a7565b61021a7f00000000000000000000000097cdbce21b6fd0585d29e539b1b99dad328a112381565b6101c0600b5481565b6102566102a936600461153f565b6106a0565b6101c06102bc366004611509565b60066020526000908152604090205481565b61021a7f0000000000000000000000009067fb6aefa1b3dbe64b0e290c17a19b050e3f1581565b6101c060025481565b6101c06106ae565b6101c0610314366004611509565b60076020526000908152604090205481565b6101c0600a5481565b6101c061033d366004611526565b60096020526000908152604090205481565b61025661035d366004611526565b6106c1565b610256610370366004611509565b6106cb565b6101c060035481565b6101c06107f1565b610256610394366004611526565b610853565b6101c060045481565b6103c97f000000000000000000000000000000000000000000000000000000000000000181565b60405190151581526020016101ca565b61021a7f000000000000000000000000f278761576f45472bdd721eaca19317ce159c01181565b6101c060015481565b61021a7f0000000000000000000000007f9adfbd38b669f03d1d11000bc76b9aaea28a8181565b6001600160a01b0381166000908152600860209081526040808320546007909252822054670de0b6b3a7640000906104666107f1565b6104709190611585565b6001600160a01b0385166000908152600660205260409020546104939190611598565b61049d91906115af565b6104a791906115d1565b92915050565b600060015442106104be5750600090565b6000426001546104ce9190611585565b9050600254816104de9190611598565b91505090565b6104ec610938565b6104f533610962565b80600560008282546105079190611585565b9091555050336000908152600660205260408120805483929061052b908490611585565b9091555061056590506001600160a01b037f0000000000000000000000009067fb6aefa1b3dbe64b0e290c17a19b050e3f151633836109af565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a26105a46001600055565b50565b6105af610938565b7f000000000000000000000000f278761576f45472bdd721eaca19317ce159c0116001600160a01b031663b86d52986040518163ffffffff1660e01b8152600401602060405180830381865afa15801561060d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063191906115e4565b6001600160a01b0316336001600160a01b03161461066257604051634dd0641d60e11b815260040160405180910390fd5b8060000361068357604051631f2a200560e01b815260040160405180910390fd5b61068b610a13565b505061069681610d71565b6105a46001600055565b6106aa8282610fa9565b5050565b60006106bc42600154611143565b905090565b6105a48133610fa9565b6106d3610938565b336001600160a01b038216148015906107155750336001600160a01b037f00000000000000000000000097cdbce21b6fd0585d29e539b1b99dad328a11231614155b156107335760405163ea8e4eb560e01b815260040160405180910390fd5b61073c81610962565b6001600160a01b03811660009081526008602052604090205480156107e6576001600160a01b038083166000908152600860205260408120556107a2907f0000000000000000000000007f9adfbd38b669f03d1d11000bc76b9aaea28a811683836109af565b816001600160a01b03167f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc67826040516107dd91815260200190565b60405180910390a25b506105a46001600055565b6000600554600003610804575060045490565b600554670de0b6b3a764000060025460035461081e6106ae565b6108289190611585565b6108329190611598565b61083c9190611598565b61084691906115af565b6004546106bc91906115d1565b61085b610938565b7f000000000000000000000000f278761576f45472bdd721eaca19317ce159c0116001600160a01b031663b86d52986040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108dd91906115e4565b6001600160a01b0316336001600160a01b03161461090e57604051634dd0641d60e11b815260040160405180910390fd5b8060000361092f57604051631f2a200560e01b815260040160405180910390fd5b61069681610d71565b60026000540361095b57604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b61096a6107f1565b6004556109756106ae565b60035561098181610430565b6001600160a01b03909116600090815260086020908152604080832093909355600454600790915291902055565b6040516001600160a01b03838116602483015260448201839052610a0e91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061115b565b505050565b6000807f0000000000000000000000000000000000000000000000000000000000000001610a445750600091829150565b7f0000000000000000000000009067fb6aefa1b3dbe64b0e290c17a19b050e3f156001600160a01b031663d294f0936040518163ffffffff1660e01b815260040160408051808303816000875af1158015610aa3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac79190611601565b909250905081151580610ada5750600081115b15610d6d57600082600a54610aef91906115d1565b9050600082600b54610b0191906115d1565b90506000807f0000000000000000000000009067fb6aefa1b3dbe64b0e290c17a19b050e3f156001600160a01b0316639d63848a6040518163ffffffff1660e01b81526004016040805180830381865afa158015610b63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b879190611625565b9150915062093a80841115610c56576000600a55610bcf6001600160a01b0383167f000000000000000000000000b837edcf60c1cb6df49111df7fd28611b3321345866111c3565b60405163b66503cf60e01b81526001600160a01b038381166004830152602482018690527f000000000000000000000000b837edcf60c1cb6df49111df7fd28611b3321345169063b66503cf90604401600060405180830381600087803b158015610c3957600080fd5b505af1158015610c4d573d6000803e3d6000fd5b50505050610c5c565b600a8490555b62093a80831115610d27576000600b55610ca06001600160a01b0382167f000000000000000000000000b837edcf60c1cb6df49111df7fd28611b3321345856111c3565b60405163b66503cf60e01b81526001600160a01b038281166004830152602482018590527f000000000000000000000000b837edcf60c1cb6df49111df7fd28611b3321345169063b66503cf90604401600060405180830381600087803b158015610d0a57600080fd5b505af1158015610d1e573d6000803e3d6000fd5b50505050610d2d565b600b8390555b604080518781526020810187905233917fbc567d6cbad26368064baa0ab5a757be46aae4d70f707f9203d9d9b6c8ccbfa3910160405180910390a2505050505b9091565b610d796107f1565b6004556000610d914262093a80808206820301611585565b90506001544210610de357610dd16001600160a01b037f0000000000000000000000007f9adfbd38b669f03d1d11000bc76b9aaea28a8116333085611253565b610ddb81836115af565b600255610e57565b600042600154610df39190611585565b9050600060025482610e059190611598565b9050610e3c6001600160a01b037f0000000000000000000000007f9adfbd38b669f03d1d11000bc76b9aaea28a8116333087611253565b82610e4782866115d1565b610e5191906115af565b60025550505b60025460096000610e6d4262093a808106900390565b815260200190815260200160002081905550600254600003610ea2576040516307ced7af60e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000907f0000000000000000000000007f9adfbd38b669f03d1d11000bc76b9aaea28a816001600160a01b0316906370a0823190602401602060405180830381865afa158015610f09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2d9190611654565b9050610f3982826115af565b6002541115610f5b57604051633c6be1b360e01b815260040160405180910390fd5b426003819055610f6c9083906115d1565b60015560405183815233907f095667752957714306e1a6ad83495404412df6fdb932fca6dc849a7ee910d4c19060200160405180910390a2505050565b610fb1610938565b81600003610fd257604051631f2a200560e01b815260040160405180910390fd5b604051631703e5f960e01b81523060048201527f00000000000000000000000097cdbce21b6fd0585d29e539b1b99dad328a11236001600160a01b031690631703e5f990602401602060405180830381865afa158015611036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105a919061166d565b611077576040516310f3d9c960e01b815260040160405180910390fd5b61108081610962565b6110b56001600160a01b037f0000000000000000000000009067fb6aefa1b3dbe64b0e290c17a19b050e3f1516333085611253565b81600560008282546110c791906115d1565b90915550506001600160a01b038116600090815260066020526040812080548492906110f49084906115d1565b90915550506040518281526001600160a01b0382169033907f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f629060200160405180910390a36106aa6001600055565b60008183106111525781611154565b825b9392505050565b60006111706001600160a01b0384168361128c565b90508051600014158015611195575080806020019051810190611193919061166d565b155b15610a0e57604051635274afe760e01b81526001600160a01b03841660048201526024015b60405180910390fd5b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015611213573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112379190611654565b905061124d848461124885856115d1565b61129a565b50505050565b6040516001600160a01b03848116602483015283811660448301526064820183905261124d9186918216906323b872dd906084016109dc565b60606111548383600061132a565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663095ea7b360e01b1790526112eb84826113c7565b61124d576040516001600160a01b0384811660248301526000604483015261132091869182169063095ea7b3906064016109dc565b61124d848261115b565b60608147101561134f5760405163cd78605960e01b81523060048201526024016111ba565b600080856001600160a01b0316848660405161136b919061168f565b60006040518083038185875af1925050503d80600081146113a8576040519150601f19603f3d011682016040523d82523d6000602084013e6113ad565b606091505b50915091506113bd86838361146f565b9695505050505050565b6000806000846001600160a01b0316846040516113e4919061168f565b6000604051808303816000865af19150503d8060008114611421576040519150601f19603f3d011682016040523d82523d6000602084013e611426565b606091505b5091509150818015611450575080511580611450575080806020019051810190611450919061166d565b801561146657506000856001600160a01b03163b115b95945050505050565b6060826114845761147f826114cb565b611154565b815115801561149b57506001600160a01b0384163b155b156114c457604051639996b31560e01b81526001600160a01b03851660048201526024016111ba565b5080611154565b8051156114db5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b03811681146105a457600080fd5b60006020828403121561151b57600080fd5b8135611154816114f4565b60006020828403121561153857600080fd5b5035919050565b6000806040838503121561155257600080fd5b823591506020830135611564816114f4565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156104a7576104a761156f565b80820281158282048414176104a7576104a761156f565b6000826115cc57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156104a7576104a761156f565b6000602082840312156115f657600080fd5b8151611154816114f4565b6000806040838503121561161457600080fd5b505080516020909101519092909150565b6000806040838503121561163857600080fd5b8251611643816114f4565b6020840151909250611564816114f4565b60006020828403121561166657600080fd5b5051919050565b60006020828403121561167f57600080fd5b8151801515811461115457600080fd5b6000825160005b818110156116b05760208186018101518583015201611696565b50600092019182525091905056fea26469706673582212205db372a127289fa0b41418e440cce660876cad53a2c58cea91fc8dd7bff52f5564736f6c634300081b0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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.