ETH Price: $2,375.86 (+2.73%)

Contract

0x18651CA2Af0065E71b80EB081146e85A585c0482

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Withdraw Token1554637012023-11-30 6:43:59795 days ago1701326639IN
0x18651CA2...A585c0482
0 ETH0.000048030.1
Withdraw Token1554636422023-11-30 6:43:42795 days ago1701326622IN
0x18651CA2...A585c0482
0 ETH0.000049310.1
Withdraw Token1554635712023-11-30 6:43:23795 days ago1701326603IN
0x18651CA2...A585c0482
0 ETH0.000048830.1
Withdraw Token1554634332023-11-30 6:42:46795 days ago1701326566IN
0x18651CA2...A585c0482
0 ETH0.000047490.1
Pause1554631852023-11-30 6:41:39795 days ago1701326499IN
0x18651CA2...A585c0482
0 ETH0.000037490.1
Claim1554175772023-11-30 3:11:14795 days ago1701313874IN
0x18651CA2...A585c0482
0 ETH0.000088930.1
Claim1554144542023-11-30 2:55:38795 days ago1701312938IN
0x18651CA2...A585c0482
0 ETH0.000083580.1
Claim1554085142023-11-30 2:27:09795 days ago1701311229IN
0x18651CA2...A585c0482
0 ETH0.000061510.1
Claim1553783232023-11-29 23:58:48795 days ago1701302328IN
0x18651CA2...A585c0482
0 ETH0.000065490.1
Claim1553782922023-11-29 23:58:36795 days ago1701302316IN
0x18651CA2...A585c0482
0 ETH0.00006720.1
Claim1552685582023-11-29 15:27:35796 days ago1701271655IN
0x18651CA2...A585c0482
0 ETH0.000079130.1
Claim1552148062023-11-29 11:37:07796 days ago1701257827IN
0x18651CA2...A585c0482
0 ETH0.000054310.1
Claim1552147052023-11-29 11:36:42796 days ago1701257802IN
0x18651CA2...A585c0482
0 ETH0.000053490.1
Claim1552064372023-11-29 11:01:14796 days ago1701255674IN
0x18651CA2...A585c0482
0 ETH0.000070110.1
Claim Multiple1551828012023-11-29 9:20:09796 days ago1701249609IN
0x18651CA2...A585c0482
0 ETH0.000100130.1
Claim1551827582023-11-29 9:19:58796 days ago1701249598IN
0x18651CA2...A585c0482
0 ETH0.000061780.1
Claim1551826912023-11-29 9:19:41796 days ago1701249581IN
0x18651CA2...A585c0482
0 ETH0.000063490.1
Claim1551822612023-11-29 9:17:47796 days ago1701249467IN
0x18651CA2...A585c0482
0 ETH0.000066240.1
Claim1551372812023-11-29 6:04:27796 days ago1701237867IN
0x18651CA2...A585c0482
0 ETH0.000062780.1
Claim1551067092023-11-29 3:45:38796 days ago1701229538IN
0x18651CA2...A585c0482
0 ETH0.000058120.1
Claim Multiple1551066792023-11-29 3:45:30796 days ago1701229530IN
0x18651CA2...A585c0482
0 ETH0.000093620.1
Claim1550917312023-11-29 2:35:22796 days ago1701225322IN
0x18651CA2...A585c0482
0 ETH0.000058160.1
Claim1550331932023-11-28 21:42:30796 days ago1701207750IN
0x18651CA2...A585c0482
0 ETH0.000102040.1
Claim1550262372023-11-28 21:07:19796 days ago1701205639IN
0x18651CA2...A585c0482
0 ETH0.000096490.1
Claim1550235662023-11-28 20:54:23796 days ago1701204863IN
0x18651CA2...A585c0482
0 ETH0.000103290.1
View all transactions

Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Claim

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 99 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;

import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";

/// @notice contract that allows a treasury contract to send ERC20 this address and allow users to claim it
/// @dev this contract is pausable, and only the owner can pause it

