Contract

0xDED25736417d0398e479A4dbDffF1d85C36D456e

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

-

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

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

Contract Source Code Verified (Exact Match)

Contract Name:
BribeFactory

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at SonicScan.org on 2024-12-18
*/

/**
 *Submitted for verification at basescan.org on 2023-09-19
*/

/**v1.0.0
 *0x8868ae6De5e723e6840Cdc21370e415bF5123684
 *Submitted for verification at FtmScan.com on 2022-11-04
*/



/**
 *  EQUALIZER EXCHANGE
 *  The New Liquidity Hub of Fantom chain!
 *  https://equalizer.exchange  (Dapp)
 *  https://discord.gg/MaMhbgHMby   (Community)
 *
 *
 *  Version: 1.4.0
 *  - Remove the whole concept of Internal Bribes (Trade Fees Streamer), Unify.
 *  - Prevent breaking of rewards in earned() from reading 0-supply checkpoints
 *  - Voter.team() can siphon out unclaimed rewards.
 *    - This contract does not take or allow deposits of any user funds.
 *    - Only the Bribes can be rescue()'d.
 *
 *
 *  Contributors:
 *   -   Andre Cronje, Solidly.Exchange
 *   -   Team, Velodrome.finance
 *   -   @smartcoding51, Equalizer.exchange
 *   -   543#3017 (Sam), ftm.guru & Equalizer.exchange
 *
 *
 *	SPDX-License-Identifier: UNLICENSED
*/



// File: contracts/interfaces/IGauge.sol


pragma solidity 0.8.9;

interface IGauge {
    function notifyRewardAmount(address token, uint amount) external;
    function getReward(address account, address[] memory tokens) external;
    function claimFees() external returns (uint claimed0, uint claimed1);
    function left(address token) external view returns (uint);
    function isForPair() external view returns (bool);
}

// File: contracts/interfaces/IVotingEscrow.sol


pragma solidity 0.8.9;

interface IVotingEscrow {

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

    function team() external returns (address);
    function epoch() external view returns (uint);
    function token() external view returns (address);
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint);
    function point_history(uint loc) external view returns (Point memory);
    function user_point_history(uint tokenId, uint loc) external view returns (Point memory);
    function user_point_epoch(uint tokenId) external view returns (uint);

    function ownerOf(uint) external view returns (address);
    function isApprovedOrOwner(address, uint) external view returns (bool);
    function transferFrom(address, address, uint) external;

    function voting(uint tokenId) external;
    function abstain(uint tokenId) external;
    function attach(uint tokenId) external;
    function detach(uint tokenId) external;

    function checkpoint() external;
    function deposit_for(uint tokenId, uint value) external;
    function create_lock_for(uint, uint, address) external returns (uint);

    function balanceOf(address) external view returns (uint);
    function balanceOfNFT(uint) external view returns (uint);
    function totalSupply() external view returns (uint);
    function tokenOfOwnerByIndex(address _owner, uint _tokenIndex) external view returns (uint);
}

// File: contracts/interfaces/IVoter.sol


pragma solidity 0.8.9;

interface IVoter {
    function _ve() external view returns (address);
    function governor() external view returns (address);
    function emergencyCouncil() external view returns (address);
    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 isWhitelisted(address token) external view returns (bool);
    function notifyRewardAmount(uint amount) external;
    function distribute(address _gauge) external;
}
// File: contracts/interfaces/IERC20.sol


pragma solidity 0.8.9;

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function transfer(address recipient, uint amount) external returns (bool);
    function decimals() external view returns (uint8);
    function symbol() external view returns (string memory);
    function balanceOf(address) external view returns (uint);
    function transferFrom(address sender, address recipient, uint amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint);
    function approve(address spender, uint value) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint value);
    event Approval(address indexed owner, address indexed spender, uint value);
}

// File: contracts/libraries/Math.sol


pragma solidity 0.8.9;

library Math {
    function max(uint a, uint b) internal pure returns (uint) {
        return a >= b ? a : b;
    }
    function min(uint a, uint b) internal pure returns (uint) {
        return a < b ? a : b;
    }
    function sqrt(uint y) internal pure returns (uint z) {
        if (y > 3) {
            z = y;
            uint x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }
    function cbrt(uint256 n) internal pure returns (uint256) { unchecked {
        uint256 x = 0;
        for (uint256 y = 1 << 255; y > 0; y >>= 3) {
            x <<= 1;
            uint256 z = 3 * x * (x + 1) + 1;
            if (n / y >= z) {
                n -= y * z;
                x += 1;
            }
        }
        return x;
    }}
}

// File: @openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol


// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol


// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;


/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized < type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }
}

// File: contracts/Bribe.sol


pragma solidity 0.8.9;







/**
 * @notice Bribes pay out rewards for a given pool based on the votes that were received from the user
 * goes hand in hand with Voter.vote()
 */

