ETH Price: $3,224.99 (+1.69%)

Contract

0x99ba298f52276c11034c7543459578DEB411191e
 

Overview

ETH Balance

0.011455661012464817 ETH

Eth Value

$36.94 (@ $3,224.99/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim194453222024-03-16 5:14:11304 days ago1710566051IN
0x99ba298f...EB411191e
0 ETH0.002516531.65807957
Press Button194408212024-03-15 14:03:47305 days ago1710511427IN
0x99ba298f...EB411191e
0 ETH0.0040530440.75211862
Press Button194362872024-03-14 22:47:11306 days ago1710456431IN
0x99ba298f...EB411191e
0 ETH0.0048789244.40472519
Claim194215582024-03-12 21:02:47308 days ago1710277367IN
0x99ba298f...EB411191e
0 ETH0.005078556.50314618
Claim194207882024-03-12 18:28:23308 days ago1710268103IN
0x99ba298f...EB411191e
0 ETH0.0052968366.63518672
Press Button194187452024-03-12 11:37:35308 days ago1710243455IN
0x99ba298f...EB411191e
0 ETH0.0061505846.01802537
Press Button194135532024-03-11 18:11:11309 days ago1710180671IN
0x99ba298f...EB411191e
0 ETH0.0085742278.02840701
Claim194129282024-03-11 16:04:35309 days ago1710173075IN
0x99ba298f...EB411191e
0 ETH0.01482493164.94146264
Claim194096852024-03-11 5:11:35309 days ago1710133895IN
0x99ba298f...EB411191e
0 ETH0.0035538439.53991875
Claim194065202024-03-10 18:35:23310 days ago1710095723IN
0x99ba298f...EB411191e
0 ETH0.0054574160.71886211
Claim194053192024-03-10 14:34:11310 days ago1710081251IN
0x99ba298f...EB411191e
0 ETH0.0061639968.58026103
Claim194044362024-03-10 11:36:35310 days ago1710070595IN
0x99ba298f...EB411191e
0 ETH0.0042639347.44026138
Claim194034792024-03-10 8:23:23310 days ago1710059003IN
0x99ba298f...EB411191e
0 ETH0.0018902450.2871115
Claim194027662024-03-10 6:00:23310 days ago1710050423IN
0x99ba298f...EB411191e
0 ETH0.0040285244.82119919
Claim194004472024-03-09 22:12:35311 days ago1710022355IN
0x99ba298f...EB411191e
0 ETH0.0056302762.64208268
Claim193997852024-03-09 19:59:47311 days ago1710014387IN
0x99ba298f...EB411191e
0 ETH0.0066893874.42571033
Claim193995322024-03-09 19:08:59311 days ago1710011339IN
0x99ba298f...EB411191e
0 ETH0.0062498369.53527501
Claim193994852024-03-09 18:59:23311 days ago1710010763IN
0x99ba298f...EB411191e
0 ETH0.0064759572.05117569
Claim193994372024-03-09 18:49:35311 days ago1710010175IN
0x99ba298f...EB411191e
0 ETH0.0059949766.6997192
Claim193991692024-03-09 17:55:47311 days ago1710006947IN
0x99ba298f...EB411191e
0 ETH0.0065171972.50998034
Claim193991622024-03-09 17:54:23311 days ago1710006863IN
0x99ba298f...EB411191e
0 ETH0.0065820373.23134785
Claim193991462024-03-09 17:51:11311 days ago1710006671IN
0x99ba298f...EB411191e
0 ETH0.0065316172.67038514
Claim193991442024-03-09 17:50:35311 days ago1710006635IN
0x99ba298f...EB411191e
0 ETH0.0065910273.33137865
Claim193991352024-03-09 17:48:47311 days ago1710006527IN
0x99ba298f...EB411191e
0 ETH0.0075219983.68935332
Claim193991302024-03-09 17:47:47311 days ago1710006467IN
0x99ba298f...EB411191e
0 ETH0.0083223692.59417926
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
202539302024-07-07 10:06:23191 days ago1720346783
0x99ba298f...EB411191e
0.00278002 ETH
199179242024-05-21 11:16:11238 days ago1716290171
0x99ba298f...EB411191e
0.00019817 ETH
198866682024-05-17 2:18:47243 days ago1715912327
0x99ba298f...EB411191e
0.00025888 ETH
198809952024-05-16 7:17:47243 days ago1715843867
0x99ba298f...EB411191e
0.00039149 ETH
197026672024-04-21 8:44:11268 days ago1713689051
0x99ba298f...EB411191e
0.00086131 ETH
195894262024-04-05 12:05:59284 days ago1712318759
0x99ba298f...EB411191e
0.00337099 ETH
194783952024-03-20 20:49:59300 days ago1710967799
0x99ba298f...EB411191e
0.00283155 ETH
194655082024-03-19 1:23:35302 days ago1710811415
0x99ba298f...EB411191e
0.00076289 ETH
194453222024-03-16 5:14:11304 days ago1710566051
0x99ba298f...EB411191e
0.02668304 ETH
194425422024-03-15 19:51:11305 days ago1710532271
0x99ba298f...EB411191e
0.00365994 ETH
194332102024-03-14 12:20:47306 days ago1710418847
0x99ba298f...EB411191e
0.00190732 ETH
194294902024-03-13 23:46:59307 days ago1710373619
0x99ba298f...EB411191e
0.00094163 ETH
194238772024-03-13 4:50:35307 days ago1710305435
0x99ba298f...EB411191e
0.00191715 ETH
194215582024-03-12 21:02:47308 days ago1710277367
0x99ba298f...EB411191e
0.0815974 ETH
194210132024-03-12 19:13:35308 days ago1710270815
0x99ba298f...EB411191e
0.00068795 ETH
194210132024-03-12 19:13:35308 days ago1710270815
0x99ba298f...EB411191e
0.00323053 ETH
194210092024-03-12 19:12:47308 days ago1710270767
0x99ba298f...EB411191e
0.00090385 ETH
194210092024-03-12 19:12:47308 days ago1710270767
0x99ba298f...EB411191e
0.00090486 ETH
194210092024-03-12 19:12:47308 days ago1710270767
0x99ba298f...EB411191e
0.01253011 ETH
194207882024-03-12 18:28:23308 days ago1710268103
0x99ba298f...EB411191e
0.01665253 ETH
194158222024-03-12 1:48:47309 days ago1710208127
0x99ba298f...EB411191e
0.00137202 ETH
194145262024-03-11 21:26:47309 days ago1710192407
0x99ba298f...EB411191e
0.00573226 ETH
194129282024-03-11 16:04:35309 days ago1710173075
0x99ba298f...EB411191e
0.32581184 ETH
194096852024-03-11 5:11:35309 days ago1710133895
0x99ba298f...EB411191e
0.08950377 ETH
194065202024-03-10 18:35:23310 days ago1710095723
0x99ba298f...EB411191e
0.13000698 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Game

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 200 runs

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

import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./IGame.sol";

contract Game is IGame, Ownable, ReentrancyGuard {
    uint256 constant _gameStartTime = 24 hours;
    uint256 constant _secondsPerTokenMax = 600;
    uint256 constant _periodTimer = 72 hours;
    uint256 constant _periodsForAccountReward = 0;
    uint256 constant _tokenDecimals = 10 ** 9;
    uint256 constant _gameClaimTimer = 48 hours;  

    IERC20 immutable _token;
    uint256 _gameNumberSnap;
    uint256 _gameRewardNumberSnap;
    uint256 _gameEthForRewardTotalSnap;
    uint256 _gameTokensStackedNumberSnap;
    uint256 _secondsPerToken = 20;
    uint256 _startTime;
    uint256 _gameEndTime;
    uint256 _gameTokensStakedTotal;
    uint256 _totalStackedTokensSnap;
    uint256 _ethTotalForPeriod;
    uint256 _periodNumberSnap;
    mapping(address => AccountData) _accounts;

    constructor(address tokenAddress_) Ownable(msg.sender) {
        _token = IERC20(tokenAddress_);
    }

    modifier whenStarted() {
        require(this.isStarted(), "not started");
        _;
    }

    modifier whenNotGameClaimState() {
        require(!_isGameEnd(), "the game is in claim state now");
        _;
    }

    modifier noContracts() {
        require(msg.sender == tx.origin, "no contracts allowed");
        _;
    }

    receive() external payable {}

    function _sendEther(address to, uint256 count) internal nonReentrant {
        if (count == 0) return;
        payable(to).transfer(count);
    }

    function start() external onlyOwner {
        require(!this.isStarted());
        _startTime = block.timestamp;
        _gameEndTime = block.timestamp + _gameStartTime;
        _gameNumberSnap = 1;
    }

    function startTime() external view returns (uint256) {
        return _startTime;
    }

    function isGameEnd() external view returns (bool) {
        return _isGameEnd();
    }

    function _isGameEnd() private view returns (bool) {
        return
            _gameEndTime > 0 &&
            block.timestamp >= _gameEndTime &&
            block.timestamp < _newGameTime();
    }

    function newGameTime() external view returns (uint256) {
        return _newGameTime();
    }

    function _newGameTime() private view returns (uint256) {
        if (_gameEndTime == 0) return 0;
        return _gameEndTime + _gameClaimTimer;
    }

    function gameClaimTimer() external pure returns (uint256) {
        return _gameClaimTimer;
    }

    function isGameDirty() external view returns (bool) {
        return _isGameDirty();
    }

    function _isGameDirty() private view returns (bool) {
        return _gameEndTime > 0 && block.timestamp >= _newGameTime();
    }

    function isGameEthSnapNumberDirty() external view returns (bool) {
        return _isGameEthSnapNumberDirty();
    }

    function _isGameEthSnapNumberDirty() private view returns (bool) {
        if (!_isStarted()) return true;
        return (_gameEndTime > 0 && (_gameRewardNumberSnap != _gameNumber()));
    }

    function _isTokensStakedGameTotalDirty() private view returns (bool) {
        return _gameNumber() > _gameTokensStackedNumberSnap;
    }

    function _tryUpdateGameRewardSnap() private {
        if (block.timestamp < _gameEndTime) return;
        if (!_isGameEthSnapNumberDirty()) return;
        _gameRewardNumberSnap = _gameNumber();
        _gameEthForRewardTotalSnap = address(this).balance;
    }

    function _tryUpdateTokensStakedGameTotal() private {
        if (!_isTokensStakedGameTotalDirty()) return;
        _gameTokensStackedNumberSnap = _gameNumber();
        _gameTokensStakedTotal = 0;
    }

    function gameEthForRewardTotal() external view returns (uint256) {
        return _gameEthForRewardTotal();
    }

    function _gameEthForRewardTotal() private view returns (uint256) {
        if (_isGameEthSnapNumberDirty()) return address(this).balance;
        return _gameEthForRewardTotalSnap;
    }

    function tokensStakedGameTotal() external view returns (uint256) {
        return _tokensStakedGameTotal();
    }

    function _tokensStakedGameTotal() private view returns (uint256) {
        if (!_isTokensStakedGameTotalDirty()) return _gameTokensStakedTotal;
        return 0;
    }

    function _tryRestartGame() private {
        if (!_isGameDirty()) return;
        _startTime = block.timestamp;
        _gameEndTime = block.timestamp + _gameStartTime;
        ++_gameNumberSnap;
    }

    function gameNumber() external view returns (uint256) {
        return _gameNumber();
    }

    function _gameNumber() private view returns (uint256) {
        if (!_isStarted()) return 0;
        if (!_isGameDirty()) return _gameNumberSnap;
        return _gameNumberSnap + 1;
    }

    function periodNumber() external view returns (uint256) {
        return _periodNumber();
    }

    function _periodNumber() private view returns (uint256) {
        if (!_isStarted()) return 0;
        return (block.timestamp - _startTime) / _periodTimer;
    }

    function periodTimeLeft() external view returns (uint256) {
        if (!_isStarted()) return _periodTimer;
        if (_isGameEnd()) return 0;
        return _periodTimer - ((block.timestamp - _startTime) % _periodTimer);
    }

    function gameTimeLeft() external view returns (uint256) {
        if (!_isStarted()) return _gameStartTime;
        if (_isGameEnd()) return 0;
        return _gameEndTime - block.timestamp;
    }

    function _isPeriodDirty() private view returns (bool) {
        if (!_isStarted()) return false;
        if (_isGameEnd()) return false;
        return _periodNumberSnap != _periodNumber();
    }

    function periodTimer() external pure returns (uint256) {
        return _periodTimer;
    }

    function isStarted() external view returns (bool) {
        return _isStarted();
    }

    function _isStarted() private view returns (bool) {
        return _startTime != 0;
    }

    function tokenAddress() external view returns (address) {
        return address(_token);
    }

    function secondsPerToken() external view returns (uint256) {
        return _secondsPerToken;
    }

    function setSecondsPerToken(uint256 newSecondsPerToken) external onlyOwner {
        require(newSecondsPerToken <= _secondsPerTokenMax);
        _secondsPerToken = newSecondsPerToken;
    }

    function gameEndTime() external view returns (uint256) {
        return _gameEndTime;
    }

    function periodEndTime() external view returns (uint256) {
        if (!_isStarted()) return 0;
        if (_isGameEnd()) return 0;
        return
            _startTime +
            _periodTimer *
            (1 + (block.timestamp - _startTime) / _periodTimer);
    }

    function tokensStakedOnPeriod() external view returns (uint256) {
        return _tokensStakedOnPeriod();
    }

    function _tokensStakedOnPeriod() private view returns (uint256) {
        if (_isPeriodDirty()) return _tokensStakedGameTotal();
        return _totalStackedTokensSnap;
    }

    function tokenStakedAccount(
        address account
    ) external view returns (uint256) {
        return _tokenStakedAccount(_accounts[account]);
    }

    function _tokenStakedAccount(
        AccountData memory data
    ) private view returns (uint256) {
        if (data.gameNumber != _gameNumber()) return 0;
        return data.count;
    }

    function ethRewardOnPeriod() external view returns (uint256) {
        return _ethRewardOnPeriod();
    }

    function _ethRewardOnPeriod() private view returns (uint256) {
        if (!_isPeriodDirty()) return _ethTotalForPeriod;
        return _getEthForPeriod();
    }

    function ethRewardOnPeriodCalculated() external view returns (uint256) {
        return _getEthForPeriod();
    }

    function _getEthForPeriod() private view returns (uint256) {
        uint256 balance = address(this).balance;
        if (balance < 10e18) return balance / 2;
        if (balance < 20e18) return (balance * 40) / 100;
        if (balance < 40e18) return (balance * 30) / 100;
        if (balance < 80e18) return (balance * 20) / 100;
        return balance / 10;
    }

    function tryUpdateSnap() public {
        _tryRestartGame();
        _tryUpdateGameRewardSnap();
        _tryUpdatePeriodSnap();
        _tryUpdateTokensStakedGameTotal();
    }

    function _tryUpdatePeriodSnap() private {
        if (!_isPeriodDirty()) return;
        _ethTotalForPeriod = _getEthForPeriod();
        _periodNumberSnap = _periodNumber();
        _totalStackedTokensSnap = _tokensStakedGameTotal();
    }

    function pressButton(uint256 count) external {
        _addStake(msg.sender, count);
    }

    function _addStake(
        address account,
        uint256 count
    ) private whenStarted whenNotGameClaimState noContracts {
        tryUpdateSnap();
        AccountData storage data = _accounts[account];
        _claim(account, data);
        _token.transferFrom(account, address(_token), count);
        data.count = _tokenStakedAccount(data) + count;
        data.gameNumber = _gameNumber();
        data.period = _periodNumber();
        _gameEndTime += (_secondsPerToken * count) / _tokenDecimals;
        _gameTokensStakedTotal += count;
    }

    function claim() external {
        AccountData storage data = _accounts[msg.sender];
        require(_canClaim(data), "can not claim");
        _claim(msg.sender, _accounts[msg.sender]);
    }

    function _claim(
        address account,
        AccountData storage data
    ) private noContracts {
        tryUpdateSnap();
        if (!_canClaim(data)) return;
        uint256 count = _ethForClaimForAccount(data);
        data.claimedGame = _gameNumber();
        _sendEther(account, count);
    }

    function claimOnPeriod() external {
        AccountData storage data = _accounts[msg.sender];
        require(_canClaimOnPeriod(data), "can not claim on period");
        _claimOnPeriod(msg.sender, data);
    }

    function _claimOnPeriod(
        address account,
        AccountData storage data
    ) private noContracts {
        if (!_canClaimOnPeriod(data)) return;
        uint256 count = _ethForClaimForAccountOnPeriod(data);
        data.period = _periodNumber();
        _sendEther(account, count);
    }

    function canClaimOnPeriod(address account) external view returns (bool) {
        return _canClaimOnPeriod(_accounts[account]);
    }

    function _canClaimOnPeriod(
        AccountData memory data
    ) private view returns (bool) {
        if (_isGameEnd()) return false;
        if (_tokenStakedAccount(data) == 0) return false;
        if (data.period + _periodsForAccountReward >= _periodNumber())
            return false;
        return true;
    }

    function canClaim(address account) external view returns (bool) {
        return _canClaim(_accounts[account]);
    }

    function _canClaim(AccountData memory data) private view returns (bool) {
        if (!_isGameEnd()) return false;
        if (data.claimedGame == _gameNumber()) return false;
        if (_tokenStakedAccount(data) == 0) return false;
        return true;
    }

    function ethForClaimForAccount(
        address account
    ) external view returns (uint256) {
        return _ethForClaimForAccount(_accounts[account]);
    }

    function _ethForClaimForAccount(
        AccountData memory data
    ) private view returns (uint256) {
        if (!_canClaim(data)) return 0;
        return _ethForClaimForTokens(_tokenStakedAccount(data));
    }

    function ethForClaimForAccountPredicted(
        address account
    ) external view returns (uint256) {
        return _ethForClaimForTokens(_tokenStakedAccount(_accounts[account]));
    }

    function ethForClaimForTokens(
        uint256 count
    ) external view returns (uint256) {
        return _ethForClaimForTokens(count);
    }

    function _ethForClaimForTokens(
        uint256 count
    ) private view returns (uint256) {
        return (_gameEthForRewardTotal() * count) / _tokensStakedGameTotal();
    }

    function ethForClaimForAccountOnPeriod(
        address account
    ) external view returns (uint256) {
        return _ethForClaimForAccountOnPeriod(_accounts[account]);
    }

    function _ethForClaimForAccountOnPeriod(
        AccountData memory data
    ) private view returns (uint256) {
        if (!_canClaimOnPeriod(data)) return 0;
        return _ethForClaimForTokensOnPeriod(_tokenStakedAccount(data));
    }

    function ethForClaimForTokensOnPeriod(
        uint256 count
    ) external view returns (uint256) {
        return _ethForClaimForTokensOnPeriod(count);
    }

    function ethForClaimForTokensOnPeriodPrediction(
        uint256 count
    ) external view returns (uint256) {
        return _ethForClaimForTokensOnPeriodPrediction(count);
    }

    function _ethForClaimForTokensOnPeriodPrediction(
        uint256 count
    ) private view returns (uint256) {
        return (_getEthForPeriod() * count) / _tokensStakedGameTotal();
    }

    function ethForClaimForAccountOnPeriodPrediction(
        address account
    ) external view returns (uint256) {
        return
            _ethForClaimForTokensOnPeriodPrediction(
                _tokenStakedAccount(_accounts[account])
            );
    }

    function _ethForClaimForTokensOnPeriod(
        uint256 count
    ) private view returns (uint256) {
        return (_ethRewardOnPeriod() * count) / _tokensStakedGameTotal();
    }

    function getAccountData(
        address account
    ) external view returns (AccountData memory) {
        return _accounts[account];
    }
}

File 2 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @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 {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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 3 of 6 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

File 4 of 6 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

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

pragma solidity ^0.8.20;

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

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

    uint256 private _status;

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

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

File 6 of 6 : IGame.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

struct AccountData {
    uint256 count;
    uint256 period;
    uint256 claimedGame;
    uint256 gameNumber;
}

interface IGame {
    function isStarted() external view returns (bool);

    function startTime() external view returns (uint256);

    function isGameEnd() external view returns (bool);

    /// @dev new game time. only if game end
    function newGameTime() external view returns (uint256);

    function gameClaimTimer() external view returns (uint256);

    function gameNumber() external view returns (uint256);

    function periodNumber() external view returns (uint256);

    function periodTimer() external view returns (uint256);

    function tokenAddress() external view returns (address);

    function secondsPerToken() external view returns (uint256);

    function gameEndTime() external view returns (uint256);

    function periodEndTime() external view returns (uint256);

    function tokensStakedGameTotal() external view returns (uint256);

    function tokensStakedOnPeriod() external view returns (uint256);

    function tokenStakedAccount(
        address account
    ) external view returns (uint256);

    function ethRewardOnPeriod() external view returns (uint256);

    function ethRewardOnPeriodCalculated() external view returns (uint256);

    function pressButton(uint256 count) external;

    function canClaim(address account) external view returns (bool);

    function canClaimOnPeriod(address account) external view returns (bool);

    function claim() external;

    function claimOnPeriod() external;

    function ethForClaimForAccount(
        address account
    ) external view returns (uint256);

    function ethForClaimForAccountPredicted(
        address account
    ) external view returns (uint256);

    function ethForClaimForTokens(
        uint256 count
    ) external view returns (uint256);

    function ethForClaimForAccountOnPeriod(
        address account
    ) external view returns (uint256);

    function ethForClaimForTokensOnPeriod(
        uint256 count
    ) external view returns (uint256);

    function ethForClaimForTokensOnPeriodPrediction(
        uint256 count
    ) external view returns (uint256);

    function ethForClaimForAccountOnPeriodPrediction(
        address account
    ) external view returns (uint256);

    function gameTimeLeft() external view returns (uint256);

    function periodTimeLeft() external view returns (uint256);

    function getAccountData(
        address account
    ) external view returns (AccountData memory);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"tokenAddress_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"canClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"canClaimOnPeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOnPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"ethForClaimForAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"ethForClaimForAccountOnPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"ethForClaimForAccountOnPeriodPrediction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"ethForClaimForAccountPredicted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"ethForClaimForTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"ethForClaimForTokensOnPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"ethForClaimForTokensOnPeriodPrediction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethRewardOnPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ethRewardOnPeriodCalculated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameClaimTimer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"gameEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameEthForRewardTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gameTimeLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountData","outputs":[{"components":[{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"claimedGame","type":"uint256"},{"internalType":"uint256","name":"gameNumber","type":"uint256"}],"internalType":"struct AccountData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isGameDirty","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isGameEnd","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isGameEthSnapNumberDirty","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isStarted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newGameTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodTimeLeft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodTimer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"pressButton","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"secondsPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newSecondsPerToken","type":"uint256"}],"name":"setSecondsPerToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"start","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"tokenStakedAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensStakedGameTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensStakedOnPeriod","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":"tryUpdateSnap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052601460065534801561001557600080fd5b506040516200199d3803806200199d833981016040819052610036916100cb565b338061005c57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6100658161007b565b50600180556001600160a01b03166080526100fb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100dd57600080fd5b81516001600160a01b03811681146100f457600080fd5b9392505050565b60805161187f6200011e600039600081816105a70152610fff015261187f6000f3fe60806040526004361061024a5760003560e01c806378e9792511610139578063a3e084b0116100b6578063d8d40cee1161007a578063d8d40cee1461064a578063e133da131461065f578063f2fde38b14610674578063f36008b014610694578063f6a71564146106b4578063f6c9e6c4146106c957600080fd5b8063a3e084b0146105cb578063a78deefa146105e0578063b7232b07146105f5578063be9a655514610615578063bf3506c11461062a57600080fd5b80639551203f116100fd5780639551203f146105395780639760bdde1461054e5780639961877514610563578063996f0932146105835780639d76ea581461059857600080fd5b806378e979251461049257806379ca7907146104a7578063870fd511146104c75780638da5cb5b146104e75780638f67eda81461051957600080fd5b806342d6435b116101c7578063544736e61161018b578063544736e6146103e05780635d78650e146103f557806360dc9622146104485780636bd88a5b1461045d578063715018a61461047d57600080fd5b806342d6435b1461036157806344d9bc5f1461038157806348cfaee01461039657806349025809146103ab5780634e71d92d146103cb57600080fd5b80631b9cfbe51161020e5780631b9cfbe5146102da5780631d78e562146102ff5780632971518714610314578063365e805414610329578063400efa851461033f57600080fd5b80630bf4a96b146102565780630df99ff11461027b57806314c944d614610290578063174203f8146102b05780631ac55e3f146102c557600080fd5b3661025157005b600080fd5b34801561026257600080fd5b506202a3005b6040519081526020015b60405180910390f35b34801561028757600080fd5b506102686106de565b34801561029c57600080fd5b506102686102ab366004611706565b6106ed565b3480156102bc57600080fd5b50610268610744565b3480156102d157600080fd5b5061026861074e565b3480156102e657600080fd5b506102ef610758565b6040519015158152602001610272565b34801561030b57600080fd5b50610268610762565b34801561032057600080fd5b5061026861076c565b34801561033557600080fd5b506203f480610268565b34801561034b57600080fd5b5061035f61035a366004611736565b6107a6565b005b34801561036d57600080fd5b5061035f61037c366004611736565b6107b3565b34801561038d57600080fd5b50600854610268565b3480156103a257600080fd5b506102ef6107cf565b3480156103b757600080fd5b506102686103c6366004611706565b6107d9565b3480156103d757600080fd5b5061035f61082a565b3480156103ec57600080fd5b506102ef6108ce565b34801561040157600080fd5b50610415610410366004611706565b6108db565b60405161027291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561045457600080fd5b50610268610954565b34801561046957600080fd5b506102ef610478366004611706565b61095e565b34801561048957600080fd5b5061035f6109af565b34801561049e57600080fd5b50600754610268565b3480156104b357600080fd5b506102686104c2366004611736565b6109c3565b3480156104d357600080fd5b506102686104e2366004611706565b6109ce565b3480156104f357600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610272565b34801561052557600080fd5b50610268610534366004611706565b610a1f565b34801561054557600080fd5b50610268610a79565b34801561055a57600080fd5b5061035f610a83565b34801561056f57600080fd5b5061026861057e366004611706565b610b23565b34801561058f57600080fd5b50610268610b7d565b3480156105a457600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610501565b3480156105d757600080fd5b50600654610268565b3480156105ec57600080fd5b506102ef610be8565b34801561060157600080fd5b50610268610610366004611736565b610bf2565b34801561062157600080fd5b5061035f610bfd565b34801561063657600080fd5b506102ef610645366004611706565b610c8f565b34801561065657600080fd5b50610268610ce0565b34801561066b57600080fd5b50610268610cea565b34801561068057600080fd5b5061035f61068f366004611706565b610d3f565b3480156106a057600080fd5b506102686106af366004611736565b610d7a565b3480156106c057600080fd5b5061035f610d85565b3480156106d557600080fd5b50610268610da5565b60006106e8610daf565b905090565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e90610de2565b92915050565b60006106e8610e0a565b60006106e8610e25565b60006106e8610e42565b60006106e8610e60565b6000610779600754151590565b61078557506201518090565b61078d610e7b565b156107985750600090565b426008546106e89190611765565b6107b03382610ea6565b50565b6107bb61112c565b6102588111156107ca57600080fd5b600655565b60006106e8611159565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e9061118f565b336000908152600d602090815260409182902082516080810184528154815260018201549281019290925260028101549282019290925260038201546060820152610874906111b2565b6108b55760405162461bcd60e51b815260206004820152600d60248201526c63616e206e6f7420636c61696d60981b60448201526064015b60405180910390fd5b336000818152600d602052604090206107b09190611202565b60006106e8600754151590565b6109066040518060800160405280600081526020016000815260200160008152602001600081525090565b506001600160a01b03166000908152600d6020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b60006106e86112be565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e906112e1565b6109b761112c565b6109c16000611336565b565b600061073e82611386565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e906113ad565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e90610a74906113ad565b6113ce565b60006106e86113dd565b336000908152600d602090815260409182902082516080810184528154815260018201549281019290925260028101549282019290925260038201546060820152610acd906112e1565b610b195760405162461bcd60e51b815260206004820152601760248201527f63616e206e6f7420636c61696d206f6e20706572696f6400000000000000000060448201526064016108ac565b6107b03382611470565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e90610b78906113ad565b61151e565b6000610b8a600754151590565b610b945750600090565b610b9c610e7b565b15610ba75750600090565b6203f48060075442610bb99190611765565b610bc3919061178e565b610bce9060016117a2565b610bdb906203f4806117b5565b6007546106e891906117a2565b60006106e8610e7b565b600061073e8261151e565b610c0561112c565b306001600160a01b031663544736e66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6791906117cc565b15610c7157600080fd5b426007819055610c859062015180906117a2565b6008556001600255565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e906111b2565b60006106e8611531565b6000610cf7600754151590565b610d0357506203f48090565b610d0b610e7b565b15610d165750600090565b6203f48060075442610d289190611765565b610d3291906117ee565b6106e8906203f480611765565b610d4761112c565b6001600160a01b038116610d7157604051631e4fbdf760e01b8152600060048201526024016108ac565b6107b081611336565b600061073e826113ce565b610d8d611569565b610d956115a4565b610d9d6115cf565b6109c1611600565b60006106e8611620565b6000610dbc600754151590565b610dc65750600090565b6203f48060075442610dd89190611765565b6106e8919061178e565b6000610ded826112e1565b610df957506000919050565b61073e610e05836113ad565b611386565b6000610e14611159565b15610e1e57504790565b5060045490565b6000610e2f61163e565b610e3a5750600b5490565b6106e86113dd565b6000806008541180156106e85750610e586112be565b421015905090565b6000610e6a61167a565b610e75575060095490565b50600090565b600080600854118015610e9057506008544210155b80156106e85750610e9f6112be565b4210905090565b306001600160a01b031663544736e66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ee4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0891906117cc565b610f425760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081cdd185c9d195960aa1b60448201526064016108ac565b610f4a610e7b565b15610f975760405162461bcd60e51b815260206004820152601e60248201527f7468652067616d6520697320696e20636c61696d207374617465206e6f77000060448201526064016108ac565b333214610fb65760405162461bcd60e51b81526004016108ac90611802565b610fbe610d85565b6001600160a01b0382166000908152600d60205260409020610fe08382611202565b6040516323b872dd60e01b81526001600160a01b0384811660048301527f0000000000000000000000000000000000000000000000000000000000000000166024820181905260448201849052906323b872dd906064016020604051808303816000875af1158015611056573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107a91906117cc565b506040805160808101825282548152600183015460208201526002830154918101919091526003820154606082015282906110b4906113ad565b6110be91906117a2565b81556110c8611531565b60038201556110d5610daf565b6001820155600654633b9aca00906110ee9084906117b5565b6110f8919061178e565b6008600082825461110991906117a2565b92505081905550816009600082825461112291906117a2565b9091555050505050565b6000546001600160a01b031633146109c15760405163118cdaa760e01b81523360048201526024016108ac565b6000611166600754151590565b6111705750600190565b60006008541180156106e85750611185611531565b6003541415905090565b600061119a826111b2565b6111a657506000919050565b61073e610b78836113ad565b60006111bc610e7b565b6111c857506000919050565b6111d0611531565b8260400151036111e257506000919050565b6111eb826113ad565b6000036111fa57506000919050565b506001919050565b3332146112215760405162461bcd60e51b81526004016108ac90611802565b611229610d85565b60408051608081018252825481526001830154602082015260028301549181019190915260038201546060820152611260906111b2565b156112ba576040805160808101825282548152600183015460208201526002830154918101919091526003820154606082015260009061129f9061118f565b90506112a9611531565b60028301556112b8838261168d565b505b5050565b60006008546000036112d05750600090565b6202a3006008546106e891906117a2565b60006112eb610e7b565b156112f857506000919050565b611301826113ad565b60000361131057506000919050565b611318610daf565b6000836020015161132991906117a2565b106111fa57506000919050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000611390610e60565b82611399610e25565b6113a391906117b5565b61073e919061178e565b60006113b7611531565b8260600151146113c957506000919050565b505190565b60006113d8610e60565b826113995b600047678ac7230489e80000811015611401576113fb60028261178e565b91505090565b6801158e460913d0000081101561142957606461141f8260286117b5565b6113fb919061178e565b68022b1c8c1227a0000081101561144757606461141f82601e6117b5565b6804563918244f40000081101561146557606461141f8260146117b5565b6113fb600a8261178e565b33321461148f5760405162461bcd60e51b81526004016108ac90611802565b604080516080810182528254815260018301546020820152600283015491810191909152600382015460608201526114c6906112e1565b156112ba576040805160808101825282548152600183015460208201526002830154918101919091526003820154606082015260009061150590610de2565b905061150f610daf565b60018301556112b8838261168d565b6000611528610e60565b82611399610e0a565b600061153e600754151590565b6115485750600090565b611550610e42565b61155b575060025490565b6002546106e89060016117a2565b611571610e42565b61157757565b42600781905561158b9062015180906117a2565b6008556002805460009061159e90611830565b90915550565b6008544210156115b057565b6115b8611159565b6115be57565b6115c6611531565b60035547600455565b6115d761163e565b6115dd57565b6115e56113dd565b600b556115f0610daf565b600c556115fb610e60565b600a55565b61160861167a565b61160e57565b611616611531565b6005556000600955565b600061162a61163e565b15611637576106e8610e60565b50600a5490565b600061164b600754151590565b6116555750600090565b61165d610e7b565b156116685750600090565b611670610daf565b600c541415905090565b6000600554611687611531565b11905090565b6116956116dc565b80156116d3576040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156116d1573d6000803e3d6000fd5b505b6112ba60018055565b6002600154036116ff57604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b60006020828403121561171857600080fd5b81356001600160a01b038116811461172f57600080fd5b9392505050565b60006020828403121561174857600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561073e5761073e61174f565b634e487b7160e01b600052601260045260246000fd5b60008261179d5761179d611778565b500490565b8082018082111561073e5761073e61174f565b808202811582820484141761073e5761073e61174f565b6000602082840312156117de57600080fd5b8151801515811461172f57600080fd5b6000826117fd576117fd611778565b500690565b6020808252601490820152731b9bc818dbdb9d1c9858dd1cc8185b1b1bddd95960621b604082015260600190565b6000600182016118425761184261174f565b506001019056fea2646970667358221220ff7c477cbf1d95101041e5460f822ecccaa0f7f76eb7265e08ac3f71f4df89f564736f6c6343000817003300000000000000000000000080dd9b0d9cea9be301bf1959cc4fed7d72dc2d39

Deployed Bytecode

0x60806040526004361061024a5760003560e01c806378e9792511610139578063a3e084b0116100b6578063d8d40cee1161007a578063d8d40cee1461064a578063e133da131461065f578063f2fde38b14610674578063f36008b014610694578063f6a71564146106b4578063f6c9e6c4146106c957600080fd5b8063a3e084b0146105cb578063a78deefa146105e0578063b7232b07146105f5578063be9a655514610615578063bf3506c11461062a57600080fd5b80639551203f116100fd5780639551203f146105395780639760bdde1461054e5780639961877514610563578063996f0932146105835780639d76ea581461059857600080fd5b806378e979251461049257806379ca7907146104a7578063870fd511146104c75780638da5cb5b146104e75780638f67eda81461051957600080fd5b806342d6435b116101c7578063544736e61161018b578063544736e6146103e05780635d78650e146103f557806360dc9622146104485780636bd88a5b1461045d578063715018a61461047d57600080fd5b806342d6435b1461036157806344d9bc5f1461038157806348cfaee01461039657806349025809146103ab5780634e71d92d146103cb57600080fd5b80631b9cfbe51161020e5780631b9cfbe5146102da5780631d78e562146102ff5780632971518714610314578063365e805414610329578063400efa851461033f57600080fd5b80630bf4a96b146102565780630df99ff11461027b57806314c944d614610290578063174203f8146102b05780631ac55e3f146102c557600080fd5b3661025157005b600080fd5b34801561026257600080fd5b506202a3005b6040519081526020015b60405180910390f35b34801561028757600080fd5b506102686106de565b34801561029c57600080fd5b506102686102ab366004611706565b6106ed565b3480156102bc57600080fd5b50610268610744565b3480156102d157600080fd5b5061026861074e565b3480156102e657600080fd5b506102ef610758565b6040519015158152602001610272565b34801561030b57600080fd5b50610268610762565b34801561032057600080fd5b5061026861076c565b34801561033557600080fd5b506203f480610268565b34801561034b57600080fd5b5061035f61035a366004611736565b6107a6565b005b34801561036d57600080fd5b5061035f61037c366004611736565b6107b3565b34801561038d57600080fd5b50600854610268565b3480156103a257600080fd5b506102ef6107cf565b3480156103b757600080fd5b506102686103c6366004611706565b6107d9565b3480156103d757600080fd5b5061035f61082a565b3480156103ec57600080fd5b506102ef6108ce565b34801561040157600080fd5b50610415610410366004611706565b6108db565b60405161027291908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561045457600080fd5b50610268610954565b34801561046957600080fd5b506102ef610478366004611706565b61095e565b34801561048957600080fd5b5061035f6109af565b34801561049e57600080fd5b50600754610268565b3480156104b357600080fd5b506102686104c2366004611736565b6109c3565b3480156104d357600080fd5b506102686104e2366004611706565b6109ce565b3480156104f357600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610272565b34801561052557600080fd5b50610268610534366004611706565b610a1f565b34801561054557600080fd5b50610268610a79565b34801561055a57600080fd5b5061035f610a83565b34801561056f57600080fd5b5061026861057e366004611706565b610b23565b34801561058f57600080fd5b50610268610b7d565b3480156105a457600080fd5b507f00000000000000000000000080dd9b0d9cea9be301bf1959cc4fed7d72dc2d39610501565b3480156105d757600080fd5b50600654610268565b3480156105ec57600080fd5b506102ef610be8565b34801561060157600080fd5b50610268610610366004611736565b610bf2565b34801561062157600080fd5b5061035f610bfd565b34801561063657600080fd5b506102ef610645366004611706565b610c8f565b34801561065657600080fd5b50610268610ce0565b34801561066b57600080fd5b50610268610cea565b34801561068057600080fd5b5061035f61068f366004611706565b610d3f565b3480156106a057600080fd5b506102686106af366004611736565b610d7a565b3480156106c057600080fd5b5061035f610d85565b3480156106d557600080fd5b50610268610da5565b60006106e8610daf565b905090565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e90610de2565b92915050565b60006106e8610e0a565b60006106e8610e25565b60006106e8610e42565b60006106e8610e60565b6000610779600754151590565b61078557506201518090565b61078d610e7b565b156107985750600090565b426008546106e89190611765565b6107b03382610ea6565b50565b6107bb61112c565b6102588111156107ca57600080fd5b600655565b60006106e8611159565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e9061118f565b336000908152600d602090815260409182902082516080810184528154815260018201549281019290925260028101549282019290925260038201546060820152610874906111b2565b6108b55760405162461bcd60e51b815260206004820152600d60248201526c63616e206e6f7420636c61696d60981b60448201526064015b60405180910390fd5b336000818152600d602052604090206107b09190611202565b60006106e8600754151590565b6109066040518060800160405280600081526020016000815260200160008152602001600081525090565b506001600160a01b03166000908152600d6020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b60006106e86112be565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e906112e1565b6109b761112c565b6109c16000611336565b565b600061073e82611386565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e906113ad565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e90610a74906113ad565b6113ce565b60006106e86113dd565b336000908152600d602090815260409182902082516080810184528154815260018201549281019290925260028101549282019290925260038201546060820152610acd906112e1565b610b195760405162461bcd60e51b815260206004820152601760248201527f63616e206e6f7420636c61696d206f6e20706572696f6400000000000000000060448201526064016108ac565b6107b03382611470565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e90610b78906113ad565b61151e565b6000610b8a600754151590565b610b945750600090565b610b9c610e7b565b15610ba75750600090565b6203f48060075442610bb99190611765565b610bc3919061178e565b610bce9060016117a2565b610bdb906203f4806117b5565b6007546106e891906117a2565b60006106e8610e7b565b600061073e8261151e565b610c0561112c565b306001600160a01b031663544736e66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6791906117cc565b15610c7157600080fd5b426007819055610c859062015180906117a2565b6008556001600255565b6001600160a01b0381166000908152600d6020908152604080832081516080810183528154815260018201549381019390935260028101549183019190915260030154606082015261073e906111b2565b60006106e8611531565b6000610cf7600754151590565b610d0357506203f48090565b610d0b610e7b565b15610d165750600090565b6203f48060075442610d289190611765565b610d3291906117ee565b6106e8906203f480611765565b610d4761112c565b6001600160a01b038116610d7157604051631e4fbdf760e01b8152600060048201526024016108ac565b6107b081611336565b600061073e826113ce565b610d8d611569565b610d956115a4565b610d9d6115cf565b6109c1611600565b60006106e8611620565b6000610dbc600754151590565b610dc65750600090565b6203f48060075442610dd89190611765565b6106e8919061178e565b6000610ded826112e1565b610df957506000919050565b61073e610e05836113ad565b611386565b6000610e14611159565b15610e1e57504790565b5060045490565b6000610e2f61163e565b610e3a5750600b5490565b6106e86113dd565b6000806008541180156106e85750610e586112be565b421015905090565b6000610e6a61167a565b610e75575060095490565b50600090565b600080600854118015610e9057506008544210155b80156106e85750610e9f6112be565b4210905090565b306001600160a01b031663544736e66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ee4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0891906117cc565b610f425760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd081cdd185c9d195960aa1b60448201526064016108ac565b610f4a610e7b565b15610f975760405162461bcd60e51b815260206004820152601e60248201527f7468652067616d6520697320696e20636c61696d207374617465206e6f77000060448201526064016108ac565b333214610fb65760405162461bcd60e51b81526004016108ac90611802565b610fbe610d85565b6001600160a01b0382166000908152600d60205260409020610fe08382611202565b6040516323b872dd60e01b81526001600160a01b0384811660048301527f00000000000000000000000080dd9b0d9cea9be301bf1959cc4fed7d72dc2d39166024820181905260448201849052906323b872dd906064016020604051808303816000875af1158015611056573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107a91906117cc565b506040805160808101825282548152600183015460208201526002830154918101919091526003820154606082015282906110b4906113ad565b6110be91906117a2565b81556110c8611531565b60038201556110d5610daf565b6001820155600654633b9aca00906110ee9084906117b5565b6110f8919061178e565b6008600082825461110991906117a2565b92505081905550816009600082825461112291906117a2565b9091555050505050565b6000546001600160a01b031633146109c15760405163118cdaa760e01b81523360048201526024016108ac565b6000611166600754151590565b6111705750600190565b60006008541180156106e85750611185611531565b6003541415905090565b600061119a826111b2565b6111a657506000919050565b61073e610b78836113ad565b60006111bc610e7b565b6111c857506000919050565b6111d0611531565b8260400151036111e257506000919050565b6111eb826113ad565b6000036111fa57506000919050565b506001919050565b3332146112215760405162461bcd60e51b81526004016108ac90611802565b611229610d85565b60408051608081018252825481526001830154602082015260028301549181019190915260038201546060820152611260906111b2565b156112ba576040805160808101825282548152600183015460208201526002830154918101919091526003820154606082015260009061129f9061118f565b90506112a9611531565b60028301556112b8838261168d565b505b5050565b60006008546000036112d05750600090565b6202a3006008546106e891906117a2565b60006112eb610e7b565b156112f857506000919050565b611301826113ad565b60000361131057506000919050565b611318610daf565b6000836020015161132991906117a2565b106111fa57506000919050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000611390610e60565b82611399610e25565b6113a391906117b5565b61073e919061178e565b60006113b7611531565b8260600151146113c957506000919050565b505190565b60006113d8610e60565b826113995b600047678ac7230489e80000811015611401576113fb60028261178e565b91505090565b6801158e460913d0000081101561142957606461141f8260286117b5565b6113fb919061178e565b68022b1c8c1227a0000081101561144757606461141f82601e6117b5565b6804563918244f40000081101561146557606461141f8260146117b5565b6113fb600a8261178e565b33321461148f5760405162461bcd60e51b81526004016108ac90611802565b604080516080810182528254815260018301546020820152600283015491810191909152600382015460608201526114c6906112e1565b156112ba576040805160808101825282548152600183015460208201526002830154918101919091526003820154606082015260009061150590610de2565b905061150f610daf565b60018301556112b8838261168d565b6000611528610e60565b82611399610e0a565b600061153e600754151590565b6115485750600090565b611550610e42565b61155b575060025490565b6002546106e89060016117a2565b611571610e42565b61157757565b42600781905561158b9062015180906117a2565b6008556002805460009061159e90611830565b90915550565b6008544210156115b057565b6115b8611159565b6115be57565b6115c6611531565b60035547600455565b6115d761163e565b6115dd57565b6115e56113dd565b600b556115f0610daf565b600c556115fb610e60565b600a55565b61160861167a565b61160e57565b611616611531565b6005556000600955565b600061162a61163e565b15611637576106e8610e60565b50600a5490565b600061164b600754151590565b6116555750600090565b61165d610e7b565b156116685750600090565b611670610daf565b600c541415905090565b6000600554611687611531565b11905090565b6116956116dc565b80156116d3576040516001600160a01b0383169082156108fc029083906000818181858888f193505050501580156116d1573d6000803e3d6000fd5b505b6112ba60018055565b6002600154036116ff57604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b60006020828403121561171857600080fd5b81356001600160a01b038116811461172f57600080fd5b9392505050565b60006020828403121561174857600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561073e5761073e61174f565b634e487b7160e01b600052601260045260246000fd5b60008261179d5761179d611778565b500490565b8082018082111561073e5761073e61174f565b808202811582820484141761073e5761073e61174f565b6000602082840312156117de57600080fd5b8151801515811461172f57600080fd5b6000826117fd576117fd611778565b500690565b6020808252601490820152731b9bc818dbdb9d1c9858dd1cc8185b1b1bddd95960621b604082015260600190565b6000600182016118425761184261174f565b506001019056fea2646970667358221220ff7c477cbf1d95101041e5460f822ecccaa0f7f76eb7265e08ac3f71f4df89f564736f6c63430008170033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000080dd9b0d9cea9be301bf1959cc4fed7d72dc2d39

-----Decoded View---------------
Arg [0] : tokenAddress_ (address): 0x80Dd9B0d9cEa9BE301Bf1959CC4fed7D72DC2d39

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000080dd9b0d9cea9be301bf1959cc4fed7d72dc2d39


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  ]
[ 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.