ETH Price: $3,439.87 (-0.07%)
Gas: 2 Gwei

Contract

0x4d07E2B2BAe3d8d5F489A7FBf3c421fd3B8AB8b4
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim201465082024-06-22 9:59:5931 days ago1719050399IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.000364953.45188624
Claim199952202024-06-01 6:36:5952 days ago1717223819IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.000803947.60402158
Claim199899582024-05-31 12:57:3553 days ago1717160255IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0018331320.68393056
Claim197613032024-04-29 13:35:5985 days ago1714397759IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0028180623.28615613
Claim197612952024-04-29 13:34:2385 days ago1714397663IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0028783523.7843353
Claim196884652024-04-19 9:02:5995 days ago1713517379IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0017711216.75204278
Claim196618512024-04-15 15:37:5999 days ago1713195479IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0038501233.04179397
Claim196588442024-04-15 5:30:35100 days ago1713159035IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0011467912.93966839
Claim196587782024-04-15 5:17:23100 days ago1713158243IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0009640610.8778816
Claim196530442024-04-14 10:01:47100 days ago1713088907IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0015697912.3294455
Claim196457832024-04-13 9:32:47101 days ago1713000767IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0013952615.74329519
Claim196029562024-04-07 9:34:59107 days ago1712482499IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0020752123.41544482
Claim195863152024-04-05 1:37:59110 days ago1712281079IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0016301814.79015541
Claim195863002024-04-05 1:34:59110 days ago1712280899IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0015562914.11980384
Claim195111922024-03-25 11:27:11120 days ago1711366031IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0025563428.84413575
Claim194878762024-03-22 4:46:23124 days ago1711082783IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0036730736.94387277
Claim194871232024-03-22 2:14:47124 days ago1711073687IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0031989236.09469836
Claim194796532024-03-21 1:02:47125 days ago1710982967IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0041682847.03227333
Claim194648242024-03-18 23:05:11127 days ago1710803111IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0044173549.84266849
Claim194536952024-03-17 9:31:59128 days ago1710667919IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0035917340.52682186
Claim193545962024-03-03 12:18:35142 days ago1709468315IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0072998282.36659866
Claim193432352024-03-01 22:12:35144 days ago1709331155IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0066041974.51752999
Claim193315242024-02-29 6:55:47145 days ago1709189747IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0077399487.33268371
Claim193309292024-02-29 4:55:59146 days ago1709182559IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0083755469.20850305
Claim193309212024-02-29 4:54:23146 days ago1709182463IN
0x4d07E2B2...d3B8AB8b4
0 ETH0.0090370574.67465261
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

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

Contract Name:
TimeLockStaking

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : TimeLockStaking.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./OwnPauseAuth.sol";