contract Claim is Pausable, Ownable {
    using SafeERC20 for IERC20;

    struct ClaimableInfo {
        uint256 id;
        address tokenAddress;
        uint256 totalRemainingAmount; //total amount of the claimable balance
        uint256 claimablePeriod;
        uint256 startTimestamp;
    }
    uint256 public constant MAX_CLAIMABLE_PERIOD = 730 days; // 2 years
    uint256 public constant MIN_CLAIMABLE_PERIOD = 7 days;

    uint256 public currentId; //id for the claimable balance

    //user address => claimableId => amount
    mapping(address => mapping(uint256 => uint256)) public claimableBalances;
    //ids => tokenAddress
    mapping(uint256 => ClaimableInfo) public claimableInfo;

    mapping(address => mapping(uint256 => bool)) public hasClaimable;

    mapping(address => bool) public isHandler;

    event TransferExpired(uint256 indexed id, address indexed token, address indexed user, uint256 amount);

    event Claimed(uint256 indexed id, address indexed token, address indexed user, uint256 amount);

    event ClaimableRoundAdded(
        uint256 indexed id,
        address indexed token,
        uint256 totalRemainingAmount,
        uint256 claimablePeriod,
        uint256 startTimestamp
    );

    event HandlerSet(address handler, bool isActive);

    ///@notice modifier to check if the caller is a leverage vault
    modifier onlyHandler() {
        require(isHandler[msg.sender], "handler only");
        _;
    }

    constructor() {
        isHandler[msg.sender] = true;
    }

    /// @notice set the handler, only owner can call this function
    /// @param _handler handler address
    /// @param _isActive whether the handler is active
    function setHandler(address _handler, bool _isActive) external onlyOwner {
        //Implement zero address checks
        require(_handler != address(0), "Claimable: Invalid address");
        isHandler[_handler] = _isActive;
        emit HandlerSet(_handler, _isActive);
    }

    /// @notice function to pause the contract, only handler can call this function
    function pause() external onlyHandler {
        _pause();
    }

    //add upaused function
    /// @notice function to unpause the contract, only handler can call this function
    function unpause() external onlyHandler {
        _unpause();
    }

    /// @notice let treasury notifiy users of a claimable balance, the input will be token address, a user array and a balance array
    /// @dev the user array and balance array will be the same length, and the index of the user will be the same as the index of the balance
    /// @dev only ERC20 token can be notified, no native asset
    /// @param _token token address
    /// @param claimablePeriod the period of time that the user can claim the balance
    /// @param _users user array
    /// @param _balances balance array
    function notifyClaimable(
        address _token,
        uint256 claimablePeriod,
        address[] memory _users,
        uint256[] memory _balances,
        uint256 _inputTotalAmount
    ) external onlyHandler {
        //require the claimablePeriod to be within the max and min claimable period
        require(
            claimablePeriod <= MAX_CLAIMABLE_PERIOD && claimablePeriod >= MIN_CLAIMABLE_PERIOD,
            "Claimable: invalid period"
        );
        uint256 length = _users.length;
        require(_token != address(0), "Claimable: token address cannot be zero");
        require(length == _balances.length, "Claimable: user and balance array length mismatch");

        uint256 _currentId = currentId;
        uint256 _totalAmount;

        for (uint256 i; i < length; i++) {
            //Implement zero address checks
            require(_users[i] != address(0), "Claimable: Invalid address");
            address user = _users[i];
            uint256 balance = _balances[i];

            claimableBalances[user][_currentId] = balance;
            hasClaimable[user][_currentId] = true;
            _totalAmount += balance;
        }
        ClaimableInfo storage claimable = claimableInfo[_currentId];
        claimable.id = _currentId;
        claimable.tokenAddress = _token;
        claimable.totalRemainingAmount = _totalAmount;
        claimable.claimablePeriod = claimablePeriod;
        claimable.startTimestamp = block.timestamp;

        require(_inputTotalAmount == _totalAmount, "Claimable: input total amount mismatch");

        IERC20(_token).safeTransferFrom(msg.sender, address(this), _totalAmount);

        currentId++;

        emit ClaimableRoundAdded(claimable.id, _token, _totalAmount, claimablePeriod, block.timestamp);
    }

    /// @notice let handler notifiy users of a claimable balance and transfer the amount into this contract, the input will be token address, a user array and a balance array

    /// @param id the id of the claimable balance
    /// @param claimablePeriod the period of time that the user can claim the balance
    /// @param _users user array
    /// @param _balances balance array
    ///@dev the claimablePeriod will replace the old claimablePeriod if the id already exists
    function notifyAdditionalClaimable(
        uint256 id,
        uint256 claimablePeriod,
        address[] memory _users,
        uint256[] memory _balances,
        uint256 _inputTotalAmount
    ) external onlyHandler {
        require(
            claimablePeriod <= MAX_CLAIMABLE_PERIOD && claimablePeriod >= MIN_CLAIMABLE_PERIOD,
            "Claimable: invalid period"
        );

        uint256 length = _users.length;
        require(length == _balances.length, "Claimable: user and balance array length mismatch");
        //checking if the id exists
        require(claimableInfo[id].id == id, "Claimable: id does not exist");

        uint256 _totalAmount;
        for (uint256 i; i < length; i++) {
            //Implement zero address checks
            require(_users[i] != address(0), "Claimable: Invalid address");
            address user = _users[i];
            uint256 balance = _balances[i];

            claimableBalances[user][id] += balance;
            hasClaimable[user][id] = true;
            _totalAmount += balance;
        }
        require(_inputTotalAmount == _totalAmount, "Claimable: input total amount mismatch");
        ClaimableInfo storage claimable = claimableInfo[id];
        claimable.totalRemainingAmount += _totalAmount;
        claimable.claimablePeriod = claimablePeriod;
        claimable.startTimestamp = block.timestamp;

        IERC20(claimableInfo[id].tokenAddress).safeTransferFrom(msg.sender, address(this), _totalAmount);

        emit ClaimableRoundAdded(id, claimableInfo[id].tokenAddress, _totalAmount, claimablePeriod, block.timestamp);
    }

    /// @notice let users claim their claimable balances in batch
    /// @param _ids the ids of the claimable balance
    function claimMultiple(uint256[] memory _ids) external whenNotPaused {
        uint256 len = _ids.length;
        for (uint256 i = 0; i < len; i++) {
            claim(_ids[i]);
        }
    }

    /// @notice check if the claimable balance is expired, if it is, then let owner claim the balance of a specific id
    /// @param _id the id of the claimable balance
    /// @param _to the address that will receive the expired balance
    function transferExpired(uint256 _id, address _to) external onlyHandler {
        //Implement zero address checks
        require(_to != address(0), "Claimable: Invalid address");
        ClaimableInfo storage claimable = claimableInfo[_id];
        require(block.timestamp > claimable.startTimestamp + claimable.claimablePeriod, "claim not expired");
        uint256 amount = claimable.totalRemainingAmount;
        claimable.totalRemainingAmount = 0;
        IERC20(claimable.tokenAddress).safeTransfer(_to, amount);
        emit TransferExpired(_id, claimable.tokenAddress, _to, amount);
    }

    /// @notice withdraw the token to the owner
    /// @param token token address
    function withdrawToken(address token) external onlyOwner {
        uint256 balance = IERC20(token).balanceOf(address(this));
        IERC20(token).safeTransfer(msg.sender, balance);
    }

    /// @notice let users claim their claimable balance
    /// @param _id the id of the claimable balance

    //create a view function to check the claimable balance of a user
    function checkClaimableBalance(uint256 _id, address _user) external view returns (uint256) {
        return claimableBalances[_user][_id];
    }

    function claim(uint256 _id) public whenNotPaused {
        require(hasClaimable[msg.sender][_id], "Claimable: user does not have claimable balance");

        ClaimableInfo storage claimable = claimableInfo[_id];
        require(
            block.timestamp <= claimable.startTimestamp + claimable.claimablePeriod,
            "Claimable: claimable period ended"
        );

        uint256 amount = claimableBalances[msg.sender][_id];
        // require(amount > 0, "Claimable: claimable balance already claimed");

        claimableBalances[msg.sender][_id] = 0;
        hasClaimable[msg.sender][_id] = false;
        claimable.totalRemainingAmount -= amount;

        IERC20(claimable.tokenAddress).safeTransfer(msg.sender, amount);
        emit Claimed(_id, claimable.tokenAddress, msg.sender, amount);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

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

pragma solidity ^0.8.0;

import "../utils/Context.sol";

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

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

    bool private _paused;

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

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [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 functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

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

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

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

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

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

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

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

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

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

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalRemainingAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimablePeriod","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTimestamp","type":"uint256"}],"name":"ClaimableRoundAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"handler","type":"address"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"HandlerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferExpired","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAX_CLAIMABLE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_CLAIMABLE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"checkClaimableBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"claimMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimableBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimableInfo","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"totalRemainingAmount","type":"uint256"},{"internalType":"uint256","name":"claimablePeriod","type":"uint256"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"hasClaimable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isHandler","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"claimablePeriod","type":"uint256"},{"internalType":"address[]","name":"_users","type":"address[]"},{"internalType":"uint256[]","name":"_balances","type":"uint256[]"},{"internalType":"uint256","name":"_inputTotalAmount","type":"uint256"}],"name":"notifyAdditionalClaimable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"claimablePeriod","type":"uint256"},{"internalType":"address[]","name":"_users","type":"address[]"},{"internalType":"uint256[]","name":"_balances","type":"uint256[]"},{"internalType":"uint256","name":"_inputTotalAmount","type":"uint256"}],"name":"notifyClaimable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_handler","type":"address"},{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"setHandler","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"transferExpired","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506000805460ff1916905561002433610043565b336000908152600560205260409020805460ff1916600117905561009c565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b611925806100ab6000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80637320bdbe116100b85780639cb7de4b1161007c5780639cb7de4b146102f0578063d6d110e714610303578063e00dd1611461032e578063e2d1477514610337578063f2fde38b14610342578063ffb629271461035557600080fd5b80637320bdbe146102915780638456cb59146102a457806389476069146102ac5780638da5cb5b146102bf5780639051cce9146102dd57600080fd5b806346ea87af116100ff57806346ea87af146101c25780635156ed87146101e55780635c975abb1461025d578063715018a6146102685780637275fcf61461027057600080fd5b80630eedf0a31461013c578063133e8813146101515780631657ca0514610164578063379607f5146101a75780633f4ba83a146101ba575b600080fd5b61014f61014a36600461139c565b61035f565b005b61014f61015f366004611500565b610495565b61019261017236600461157f565b600460209081526000928352604080842090915290825290205460ff1681565b60405190151581526020015b60405180910390f35b61014f6101b53660046115a9565b61078c565b61014f610948565b6101926101d03660046115c2565b60056020526000908152604090205460ff1681565b61022d6101f33660046115a9565b60036020819052600091825260409091208054600182015460028301549383015460049093015491936001600160a01b0390911692909185565b604080519586526001600160a01b039094166020860152928401919091526060830152608082015260a00161019e565b60005460ff16610192565b61014f610981565b61028361027e36600461139c565b610993565b60405190815260200161019e565b61014f61029f3660046115e4565b6109be565b61014f610c8b565b61014f6102ba3660046115c2565b610cc2565b60005461010090046001600160a01b031660405161019e9190611629565b61014f6102eb36600461163d565b610d54565b61014f6102fe366004611680565b610da2565b61028361031136600461157f565b600260209081526000928352604080842090915290825290205481565b61028360015481565b6102836303c2670081565b61014f6103503660046115c2565b610e33565b61028362093a8081565b3360009081526005602052604090205460ff166103975760405162461bcd60e51b815260040161038e906116b7565b60405180910390fd5b6001600160a01b0381166103bd5760405162461bcd60e51b815260040161038e906116dd565b60008281526003602081905260409091209081015460048201546103e19190611727565b42116104235760405162461bcd60e51b815260206004820152601160248201527018db185a5b481b9bdd08195e1c1a5c9959607a1b604482015260640161038e565b60028101805460009091556001820154610447906001600160a01b03168483610eac565b60018201546040518281526001600160a01b0385811692169086907f970d5878e6d71aa8007ff0563da7bcab30bc42129439ee7ed7bb62603e9983159060200160405180910390a450505050565b3360009081526005602052604090205460ff166104c45760405162461bcd60e51b815260040161038e906116b7565b6303c2670084111580156104db575062093a808410155b6104f75760405162461bcd60e51b815260040161038e9061173a565b8251825181146105195760405162461bcd60e51b815260040161038e9061176d565b60008681526003602052604090205486146105765760405162461bcd60e51b815260206004820152601c60248201527f436c61696d61626c653a20696420646f6573206e6f7420657869737400000000604482015260640161038e565b6000805b828110156106a35760006001600160a01b031686828151811061059f5761059f6117be565b60200260200101516001600160a01b0316036105cd5760405162461bcd60e51b815260040161038e906116dd565b60008682815181106105e1576105e16117be565b6020026020010151905060008683815181106105ff576105ff6117be565b602002602001015190508060026000846001600160a01b03166001600160a01b0316815260200190815260200160002060008c8152602001908152602001600020600082825461064f9190611727565b90915550506001600160a01b03821660009081526004602090815260408083208d84529091529020805460ff1916600117905561068c8185611727565b93505050808061069b906117d4565b91505061057a565b508083146106c35760405162461bcd60e51b815260040161038e906117ed565b6000878152600360205260408120600281018054919284926106e6908490611727565b9091555050600380820188905542600483015560008981526020919091526040902060010154610721906001600160a01b0316333085610f0f565b6000888152600360209081526040918290206001015482518581529182018a9052428284015291516001600160a01b03909216918a917f8bef2f9a0ffc703ad74a923f818f32d9d78b1c49cc3b248c0cab473eefae585b919081900360600190a35050505050505050565b610794610f4d565b33600090815260046020908152604080832084845290915290205460ff166108165760405162461bcd60e51b815260206004820152602f60248201527f436c61696d61626c653a207573657220646f6573206e6f74206861766520636c60448201526e61696d61626c652062616c616e636560881b606482015260840161038e565b600081815260036020819052604090912090810154600482015461083a9190611727565b4211156108935760405162461bcd60e51b815260206004820152602160248201527f436c61696d61626c653a20636c61696d61626c6520706572696f6420656e64656044820152601960fa1b606482015260840161038e565b3360008181526002602081815260408084208785528252808420805490859055948452600482528084208785529091528220805460ff19169055830180548392906108df908490611833565b909155505060018201546108fd906001600160a01b03163383610eac565b600182015460405182815233916001600160a01b03169085907fce3bcb6e219596cf26007ffdfaae8953bc3f76e3f36c0a79b23e28020da3222e9060200160405180910390a4505050565b3360009081526005602052604090205460ff166109775760405162461bcd60e51b815260040161038e906116b7565b61097f610f93565b565b610989610fdf565b61097f600061103f565b6001600160a01b03811660009081526002602090815260408083208584529091529020545b92915050565b3360009081526005602052604090205460ff166109ed5760405162461bcd60e51b815260040161038e906116b7565b6303c267008411158015610a04575062093a808410155b610a205760405162461bcd60e51b815260040161038e9061173a565b82516001600160a01b038616610a885760405162461bcd60e51b815260206004820152602760248201527f436c61696d61626c653a20746f6b656e20616464726573732063616e6e6f74206044820152666265207a65726f60c81b606482015260840161038e565b82518114610aa85760405162461bcd60e51b815260040161038e9061176d565b6001546000805b83811015610ba45760006001600160a01b0316878281518110610ad457610ad46117be565b60200260200101516001600160a01b031603610b025760405162461bcd60e51b815260040161038e906116dd565b6000878281518110610b1657610b166117be565b602002602001015190506000878381518110610b3457610b346117be565b6020908102919091018101516001600160a01b03841660008181526002845260408082208a8352855280822084905591815260048452818120898252909352909120805460ff191660011790559050610b8d8185611727565b935050508080610b9c906117d4565b915050610aaf565b5060008281526003602081905260409091208381556001810180546001600160a01b0319166001600160a01b038c1617905560028101839055908101889055426004820155848214610c085760405162461bcd60e51b815260040161038e906117ed565b610c1d6001600160a01b038a16333085610f0f565b60018054906000610c2d836117d4565b9091555050805460408051848152602081018b9052428183015290516001600160a01b038c1692917f8bef2f9a0ffc703ad74a923f818f32d9d78b1c49cc3b248c0cab473eefae585b919081900360600190a3505050505050505050565b3360009081526005602052604090205460ff16610cba5760405162461bcd60e51b815260040161038e906116b7565b61097f611098565b610cca610fdf565b6040516370a0823160e01b81526000906001600160a01b038316906370a0823190610cf9903090600401611629565b602060405180830381865afa158015610d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3a9190611846565b9050610d506001600160a01b0383163383610eac565b5050565b610d5c610f4d565b805160005b81811015610d9d57610d8b838281518110610d7e57610d7e6117be565b602002602001015161078c565b80610d95816117d4565b915050610d61565b505050565b610daa610fdf565b6001600160a01b038216610dd05760405162461bcd60e51b815260040161038e906116dd565b6001600160a01b038216600081815260056020908152604091829020805460ff19168515159081179091558251938452908301527f6cc67219f62a9e5d66cc9f2a62e16634cffcf48facd698a829bafcc1ad2c5c83910160405180910390a15050565b610e3b610fdf565b6001600160a01b038116610ea05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161038e565b610ea98161103f565b50565b6040516001600160a01b038316602482015260448101829052610d9d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526110d5565b6040516001600160a01b0380851660248301528316604482015260648101829052610f479085906323b872dd60e01b90608401610ed8565b50505050565b60005460ff161561097f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161038e565b610f9b6111a7565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610fd59190611629565b60405180910390a1565b6000546001600160a01b0361010090910416331461097f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161038e565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6110a0610f4d565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610fc83390565b600061112a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111f09092919063ffffffff16565b805190915015610d9d5780806020019051810190611148919061185f565b610d9d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161038e565b60005460ff1661097f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161038e565b60606111ff8484600085611207565b949350505050565b6060824710156112685760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161038e565b600080866001600160a01b0316858760405161128491906118a0565b60006040518083038185875af1925050503d80600081146112c1576040519150601f19603f3d011682016040523d82523d6000602084013e6112c6565b606091505b50915091506112d7878383876112e2565b979650505050505050565b6060831561135157825160000361134a576001600160a01b0385163b61134a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161038e565b50816111ff565b6111ff83838151156113665781518083602001fd5b8060405162461bcd60e51b815260040161038e91906118bc565b80356001600160a01b038116811461139757600080fd5b919050565b600080604083850312156113af57600080fd5b823591506113bf60208401611380565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611407576114076113c8565b604052919050565b600067ffffffffffffffff821115611429576114296113c8565b5060051b60200190565b600082601f83011261144457600080fd5b813560206114596114548361140f565b6113de565b82815260059290921b8401810191818101908684111561147857600080fd5b8286015b8481101561149a5761148d81611380565b835291830191830161147c565b509695505050505050565b600082601f8301126114b657600080fd5b813560206114c66114548361140f565b82815260059290921b840181019181810190868411156114e557600080fd5b8286015b8481101561149a57803583529183019183016114e9565b600080600080600060a0868803121561151857600080fd5b8535945060208601359350604086013567ffffffffffffffff8082111561153e57600080fd5b61154a89838a01611433565b9450606088013591508082111561156057600080fd5b5061156d888289016114a5565b95989497509295608001359392505050565b6000806040838503121561159257600080fd5b61159b83611380565b946020939093013593505050565b6000602082840312156115bb57600080fd5b5035919050565b6000602082840312156115d457600080fd5b6115dd82611380565b9392505050565b600080600080600060a086880312156115fc57600080fd5b61160586611380565b945060208601359350604086013567ffffffffffffffff8082111561153e57600080fd5b6001600160a01b0391909116815260200190565b60006020828403121561164f57600080fd5b813567ffffffffffffffff81111561166657600080fd5b6111ff848285016114a5565b8015158114610ea957600080fd5b6000806040838503121561169357600080fd5b61169c83611380565b915060208301356116ac81611672565b809150509250929050565b6020808252600c908201526b68616e646c6572206f6e6c7960a01b604082015260600190565b6020808252601a9082015279436c61696d61626c653a20496e76616c6964206164647265737360301b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156109b8576109b8611711565b60208082526019908201527810db185a5b58589b194e881a5b9d985b1a59081c195c9a5bd9603a1b604082015260600190565b60208082526031908201527f436c61696d61626c653a207573657220616e642062616c616e636520617272616040820152700f240d8cadccee8d040dad2e6dac2e8c6d607b1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6000600182016117e6576117e6611711565b5060010190565b60208082526026908201527f436c61696d61626c653a20696e70757420746f74616c20616d6f756e74206d696040820152650e6dac2e8c6d60d31b606082015260800190565b818103818111156109b8576109b8611711565b60006020828403121561185857600080fd5b5051919050565b60006020828403121561187157600080fd5b81516115dd81611672565b60005b8381101561189757818101518382015260200161187f565b50506000910152565b600082516118b281846020870161187c565b9190910192915050565b60208152600082518060208401526118db81604085016020870161187c565b601f01601f1916919091016040019291505056fea264697066735822122021737c02e2d779668ef3493e54a3a007ace81fecea195ca3418dea2251e2340564736f6c63430008120033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101375760003560e01c80637320bdbe116100b85780639cb7de4b1161007c5780639cb7de4b146102f0578063d6d110e714610303578063e00dd1611461032e578063e2d1477514610337578063f2fde38b14610342578063ffb629271461035557600080fd5b80637320bdbe146102915780638456cb59146102a457806389476069146102ac5780638da5cb5b146102bf5780639051cce9146102dd57600080fd5b806346ea87af116100ff57806346ea87af146101c25780635156ed87146101e55780635c975abb1461025d578063715018a6146102685780637275fcf61461027057600080fd5b80630eedf0a31461013c578063133e8813146101515780631657ca0514610164578063379607f5146101a75780633f4ba83a146101ba575b600080fd5b61014f61014a36600461139c565b61035f565b005b61014f61015f366004611500565b610495565b61019261017236600461157f565b600460209081526000928352604080842090915290825290205460ff1681565b60405190151581526020015b60405180910390f35b61014f6101b53660046115a9565b61078c565b61014f610948565b6101926101d03660046115c2565b60056020526000908152604090205460ff1681565b61022d6101f33660046115a9565b60036020819052600091825260409091208054600182015460028301549383015460049093015491936001600160a01b0390911692909185565b604080519586526001600160a01b039094166020860152928401919091526060830152608082015260a00161019e565b60005460ff16610192565b61014f610981565b61028361027e36600461139c565b610993565b60405190815260200161019e565b61014f61029f3660046115e4565b6109be565b61014f610c8b565b61014f6102ba3660046115c2565b610cc2565b60005461010090046001600160a01b031660405161019e9190611629565b61014f6102eb36600461163d565b610d54565b61014f6102fe366004611680565b610da2565b61028361031136600461157f565b600260209081526000928352604080842090915290825290205481565b61028360015481565b6102836303c2670081565b61014f6103503660046115c2565b610e33565b61028362093a8081565b3360009081526005602052604090205460ff166103975760405162461bcd60e51b815260040161038e906116b7565b60405180910390fd5b6001600160a01b0381166103bd5760405162461bcd60e51b815260040161038e906116dd565b60008281526003602081905260409091209081015460048201546103e19190611727565b42116104235760405162461bcd60e51b815260206004820152601160248201527018db185a5b481b9bdd08195e1c1a5c9959607a1b604482015260640161038e565b60028101805460009091556001820154610447906001600160a01b03168483610eac565b60018201546040518281526001600160a01b0385811692169086907f970d5878e6d71aa8007ff0563da7bcab30bc42129439ee7ed7bb62603e9983159060200160405180910390a450505050565b3360009081526005602052604090205460ff166104c45760405162461bcd60e51b815260040161038e906116b7565b6303c2670084111580156104db575062093a808410155b6104f75760405162461bcd60e51b815260040161038e9061173a565b8251825181146105195760405162461bcd60e51b815260040161038e9061176d565b60008681526003602052604090205486146105765760405162461bcd60e51b815260206004820152601c60248201527f436c61696d61626c653a20696420646f6573206e6f7420657869737400000000604482015260640161038e565b6000805b828110156106a35760006001600160a01b031686828151811061059f5761059f6117be565b60200260200101516001600160a01b0316036105cd5760405162461bcd60e51b815260040161038e906116dd565b60008682815181106105e1576105e16117be565b6020026020010151905060008683815181106105ff576105ff6117be565b602002602001015190508060026000846001600160a01b03166001600160a01b0316815260200190815260200160002060008c8152602001908152602001600020600082825461064f9190611727565b90915550506001600160a01b03821660009081526004602090815260408083208d84529091529020805460ff1916600117905561068c8185611727565b93505050808061069b906117d4565b91505061057a565b508083146106c35760405162461bcd60e51b815260040161038e906117ed565b6000878152600360205260408120600281018054919284926106e6908490611727565b9091555050600380820188905542600483015560008981526020919091526040902060010154610721906001600160a01b0316333085610f0f565b6000888152600360209081526040918290206001015482518581529182018a9052428284015291516001600160a01b03909216918a917f8bef2f9a0ffc703ad74a923f818f32d9d78b1c49cc3b248c0cab473eefae585b919081900360600190a35050505050505050565b610794610f4d565b33600090815260046020908152604080832084845290915290205460ff166108165760405162461bcd60e51b815260206004820152602f60248201527f436c61696d61626c653a207573657220646f6573206e6f74206861766520636c60448201526e61696d61626c652062616c616e636560881b606482015260840161038e565b600081815260036020819052604090912090810154600482015461083a9190611727565b4211156108935760405162461bcd60e51b815260206004820152602160248201527f436c61696d61626c653a20636c61696d61626c6520706572696f6420656e64656044820152601960fa1b606482015260840161038e565b3360008181526002602081815260408084208785528252808420805490859055948452600482528084208785529091528220805460ff19169055830180548392906108df908490611833565b909155505060018201546108fd906001600160a01b03163383610eac565b600182015460405182815233916001600160a01b03169085907fce3bcb6e219596cf26007ffdfaae8953bc3f76e3f36c0a79b23e28020da3222e9060200160405180910390a4505050565b3360009081526005602052604090205460ff166109775760405162461bcd60e51b815260040161038e906116b7565b61097f610f93565b565b610989610fdf565b61097f600061103f565b6001600160a01b03811660009081526002602090815260408083208584529091529020545b92915050565b3360009081526005602052604090205460ff166109ed5760405162461bcd60e51b815260040161038e906116b7565b6303c267008411158015610a04575062093a808410155b610a205760405162461bcd60e51b815260040161038e9061173a565b82516001600160a01b038616610a885760405162461bcd60e51b815260206004820152602760248201527f436c61696d61626c653a20746f6b656e20616464726573732063616e6e6f74206044820152666265207a65726f60c81b606482015260840161038e565b82518114610aa85760405162461bcd60e51b815260040161038e9061176d565b6001546000805b83811015610ba45760006001600160a01b0316878281518110610ad457610ad46117be565b60200260200101516001600160a01b031603610b025760405162461bcd60e51b815260040161038e906116dd565b6000878281518110610b1657610b166117be565b602002602001015190506000878381518110610b3457610b346117be565b6020908102919091018101516001600160a01b03841660008181526002845260408082208a8352855280822084905591815260048452818120898252909352909120805460ff191660011790559050610b8d8185611727565b935050508080610b9c906117d4565b915050610aaf565b5060008281526003602081905260409091208381556001810180546001600160a01b0319166001600160a01b038c1617905560028101839055908101889055426004820155848214610c085760405162461bcd60e51b815260040161038e906117ed565b610c1d6001600160a01b038a16333085610f0f565b60018054906000610c2d836117d4565b9091555050805460408051848152602081018b9052428183015290516001600160a01b038c1692917f8bef2f9a0ffc703ad74a923f818f32d9d78b1c49cc3b248c0cab473eefae585b919081900360600190a3505050505050505050565b3360009081526005602052604090205460ff16610cba5760405162461bcd60e51b815260040161038e906116b7565b61097f611098565b610cca610fdf565b6040516370a0823160e01b81526000906001600160a01b038316906370a0823190610cf9903090600401611629565b602060405180830381865afa158015610d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3a9190611846565b9050610d506001600160a01b0383163383610eac565b5050565b610d5c610f4d565b805160005b81811015610d9d57610d8b838281518110610d7e57610d7e6117be565b602002602001015161078c565b80610d95816117d4565b915050610d61565b505050565b610daa610fdf565b6001600160a01b038216610dd05760405162461bcd60e51b815260040161038e906116dd565b6001600160a01b038216600081815260056020908152604091829020805460ff19168515159081179091558251938452908301527f6cc67219f62a9e5d66cc9f2a62e16634cffcf48facd698a829bafcc1ad2c5c83910160405180910390a15050565b610e3b610fdf565b6001600160a01b038116610ea05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161038e565b610ea98161103f565b50565b6040516001600160a01b038316602482015260448101829052610d9d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526110d5565b6040516001600160a01b0380851660248301528316604482015260648101829052610f479085906323b872dd60e01b90608401610ed8565b50505050565b60005460ff161561097f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161038e565b610f9b6111a7565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b604051610fd59190611629565b60405180910390a1565b6000546001600160a01b0361010090910416331461097f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161038e565b600080546001600160a01b03838116610100818102610100600160a81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6110a0610f4d565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610fc83390565b600061112a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111f09092919063ffffffff16565b805190915015610d9d5780806020019051810190611148919061185f565b610d9d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161038e565b60005460ff1661097f5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161038e565b60606111ff8484600085611207565b949350505050565b6060824710156112685760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161038e565b600080866001600160a01b0316858760405161128491906118a0565b60006040518083038185875af1925050503d80600081146112c1576040519150601f19603f3d011682016040523d82523d6000602084013e6112c6565b606091505b50915091506112d7878383876112e2565b979650505050505050565b6060831561135157825160000361134a576001600160a01b0385163b61134a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161038e565b50816111ff565b6111ff83838151156113665781518083602001fd5b8060405162461bcd60e51b815260040161038e91906118bc565b80356001600160a01b038116811461139757600080fd5b919050565b600080604083850312156113af57600080fd5b823591506113bf60208401611380565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611407576114076113c8565b604052919050565b600067ffffffffffffffff821115611429576114296113c8565b5060051b60200190565b600082601f83011261144457600080fd5b813560206114596114548361140f565b6113de565b82815260059290921b8401810191818101908684111561147857600080fd5b8286015b8481101561149a5761148d81611380565b835291830191830161147c565b509695505050505050565b600082601f8301126114b657600080fd5b813560206114c66114548361140f565b82815260059290921b840181019181810190868411156114e557600080fd5b8286015b8481101561149a57803583529183019183016114e9565b600080600080600060a0868803121561151857600080fd5b8535945060208601359350604086013567ffffffffffffffff8082111561153e57600080fd5b61154a89838a01611433565b9450606088013591508082111561156057600080fd5b5061156d888289016114a5565b95989497509295608001359392505050565b6000806040838503121561159257600080fd5b61159b83611380565b946020939093013593505050565b6000602082840312156115bb57600080fd5b5035919050565b6000602082840312156115d457600080fd5b6115dd82611380565b9392505050565b600080600080600060a086880312156115fc57600080fd5b61160586611380565b945060208601359350604086013567ffffffffffffffff8082111561153e57600080fd5b6001600160a01b0391909116815260200190565b60006020828403121561164f57600080fd5b813567ffffffffffffffff81111561166657600080fd5b6111ff848285016114a5565b8015158114610ea957600080fd5b6000806040838503121561169357600080fd5b61169c83611380565b915060208301356116ac81611672565b809150509250929050565b6020808252600c908201526b68616e646c6572206f6e6c7960a01b604082015260600190565b6020808252601a9082015279436c61696d61626c653a20496e76616c6964206164647265737360301b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156109b8576109b8611711565b60208082526019908201527810db185a5b58589b194e881a5b9d985b1a59081c195c9a5bd9603a1b604082015260600190565b60208082526031908201527f436c61696d61626c653a207573657220616e642062616c616e636520617272616040820152700f240d8cadccee8d040dad2e6dac2e8c6d607b1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b6000600182016117e6576117e6611711565b5060010190565b60208082526026908201527f436c61696d61626c653a20696e70757420746f74616c20616d6f756e74206d696040820152650e6dac2e8c6d60d31b606082015260800190565b818103818111156109b8576109b8611711565b60006020828403121561185857600080fd5b5051919050565b60006020828403121561187157600080fd5b81516115dd81611672565b60005b8381101561189757818101518382015260200161187f565b50506000910152565b600082516118b281846020870161187c565b9190910192915050565b60208152600082518060208401526118db81604085016020870161187c565b601f01601f1916919091016040019291505056fea264697066735822122021737c02e2d779668ef3493e54a3a007ace81fecea195ca3418dea2251e2340564736f6c63430008120033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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.