contract UnifiedBribe is Initializable {

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

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

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

    uint public constant DURATION = 7 days; // rewards are released over the voting period

    uint internal constant MAX_REWARD_TOKENS = 8;

    uint internal constant PRECISION = 10 ** 18;

    uint public totalSupply;
    mapping(uint => uint) public balanceOfId;

    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 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;
    /// @notice simple re-entrancy check
    bool internal _locked;

    /// Helper vars for analytics, read-only
    mapping(address => uint) public payouts;	/// token -> amountSinceGenesis
    mapping(address => uint) public payoutHistory;	/// token -> amountSinceGenesis
    mapping(address => mapping(address => uint)) public earnings;	/// user -> token -> amountSinceGenesis
    mapping(uint => mapping(address => uint)) public rewardHistory;	/// epoch -> token -> amountDuringThatEpoch



    event Transfer(address indexed from, address indexed to, uint value);
    event Deposit(address indexed voter, address indexed owner, uint indexed tokenId, uint amount);
    event Withdraw(address indexed voter, address indexed owner, uint indexed tokenId, uint amount);
    event NotifyReward(address indexed from, address indexed reward, uint indexed epoch, uint amount);
    event ClaimRewards(address indexed from, address indexed reward, uint indexed tokenId, uint amount);
    event ClaimRewardsForDelegate(address indexed owner, address indexed claimer, address indexed reward, uint tokenId, uint amount);

    modifier lock() {
        require(!_locked,  "No re-entrancy");
        _locked = true;
        _;
        _locked = false;
    }

    function initialize(address _voter, address[] memory _allowedRewardTokens) public initializer {
        voter = _voter;
        _ve = IVoter(_voter)._ve();

        for (uint i; i < _allowedRewardTokens.length; i++) {
            if (_allowedRewardTokens[i] != address(0)) {
                isReward[_allowedRewardTokens[i]] = true;
                rewards.push(_allowedRewardTokens[i]);
            }
        }
    }

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

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

    /**
    * @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 name() external view returns (string memory) {
        return string(abi.encodePacked(IVotingEscrow(_ve).name()," Votes",unicode" 🗳️"));
    }

    function symbol() external view returns (string memory) {
        return string(abi.encodePacked(IVotingEscrow(_ve).symbol(),".votes"));
    }

    function decimals() external view returns (uint256) {
        return IVotingEscrow(_ve).decimals();
    }

    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), "Neither approved nor owner");
        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], msg.sender, _reward);

            emit ClaimRewards(_owner, tokens[i], tokenId, _reward);
            payouts[tokens[i]] += _reward;
            earnings[_owner][tokens[i]] += _reward;

            if(_owner != msg.sender) {
                emit ClaimRewardsForDelegate(_owner, msg.sender, tokens[i], tokenId, _reward);
            }
        }
    }

    // used by Voter to allow batched reward claims
    function getRewardForOwner(uint tokenId, address[] memory tokens) external lock  {
        require(msg.sender == voter, "Not 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], tokenId, _reward);
            payouts[tokens[i]] += _reward;
            earnings[_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;
                /// Bribes but no voters? Let admin decide, via rescue.
                /// Previously this bricked claims for all (division by Zero)
                if (_supply > 0) {
                    reward += _bal * tokenRewardsPerEpoch[token][_currTs] / _supply;
                }
                _currTs += DURATION;
            }
        }

        return reward;
    }

    // Total User Votes
    function balanceOf(uint _vid) external view returns(uint _bal) {
    	_bal = balanceOfId[_vid];
    }

    // Total User Votes
    function balanceOf(address _usr) external view returns(uint _bal) {
    	IVotingEscrow _VE = IVotingEscrow(_ve);
    	uint _n = _VE.balanceOf(_usr);
    	for(uint i;i<_n;i++) {
    		_bal += balanceOfId[_VE.tokenOfOwnerByIndex(_usr, i)];
    	}
    }

    // 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, address _vtr, address _onr) external {
        require(msg.sender == voter, "Not voter");
        require(amount > 0, "Zero amount");

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

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

        emit Deposit(_vtr, _onr, tokenId, amount);
        emit Transfer(address(0), _onr, amount);
    }

    function _withdraw(uint amount, uint tokenId, address _vtr, address _onr) external {
        require(msg.sender == voter, "Not voter");

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

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

        emit Withdraw(_vtr, _onr, tokenId, amount);
        emit Transfer(_onr, address(0), 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 {
        if (!isReward[token] && !(IVotingEscrow(_ve).team()==msg.sender)) {
          require(IVoter(voter).isWhitelisted(token), "bribe tokens must be whitelisted");
          require(rewards.length < MAX_REWARD_TOKENS, "too many rewards tokens");
        }
        // bribes kick in at the start of next bribe period
        uint adjustedTstamp = getEpochStart(block.timestamp);
        uint epochRewards = tokenRewardsPerEpoch[token][adjustedTstamp];

        uint rtbb = IERC20(token).balanceOf(address(this));
        _safeTransferFrom(token, msg.sender, address(this), amount);
        uint rtba = IERC20(token).balanceOf(address(this));
        amount = rtba - rtbb;
        require(amount > 0, "Amount must be greater than 0");

        tokenRewardsPerEpoch[token][adjustedTstamp] = epochRewards + amount;

        periodFinish[token] = adjustedTstamp + DURATION;

        if (!isReward[token]) {
            isReward[token] = true;
            rewards.push(token);
        }

        emit NotifyReward(msg.sender, token, adjustedTstamp, amount);
        rewardHistory[adjustedTstamp][token] += amount;
        payoutHistory[token] += amount;
    }

    function swapOutRewardToken(uint i, address oldToken, address newToken) external {
        require(msg.sender == IVotingEscrow(_ve).team(), "only team");
        require(rewards[i] == oldToken);
        isReward[oldToken] = false;
        isReward[newToken] = true;
        rewards[i] = newToken;
    }

    /// This can break claims of bribes! Useful during a platform-wide upgrade (optional)
    function rescue(uint _amt, address _token, address _to) external {
        require(msg.sender == IVotingEscrow(_ve).team(), "only team");
        IERC20(_token).transfer(_to, _amt);
    }

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

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


// File: contracts/interfaces/IBribeFactory.sol


pragma solidity 0.8.9;

interface IBribeFactory {
    function createBribe(address[] memory) external returns (address);
}

// File: contracts/factories/BribeFactory.sol


pragma solidity 0.8.9;




contract BribeFactory is IBribeFactory {
    address public lastBribe;

    function createBribe(address[] memory _allowedRewards) external returns (address) {
        UnifiedBribe unifiedBribe = new UnifiedBribe();
        unifiedBribe.initialize(msg.sender, _allowedRewards);
        lastBribe = address(unifiedBribe);
        return address(unifiedBribe);
    }

}

Contract Security Audit

Contract ABI

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

608060405234801561001057600080fd5b50612f48806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806328f818a11461003b578063897cd6b31461006a575b600080fd5b60005461004e906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b61004e610078366004610168565b60008060405161008790610129565b604051809103906000f0801580156100a3573d6000803e3d6000fd5b5060405163251b648160e21b81529091506001600160a01b0382169063946d9204906100d5903390879060040161022d565b600060405180830381600087803b1580156100ef57600080fd5b505af1158015610103573d6000803e3d6000fd5b5050600080546001600160a01b0319166001600160a01b03851617905550909392505050565b612c898061028a83390190565b634e487b7160e01b600052604160045260246000fd5b80356001600160a01b038116811461016357600080fd5b919050565b6000602080838503121561017b57600080fd5b823567ffffffffffffffff8082111561019357600080fd5b818501915085601f8301126101a757600080fd5b8135818111156101b9576101b9610136565b8060051b604051601f19603f830116810181811085821117156101de576101de610136565b6040529182528482019250838101850191888311156101fc57600080fd5b938501935b82851015610221576102128561014c565b84529385019392850192610201565b98975050505050505050565b6001600160a01b038381168252604060208084018290528451918401829052600092858201929091906060860190855b8181101561027b57855185168352948301949183019160010161025d565b50909897505050505050505056fe608060405234801561001057600080fd5b50612c69806100206000396000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c806392777b2911610130578063b66503cf116100b8578063e9dbe94c1161007c578063e9dbe94c1461057e578063f25e55a51461059e578063f301af42146105c9578063f5f8d365146105dc578063f7412baf146105ef57600080fd5b8063b66503cf1461050f578063da09d19d14610522578063dce2321c14610542578063e68863961461056d578063e8111a121461057557600080fd5b806399bcc052116100ff57806399bcc052146104965780639cc7f708146104a9578063a1c95e5a146104c9578063a28d4c9c146104e9578063a7852afa146104fc57600080fd5b806392777b291461043d5780639418f93914610468578063946d92041461047b57806395d89b411461048e57600080fd5b806349dcc204116101be5780636768dc18116101825780636768dc18146103de57806370a08231146103f157806376f4be36146104045780638a501100146104175780638dd598fb1461042a57600080fd5b806349dcc204146103115780634d5ce03814610358578063505897931461038b578063638634ee146103ab57806365bcfbe7146103be57600080fd5b80632af2cecc116102055780632af2cecc14610285578063313ce567146102b057806335da504d146102b85780633e491d47146102cd57806346c96aac146102e057600080fd5b80630175e23b1461023757806306fdde031461025d57806318160ddd146102725780631be052891461027b575b600080fd5b61024a61024536600461263a565b610616565b6040519081526020015b60405180910390f35b610265610658565b604051610254919061267f565b61024a60025481565b61024a62093a8081565b61024a6102933660046126ca565b601060209081526000928352604080842090915290825290205481565b61024a6106fd565b6102cb6102c6366004612703565b61077f565b005b61024a6102db36600461274d565b6108e8565b6000546102f9906201000090046001600160a01b031681565b6040516001600160a01b039091168152602001610254565b61034361031f366004612779565b60096020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610254565b61037b61036636600461279b565b60086020526000908152604090205460ff1681565b6040519015158152602001610254565b61024a61039936600461263a565b600a6020526000908152604090205481565b61024a6103b936600461279b565b610a9e565b61024a6103cc36600461279b565b600e6020526000908152604090205481565b6102cb6103ec366004612703565b610ac2565b61024a6103ff36600461279b565b610bda565b61024a61041236600461263a565b610d25565b6102cb6104253660046127b8565b610e57565b6001546102f9906001600160a01b031681565b61024a61044b36600461274d565b600460209081526000928352604080842090915290825290205481565b6102cb6104763660046127b8565b610fb3565b6102cb6104893660046128ca565b611143565b6102656113ff565b61024a6104a436600461279b565b611490565b61024a6104b736600461263a565b60009081526003602052604090205490565b61024a6104d736600461263a565b60036020526000908152604090205481565b61024a6104f7366004612779565b6114c9565b6102cb61050a36600461291a565b61160c565b6102cb61051d36600461274d565b6118dc565b61024a61053036600461279b565b60056020526000908152604090205481565b61024a61055036600461294b565b601160209081526000928352604080842090915290825290205481565b60075461024a565b61024a600c5481565b61024a61058c36600461279b565b600f6020526000908152604090205481565b61024a6105ac36600461274d565b600660209081526000928352604080842090915290825290205481565b6102f96105d736600461263a565b611dfb565b6102cb6105ea36600461291a565b611e25565b6103436105fd36600461263a565b600b602052600090815260409020805460019091015482565b600080610622836121fc565b9050600061063362093a8083612986565b905080841061064e5761064962093a8083612986565b610650565b815b949350505050565b600154604080516306fdde0360e01b815290516060926001600160a01b0316916306fdde03916004808301926000929190829003018186803b15801561069d57600080fd5b505afa1580156106b1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106d9919081019061299e565b6040516020016106e99190612a29565b604051602081830303815290604052905090565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b15801561074257600080fd5b505afa158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190612a64565b905090565b6000546201000090046001600160a01b031633146107b85760405162461bcd60e51b81526004016107af90612a7d565b60405180910390fd5b600084116107f65760405162461bcd60e51b815260206004820152600b60248201526a16995c9bc8185b5bdd5b9d60aa1b60448201526064016107af565b83600260008282546108089190612986565b90915550506000838152600360205260408120805486929061082b908490612986565b909155505060008381526003602052604090205461084a908490612215565b6108526122ed565b82816001600160a01b0316836001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d78760405161089891815260200190565b60405180910390a46040518481526001600160a01b038216906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a350505050565b6000818152600a602052604081205461090357506000610a98565b6001600160a01b0383166000908152600660209081526040808320858452909152812054819081906001908290819061093b906121fc565b905061094788826114c9565b600089815260096020908152604080832084845290915290208054600190910154909650945091506109818161097c876121fc565b612391565b9050600062093a8082610993426121fc565b61099d9190612aa0565b6109a79190612acd565b90508015610a8e5760005b81811015610a8c576109cb8a6104f762093a8086612986565b60008b8152600960209081526040808320848452909152812080546001909101549099509750909450600b90610a0761041262093a8087612986565b81526020019081526020016000206001015494506000851115610a6b576001600160a01b038b1660009081526004602090815260408083208684529091529020548590610a549088612ae1565b610a5e9190612acd565b610a689089612986565b97505b610a7862093a8084612986565b925080610a8481612b00565b9150506109b2565b505b5094955050505050505b92915050565b6001600160a01b038116600090815260056020526040812054610a989042906123a8565b6000546201000090046001600160a01b03163314610af25760405162461bcd60e51b81526004016107af90612a7d565b8360026000828254610b049190612aa0565b909155505060008381526003602052604081208054869290610b27908490612aa0565b9091555050600083815260036020526040902054610b46908490612215565b610b4e6122ed565b82816001600160a01b0316836001600160a01b03167ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb56787604051610b9491815260200190565b60405180910390a46040518481526000906001600160a01b038316907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016108da565b6001546040516370a0823160e01b81526001600160a01b0383811660048301526000921690829082906370a082319060240160206040518083038186803b158015610c2457600080fd5b505afa158015610c38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5c9190612a64565b905060005b81811015610d1d57604051632f745c5960e01b81526001600160a01b03868116600483015260248201839052600391600091861690632f745c599060440160206040518083038186803b158015610cb757600080fd5b505afa158015610ccb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cef9190612a64565b81526020019081526020016000205484610d099190612986565b935080610d1581612b00565b915050610c61565b505050919050565b600c5460009080610d395750600092915050565b82600b6000610d49600185612aa0565b81526020019081526020016000206000015411610d7257610d6b600182612aa0565b9392505050565b60008052600b6020527fdf7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f7654831015610dad5750600092915050565b600080610dbb600184612aa0565b90505b81811115610e4f5760006002610dd48484612aa0565b610dde9190612acd565b610de89083612aa0565b6000818152600b6020908152604091829020825180840190935280548084526001909101549183019190915291925090871415610e29575095945050505050565b8051871115610e3a57819350610e48565b610e45600183612aa0565b92505b5050610dbe565b509392505050565b600160009054906101000a90046001600160a01b03166001600160a01b03166385f2aef26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610ea757600080fd5b505af1158015610ebb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edf9190612b1b565b6001600160a01b0316336001600160a01b031614610f2b5760405162461bcd60e51b81526020600482015260096024820152686f6e6c79207465616d60b81b60448201526064016107af565b60405163a9059cbb60e01b81526001600160a01b0382811660048301526024820185905283169063a9059cbb90604401602060405180830381600087803b158015610f7557600080fd5b505af1158015610f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fad9190612b38565b50505050565b600160009054906101000a90046001600160a01b03166001600160a01b03166385f2aef26040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561100357600080fd5b505af1158015611017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103b9190612b1b565b6001600160a01b0316336001600160a01b0316146110875760405162461bcd60e51b81526020600482015260096024820152686f6e6c79207465616d60b81b60448201526064016107af565b816001600160a01b0316600784815481106110a4576110a4612b5a565b6000918252602090912001546001600160a01b0316146110c357600080fd5b6001600160a01b03808316600090815260086020526040808220805460ff199081169091559284168252902080549091166001179055600780548291908590811061111057611110612b5a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b600054610100900460ff16158080156111635750600054600160ff909116105b8061117d5750303b15801561117d575060005460ff166001145b6111e05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016107af565b6000805460ff191660011790558015611203576000805461ff0019166101001790555b82600060026101000a8154816001600160a01b0302191690836001600160a01b03160217905550826001600160a01b0316638dd598fb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561126357600080fd5b505afa158015611277573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129b9190612b1b565b600180546001600160a01b0319166001600160a01b039290921691909117905560005b82518110156113b35760006001600160a01b03168382815181106112e4576112e4612b5a565b60200260200101516001600160a01b0316146113a15760016008600085848151811061131257611312612b5a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600783828151811061136557611365612b5a565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b039092169190911790555b806113ab81612b00565b9150506112be565b5080156113fa576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b600154604080516395d89b4160e01b815290516060926001600160a01b0316916395d89b41916004808301926000929190829003018186803b15801561144457600080fd5b505afa158015611458573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611480919081019061299e565b6040516020016106e99190612b70565b60008061149c42610616565b6001600160a01b039093166000908152600460209081526040808320958352949052929092205492915050565b6000828152600a6020526040812054806114e7576000915050610a98565b60008481526009602052604081208491611502600185612aa0565b8152602001908152602001600020600001541161152c57611524600182612aa0565b915050610a98565b6000848152600960209081526040808320838052909152902054831015611557576000915050610a98565b600080611565600184612aa0565b90505b81811115611603576000600261157e8484612aa0565b6115889190612acd565b6115929083612aa0565b60008881526009602090815260408083208484528252918290208251808401909352805480845260019091015491830191909152919250908714156115dd57509350610a9892505050565b80518711156115ee578193506115fc565b6115f9600183612aa0565b92505b5050611568565b50949350505050565b600d5460ff161561162f5760405162461bcd60e51b81526004016107af90612b9a565b600d8054600160ff199091161790556000546201000090046001600160a01b0316331461166e5760405162461bcd60e51b81526004016107af90612a7d565b6001546040516331a9108f60e11b8152600481018490526000916001600160a01b031690636352211e9060240160206040518083038186803b1580156116b357600080fd5b505afa1580156116c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116eb9190612b1b565b905060005b82518110156118cc57600061171e84838151811061171057611710612b5a565b6020026020010151866108e8565b9050426006600086858151811061173757611737612b5a565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812089825290925290205580156117925761179284838151811061178357611783612b5a565b602002602001015184836123b7565b848483815181106117a5576117a5612b5a565b60200260200101516001600160a01b0316846001600160a01b03167f5edbb4c958d6c6218724840db450599207c2f649c9879fbc8ae8f5992a90f115846040516117f191815260200190565b60405180910390a480600e600086858151811061181057611810612b5a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008282546118479190612986565b90915550506001600160a01b0383166000908152601060205260408120855183929087908690811061187b5761187b612b5a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008282546118b29190612986565b909155508291506118c4905081612b00565b9150506116f0565b5050600d805460ff191690555050565b600d5460ff16156118ff5760405162461bcd60e51b81526004016107af90612b9a565b600d805460ff191660011790556001600160a01b03821660009081526008602052604090205460ff161580156119ba5750600154604080516342f9577960e11b8152905133926001600160a01b0316916385f2aef29160048083019260209291908290030181600087803b15801561197657600080fd5b505af115801561198a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ae9190612b1b565b6001600160a01b031614155b15611ae157600054604051633af32abf60e01b81526001600160a01b0384811660048301526201000090920490911690633af32abf9060240160206040518083038186803b158015611a0b57600080fd5b505afa158015611a1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a439190612b38565b611a8f5760405162461bcd60e51b815260206004820181905260248201527f627269626520746f6b656e73206d7573742062652077686974656c697374656460448201526064016107af565b600754600811611ae15760405162461bcd60e51b815260206004820152601760248201527f746f6f206d616e79207265776172647320746f6b656e7300000000000000000060448201526064016107af565b6000611aec42610616565b6001600160a01b03841660008181526004602081815260408084208685529091528083205490516370a0823160e01b815230928101929092529394509091906370a082319060240160206040518083038186803b158015611b4c57600080fd5b505afa158015611b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b849190612a64565b9050611b92853330876124f4565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a082319060240160206040518083038186803b158015611bd457600080fd5b505afa158015611be8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0c9190612a64565b9050611c188282612aa0565b945060008511611c6a5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016107af565b611c748584612986565b6001600160a01b0387166000908152600460209081526040808320888452909152902055611ca562093a8085612986565b6001600160a01b03871660009081526005602090815260408083209390935560089052205460ff16611d37576001600160a01b0386166000818152600860205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b03191690911790555b83866001600160a01b0316336001600160a01b03167f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b88604051611d7d91815260200190565b60405180910390a460008481526011602090815260408083206001600160a01b038a16845290915281208054879290611db7908490612986565b90915550506001600160a01b0386166000908152600f602052604081208054879290611de4908490612986565b9091555050600d805460ff19169055505050505050565b60078181548110611e0b57600080fd5b6000918252602090912001546001600160a01b0316905081565b600d5460ff1615611e485760405162461bcd60e51b81526004016107af90612b9a565b600d805460ff191660019081179091555460405163430c208160e01b8152336004820152602481018490526001600160a01b039091169063430c20819060440160206040518083038186803b158015611ea057600080fd5b505afa158015611eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed89190612b38565b611f245760405162461bcd60e51b815260206004820152601a60248201527f4e65697468657220617070726f766564206e6f72206f776e657200000000000060448201526064016107af565b6001546040516331a9108f60e11b8152600481018490526000916001600160a01b031690636352211e9060240160206040518083038186803b158015611f6957600080fd5b505afa158015611f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa19190612b1b565b905060005b82518110156118cc576000611fc684838151811061171057611710612b5a565b90504260066000868581518110611fdf57611fdf612b5a565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902055801561203a5761203a84838151811061202b5761202b612b5a565b602002602001015133836123b7565b8484838151811061204d5761204d612b5a565b60200260200101516001600160a01b0316846001600160a01b03167f5edbb4c958d6c6218724840db450599207c2f649c9879fbc8ae8f5992a90f1158460405161209991815260200190565b60405180910390a480600e60008685815181106120b8576120b8612b5a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008282546120ef9190612986565b90915550506001600160a01b0383166000908152601060205260408120855183929087908690811061212357612123612b5a565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600082825461215a9190612986565b90915550506001600160a01b03831633146121e95783828151811061218157612181612b5a565b60200260200101516001600160a01b0316336001600160a01b0316846001600160a01b03167f43be61a5ef13e8d87e40f389a9b02d8b61c87a06a1b9f0e33ad764a49b5f0b8e88856040516121e0929190918252602082015260400190565b60405180910390a45b50806121f481612b00565b915050611fa6565b600061220b62093a8083612bc2565b610a989083612aa0565b6000828152600a60205260409020544290801580159061225f57506000848152600960205260408120839161224b600185612aa0565b815260200190815260200160002060000154145b15612298576000848152600960205260408120849161227f600185612aa0565b8152602081019190915260400160002060010155610fad565b60408051808201825283815260208082018681526000888152600983528481208682529092529290209051815590516001918201556122d8908290612986565b6000858152600a602052604090205550505050565b600c5442811580159061231f575080600b600061230b600186612aa0565b815260200190815260200160002060000154145b1561234e57600254600b6000612336600186612aa0565b81526020810191909152604001600020600101555050565b60408051808201825282815260025460208083019182526000868152600b9091529290922090518155905160019182015561238a908390612986565b600c555050565b6000818310156123a15781610d6b565b5090919050565b60008183106123a15781610d6b565b6000836001600160a01b03163b116124095760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420746f6b656e206164647265737360581b60448201526064016107af565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916124659190612bd6565b6000604051808303816000865af19150503d80600081146124a2576040519150601f19603f3d011682016040523d82523d6000602084013e6124a7565b606091505b50915091508180156124d15750805115806124d15750808060200190518101906124d19190612b38565b6124ed5760405162461bcd60e51b81526004016107af90612bf2565b5050505050565b6000846001600160a01b03163b116125465760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420746f6b656e206164647265737360581b60448201526064016107af565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916125aa9190612bd6565b6000604051808303816000865af19150503d80600081146125e7576040519150601f19603f3d011682016040523d82523d6000602084013e6125ec565b606091505b50915091508180156126165750805115806126165750808060200190518101906126169190612b38565b6126325760405162461bcd60e51b81526004016107af90612bf2565b505050505050565b60006020828403121561264c57600080fd5b5035919050565b60005b8381101561266e578181015183820152602001612656565b83811115610fad5750506000910152565b602081526000825180602084015261269e816040850160208701612653565b601f01601f19169190910160400192915050565b6001600160a01b03811681146126c757600080fd5b50565b600080604083850312156126dd57600080fd5b82356126e8816126b2565b915060208301356126f8816126b2565b809150509250929050565b6000806000806080858703121561271957600080fd5b84359350602085013592506040850135612732816126b2565b91506060850135612742816126b2565b939692955090935050565b6000806040838503121561276057600080fd5b823561276b816126b2565b946020939093013593505050565b6000806040838503121561278c57600080fd5b50508035926020909101359150565b6000602082840312156127ad57600080fd5b8135610d6b816126b2565b6000806000606084860312156127cd57600080fd5b8335925060208401356127df816126b2565b915060408401356127ef816126b2565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612839576128396127fa565b604052919050565b600082601f83011261285257600080fd5b8135602067ffffffffffffffff82111561286e5761286e6127fa565b8160051b61287d828201612810565b928352848101820192828101908785111561289757600080fd5b83870192505b848310156128bf5782356128b0816126b2565b8252918301919083019061289d565b979650505050505050565b600080604083850312156128dd57600080fd5b82356128e8816126b2565b9150602083013567ffffffffffffffff81111561290457600080fd5b61291085828601612841565b9150509250929050565b6000806040838503121561292d57600080fd5b82359150602083013567ffffffffffffffff81111561290457600080fd5b6000806040838503121561295e57600080fd5b8235915060208301356126f8816126b2565b634e487b7160e01b600052601160045260246000fd5b6000821982111561299957612999612970565b500190565b6000602082840312156129b057600080fd5b815167ffffffffffffffff808211156129c857600080fd5b818401915084601f8301126129dc57600080fd5b8151818111156129ee576129ee6127fa565b612a01601f8201601f1916602001612810565b9150808252856020828501011115612a1857600080fd5b611603816020840160208601612653565b60008251612a3b818460208701612653565b6520566f74657360d01b9201918252506720f09f97b3efb88f60c01b6006820152600e01919050565b600060208284031215612a7657600080fd5b5051919050565b6020808252600990820152682737ba103b37ba32b960b91b604082015260600190565b600082821015612ab257612ab2612970565b500390565b634e487b7160e01b600052601260045260246000fd5b600082612adc57612adc612ab7565b500490565b6000816000190483118215151615612afb57612afb612970565b500290565b6000600019821415612b1457612b14612970565b5060010190565b600060208284031215612b2d57600080fd5b8151610d6b816126b2565b600060208284031215612b4a57600080fd5b81518015158114610d6b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60008251612b82818460208701612653565b652e766f74657360d01b920191825250600601919050565b6020808252600e908201526d4e6f2072652d656e7472616e637960901b604082015260600190565b600082612bd157612bd1612ab7565b500690565b60008251612be8818460208701612653565b9190910192915050565b60208082526021908201527f556e696669656442726962653a205472616e7366657246726f6d206661696c656040820152601960fa1b60608201526080019056fea2646970667358221220f3e07ea8bfb47ecaaf81145b8df28e9999335027ecc6a666a26dc66520cc7add64736f6c63430008090033a2646970667358221220327c732fa9d8d261abde0a9ee3b9aef40f0525eb79d3fcd2c5afd4a98ce7f34b64736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100365760003560e01c806328f818a11461003b578063897cd6b31461006a575b600080fd5b60005461004e906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b61004e610078366004610168565b60008060405161008790610129565b604051809103906000f0801580156100a3573d6000803e3d6000fd5b5060405163251b648160e21b81529091506001600160a01b0382169063946d9204906100d5903390879060040161022d565b600060405180830381600087803b1580156100ef57600080fd5b505af1158015610103573d6000803e3d6000fd5b5050600080546001600160a01b0319166001600160a01b03851617905550909392505050565b612c898061028a83390190565b634e487b7160e01b600052604160045260246000fd5b80356001600160a01b038116811461016357600080fd5b919050565b6000602080838503121561017b57600080fd5b823567ffffffffffffffff8082111561019357600080fd5b818501915085601f8301126101a757600080fd5b8135818111156101b9576101b9610136565b8060051b604051601f19603f830116810181811085821117156101de576101de610136565b6040529182528482019250838101850191888311156101fc57600080fd5b938501935b82851015610221576102128561014c565b84529385019392850192610201565b98975050505050505050565b6001600160a01b038381168252604060208084018290528451918401829052600092858201929091906060860190855b8181101561027b57855185168352948301949183019160010161025d565b50909897505050505050505056fe608060405234801561001057600080fd5b50612c69806100206000396000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c806392777b2911610130578063b66503cf116100b8578063e9dbe94c1161007c578063e9dbe94c1461057e578063f25e55a51461059e578063f301af42146105c9578063f5f8d365146105dc578063f7412baf146105ef57600080fd5b8063b66503cf1461050f578063da09d19d14610522578063dce2321c14610542578063e68863961461056d578063e8111a121461057557600080fd5b806399bcc052116100ff57806399bcc052146104965780639cc7f708146104a9578063a1c95e5a146104c9578063a28d4c9c146104e9578063a7852afa146104fc57600080fd5b806392777b291461043d5780639418f93914610468578063946d92041461047b57806395d89b411461048e57600080fd5b806349dcc204116101be5780636768dc18116101825780636768dc18146103de57806370a08231146103f157806376f4be36146104045780638a501100146104175780638dd598fb1461042a57600080fd5b806349dcc204146103115780634d5ce03814610358578063505897931461038b578063638634ee146103ab57806365bcfbe7146103be57600080fd5b80632af2cecc116102055780632af2cecc14610285578063313ce567146102b057806335da504d146102b85780633e491d47146102cd57806346c96aac146102e057600080fd5b80630175e23b1461023757806306fdde031461025d57806318160ddd146102725780631be052891461027b575b600080fd5b61024a61024536600461263a565b610616565b6040519081526020015b60405180910390f35b610265610658565b604051610254919061267f565b61024a60025481565b61024a62093a8081565b61024a6102933660046126ca565b601060209081526000928352604080842090915290825290205481565b61024a6106fd565b6102cb6102c6366004612703565b61077f565b005b61024a6102db36600461274d565b6108e8565b6000546102f9906201000090046001600160a01b031681565b6040516001600160a01b039091168152602001610254565b61034361031f366004612779565b60096020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610254565b61037b61036636600461279b565b60086020526000908152604090205460ff1681565b6040519015158152602001610254565b61024a61039936600461263a565b600a6020526000908152604090205481565b61024a6103b936600461279b565b610a9e565b61024a6103cc36600461279b565b600e6020526000908152604090205481565b6102cb6103ec366004612703565b610ac2565b61024a6103ff36600461279b565b610bda565b61024a61041236600461263a565b610d25565b6102cb6104253660046127b8565b610e57565b6001546102f9906001600160a01b031681565b61024a61044b36600461274d565b600460209081526000928352604080842090915290825290205481565b6102cb6104763660046127b8565b610fb3565b6102cb6104893660046128ca565b611143565b6102656113ff565b61024a6104a436600461279b565b611490565b61024a6104b736600461263a565b60009081526003602052604090205490565b61024a6104d736600461263a565b60036020526000908152604090205481565b61024a6104f7366004612779565b6114c9565b6102cb61050a36600461291a565b61160c565b6102cb61051d36600461274d565b6118dc565b61024a61053036600461279b565b60056020526000908152604090205481565b61024a61055036600461294b565b601160209081526000928352604080842090915290825290205481565b60075461024a565b61024a600c5481565b61024a61058c36600461279b565b600f6020526000908152604090205481565b61024a6105ac36600461274d565b600660209081526000928352604080842090915290825290205481565b6102f96105d736600461263a565b611dfb565b6102cb6105ea36600461291a565b611e25565b6103436105fd36600461263a565b600b602052600090815260409020805460019091015482565b600080610622836121fc565b9050600061063362093a8083612986565b905080841061064e5761064962093a8083612986565b610650565b815b949350505050565b600154604080516306fdde0360e01b815290516060926001600160a01b0316916306fdde03916004808301926000929190829003018186803b15801561069d57600080fd5b505afa1580156106b1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106d9919081019061299e565b6040516020016106e99190612a29565b604051602081830303815290604052905090565b6001546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b15801561074257600080fd5b505afa158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190612a64565b905090565b6000546201000090046001600160a01b031633146107b85760405162461bcd60e51b81526004016107af90612a7d565b60405180910390fd5b600084116107f65760405162461bcd60e51b815260206004820152600b60248201526a16995c9bc8185b5bdd5b9d60aa1b60448201526064016107af565b83600260008282546108089190612986565b90915550506000838152600360205260408120805486929061082b908490612986565b909155505060008381526003602052604090205461084a908490612215565b6108526122ed565b82816001600160a01b0316836001600160a01b03167fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d78760405161089891815260200190565b60405180910390a46040518481526001600160a01b038216906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a350505050565b6000818152600a602052604081205461090357506000610a98565b6001600160a01b0383166000908152600660209081526040808320858452909152812054819081906001908290819061093b906121fc565b905061094788826114c9565b600089815260096020908152604080832084845290915290208054600190910154909650945091506109818161097c876121fc565b612391565b9050600062093a8082610993426121fc565b61099d9190612aa0565b6109a79190612acd565b90508015610a8e5760005b81811015610a8c576109cb8a6104f762093a8086612986565b60008b8152600960209081526040808320848452909152812080546001909101549099509750909450600b90610a0761041262093a8087612986565b81526020019081526020016000206001015494506000851115610a6b576001600160a01b038b1660009081526004602090815260408083208684529091529020548590610a549088612ae1565b610a5e9190612acd565b610a689089612986565b97505b610a7862093a8084612986565b925080610a8481612b00565b9150506109b2565b505b5094955050505050505b92915050565b6001600160a01b038116600090815260056020526040812054610a989042906123a8565b6000546201000090046001600160a01b03163314610af25760405162461bcd60e51b81526004016107af90612a7d565b8360026000828254610b049190612aa0565b909155505060008381526003602052604081208054869290610b27908490612aa0565b9091555050600083815260036020526040902054610b46908490612215565b610b4e6122ed565b82816001600160a01b0316836001600160a01b03167ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb56787604051610b9491815260200190565b60405180910390a46040518481526000906001600160a01b038316907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016108da565b6001546040516370a0823160e01b81526001600160a01b0383811660048301526000921690829082906370a082319060240160206040518083038186803b158015610c2457600080fd5b505afa158015610c38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5c9190612a64565b905060005b81811015610d1d57604051632f745c5960e01b81526001600160a01b03868116600483015260248201839052600391600091861690632f745c599060440160206040518083038186803b158015610cb757600080fd5b505afa158015610ccb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cef9190612a64565b81526020019081526020016000205484610d099190612986565b935080610d1581612b00565b915050610c61565b505050919050565b600c5460009080610d395750600092915050565b82600b6000610d49600185612aa0565b81526020019081526020016000206000015411610d7257610d6b600182612aa0565b9392505050565b60008052600b6020527fdf7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f7654831015610dad5750600092915050565b600080610dbb600184612aa0565b90505b81811115610e4f5760006002610dd48484612aa0565b610dde9190612acd565b610de89083612aa0565b6000818152600b6020908152604091829020825180840190935280548084526001909101549183019190915291925090871415610e29575095945050505050565b8051871115610e3a57819350610e48565b610e45600183612aa0565b92505b5050610dbe565b509392505050565b600160009054906101000a90046001600160a01b03166001600160a01b03166385f2aef26040518163ffffffff1660e01b8152600401602060405180830381600087803b158015610ea757600080fd5b505af1158015610ebb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edf9190612b1b565b6001600160a01b0316336001600160a01b031614610f2b5760405162461bcd60e51b81526020600482015260096024820152686f6e6c79207465616d60b81b60448201526064016107af565b60405163a9059cbb60e01b81526001600160a01b0382811660048301526024820185905283169063a9059cbb90604401602060405180830381600087803b158015610f7557600080fd5b505af1158015610f89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fad9190612b38565b50505050565b600160009054906101000a90046001600160a01b03166001600160a01b03166385f2aef26040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561100357600080fd5b505af1158015611017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103b9190612b1b565b6001600160a01b0316336001600160a01b0316146110875760405162461bcd60e51b81526020600482015260096024820152686f6e6c79207465616d60b81b60448201526064016107af565b816001600160a01b0316600784815481106110a4576110a4612b5a565b6000918252602090912001546001600160a01b0316146110c357600080fd5b6001600160a01b03808316600090815260086020526040808220805460ff199081169091559284168252902080549091166001179055600780548291908590811061111057611110612b5a565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050565b600054610100900460ff16158080156111635750600054600160ff909116105b8061117d5750303b15801561117d575060005460ff166001145b6111e05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016107af565b6000805460ff191660011790558015611203576000805461ff0019166101001790555b82600060026101000a8154816001600160a01b0302191690836001600160a01b03160217905550826001600160a01b0316638dd598fb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561126357600080fd5b505afa158015611277573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129b9190612b1b565b600180546001600160a01b0319166001600160a01b039290921691909117905560005b82518110156113b35760006001600160a01b03168382815181106112e4576112e4612b5a565b60200260200101516001600160a01b0316146113a15760016008600085848151811061131257611312612b5a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600783828151811061136557611365612b5a565b60209081029190910181015182546001810184556000938452919092200180546001600160a01b0319166001600160a01b039092169190911790555b806113ab81612b00565b9150506112be565b5080156113fa576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b600154604080516395d89b4160e01b815290516060926001600160a01b0316916395d89b41916004808301926000929190829003018186803b15801561144457600080fd5b505afa158015611458573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611480919081019061299e565b6040516020016106e99190612b70565b60008061149c42610616565b6001600160a01b039093166000908152600460209081526040808320958352949052929092205492915050565b6000828152600a6020526040812054806114e7576000915050610a98565b60008481526009602052604081208491611502600185612aa0565b8152602001908152602001600020600001541161152c57611524600182612aa0565b915050610a98565b6000848152600960209081526040808320838052909152902054831015611557576000915050610a98565b600080611565600184612aa0565b90505b81811115611603576000600261157e8484612aa0565b6115889190612acd565b6115929083612aa0565b60008881526009602090815260408083208484528252918290208251808401909352805480845260019091015491830191909152919250908714156115dd57509350610a9892505050565b80518711156115ee578193506115fc565b6115f9600183612aa0565b92505b5050611568565b50949350505050565b600d5460ff161561162f5760405162461bcd60e51b81526004016107af90612b9a565b600d8054600160ff199091161790556000546201000090046001600160a01b0316331461166e5760405162461bcd60e51b81526004016107af90612a7d565b6001546040516331a9108f60e11b8152600481018490526000916001600160a01b031690636352211e9060240160206040518083038186803b1580156116b357600080fd5b505afa1580156116c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116eb9190612b1b565b905060005b82518110156118cc57600061171e84838151811061171057611710612b5a565b6020026020010151866108e8565b9050426006600086858151811061173757611737612b5a565b6020908102919091018101516001600160a01b03168252818101929092526040908101600090812089825290925290205580156117925761179284838151811061178357611783612b5a565b602002602001015184836123b7565b848483815181106117a5576117a5612b5a565b60200260200101516001600160a01b0316846001600160a01b03167f5edbb4c958d6c6218724840db450599207c2f649c9879fbc8ae8f5992a90f115846040516117f191815260200190565b60405180910390a480600e600086858151811061181057611810612b5a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008282546118479190612986565b90915550506001600160a01b0383166000908152601060205260408120855183929087908690811061187b5761187b612b5a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008282546118b29190612986565b909155508291506118c4905081612b00565b9150506116f0565b5050600d805460ff191690555050565b600d5460ff16156118ff5760405162461bcd60e51b81526004016107af90612b9a565b600d805460ff191660011790556001600160a01b03821660009081526008602052604090205460ff161580156119ba5750600154604080516342f9577960e11b8152905133926001600160a01b0316916385f2aef29160048083019260209291908290030181600087803b15801561197657600080fd5b505af115801561198a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119ae9190612b1b565b6001600160a01b031614155b15611ae157600054604051633af32abf60e01b81526001600160a01b0384811660048301526201000090920490911690633af32abf9060240160206040518083038186803b158015611a0b57600080fd5b505afa158015611a1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a439190612b38565b611a8f5760405162461bcd60e51b815260206004820181905260248201527f627269626520746f6b656e73206d7573742062652077686974656c697374656460448201526064016107af565b600754600811611ae15760405162461bcd60e51b815260206004820152601760248201527f746f6f206d616e79207265776172647320746f6b656e7300000000000000000060448201526064016107af565b6000611aec42610616565b6001600160a01b03841660008181526004602081815260408084208685529091528083205490516370a0823160e01b815230928101929092529394509091906370a082319060240160206040518083038186803b158015611b4c57600080fd5b505afa158015611b60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b849190612a64565b9050611b92853330876124f4565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a082319060240160206040518083038186803b158015611bd457600080fd5b505afa158015611be8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0c9190612a64565b9050611c188282612aa0565b945060008511611c6a5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016107af565b611c748584612986565b6001600160a01b0387166000908152600460209081526040808320888452909152902055611ca562093a8085612986565b6001600160a01b03871660009081526005602090815260408083209390935560089052205460ff16611d37576001600160a01b0386166000818152600860205260408120805460ff191660019081179091556007805491820181559091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b03191690911790555b83866001600160a01b0316336001600160a01b03167f52977ea98a2220a03ee9ba5cb003ada08d394ea10155483c95dc2dc77a7eb24b88604051611d7d91815260200190565b60405180910390a460008481526011602090815260408083206001600160a01b038a16845290915281208054879290611db7908490612986565b90915550506001600160a01b0386166000908152600f602052604081208054879290611de4908490612986565b9091555050600d805460ff19169055505050505050565b60078181548110611e0b57600080fd5b6000918252602090912001546001600160a01b0316905081565b600d5460ff1615611e485760405162461bcd60e51b81526004016107af90612b9a565b600d805460ff191660019081179091555460405163430c208160e01b8152336004820152602481018490526001600160a01b039091169063430c20819060440160206040518083038186803b158015611ea057600080fd5b505afa158015611eb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed89190612b38565b611f245760405162461bcd60e51b815260206004820152601a60248201527f4e65697468657220617070726f766564206e6f72206f776e657200000000000060448201526064016107af565b6001546040516331a9108f60e11b8152600481018490526000916001600160a01b031690636352211e9060240160206040518083038186803b158015611f6957600080fd5b505afa158015611f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa19190612b1b565b905060005b82518110156118cc576000611fc684838151811061171057611710612b5a565b90504260066000868581518110611fdf57611fdf612b5a565b6020908102919091018101516001600160a01b031682528181019290925260409081016000908120898252909252902055801561203a5761203a84838151811061202b5761202b612b5a565b602002602001015133836123b7565b8484838151811061204d5761204d612b5a565b60200260200101516001600160a01b0316846001600160a01b03167f5edbb4c958d6c6218724840db450599207c2f649c9879fbc8ae8f5992a90f1158460405161209991815260200190565b60405180910390a480600e60008685815181106120b8576120b8612b5a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008282546120ef9190612986565b90915550506001600160a01b0383166000908152601060205260408120855183929087908690811061212357612123612b5a565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600082825461215a9190612986565b90915550506001600160a01b03831633146121e95783828151811061218157612181612b5a565b60200260200101516001600160a01b0316336001600160a01b0316846001600160a01b03167f43be61a5ef13e8d87e40f389a9b02d8b61c87a06a1b9f0e33ad764a49b5f0b8e88856040516121e0929190918252602082015260400190565b60405180910390a45b50806121f481612b00565b915050611fa6565b600061220b62093a8083612bc2565b610a989083612aa0565b6000828152600a60205260409020544290801580159061225f57506000848152600960205260408120839161224b600185612aa0565b815260200190815260200160002060000154145b15612298576000848152600960205260408120849161227f600185612aa0565b8152602081019190915260400160002060010155610fad565b60408051808201825283815260208082018681526000888152600983528481208682529092529290209051815590516001918201556122d8908290612986565b6000858152600a602052604090205550505050565b600c5442811580159061231f575080600b600061230b600186612aa0565b815260200190815260200160002060000154145b1561234e57600254600b6000612336600186612aa0565b81526020810191909152604001600020600101555050565b60408051808201825282815260025460208083019182526000868152600b9091529290922090518155905160019182015561238a908390612986565b600c555050565b6000818310156123a15781610d6b565b5090919050565b60008183106123a15781610d6b565b6000836001600160a01b03163b116124095760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420746f6b656e206164647265737360581b60448201526064016107af565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916124659190612bd6565b6000604051808303816000865af19150503d80600081146124a2576040519150601f19603f3d011682016040523d82523d6000602084013e6124a7565b606091505b50915091508180156124d15750805115806124d15750808060200190518101906124d19190612b38565b6124ed5760405162461bcd60e51b81526004016107af90612bf2565b5050505050565b6000846001600160a01b03163b116125465760405162461bcd60e51b8152602060048201526015602482015274496e76616c696420746f6b656e206164647265737360581b60448201526064016107af565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916125aa9190612bd6565b6000604051808303816000865af19150503d80600081146125e7576040519150601f19603f3d011682016040523d82523d6000602084013e6125ec565b606091505b50915091508180156126165750805115806126165750808060200190518101906126169190612b38565b6126325760405162461bcd60e51b81526004016107af90612bf2565b505050505050565b60006020828403121561264c57600080fd5b5035919050565b60005b8381101561266e578181015183820152602001612656565b83811115610fad5750506000910152565b602081526000825180602084015261269e816040850160208701612653565b601f01601f19169190910160400192915050565b6001600160a01b03811681146126c757600080fd5b50565b600080604083850312156126dd57600080fd5b82356126e8816126b2565b915060208301356126f8816126b2565b809150509250929050565b6000806000806080858703121561271957600080fd5b84359350602085013592506040850135612732816126b2565b91506060850135612742816126b2565b939692955090935050565b6000806040838503121561276057600080fd5b823561276b816126b2565b946020939093013593505050565b6000806040838503121561278c57600080fd5b50508035926020909101359150565b6000602082840312156127ad57600080fd5b8135610d6b816126b2565b6000806000606084860312156127cd57600080fd5b8335925060208401356127df816126b2565b915060408401356127ef816126b2565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612839576128396127fa565b604052919050565b600082601f83011261285257600080fd5b8135602067ffffffffffffffff82111561286e5761286e6127fa565b8160051b61287d828201612810565b928352848101820192828101908785111561289757600080fd5b83870192505b848310156128bf5782356128b0816126b2565b8252918301919083019061289d565b979650505050505050565b600080604083850312156128dd57600080fd5b82356128e8816126b2565b9150602083013567ffffffffffffffff81111561290457600080fd5b61291085828601612841565b9150509250929050565b6000806040838503121561292d57600080fd5b82359150602083013567ffffffffffffffff81111561290457600080fd5b6000806040838503121561295e57600080fd5b8235915060208301356126f8816126b2565b634e487b7160e01b600052601160045260246000fd5b6000821982111561299957612999612970565b500190565b6000602082840312156129b057600080fd5b815167ffffffffffffffff808211156129c857600080fd5b818401915084601f8301126129dc57600080fd5b8151818111156129ee576129ee6127fa565b612a01601f8201601f1916602001612810565b9150808252856020828501011115612a1857600080fd5b611603816020840160208601612653565b60008251612a3b818460208701612653565b6520566f74657360d01b9201918252506720f09f97b3efb88f60c01b6006820152600e01919050565b600060208284031215612a7657600080fd5b5051919050565b6020808252600990820152682737ba103b37ba32b960b91b604082015260600190565b600082821015612ab257612ab2612970565b500390565b634e487b7160e01b600052601260045260246000fd5b600082612adc57612adc612ab7565b500490565b6000816000190483118215151615612afb57612afb612970565b500290565b6000600019821415612b1457612b14612970565b5060010190565b600060208284031215612b2d57600080fd5b8151610d6b816126b2565b600060208284031215612b4a57600080fd5b81518015158114610d6b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60008251612b82818460208701612653565b652e766f74657360d01b920191825250600601919050565b6020808252600e908201526d4e6f2072652d656e7472616e637960901b604082015260600190565b600082612bd157612bd1612ab7565b500690565b60008251612be8818460208701612653565b9190910192915050565b60208082526021908201527f556e696669656442726962653a205472616e7366657246726f6d206661696c656040820152601960fa1b60608201526080019056fea2646970667358221220f3e07ea8bfb47ecaaf81145b8df28e9999335027ecc6a666a26dc66520cc7add64736f6c63430008090033a2646970667358221220327c732fa9d8d261abde0a9ee3b9aef40f0525eb79d3fcd2c5afd4a98ce7f34b64736f6c63430008090033

Deployed Bytecode Sourcemap

35199:377:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;35245:24;;;;;-1:-1:-1;;;;;35245:24:0;;;;;;-1:-1:-1;;;;;178:32:1;;;160:51;;148:2;133:18;35245:24:0;;;;;;;35278:293;;;;;;:::i;:::-;35351:7;35371:25;35399:18;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;35428:52:0;;-1:-1:-1;;;35428:52:0;;35371:46;;-1:-1:-1;;;;;;35428:23:0;;;;;:52;;35452:10;;35464:15;;35428:52;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;35491:9:0;:33;;-1:-1:-1;;;;;;35491:33:0;-1:-1:-1;;;;;35491:33:0;;;;;-1:-1:-1;35491:33:0;;35511:12;-1:-1:-1;;;35278:293:0:o;-1:-1:-1:-;;;;;;;;:::o;222:127:1:-;283:10;278:3;274:20;271:1;264:31;314:4;311:1;304:15;338:4;335:1;328:15;354:173;422:20;;-1:-1:-1;;;;;471:31:1;;461:42;;451:70;;517:1;514;507:12;451:70;354:173;;;:::o;532:1121::-;616:6;647:2;690;678:9;669:7;665:23;661:32;658:52;;;706:1;703;696:12;658:52;746:9;733:23;775:18;816:2;808:6;805:14;802:34;;;832:1;829;822:12;802:34;870:6;859:9;855:22;845:32;;915:7;908:4;904:2;900:13;896:27;886:55;;937:1;934;927:12;886:55;973:2;960:16;995:2;991;988:10;985:36;;;1001:18;;:::i;:::-;1047:2;1044:1;1040:10;1079:2;1073:9;1142:2;1138:7;1133:2;1129;1125:11;1121:25;1113:6;1109:38;1197:6;1185:10;1182:22;1177:2;1165:10;1162:18;1159:46;1156:72;;;1208:18;;:::i;:::-;1244:2;1237:22;1294:18;;;1328:15;;;;-1:-1:-1;1370:11:1;;;1366:20;;;1398:19;;;1395:39;;;1430:1;1427;1420:12;1395:39;1454:11;;;;1474:148;1490:6;1485:3;1482:15;1474:148;;;1556:23;1575:3;1556:23;:::i;:::-;1544:36;;1507:12;;;;1600;;;;1474:148;;;1641:6;532:1121;-1:-1:-1;;;;;;;;532:1121:1:o;1658:759::-;-1:-1:-1;;;;;1944:15:1;;;1926:34;;1876:2;1979;1997:18;;;1990:30;;;2069:13;;1861:18;;;2091:22;;;1828:4;;2170:15;;;;1898:19;;1979:2;2144;2129:18;;;1828:4;2213:178;2227:6;2224:1;2221:13;2213:178;;;2292:13;;2288:22;;2276:35;;2366:15;;;;2331:12;;;;2249:1;2242:9;2213:178;;;-1:-1:-1;2408:3:1;;1658:759;-1:-1:-1;;;;;;;;1658:759:1:o

Swarm Source

ipfs://327c732fa9d8d261abde0a9ee3b9aef40f0525eb79d3fcd2c5afd4a98ce7f34b

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

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.