contract TimeLockStaking is OwnPauseAuth, ReentrancyGuard {
    using SafeERC20 for IERC20;

    // ERC20 token for staking
    IERC20 public token;

    // Campaign Name
    string public name;

    // Locking timelock (in second) after that possible to claim
    uint256 public timelock;

    // Annual Percentage Rate
    uint256 public apr;

    // Max allowable tokens for deposit
    uint256 public maxCap;

    // Campaign expiry time (in second) after that impossible to deposit
    uint256 public expiryTime;

    uint256 public minTokensPerDeposit;

    uint256 public maxTokensPerDeposit;

    // Total amount of deposited and reward tokens that have already been paid out
    uint256 public totalPayout;

    // Total amount of reward tokens
    uint256 public totalRewardTokens;

    uint256 public totalDepositedTokens;

    bool public isMaxCapReached = false;

    struct DepositInfo {
        uint256 seq;
        uint256 amount;
        uint256 reward;
        bool isPaidOut;
        uint256 unlockTime;
    }

    mapping(address => DepositInfo[]) public stakingList;

    event Deposited(
        address indexed sender,
        uint256 seq,
        uint256 amount,
        uint256 timestamp
    );

    event Claimed(
        address indexed sender,
        uint256 seq,
        uint256 amount,
        uint256 reward,
        uint256 timestamp
    );

    event OwnerClaimed(address indexed sender, uint256 _remainingReward, address _to);
    event OwnerWithdrawn(address indexed sender, uint256 _amount, address _to);
    event OwnerWithdrawnAll(address indexed sender, uint256 _amount, address _to);

    event EvtSetName(string _name);
    event EvtSetTimelock(uint256 _timelock);
    event EvtSetAPR(uint256 _apr);
    event EvtSetMaxCap(uint256 _maxCap);
    event EvtSetExpiryTime(uint256 _expiryTime);
    event EvtSetMinTokensPerDeposit(uint256 _minTokensPerDeposit);
    event EvtSetMaxTokensPerDeposit(uint256 _maxTokensPerDeposit);

    constructor(
        IERC20 _token,
        string memory _campaignName,
        uint256 _expiryTime, // set to zero to disable expiry
        uint256 _maxCap,
        uint256 _maxTokensPerDeposit,
        uint256 _minTokensPerDeposit,
        uint256 _timelock,
        uint256 _apr
    ) {
        token = _token;
        name = _campaignName;

        if (_expiryTime > 0) {
            expiryTime = block.timestamp + _expiryTime;
        }

        maxCap = _maxCap;
        maxTokensPerDeposit = _maxTokensPerDeposit;
        minTokensPerDeposit = _minTokensPerDeposit;
        timelock = _timelock;
        apr = _apr;
    }

    function deposit(uint256 _amountIn) external whenNotPaused nonReentrant {
        require(isMaxCapReached == false, "TimeLockStaking: Max cap reached");

        uint256 _amount;
        if (totalDepositedTokens + _amountIn <= maxCap) {
            _amount = _amountIn;
        } else {
            isMaxCapReached = true;
            _amount = maxCap - totalDepositedTokens;
        }

        require(
            _amount >= minTokensPerDeposit,
            "TimeLockStaking: Depositing amount smaller than minTokensPerDeposit"
        );
        require(
            _amount <= maxTokensPerDeposit,
            "TimeLockStaking: Depositing amount larger than maxTokensPerDeposit"
        );
        require(
            expiryTime == 0 || block.timestamp < expiryTime,
            "TimeLockStaking: Campaign over"
        );

        token.safeTransferFrom(msg.sender, address(this), _amount);
        uint256 unlockTime = block.timestamp + timelock;
        uint256 seq = stakingList[msg.sender].length + 1;
        uint256 reward = (_amount * apr * timelock) /
            (365 * 24 * 60 * 60 * 100);

        DepositInfo memory staking = DepositInfo(
            seq,
            _amount,
            reward,
            false,
            unlockTime
        );
        stakingList[msg.sender].push(staking);

        totalDepositedTokens += _amount;
        totalRewardTokens += reward;

        emit Deposited(msg.sender, seq, _amount, block.timestamp);
    }

    function claim(uint256 _seq) external whenNotPaused nonReentrant {
        DepositInfo[] memory userStakings = stakingList[msg.sender];
        require(
            _seq > 0 && userStakings.length >= _seq,
            "TimeLockStaking: Invalid seq"
        );

        uint256 idx = _seq - 1;

        DepositInfo memory staking = userStakings[idx];

        require(!staking.isPaidOut, "TimeLockStaking: Already paid out");
        require(
            staking.unlockTime <= block.timestamp,
            "TimeLockStaking: Staking still locked"
        );

        uint256 payout = staking.amount + staking.reward;

        token.safeTransfer(msg.sender, payout);
        totalPayout += payout;

        stakingList[msg.sender][idx].isPaidOut = true;

        emit Claimed(
            msg.sender,
            _seq,
            staking.amount,
            staking.reward,
            block.timestamp
        );
    }

    // Get the total tokens that still need to be paid out (including deposited tokens and reward tokens)
    function getRemainingPayout() public view returns (uint256) {
        uint256 remainingPayoutAmount = totalDepositedTokens +
            totalRewardTokens -
            totalPayout;
        return remainingPayoutAmount;
    }

    // Get the token balance of this contract
    function getTokenBalance() public view returns (uint256) {
        return token.balanceOf(address(this));
    }

    // Get the total tokens that still need to be rewarded
    function getRemainingReward() public view returns (uint256) {
        uint256 remainingPayoutAmount = getRemainingPayout();
        uint256 balance = getTokenBalance();
        return balance - remainingPayoutAmount;
    }

    // Owner can withdraw all remaining reward tokens
    function ownerClaimRemainingReward(address _to)
        external
        isOwner
        nonReentrant
    {
        require(
            block.timestamp > expiryTime,
            "TimeLockStaking: Campaign not yet expired"
        );

        uint256 remainingReward = getRemainingReward();
        token.safeTransfer(_to, remainingReward);

        emit OwnerClaimed(msg.sender, remainingReward, _to);
    }

    // Owner can withdraw a specified amount of tokens
    function ownerWithdraw(address _to, uint256 _amount)
        external
        isOwner
        nonReentrant
    {
        token.safeTransfer(_to, _amount);

        emit OwnerWithdrawn(msg.sender, _amount, _to);
    }

    // Owner can withdraw all tokens
    function ownerWithdrawAll(address _to) external isOwner nonReentrant {
        uint256 tokenBal = getTokenBalance();
        token.safeTransfer(_to, tokenBal);

        emit OwnerWithdrawnAll(msg.sender, tokenBal, _to);
    }

    function setName(string memory _name) external isAuthorized {
        name = _name;
        emit EvtSetName(_name);
    }

    function setTimelock(uint256 _timelock) external isAuthorized {
        timelock = _timelock;
        emit EvtSetTimelock(_timelock);
    }

    function setAPR(uint256 _apr) external isAuthorized {
        apr = _apr;
        emit EvtSetAPR(_apr);
    }

    function setMaxCap(uint256 _maxCap) external isAuthorized {
        maxCap = _maxCap;
        isMaxCapReached = false;
        emit EvtSetMaxCap(_maxCap);
    }

    function setExpiryTime(uint256 _expiryTime) external isAuthorized {
        expiryTime = _expiryTime;
        emit EvtSetExpiryTime(_expiryTime);
    }

    function setMinTokensPerDeposit(uint256 _minTokensPerDeposit)
        external
        isAuthorized
    {
        minTokensPerDeposit = _minTokensPerDeposit;
        emit EvtSetMinTokensPerDeposit(_minTokensPerDeposit);
    }

    function setMaxTokensPerDeposit(uint256 _maxTokensPerDeposit)
        external
        isAuthorized
    {
        maxTokensPerDeposit = _maxTokensPerDeposit;
        emit EvtSetMaxTokensPerDeposit(_maxTokensPerDeposit);
    }

    function getCampaignInfo()
        external
        view
        returns (
            IERC20 _token,
            string memory _campaignName,
            uint256 _expiryTime,
            uint256 _maxCap,
            uint256 _maxTokensPerDeposit,
            uint256 _minTokensPerDeposit,
            uint256 _timelock,
            uint256 _apr,
            uint256 _totalDepositedTokens,
            uint256 _totalPayout
        )
    {
        return (
            token,
            name,
            expiryTime,
            maxCap,
            maxTokensPerDeposit,
            minTokensPerDeposit,
            timelock,
            apr,
            totalDepositedTokens,
            totalPayout
        );
    }

    function getStakings(address _staker)
        external
        view
        returns (
            uint256[] memory _seqs,
            uint256[] memory _amounts,
            uint256[] memory _rewards,
            bool[] memory _isPaidOuts,
            uint256[] memory _timestamps
        )
    {
        DepositInfo[] memory userStakings = stakingList[_staker];

        uint256 length = userStakings.length;

        uint256[] memory seqList = new uint256[](length);
        uint256[] memory amountList = new uint256[](length);
        uint256[] memory rewardList = new uint256[](length);
        bool[] memory isPaidOutList = new bool[](length);
        uint256[] memory timeList = new uint256[](length);

        for (uint256 idx = 0; idx < length; idx++) {
            DepositInfo memory stakingInfo = userStakings[idx];

            seqList[idx] = stakingInfo.seq;
            amountList[idx] = stakingInfo.amount;
            rewardList[idx] = stakingInfo.reward;
            isPaidOutList[idx] = stakingInfo.isPaidOut;
            timeList[idx] = stakingInfo.unlockTime;
        }

        return (seqList, amountList, rewardList, isPaidOutList, timeList);
    }
}

