S Price: $0.38441 (-16.15%)

Contract

0xc8c5172879f0b7E88cc03ca20835dbE9e283386e

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

3 Internal Transactions found.

Latest 3 internal transactions

Parent Transaction Hash Block From To
61788702025-02-01 22:02:2929 hrs ago1738447349
0xc8c51728...9e283386e
 Contract Creation0 S
51827682025-01-23 21:52:1810 days ago1737669138
0xc8c51728...9e283386e
 Contract Creation0 S
23361322025-01-03 8:26:3330 days ago1735892793
0xc8c51728...9e283386e
 Contract Creation0 S
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BribeFactory

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 10000 runs

Other Settings:
paris EvmVersion
File 1 of 6 : BribeFactory.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {Bribe} from "./Bribe.sol";

contract BribeFactory {
    address public last_bribe;

    function createBribe() external returns (address) {
        last_bribe = address(new Bribe(msg.sender));
        return last_bribe;
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 4 of 6 : Bribe.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IVotingEscrow} from "./interfaces/IVotingEscrow.sol";
import {IVoter} from "./interfaces/IVoter.sol";

// Bribes pay out rewards for a given pool based on the votes that were received from the user (goes hand in hand with BaseV1Gauges.vote())
contract Bribe {

    address public immutable voter; // only voter can modify balances (since it only happens on vote())
    address public immutable _ve;

    uint public constant DURATION = 7 days; // rewards are released over 7 days
    uint public constant PRECISION = 10 ** 18;
    uint public constant MAX_REWARD_TOKENS = 16; // max number of reward tokens that can be added

    uint public totalSupply;
    mapping(uint => uint) public balanceOf;
    mapping(address => mapping(uint => uint)) public tokenRewardsPerEpoch;
    mapping(address => uint) public periodFinish;
    mapping(address => mapping(uint => uint)) public lastEarn;

    address[] public rewards;
    mapping(address => bool) public isReward;

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

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

    /// @notice A record of balance checkpoints for each account, by index
    mapping (uint => mapping (uint => Checkpoint)) public checkpoints;
    /// @notice The number of checkpoints for each account
    mapping (uint => uint) public numCheckpoints;
    /// @notice A record of balance checkpoints for each token, by index
    mapping (uint => SupplyCheckpoint) public supplyCheckpoints;
    /// @notice The number of checkpoints
    uint public supplyNumCheckpoints;

    event Deposit(address indexed from, uint tokenId, uint amount);
    event Withdraw(address indexed from, uint tokenId, uint amount);
    event NotifyReward(address indexed from, address indexed reward, uint epoch, uint amount);
    event ClaimRewards(address indexed from, address indexed reward, uint amount);

    constructor(address _voter) {
        voter = _voter;
        _ve = IVoter(_voter)._ve();
    }

    // simple re-entrancy check
    uint internal _unlocked = 1;
    modifier lock() {
        require(_unlocked == 1);
        _unlocked = 2;
        _;
        _unlocked = 1;
    }

    function _bribeStart(uint timestamp) internal pure returns (uint) {
        return timestamp - (timestamp % (7 days));
    }

    function getEpochStart(uint timestamp) public pure returns (uint) {
        uint bribeStart = _bribeStart(timestamp);
        uint bribeEnd = bribeStart + DURATION;
        return timestamp < bribeEnd ? bribeStart : bribeStart + 7 days;
    }

    /**
    * @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(uint tokenId, uint timestamp) public view returns (uint) {
        uint nCheckpoints = numCheckpoints[tokenId];
        if (nCheckpoints == 0) {
            return 0;
        }

        // First check most recent balance
        if (checkpoints[tokenId][nCheckpoints - 1].timestamp <= timestamp) {
            return (nCheckpoints - 1);
        }

        // Next check implicit zero balance
        if (checkpoints[tokenId][0].timestamp > timestamp) {
            return 0;
        }

        uint lower = 0;
        uint upper = nCheckpoints - 1;
        while (upper > lower) {
            uint center = upper - (upper - lower) / 2; // ceil, avoiding overflow
            Checkpoint memory cp = checkpoints[tokenId][center];
            if (cp.timestamp == timestamp) {
                return center;
            } else if (cp.timestamp < timestamp) {
                lower = center;
            } else {
                upper = center - 1;
            }
        }
        return lower;
    }

    function getPriorSupplyIndex(uint timestamp) public view returns (uint) {
        uint nCheckpoints = supplyNumCheckpoints;
        if (nCheckpoints == 0) {
            return 0;
        }

        // First check most recent balance
        if (supplyCheckpoints[nCheckpoints - 1].timestamp <= timestamp) {
            return (nCheckpoints - 1);
        }

        // Next check implicit zero balance
        if (supplyCheckpoints[0].timestamp > timestamp) {
            return 0;
        }

        uint lower = 0;
        uint upper = nCheckpoints - 1;
        while (upper > lower) {
            uint center = upper - (upper - lower) / 2; // ceil, avoiding overflow
            SupplyCheckpoint memory cp = supplyCheckpoints[center];
            if (cp.timestamp == timestamp) {
                return center;
            } else if (cp.timestamp < timestamp) {
                lower = center;
            } else {
                upper = center - 1;
            }
        }
        return lower;
    }

    function _writeCheckpoint(uint tokenId, uint balance) internal {
        uint _timestamp = block.timestamp;
        uint _nCheckPoints = numCheckpoints[tokenId];

        if (_nCheckPoints > 0 && checkpoints[tokenId][_nCheckPoints - 1].timestamp == _timestamp) {
            checkpoints[tokenId][_nCheckPoints - 1].balanceOf = balance;
        } else {
            checkpoints[tokenId][_nCheckPoints] = Checkpoint(_timestamp, balance);
            numCheckpoints[tokenId] = _nCheckPoints + 1;
        }
    }

    function _writeSupplyCheckpoint() internal {
        uint _nCheckPoints = supplyNumCheckpoints;
        uint _timestamp = block.timestamp;

        if (_nCheckPoints > 0 && supplyCheckpoints[_nCheckPoints - 1].timestamp == _timestamp) {
            supplyCheckpoints[_nCheckPoints - 1].supply = totalSupply;
        } else {
            supplyCheckpoints[_nCheckPoints] = SupplyCheckpoint(_timestamp, totalSupply);
            supplyNumCheckpoints = _nCheckPoints + 1;
        }
    }

    function rewardsListLength() external view returns (uint) {
        return rewards.length;
    }

    // returns the last time the reward was modified or periodFinish if the reward has ended
    function lastTimeRewardApplicable(address token) public view returns (uint) {
        return Math.min(block.timestamp, periodFinish[token]);
    }

    // allows a user to claim rewards for a given token
    function getReward(uint tokenId, address[] memory tokens) external lock  {
        require(IVotingEscrow(_ve).isApprovedOrOwner(msg.sender, tokenId));
        for (uint i = 0; i < tokens.length; i++) {
            uint _reward = earned(tokens[i], tokenId);
            lastEarn[tokens[i]][tokenId] = block.timestamp;
            if (_reward > 0) _safeTransfer(tokens[i], msg.sender, _reward);

            emit ClaimRewards(msg.sender, tokens[i], _reward);
        }
    }

    // used by Voter to allow batched reward claims
    function getRewardForOwner(uint tokenId, address[] memory tokens) external lock  {
        require(msg.sender == voter);
        address _owner = IVotingEscrow(_ve).ownerOf(tokenId);
        for (uint i = 0; i < tokens.length; i++) {
            uint _reward = earned(tokens[i], tokenId);
            lastEarn[tokens[i]][tokenId] = block.timestamp;
            if (_reward > 0) _safeTransfer(tokens[i], _owner, _reward);

            emit ClaimRewards(_owner, tokens[i], _reward);
        }
    }

    function earned(address token, uint tokenId) public view returns (uint) {
        if (numCheckpoints[tokenId] == 0) {
            return 0;
        }

        uint reward = 0;
        uint _ts = 0;
        uint _bal = 0;
        uint _supply = 1;
        uint _index = 0;
        uint _currTs = _bribeStart(lastEarn[token][tokenId]); // take epoch last claimed in as starting point

        _index = getPriorBalanceIndex(tokenId, _currTs);
        _ts = checkpoints[tokenId][_index].timestamp;
        _bal = checkpoints[tokenId][_index].balanceOf;
        // accounts for case where lastEarn is before first checkpoint
        _currTs = Math.max(_currTs, _bribeStart(_ts));

        // get epochs between current epoch and first checkpoint in same epoch as last claim
        uint numEpochs = (_bribeStart(block.timestamp) - _currTs) / DURATION;

        if (numEpochs > 0) {
            for (uint256 i = 0; i < numEpochs; i++) {
                // get index of last checkpoint in this epoch
                _index = getPriorBalanceIndex(tokenId, _currTs + DURATION);
                // get checkpoint in this epoch
                _ts = checkpoints[tokenId][_index].timestamp;
                _bal = checkpoints[tokenId][_index].balanceOf;
                // get supply of last checkpoint in this epoch
                _supply = supplyCheckpoints[getPriorSupplyIndex(_currTs + DURATION)].supply;
                if( _supply > 0 ) // prevent div by 0
                    reward += _bal * tokenRewardsPerEpoch[token][_currTs] / _supply;
                _currTs += DURATION;
            }
        }

        return reward;
    }

    // This is an external function, but internal notation is used since it can only be called "internally" from Gauges
    function _deposit(uint amount, uint tokenId) external {
        require(msg.sender == voter);

        totalSupply += amount;
        balanceOf[tokenId] += amount;

        _writeCheckpoint(tokenId, balanceOf[tokenId]);
        _writeSupplyCheckpoint();

        emit Deposit(msg.sender, tokenId, amount);
    }

    function _withdraw(uint amount, uint tokenId) external {
        require(msg.sender == voter);

        totalSupply -= amount;
        balanceOf[tokenId] -= amount;

        _writeCheckpoint(tokenId, balanceOf[tokenId]);
        _writeSupplyCheckpoint();

        emit Withdraw(msg.sender, tokenId, amount);
    }

    function left(address token) external view returns (uint) {
        uint adjustedTstamp = getEpochStart(block.timestamp);
        return tokenRewardsPerEpoch[token][adjustedTstamp];
    }

    function notifyRewardAmount(address token, uint amount) external lock {
        require(amount > 0, "invalid amount");
        if (!isReward[token]) {
          require(IVoter(voter).isWhitelisted(token), "bribe tokens must be whitelisted");
          require(rewards.length < MAX_REWARD_TOKENS, "too many rewards tokens");
          isReward[token] = true;
          rewards.push(token);
        }
        
        // bribes kick in at the start of next bribe period
        uint adjustedTstamp = getEpochStart(block.timestamp);
        uint epochRewards = tokenRewardsPerEpoch[token][adjustedTstamp];

        _safeTransferFrom(token, msg.sender, address(this), amount);
        tokenRewardsPerEpoch[token][adjustedTstamp] = epochRewards + amount;

        periodFinish[token] = adjustedTstamp + DURATION;

        emit NotifyReward(msg.sender, token, adjustedTstamp, amount);
    }

    function swapOutRewardToken(uint i, address oldToken, address newToken) external {
        require(msg.sender == IVoter(voter).admin(), 'only voter admin');
        require(rewards[i] == oldToken);
        isReward[oldToken] = false;
        isReward[newToken] = true;
        rewards[i] = newToken;
    }

    function _safeTransfer(address token, address to, uint256 value) internal {
        require(token.code.length > 0);
        (bool success, bytes memory data) =
        token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))));
    }

    function _safeTransferFrom(address token, address from, address to, uint256 value) internal {
        require(token.code.length > 0);
        (bool success, bytes memory data) =
        token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))));
    }
}

File 5 of 6 : IVoter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

interface IVoter {

    function attachTokenToGauge(uint tokenId, address account) external;
    function detachTokenFromGauge(uint tokenId, address account) external;
    function emitDeposit(uint tokenId, address account, uint amount) external;
    function emitWithdraw(uint tokenId, address account, uint amount) external;
    function notifyRewardAmount(uint amount) external;
    function _ve() external view returns (address);
    function createGauge(address _pair) external returns (address);
    function factory() external view returns (address);
    function whitelistingFee() external view returns (uint256);
    function setWhitelistingFee(uint256 _fee) external;
    function whitelist(address _token) external;
    function isWhitelisted(address _token) external view returns (bool);
    function delist(address _token) external;
    function bribeFactory() external view returns (address);
    function bribes(address gauge) external view returns (address);
    function gauges(address pair) external view returns (address);
    function isGauge(address gauge) external view returns (bool);
    function allGauges(uint index) external view returns (address);
    function vote(uint tokenId, address[] calldata gaugeVote, uint[] calldata weights) external;
    function gaugeVote(uint tokenId) external view returns (address[] memory);
    function votes(uint tokenId, address gauge) external view returns (uint);
    function weights(address gauge) external view returns (uint);
    function usedWeights(uint tokenId) external view returns (uint);
    function claimable(address gauge) external view returns (uint);
    function totalWeight() external view returns (uint);
    function reset(uint _tokenId) external;
    function claimFees(address[] memory _fees, address[][] memory _tokens, uint _tokenId) external;
    function claimBribes(address[] memory _bribes, address[][] memory _tokens, uint _tokenId) external;
    function distributeFees(address[] memory _gauges) external;
    function updateGauge(address _gauge) external;
    function poke(uint _tokenId) external;
    function initialize(address[] memory _tokens, address _minter) external;
    function minter() external view returns (address);
    function admin() external view returns (address);
    function feeManagers(address feeManager) external view returns (bool);
    function claimRewards(address[] memory _gauges, address[][] memory _tokens) external;
    function isReward(address gauge, address token) external view returns (bool);
    function isBribe(address bribe, address token) external view returns (bool);
    function isLive(address gauge) external view returns (bool);
    function setBribe(address _bribe, address _token, bool _status) external;
    function setReward(address _gauge, address _token, bool _status) external;
    function killGauge(address _gauge) external;
    function reviveGauge(address _gauge) external;
    function distroFees() external;
    function distro() external;
    function distribute(address _gauge) external;
    function distributeRange(uint start, uint finish) external;
    function distributeGauges(address[] memory _gauges) external;
}

File 6 of 6 : IVotingEscrow.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

interface IVotingEscrow {

    struct Point {
        int128 bias;
        int128 slope; // # -dweight / dt
        uint256 ts;
        uint256 blk; // block
    }

    function user_point_epoch(uint tokenId) external view returns (uint);
    function epoch() external view returns (uint);
    function user_point_history(uint tokenId, uint loc) external view returns (Point memory);
    function point_history(uint loc) external view returns (Point memory);
    function checkpoint() external;
    function deposit_for(uint tokenId, uint value) external;
    function token() external view returns (address);
    function user_point_history__ts(uint tokenId, uint idx) external view returns (uint);
    function locked__end(uint _tokenId) external view returns (uint);
    function locked__amount(uint _tokenId) external view returns (uint);
    function approve(address spender, uint tokenId) external;
    function balanceOfNFT(uint) external view returns (uint);
    function isApprovedOrOwner(address, uint) external view returns (bool);
    function ownerOf(uint) external view returns (address);
    function transferFrom(address, address, uint) external;
    function totalSupply() external view returns (uint);
    function supply() external view returns (uint);
    function create_lock_for(uint, uint, address) external returns (uint);
    function lockVote(uint tokenId) external;
    function isVoteExpired(uint tokenId) external view returns (bool);
    function voteExpiry(uint _tokenId) external view returns (uint);
    function attach(uint tokenId) external;
    function detach(uint tokenId) external;
    function voting(uint tokenId) external;
    function abstain(uint tokenId) external;
    function voted(uint tokenId) external view returns (bool);
    function withdraw(uint tokenId) external;
    function create_lock(uint value, uint duration) external returns (uint);
    function setVoter(address voter) external;
    function balanceOf(address owner) external view returns (uint);
    function safeTransferFrom(address from, address to, uint tokenId) external;
    function burn(uint _tokenId) external;
    function setAdmin(address _admin) external;
    function setArtProxy(address _proxy) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"name":"createBribe","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"last_bribe","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506120cc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063b1d0fc821461003b578063d27b9a7814610084575b600080fd5b60005461005b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61005b60003360405161009690610119565b73ffffffffffffffffffffffffffffffffffffffff9091168152602001604051809103906000f0801580156100cf573d6000803e3d6000fd5b50600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169182179055919050565b611f70806101278339019056fe60c06040526001600b553480156200001657600080fd5b5060405162001f7038038062001f708339810160408190526200003991620000bd565b6001600160a01b038116608081905260408051638dd598fb60e01b81529051638dd598fb916004808201926020929091908290030181865afa15801562000084573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000aa9190620000bd565b6001600160a01b031660a05250620000ef565b600060208284031215620000d057600080fd5b81516001600160a01b0381168114620000e857600080fd5b9392505050565b60805160a051611e2a620001466000396000818161033901528181610d87015261147c0152600081816102250152818161085601528181610af501528181610d2b0152818161103c01526113760152611e2a6000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c806399bcc05211610104578063da09d19d116100a2578063f301af4211610071578063f301af4214610485578063f320772314610498578063f5f8d365146104ab578063f7412baf146104be57600080fd5b8063da09d19d14610429578063e688639614610449578063e8111a1214610451578063f25e55a51461045a57600080fd5b8063a28d4c9c116100de578063a28d4c9c146103e1578063a7852afa146103f4578063aaf5eb6814610407578063b66503cf1461041657600080fd5b806399bcc0521461039b5780639cc7f708146103ae5780639e2bf22c146103ce57600080fd5b8063505897931161017157806376f4be361161014b57806376f4be36146103215780638dd598fb1461033457806392777b291461035b5780639418f9391461038657600080fd5b806350589793146102e65780635d0cde9714610306578063638634ee1461030e57600080fd5b80633e491d47116101ad5780633e491d471461020d57806346c96aac1461022057806349dcc2041461026c5780634d5ce038146102b357600080fd5b80630175e23b146101d457806318160ddd146101fa5780631be0528914610203575b600080fd5b6101e76101e2366004611a7b565b6104e5565b6040519081526020015b60405180910390f35b6101e760005481565b6101e762093a8081565b6101e761021b366004611ac9565b610527565b6102477f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101f1565b61029e61027a366004611af5565b60076020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101f1565b6102d66102c1366004611b17565b60066020526000908152604090205460ff1681565b60405190151581526020016101f1565b6101e76102f4366004611a7b565b60086020526000908152604090205481565b6101e7601081565b6101e761031c366004611b17565b6106ef565b6101e761032f366004611a7b565b610720565b6102477f000000000000000000000000000000000000000000000000000000000000000081565b6101e7610369366004611ac9565b600260209081526000928352604080842090915290825290205481565b610399610394366004611b34565b610854565b005b6101e76103a9366004611b17565b610a97565b6101e76103bc366004611a7b565b60016020526000908152604090205481565b6103996103dc366004611af5565b610add565b6101e76103ef366004611af5565b610bba565b610399610402366004611ba5565b610cff565b6101e7670de0b6b3a764000081565b610399610424366004611ac9565b610f4f565b6101e7610437366004611b17565b60036020526000908152604090205481565b6005546101e7565b6101e7600a5481565b6101e7610468366004611ac9565b600460209081526000928352604080842090915290825290205481565b610247610493366004611a7b565b611327565b6103996104a6366004611af5565b61135e565b6103996104b9366004611ba5565b611433565b61029e6104cc366004611a7b565b6009602052600090815260409020805460019091015482565b6000806104f18361164a565b9050600061050262093a8083611cc3565b905080841061051d576105188262093a80611cc3565b61051f565b815b949350505050565b6000818152600860205260408120548103610544575060006106e9565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260046020908152604080832085845290915281205481908190600190829081906105899061164a565b90506105958882610bba565b600089815260076020908152604080832084845290915290208054600190910154909650945091506105cf816105ca8761164a565b611663565b9050600062093a80826105e14261164a565b6105eb9190611cd6565b6105f59190611d18565b905080156106df5760005b818110156106dd576106198a6103ef62093a8086611cc3565b60008b815260076020908152604080832084845290915281208054600190910154909950975090945060099061065561032f62093a8087611cc3565b815260200190815260200160002060010154945060008511156106c65773ffffffffffffffffffffffffffffffffffffffff8b16600090815260026020908152604080832086845290915290205485906106af9088611d2c565b6106b99190611d18565b6106c39089611cc3565b97505b6106d362093a8084611cc3565b9250600101610600565b505b5094955050505050505b92915050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120546106e9904290611679565b600a546000908082036107365750600092915050565b8260096000610746600185611cd6565b8152602001908152602001600020600001541161076f57610768600182611cd6565b9392505050565b6000805260096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b548310156107aa5750600092915050565b6000806107b8600184611cd6565b90505b8181111561084c57600060026107d18484611cd6565b6107db9190611d18565b6107e59083611cd6565b600081815260096020908152604091829020825180840190935280548084526001909101549183019190915291925090879003610826575095945050505050565b805187111561083757819350610845565b610842600183611cd6565b92505b50506107bb565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e39190611d43565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461097c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6f6e6c7920766f7465722061646d696e0000000000000000000000000000000060448201526064015b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600584815481106109a6576109a6611d60565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16146109d257600080fd5b73ffffffffffffffffffffffffffffffffffffffff80831660009081526006602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090811690915592841682529020805490911660011790556005805482919085908110610a4a57610a4a611d60565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b600080610aa3426104e5565b73ffffffffffffffffffffffffffffffffffffffff9093166000908152600260209081526040808320958352949052929092205492915050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610b1f57600080fd5b81600080828254610b309190611cd6565b909155505060008181526001602052604081208054849290610b53908490611cd6565b9091555050600081815260016020526040902054610b72908290611688565b610b7a611761565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a25050565b600082815260086020526040812054808203610bda5760009150506106e9565b60008481526007602052604081208491610bf5600185611cd6565b81526020019081526020016000206000015411610c1f57610c17600182611cd6565b9150506106e9565b6000848152600760209081526040808320838052909152902054831015610c4a5760009150506106e9565b600080610c58600184611cd6565b90505b81811115610cf65760006002610c718484611cd6565b610c7b9190611d18565b610c859083611cd6565b6000888152600760209081526040808320848452825291829020825180840190935280548084526001909101549183019190915291925090879003610cd0575093506106e992505050565b8051871115610ce157819350610cef565b610cec600183611cd6565b92505b5050610c5b565b50949350505050565b600b54600114610d0e57600080fd5b6002600b553373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610d5557600080fd5b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018390526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015610de3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e079190611d43565b905060005b8251811015610f44576000610e3a848381518110610e2c57610e2c611d60565b602002602001015186610527565b90504260046000868581518110610e5357610e53611d60565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281810192909252604090810160009081208982529092529020558015610ebb57610ebb848381518110610eac57610eac611d60565b60200260200101518483611804565b838281518110610ecd57610ecd611d60565b602002602001015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc983604051610f3391815260200190565b60405180910390a350600101610e0c565b50506001600b555050565b600b54600114610f5e57600080fd5b6002600b5580610fca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f696e76616c696420616d6f756e740000000000000000000000000000000000006044820152606401610973565b73ffffffffffffffffffffffffffffffffffffffff821660009081526006602052604090205460ff16611222576040517f3af32abf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f00000000000000000000000000000000000000000000000000000000000000001690633af32abf90602401602060405180830381865afa158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190611d8f565b61110d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f627269626520746f6b656e73206d7573742062652077686974656c69737465646044820152606401610973565b600554601011611179576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f746f6f206d616e79207265776172647320746f6b656e730000000000000000006044820152606401610973565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260066020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690911790555b600061122d426104e5565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260026020908152604080832084845290915290205490915061126d8433308661193b565b6112778382611cc3565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083208684529091529020556112b562093a8083611cc3565b73ffffffffffffffffffffffffffffffffffffffff8516600081815260036020908152604091829020939093558051858152928301869052909133917f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b910160405180910390a350506001600b555050565b6005818154811061133757600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146113a057600080fd5b816000808282546113b19190611cc3565b9091555050600081815260016020526040812080548492906113d4908490611cc3565b90915550506000818152600160205260409020546113f3908290611688565b6113fb611761565b604080518281526020810184905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610bae565b600b5460011461144257600080fd5b6002600b556040517f430c2081000000000000000000000000000000000000000000000000000000008152336004820152602481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063430c208190604401602060405180830381865afa1580156114d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114fc9190611d8f565b61150557600080fd5b60005b815181101561164057600061153683838151811061152857611528611d60565b602002602001015185610527565b9050426004600085858151811061154f5761154f611d60565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252818101929092526040908101600090812088825290925290205580156115b7576115b78383815181106115a8576115a8611d60565b60200260200101513383611804565b8282815181106115c9576115c9611d60565b602002602001015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc98360405161162f91815260200190565b60405180910390a350600101611508565b50506001600b5550565b600061165962093a8083611db1565b6106e99083611cd6565b60008183116116725781610768565b5090919050565b60008183106116725781610768565b600082815260086020526040902054429080158015906116d25750600084815260076020526040812083916116be600185611cd6565b815260200190815260200160002060000154145b1561170b57600084815260076020526040812084916116f2600185611cd6565b815260208101919091526040016000206001015561175b565b604080518082018252838152602080820186815260008881526007835284812086825290925292902090518155905160019182015561174b908290611cc3565b6000858152600860205260409020555b50505050565b600a544281158015906117935750806009600061177f600186611cd6565b815260200190815260200160002060000154145b156117c457600054600960006001856117ac9190611cd6565b81526020810191909152604001600020600101555050565b604080518082018252828152600080546020808401918252868352600990529290209051815590516001918201556117fd908390611cc3565b600a555050565b60008373ffffffffffffffffffffffffffffffffffffffff163b1161182857600080fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905291516000928392908716916118bf9190611dc5565b6000604051808303816000865af19150503d80600081146118fc576040519150601f19603f3d011682016040523d82523d6000602084013e611901565b606091505b509150915081801561192b57508051158061192b57508080602001905181019061192b9190611d8f565b61193457600080fd5b5050505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b1161195f57600080fd5b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905291516000928392908816916119fe9190611dc5565b6000604051808303816000865af19150503d8060008114611a3b576040519150601f19603f3d011682016040523d82523d6000602084013e611a40565b606091505b5091509150818015611a6a575080511580611a6a575080806020019051810190611a6a9190611d8f565b611a7357600080fd5b505050505050565b600060208284031215611a8d57600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114611ab657600080fd5b50565b8035611ac481611a94565b919050565b60008060408385031215611adc57600080fd5b8235611ae781611a94565b946020939093013593505050565b60008060408385031215611b0857600080fd5b50508035926020909101359150565b600060208284031215611b2957600080fd5b813561076881611a94565b600080600060608486031215611b4957600080fd5b833592506020840135611b5b81611a94565b91506040840135611b6b81611a94565b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060408385031215611bb857600080fd5b8235915060208084013567ffffffffffffffff80821115611bd857600080fd5b818601915086601f830112611bec57600080fd5b813581811115611bfe57611bfe611b76565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715611c4157611c41611b76565b604052918252848201925083810185019189831115611c5f57600080fd5b938501935b82851015611c8457611c7585611ab9565b84529385019392850192611c64565b8096505050505050509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156106e9576106e9611c94565b818103818111156106e9576106e9611c94565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611d2757611d27611ce9565b500490565b80820281158282048414176106e9576106e9611c94565b600060208284031215611d5557600080fd5b815161076881611a94565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215611da157600080fd5b8151801515811461076857600080fd5b600082611dc057611dc0611ce9565b500690565b6000825160005b81811015611de65760208186018101518583015201611dcc565b50600092019182525091905056fea26469706673582212209adc78608773569494ccf4dab4530ddcab4bde7ea61e093b4aec16f6a945e62764736f6c63430008160033a26469706673582212208ceec5f4b95f0fb1d922a59c68550225eb44e2e482d9e365c62269691b52998564736f6c63430008160033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063b1d0fc821461003b578063d27b9a7814610084575b600080fd5b60005461005b9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61005b60003360405161009690610119565b73ffffffffffffffffffffffffffffffffffffffff9091168152602001604051809103906000f0801580156100cf573d6000803e3d6000fd5b50600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169182179055919050565b611f70806101278339019056fe60c06040526001600b553480156200001657600080fd5b5060405162001f7038038062001f708339810160408190526200003991620000bd565b6001600160a01b038116608081905260408051638dd598fb60e01b81529051638dd598fb916004808201926020929091908290030181865afa15801562000084573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000aa9190620000bd565b6001600160a01b031660a05250620000ef565b600060208284031215620000d057600080fd5b81516001600160a01b0381168114620000e857600080fd5b9392505050565b60805160a051611e2a620001466000396000818161033901528181610d87015261147c0152600081816102250152818161085601528181610af501528181610d2b0152818161103c01526113760152611e2a6000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c806399bcc05211610104578063da09d19d116100a2578063f301af4211610071578063f301af4214610485578063f320772314610498578063f5f8d365146104ab578063f7412baf146104be57600080fd5b8063da09d19d14610429578063e688639614610449578063e8111a1214610451578063f25e55a51461045a57600080fd5b8063a28d4c9c116100de578063a28d4c9c146103e1578063a7852afa146103f4578063aaf5eb6814610407578063b66503cf1461041657600080fd5b806399bcc0521461039b5780639cc7f708146103ae5780639e2bf22c146103ce57600080fd5b8063505897931161017157806376f4be361161014b57806376f4be36146103215780638dd598fb1461033457806392777b291461035b5780639418f9391461038657600080fd5b806350589793146102e65780635d0cde9714610306578063638634ee1461030e57600080fd5b80633e491d47116101ad5780633e491d471461020d57806346c96aac1461022057806349dcc2041461026c5780634d5ce038146102b357600080fd5b80630175e23b146101d457806318160ddd146101fa5780631be0528914610203575b600080fd5b6101e76101e2366004611a7b565b6104e5565b6040519081526020015b60405180910390f35b6101e760005481565b6101e762093a8081565b6101e761021b366004611ac9565b610527565b6102477f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101f1565b61029e61027a366004611af5565b60076020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101f1565b6102d66102c1366004611b17565b60066020526000908152604090205460ff1681565b60405190151581526020016101f1565b6101e76102f4366004611a7b565b60086020526000908152604090205481565b6101e7601081565b6101e761031c366004611b17565b6106ef565b6101e761032f366004611a7b565b610720565b6102477f000000000000000000000000000000000000000000000000000000000000000081565b6101e7610369366004611ac9565b600260209081526000928352604080842090915290825290205481565b610399610394366004611b34565b610854565b005b6101e76103a9366004611b17565b610a97565b6101e76103bc366004611a7b565b60016020526000908152604090205481565b6103996103dc366004611af5565b610add565b6101e76103ef366004611af5565b610bba565b610399610402366004611ba5565b610cff565b6101e7670de0b6b3a764000081565b610399610424366004611ac9565b610f4f565b6101e7610437366004611b17565b60036020526000908152604090205481565b6005546101e7565b6101e7600a5481565b6101e7610468366004611ac9565b600460209081526000928352604080842090915290825290205481565b610247610493366004611a7b565b611327565b6103996104a6366004611af5565b61135e565b6103996104b9366004611ba5565b611433565b61029e6104cc366004611a7b565b6009602052600090815260409020805460019091015482565b6000806104f18361164a565b9050600061050262093a8083611cc3565b905080841061051d576105188262093a80611cc3565b61051f565b815b949350505050565b6000818152600860205260408120548103610544575060006106e9565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260046020908152604080832085845290915281205481908190600190829081906105899061164a565b90506105958882610bba565b600089815260076020908152604080832084845290915290208054600190910154909650945091506105cf816105ca8761164a565b611663565b9050600062093a80826105e14261164a565b6105eb9190611cd6565b6105f59190611d18565b905080156106df5760005b818110156106dd576106198a6103ef62093a8086611cc3565b60008b815260076020908152604080832084845290915281208054600190910154909950975090945060099061065561032f62093a8087611cc3565b815260200190815260200160002060010154945060008511156106c65773ffffffffffffffffffffffffffffffffffffffff8b16600090815260026020908152604080832086845290915290205485906106af9088611d2c565b6106b99190611d18565b6106c39089611cc3565b97505b6106d362093a8084611cc3565b9250600101610600565b505b5094955050505050505b92915050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120546106e9904290611679565b600a546000908082036107365750600092915050565b8260096000610746600185611cd6565b8152602001908152602001600020600001541161076f57610768600182611cd6565b9392505050565b6000805260096020527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b548310156107aa5750600092915050565b6000806107b8600184611cd6565b90505b8181111561084c57600060026107d18484611cd6565b6107db9190611d18565b6107e59083611cd6565b600081815260096020908152604091829020825180840190935280548084526001909101549183019190915291925090879003610826575095945050505050565b805187111561083757819350610845565b610842600183611cd6565b92505b50506107bb565b509392505050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f851a4406040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e39190611d43565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461097c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6f6e6c7920766f7465722061646d696e0000000000000000000000000000000060448201526064015b60405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff16600584815481106109a6576109a6611d60565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16146109d257600080fd5b73ffffffffffffffffffffffffffffffffffffffff80831660009081526006602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0090811690915592841682529020805490911660011790556005805482919085908110610a4a57610a4a611d60565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b600080610aa3426104e5565b73ffffffffffffffffffffffffffffffffffffffff9093166000908152600260209081526040808320958352949052929092205492915050565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610b1f57600080fd5b81600080828254610b309190611cd6565b909155505060008181526001602052604081208054849290610b53908490611cd6565b9091555050600081815260016020526040902054610b72908290611688565b610b7a611761565b604080518281526020810184905233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b56891015b60405180910390a25050565b600082815260086020526040812054808203610bda5760009150506106e9565b60008481526007602052604081208491610bf5600185611cd6565b81526020019081526020016000206000015411610c1f57610c17600182611cd6565b9150506106e9565b6000848152600760209081526040808320838052909152902054831015610c4a5760009150506106e9565b600080610c58600184611cd6565b90505b81811115610cf65760006002610c718484611cd6565b610c7b9190611d18565b610c859083611cd6565b6000888152600760209081526040808320848452825291829020825180840190935280548084526001909101549183019190915291925090879003610cd0575093506106e992505050565b8051871115610ce157819350610cef565b610cec600183611cd6565b92505b5050610c5b565b50949350505050565b600b54600114610d0e57600080fd5b6002600b553373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610d5557600080fd5b6040517f6352211e000000000000000000000000000000000000000000000000000000008152600481018390526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690636352211e90602401602060405180830381865afa158015610de3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e079190611d43565b905060005b8251811015610f44576000610e3a848381518110610e2c57610e2c611d60565b602002602001015186610527565b90504260046000868581518110610e5357610e53611d60565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281810192909252604090810160009081208982529092529020558015610ebb57610ebb848381518110610eac57610eac611d60565b60200260200101518483611804565b838281518110610ecd57610ecd611d60565b602002602001015173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc983604051610f3391815260200190565b60405180910390a350600101610e0c565b50506001600b555050565b600b54600114610f5e57600080fd5b6002600b5580610fca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f696e76616c696420616d6f756e740000000000000000000000000000000000006044820152606401610973565b73ffffffffffffffffffffffffffffffffffffffff821660009081526006602052604090205460ff16611222576040517f3af32abf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f00000000000000000000000000000000000000000000000000000000000000001690633af32abf90602401602060405180830381865afa158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190611d8f565b61110d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f627269626520746f6b656e73206d7573742062652077686974656c69737465646044820152606401610973565b600554601011611179576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f746f6f206d616e79207265776172647320746f6b656e730000000000000000006044820152606401610973565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260066020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690911790555b600061122d426104e5565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260026020908152604080832084845290915290205490915061126d8433308661193b565b6112778382611cc3565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083208684529091529020556112b562093a8083611cc3565b73ffffffffffffffffffffffffffffffffffffffff8516600081815260036020908152604091829020939093558051858152928301869052909133917f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b910160405180910390a350506001600b555050565b6005818154811061133757600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146113a057600080fd5b816000808282546113b19190611cc3565b9091555050600081815260016020526040812080548492906113d4908490611cc3565b90915550506000818152600160205260409020546113f3908290611688565b6113fb611761565b604080518281526020810184905233917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159101610bae565b600b5460011461144257600080fd5b6002600b556040517f430c2081000000000000000000000000000000000000000000000000000000008152336004820152602481018390527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063430c208190604401602060405180830381865afa1580156114d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114fc9190611d8f565b61150557600080fd5b60005b815181101561164057600061153683838151811061152857611528611d60565b602002602001015185610527565b9050426004600085858151811061154f5761154f611d60565b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252818101929092526040908101600090812088825290925290205580156115b7576115b78383815181106115a8576115a8611d60565b60200260200101513383611804565b8282815181106115c9576115c9611d60565b602002602001015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9aa05b3d70a9e3e2f004f039648839560576334fb45c81f91b6db03ad9e2efc98360405161162f91815260200190565b60405180910390a350600101611508565b50506001600b5550565b600061165962093a8083611db1565b6106e99083611cd6565b60008183116116725781610768565b5090919050565b60008183106116725781610768565b600082815260086020526040902054429080158015906116d25750600084815260076020526040812083916116be600185611cd6565b815260200190815260200160002060000154145b1561170b57600084815260076020526040812084916116f2600185611cd6565b815260208101919091526040016000206001015561175b565b604080518082018252838152602080820186815260008881526007835284812086825290925292902090518155905160019182015561174b908290611cc3565b6000858152600860205260409020555b50505050565b600a544281158015906117935750806009600061177f600186611cd6565b815260200190815260200160002060000154145b156117c457600054600960006001856117ac9190611cd6565b81526020810191909152604001600020600101555050565b604080518082018252828152600080546020808401918252868352600990529290209051815590516001918201556117fd908390611cc3565b600a555050565b60008373ffffffffffffffffffffffffffffffffffffffff163b1161182857600080fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017905291516000928392908716916118bf9190611dc5565b6000604051808303816000865af19150503d80600081146118fc576040519150601f19603f3d011682016040523d82523d6000602084013e611901565b606091505b509150915081801561192b57508051158061192b57508080602001905181019061192b9190611d8f565b61193457600080fd5b5050505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b1161195f57600080fd5b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905291516000928392908816916119fe9190611dc5565b6000604051808303816000865af19150503d8060008114611a3b576040519150601f19603f3d011682016040523d82523d6000602084013e611a40565b606091505b5091509150818015611a6a575080511580611a6a575080806020019051810190611a6a9190611d8f565b611a7357600080fd5b505050505050565b600060208284031215611a8d57600080fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff81168114611ab657600080fd5b50565b8035611ac481611a94565b919050565b60008060408385031215611adc57600080fd5b8235611ae781611a94565b946020939093013593505050565b60008060408385031215611b0857600080fd5b50508035926020909101359150565b600060208284031215611b2957600080fd5b813561076881611a94565b600080600060608486031215611b4957600080fd5b833592506020840135611b5b81611a94565b91506040840135611b6b81611a94565b809150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060408385031215611bb857600080fd5b8235915060208084013567ffffffffffffffff80821115611bd857600080fd5b818601915086601f830112611bec57600080fd5b813581811115611bfe57611bfe611b76565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715611c4157611c41611b76565b604052918252848201925083810185019189831115611c5f57600080fd5b938501935b82851015611c8457611c7585611ab9565b84529385019392850192611c64565b8096505050505050509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156106e9576106e9611c94565b818103818111156106e9576106e9611c94565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082611d2757611d27611ce9565b500490565b80820281158282048414176106e9576106e9611c94565b600060208284031215611d5557600080fd5b815161076881611a94565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215611da157600080fd5b8151801515811461076857600080fd5b600082611dc057611dc0611ce9565b500690565b6000825160005b81811015611de65760208186018101518583015201611dcc565b50600092019182525091905056fea26469706673582212209adc78608773569494ccf4dab4530ddcab4bde7ea61e093b4aec16f6a945e62764736f6c63430008160033a26469706673582212208ceec5f4b95f0fb1d922a59c68550225eb44e2e482d9e365c62269691b52998564736f6c63430008160033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

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

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.