File 2 of 9 : Context.sol
// 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;
    }
}

File 3 of 9 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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 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 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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 4 of 9 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.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));
        }
    }

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

File 5 of 9 : IERC20.sol
// 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);
}

File 6 of 9 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 7 of 9 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

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

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        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());
    }
}

File 8 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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);
    }
}

File 9 of 9 : OwnPauseAuth.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.9;

import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

abstract contract OwnPauseAuth is Ownable, Pausable {
    mapping(address => bool) internal _authorizedAddressList;

    event RevokeAuthorized(address auth_);
    event GrantAuthorized(address auth_);

    modifier isAuthorized() {
        require(
            msg.sender == owner() || _authorizedAddressList[msg.sender] == true,
            "OwnPauseAuth: unauthorized"
        );
        _;
    }

    modifier isOwner() {
        require(msg.sender == owner(), "OwnPauseAuth: not owner");
        _;
    }

    function grantAuthorized(address auth_) external isOwner {
        require(auth_ != address(0), "OwnPauseAuth: invalid auth_ address ");

        _authorizedAddressList[auth_] = true;

        emit GrantAuthorized(auth_);
    }

    function revokeAuthorized(address auth_) external isOwner {
        require(auth_ != address(0), "OwnPauseAuth: invalid auth_ address ");

        _authorizedAddressList[auth_] = false;

        emit RevokeAuthorized(auth_);
    }

    function checkAuthorized(address auth_) public view returns (bool) {
        require(auth_ != address(0), "OwnPauseAuth: invalid auth_ address ");

        return auth_ == owner() || _authorizedAddressList[auth_] == true;
    }

    function pause() external isOwner {
        _pause();
    }

    function unpause() external isOwner {
        _unpause();
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"string","name":"_campaignName","type":"string"},{"internalType":"uint256","name":"_expiryTime","type":"uint256"},{"internalType":"uint256","name":"_maxCap","type":"uint256"},{"internalType":"uint256","name":"_maxTokensPerDeposit","type":"uint256"},{"internalType":"uint256","name":"_minTokensPerDeposit","type":"uint256"},{"internalType":"uint256","name":"_timelock","type":"uint256"},{"internalType":"uint256","name":"_apr","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"seq","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"seq","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_apr","type":"uint256"}],"name":"EvtSetAPR","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_expiryTime","type":"uint256"}],"name":"EvtSetExpiryTime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_maxCap","type":"uint256"}],"name":"EvtSetMaxCap","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_maxTokensPerDeposit","type":"uint256"}],"name":"EvtSetMaxTokensPerDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_minTokensPerDeposit","type":"uint256"}],"name":"EvtSetMinTokensPerDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_name","type":"string"}],"name":"EvtSetName","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_timelock","type":"uint256"}],"name":"EvtSetTimelock","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"auth_","type":"address"}],"name":"GrantAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_remainingReward","type":"uint256"},{"indexed":false,"internalType":"address","name":"_to","type":"address"}],"name":"OwnerClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"_to","type":"address"}],"name":"OwnerWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"_to","type":"address"}],"name":"OwnerWithdrawnAll","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":false,"internalType":"address","name":"auth_","type":"address"}],"name":"RevokeAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"apr","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"auth_","type":"address"}],"name":"checkAuthorized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_seq","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"expiryTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCampaignInfo","outputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"string","name":"_campaignName","type":"string"},{"internalType":"uint256","name":"_expiryTime","type":"uint256"},{"internalType":"uint256","name":"_maxCap","type":"uint256"},{"internalType":"uint256","name":"_maxTokensPerDeposit","type":"uint256"},{"internalType":"uint256","name":"_minTokensPerDeposit","type":"uint256"},{"internalType":"uint256","name":"_timelock","type":"uint256"},{"internalType":"uint256","name":"_apr","type":"uint256"},{"internalType":"uint256","name":"_totalDepositedTokens","type":"uint256"},{"internalType":"uint256","name":"_totalPayout","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRemainingPayout","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRemainingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_staker","type":"address"}],"name":"getStakings","outputs":[{"internalType":"uint256[]","name":"_seqs","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"_rewards","type":"uint256[]"},{"internalType":"bool[]","name":"_isPaidOuts","type":"bool[]"},{"internalType":"uint256[]","name":"_timestamps","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"auth_","type":"address"}],"name":"grantAuthorized","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isMaxCapReached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTokensPerDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minTokensPerDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"ownerClaimRemainingReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ownerWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"ownerWithdrawAll","outputs":[],"stateMutability":"nonpayable","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":"auth_","type":"address"}],"name":"revokeAuthorized","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_apr","type":"uint256"}],"name":"setAPR","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_expiryTime","type":"uint256"}],"name":"setExpiryTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxCap","type":"uint256"}],"name":"setMaxCap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxTokensPerDeposit","type":"uint256"}],"name":"setMaxTokensPerDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minTokensPerDeposit","type":"uint256"}],"name":"setMinTokensPerDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_name","type":"string"}],"name":"setName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timelock","type":"uint256"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakingList","outputs":[{"internalType":"uint256","name":"seq","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"bool","name":"isPaidOut","type":"bool"},{"internalType":"uint256","name":"unlockTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timelock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalDepositedTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPayout","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewardTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061023d5760003560e01c806382b2e2571161013b578063d0769032116100b8578063f0ae89d51161007c578063f0ae89d514610484578063f23e0bc5146104c1578063f2fde38b146104d4578063fc0c546a146104e7578063fd012664146104fa57600080fd5b8063d076903214610413578063d33219b414610437578063d6290cd714610440578063d9c88e141461045e578063e3055f8e1461047157600080fd5b806399bc0aea116100ff57806399bc0aea146103d3578063a532f85f146103dc578063b6b55f25146103e5578063c0b5fca0146103f8578063c47f00271461040057600080fd5b806382b2e257146103785780638456cb5914610380578063854303cf146103885780638da5cb5b1461039b57806394f3ed31146103c057600080fd5b80633f4ba83a116101c9578063706455831161018d578063706455831461033f578063715018a61461034757806372841e0c1461034f57806372f8006b1461035c578063763265de1461036557600080fd5b80633f4ba83a146102f4578063454f7b8f146102fc57806357ded9c9146103055780635c975abb1461030e5780636e5390e41461032c57600080fd5b80632203817c116102105780632203817c1461029f57806323548b8b146102b257806330fc4cff146102bb578063379607f5146102ce5780633f48be2d146102e157600080fd5b806306fdde0314610242578063156125b4146102605780631b0875a6146102755780631e891c0a1461028c575b600080fd5b61024a610503565b6040516102579190612035565b60405180910390f35b61027361026e366004612048565b610591565b005b61027e600c5481565b604051908152602001610257565b61027361029a366004612048565b610620565b6102736102ad36600461207d565b61069f565b61027e60075481565b6102736102c9366004612048565b6107c3565b6102736102dc366004612048565b610842565b6102736102ef36600461207d565b610b5b565b610273610bfc565b61027e600b5481565b61027e60065481565b600054600160a01b900460ff165b6040519015158152602001610257565b61027361033a366004612048565b610c30565b61027e610caf565b610273610cd5565b600e5461031c9060ff1681565b61027e600a5481565b610273610373366004612048565b610d39565b61027e610dc2565b610273610e43565b610273610396366004612048565b610e75565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610257565b6102736103ce36600461207d565b610ef4565b61027e60085481565b61027e60095481565b6102736103f3366004612048565b610f99565b61027e611353565b61027361040e3660046120ae565b61137d565b61042661042136600461207d565b61140a565b60405161025795949392919061219a565b61027e60055481565b610448611730565b6040516102579a9998979695949392919061222d565b61027361046c366004612294565b61181c565b61031c61047f36600461207d565b6118c3565b610497610492366004612294565b611927565b6040805195865260208601949094529284019190915215156060830152608082015260a001610257565b6102736104cf36600461207d565b611978565b6102736104e236600461207d565b611a2c565b6003546103a8906001600160a01b031681565b61027e600d5481565b60048054610510906122be565b80601f016020809104026020016040519081016040528092919081815260200182805461053c906122be565b80156105895780601f1061055e57610100808354040283529160200191610589565b820191906000526020600020905b81548152906001019060200180831161056c57829003601f168201915b505050505081565b6000546001600160a01b03163314806105bf57503360009081526001602081905260409091205460ff161515145b6105e45760405162461bcd60e51b81526004016105db906122f9565b60405180910390fd5b60098190556040518181527fa80fc2e91fb709346d25a56cdbd2a8d8936d5259d20140ecb10d3305c42ffb9c906020015b60405180910390a150565b6000546001600160a01b031633148061064e57503360009081526001602081905260409091205460ff161515145b61066a5760405162461bcd60e51b81526004016105db906122f9565b60058190556040518181527f2a738282774ae6753d9a18cbb34ca1d67ccce059062e73c6f96edb1cebd481c390602001610615565b6000546001600160a01b031633146106c95760405162461bcd60e51b81526004016105db90612330565b6002805414156106eb5760405162461bcd60e51b81526004016105db90612367565b6002805560085442116107525760405162461bcd60e51b815260206004820152602960248201527f54696d654c6f636b5374616b696e673a2043616d706169676e206e6f742079656044820152681d08195e1c1a5c995960ba1b60648201526084016105db565b600061075c611353565b600354909150610776906001600160a01b03168383611af7565b604080518281526001600160a01b038416602082015233917f2483872b450329d9bdeb46fcf0b70a23ab7481f02fa1fcee27def5770953dfe491015b60405180910390a250506001600255565b6000546001600160a01b03163314806107f157503360009081526001602081905260409091205460ff161515145b61080d5760405162461bcd60e51b81526004016105db906122f9565b60088190556040518181527fc45be2495db5c374190c39b2e7f5a7cfe7b6290ef65eb01859f0121bc41831b690602001610615565b600054600160a01b900460ff161561086c5760405162461bcd60e51b81526004016105db9061239e565b60028054141561088e5760405162461bcd60e51b81526004016105db90612367565b60028055336000908152600f6020908152604080832080548251818502810185019093528083529192909190849084015b828210156109225760008481526020908190206040805160a081018252600586029092018054835260018082015484860152600282015492840192909252600381015460ff161515606084015260040154608083015290835290920191016108bf565b505050509050600082118015610939575081815110155b6109855760405162461bcd60e51b815260206004820152601c60248201527f54696d654c6f636b5374616b696e673a20496e76616c6964207365710000000060448201526064016105db565b60006109926001846123de565b905060008282815181106109a8576109a86123f5565b60200260200101519050806060015115610a0e5760405162461bcd60e51b815260206004820152602160248201527f54696d654c6f636b5374616b696e673a20416c72656164792070616964206f756044820152601d60fa1b60648201526084016105db565b4281608001511115610a705760405162461bcd60e51b815260206004820152602560248201527f54696d654c6f636b5374616b696e673a205374616b696e67207374696c6c206c6044820152641bd8dad95960da1b60648201526084016105db565b600081604001518260200151610a86919061240b565b600354909150610aa0906001600160a01b03163383611af7565b80600b6000828254610ab2919061240b565b9091555050336000908152600f6020526040902080546001919085908110610adc57610adc6123f5565b600091825260209182902060059190910201600301805460ff1916921515929092179091558281015160408085015181518981529384019290925282015242606082015233907f7708755c9b641bf197be5047b04002d2e88fa658c173a351067747eb5dfc568a9060800160405180910390a250506001600255505050565b6000546001600160a01b03163314610b855760405162461bcd60e51b81526004016105db90612330565b6001600160a01b038116610bab5760405162461bcd60e51b81526004016105db90612423565b6001600160a01b038116600081815260016020908152604091829020805460ff1916905590519182527feed123f85e69d50d4372001816df89ce5d67d5b1ba8dccdecd6d2754d7ed48e99101610615565b6000546001600160a01b03163314610c265760405162461bcd60e51b81526004016105db90612330565b610c2e611b5f565b565b6000546001600160a01b0316331480610c5e57503360009081526001602081905260409091205460ff161515145b610c7a5760405162461bcd60e51b81526004016105db906122f9565b600a8190556040518181527f16e219cb796513778e7d04b0329b5818c132c2edc0bfe74c2b2943b7c8ca07c290602001610615565b600080600b54600c54600d54610cc5919061240b565b610ccf91906123de565b92915050565b6000546001600160a01b03163314610d2f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105db565b610c2e6000611bfc565b6000546001600160a01b0316331480610d6757503360009081526001602081905260409091205460ff161515145b610d835760405162461bcd60e51b81526004016105db906122f9565b6007819055600e805460ff191690556040518181527f1153bb32456dba9b9c736d0f989022e5be1cd294eec02e6d55e23734068f6d7390602001610615565b6003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b158015610e0657600080fd5b505afa158015610e1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3e9190612467565b905090565b6000546001600160a01b03163314610e6d5760405162461bcd60e51b81526004016105db90612330565b610c2e611c4c565b6000546001600160a01b0316331480610ea357503360009081526001602081905260409091205460ff161515145b610ebf5760405162461bcd60e51b81526004016105db906122f9565b60068190556040518181527ffdd096f159dc1a96ea19f4f40e465f2f1b01586398b4cea1788b84990b81220490602001610615565b6000546001600160a01b03163314610f1e5760405162461bcd60e51b81526004016105db90612330565b6001600160a01b038116610f445760405162461bcd60e51b81526004016105db90612423565b6001600160a01b038116600081815260016020818152604092839020805460ff191690921790915590519182527fad99ece5d2f7828cc392ecc37425edaf0588e97ced1ceb0f152e538576a573929101610615565b600054600160a01b900460ff1615610fc35760405162461bcd60e51b81526004016105db9061239e565b600280541415610fe55760405162461bcd60e51b81526004016105db90612367565b60028055600e5460ff161561103c5760405162461bcd60e51b815260206004820181905260248201527f54696d654c6f636b5374616b696e673a204d617820636170207265616368656460448201526064016105db565b600060075482600d5461104f919061240b565b1161105b57508061107b565b600e805460ff19166001179055600d5460075461107891906123de565b90505b6009548110156110ff5760405162461bcd60e51b815260206004820152604360248201527f54696d654c6f636b5374616b696e673a204465706f736974696e6720616d6f7560448201527f6e7420736d616c6c6572207468616e206d696e546f6b656e735065724465706f6064820152621cda5d60ea1b608482015260a4016105db565b600a548111156111825760405162461bcd60e51b815260206004820152604260248201527f54696d654c6f636b5374616b696e673a204465706f736974696e6720616d6f7560448201527f6e74206c6172676572207468616e206d6178546f6b656e735065724465706f736064820152611a5d60f21b608482015260a4016105db565b6008541580611192575060085442105b6111de5760405162461bcd60e51b815260206004820152601e60248201527f54696d654c6f636b5374616b696e673a2043616d706169676e206f766572000060448201526064016105db565b6003546111f6906001600160a01b0316333084611cb1565b600060055442611206919061240b565b336000908152600f60205260408120549192509061122590600161240b565b9050600063bbf81e006005546006548661123f9190612480565b6112499190612480565b611253919061249f565b6040805160a0810182528481526020808201888152828401858152600060608501818152608086018b8152338352600f8652968220805460018082018355918452958320875160059097020195865593519385019390935590516002840155905160038301805460ff19169115159190911790559251600490910155600d805493945090928792906112e690849061240b565b9250508190555081600c60008282546112ff919061240b565b909155505060408051848152602081018790524281830152905133917f91ede45f04a37a7c170f5c1207df3b6bc748dc1e04ad5e917a241d0f52feada3919081900360600190a25050600160025550505050565b60008061135e610caf565b9050600061136a610dc2565b905061137682826123de565b9250505090565b6000546001600160a01b03163314806113ab57503360009081526001602081905260409091205460ff161515145b6113c75760405162461bcd60e51b81526004016105db906122f9565b80516113da906004906020840190611f44565b507f33deb38d63dc637398b2a8c54e2de288e4b161c41096ac238773deb762f582b0816040516106159190612035565b60608060608060606000600f6000886001600160a01b03166001600160a01b03168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b828210156114bc5760008481526020908190206040805160a081018252600586029092018054835260018082015484860152600282015492840192909252600381015460ff16151560608401526004015460808301529083529092019101611459565b50505050905060008151905060008167ffffffffffffffff8111156114e3576114e3612098565b60405190808252806020026020018201604052801561150c578160200160208202803683370190505b50905060008267ffffffffffffffff81111561152a5761152a612098565b604051908082528060200260200182016040528015611553578160200160208202803683370190505b50905060008367ffffffffffffffff81111561157157611571612098565b60405190808252806020026020018201604052801561159a578160200160208202803683370190505b50905060008467ffffffffffffffff8111156115b8576115b8612098565b6040519080825280602002602001820160405280156115e1578160200160208202803683370190505b50905060008567ffffffffffffffff8111156115ff576115ff612098565b604051908082528060200260200182016040528015611628578160200160208202803683370190505b50905060005b8681101561171b57600088828151811061164a5761164a6123f5565b60200260200101519050806000015187838151811061166b5761166b6123f5565b602002602001018181525050806020015186838151811061168e5761168e6123f5565b60200260200101818152505080604001518583815181106116b1576116b16123f5565b60200260200101818152505080606001518483815181106116d4576116d46123f5565b60200260200101901515908115158152505080608001518383815181106116fd576116fd6123f5565b60209081029190910101525080611713816124c1565b91505061162e565b50939c929b5090995097509095509350505050565b60006060600080600080600080600080600360009054906101000a90046001600160a01b03166004600854600754600a54600954600554600654600d54600b5488805461177c906122be565b80601f01602080910402602001604051908101604052809291908181526020018280546117a8906122be565b80156117f55780601f106117ca576101008083540402835291602001916117f5565b820191906000526020600020905b8154815290600101906020018083116117d857829003601f168201915b50505050509850995099509950995099509950995099509950995090919293949596979899565b6000546001600160a01b031633146118465760405162461bcd60e51b81526004016105db90612330565b6002805414156118685760405162461bcd60e51b81526004016105db90612367565b60028055600354611883906001600160a01b03168383611af7565b604080518281526001600160a01b038416602082015233917f25d9a96fd82e8f755871a03b07b06f9dd9d0d657f0c2282f8baae8c3d9fc926d91016107b2565b60006001600160a01b0382166118eb5760405162461bcd60e51b81526004016105db90612423565b6000546001600160a01b0383811691161480610ccf5750506001600160a01b031660009081526001602081905260409091205460ff1615151490565b600f602052816000526040600020818154811061194357600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401549295509093509160ff169085565b6000546001600160a01b031633146119a25760405162461bcd60e51b81526004016105db90612330565b6002805414156119c45760405162461bcd60e51b81526004016105db90612367565b6002805560006119d2610dc2565b6003549091506119ec906001600160a01b03168383611af7565b604080518281526001600160a01b038416602082015233917f73b1e8774cf3c1ba9985725815ab749ebd36cadb19b8194098bf8e6fcbffccc191016107b2565b6000546001600160a01b03163314611a865760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105db565b6001600160a01b038116611aeb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105db565b611af481611bfc565b50565b6040516001600160a01b038316602482015260448101829052611b5a90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cef565b505050565b600054600160a01b900460ff16611baf5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016105db565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600054600160a01b900460ff1615611c765760405162461bcd60e51b81526004016105db9061239e565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611bdf3390565b6040516001600160a01b0380851660248301528316604482015260648101829052611ce99085906323b872dd60e01b90608401611b23565b50505050565b6000611d44826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611dc19092919063ffffffff16565b805190915015611b5a5780806020019051810190611d6291906124dc565b611b5a5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105db565b6060611dd08484600085611dda565b90505b9392505050565b606082471015611e3b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105db565b6001600160a01b0385163b611e925760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105db565b600080866001600160a01b03168587604051611eae91906124fe565b60006040518083038185875af1925050503d8060008114611eeb576040519150601f19603f3d011682016040523d82523d6000602084013e611ef0565b606091505b5091509150611f00828286611f0b565b979650505050505050565b60608315611f1a575081611dd3565b825115611f2a5782518084602001fd5b8160405162461bcd60e51b81526004016105db9190612035565b828054611f50906122be565b90600052602060002090601f016020900481019282611f725760008555611fb8565b82601f10611f8b57805160ff1916838001178555611fb8565b82800160010185558215611fb8579182015b82811115611fb8578251825591602001919060010190611f9d565b50611fc4929150611fc8565b5090565b5b80821115611fc45760008155600101611fc9565b60005b83811015611ff8578181015183820152602001611fe0565b83811115611ce95750506000910152565b60008151808452612021816020860160208601611fdd565b601f01601f19169290920160200192915050565b602081526000611dd36020830184612009565b60006020828403121561205a57600080fd5b5035919050565b80356001600160a01b038116811461207857600080fd5b919050565b60006020828403121561208f57600080fd5b611dd382612061565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156120c057600080fd5b813567ffffffffffffffff808211156120d857600080fd5b818401915084601f8301126120ec57600080fd5b8135818111156120fe576120fe612098565b604051601f8201601f19908116603f0116810190838211818310171561212657612126612098565b8160405282815287602084870101111561213f57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600081518084526020808501945080840160005b8381101561218f57815187529582019590820190600101612173565b509495945050505050565b60a0815260006121ad60a083018861215f565b6020838203818501526121c0828961215f565b915083820360408501526121d4828861215f565b8481036060860152865180825282880193509082019060005b8181101561220b5784511515835293830193918301916001016121ed565b5050848103608086015261221f818761215f565b9a9950505050505050505050565b6001600160a01b038b168152610140602082018190526000906122528382018d612009565b604084019b909b5250506060810197909752608087019590955260a086019390935260c085019190915260e08401526101008301526101209091015292915050565b600080604083850312156122a757600080fd5b6122b083612061565b946020939093013593505050565b600181811c908216806122d257607f821691505b602082108114156122f357634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252601a908201527f4f776e5061757365417574683a20756e617574686f72697a6564000000000000604082015260600190565b60208082526017908201527f4f776e5061757365417574683a206e6f74206f776e6572000000000000000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156123f0576123f06123c8565b500390565b634e487b7160e01b600052603260045260246000fd5b6000821982111561241e5761241e6123c8565b500190565b60208082526024908201527f4f776e5061757365417574683a20696e76616c696420617574685f2061646472604082015263032b9b9960e51b606082015260800190565b60006020828403121561247957600080fd5b5051919050565b600081600019048311821515161561249a5761249a6123c8565b500290565b6000826124bc57634e487b7160e01b600052601260045260246000fd5b500490565b60006000198214156124d5576124d56123c8565b5060010190565b6000602082840312156124ee57600080fd5b81518015158114611dd357600080fd5b60008251612510818460208701611fdd565b919091019291505056fea2646970667358221220555b19c1b7842292f43c30672ec436a14a217e718a0560604586106ec7f11f3764736f6c63430008090033

Block Transaction Difficulty 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
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.