ETH Price: $1,797.68 (+7.27%)

Contract

0x0c9fe8E4d8BDED8a4c2e928cFBd6332aD980A53e
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Join ETH113513312024-11-13 15:41:17160 days ago1731512477IN
0x0c9fe8E4...aD980A53e
0.05 ETH0.000004720.00611105
Join ETH86318962024-09-11 16:53:27223 days ago1726073607IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000001980.00596496
Join ETH79265522024-08-26 9:01:59240 days ago1724662919IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.00000010.00031386
Join ETH78341032024-08-24 5:40:21242 days ago1724478021IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000000340.00104673
Join ETH77884192024-08-23 4:17:33243 days ago1724386653IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000006010.0179
Join ETH77500362024-08-22 6:58:07244 days ago1724309887IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000003630.0126656
Join ETH77117032024-08-21 9:40:21245 days ago1724233221IN
0x0c9fe8E4...aD980A53e
0.02 ETH0.000004540.00990423
Join ETH77084212024-08-21 7:50:57245 days ago1724226657IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000002840.00990243
Join ETH76858792024-08-20 19:19:33245 days ago1724181573IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000003520.01228929
Join ETH76856962024-08-20 19:13:27245 days ago1724181207IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000004320.01297368
Join ETH76424962024-08-19 19:13:27246 days ago1724094807IN
0x0c9fe8E4...aD980A53e
0.15 ETH0.000009180.00497569
Join ETH76424812024-08-19 19:12:57246 days ago1724094777IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000001950.00585216
Join ETH75992802024-08-18 19:12:55247 days ago1724008375IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000002880.01058088
Join ETH75616822024-08-17 22:19:39248 days ago1723933179IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000002370.00867343
Join ETH75202942024-08-16 23:20:03249 days ago1723850403IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000001930.0059197
Join ETH74910902024-08-16 7:06:35250 days ago1723791995IN
0x0c9fe8E4...aD980A53e
0.02 ETH0.000000450.00121283
Join ETH74696302024-08-15 19:11:15250 days ago1723749075IN
0x0c9fe8E4...aD980A53e
0.1 ETH0.000005870.00428245
Join ETH74695662024-08-15 19:09:07250 days ago1723748947IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000001110.0038797
Join ETH74693982024-08-15 19:03:31250 days ago1723748611IN
0x0c9fe8E4...aD980A53e
0.1 ETH0.000003830.00304047
Join ETH74690412024-08-15 18:51:37250 days ago1723747897IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000001130.00322004
Join ETH74690272024-08-15 18:51:09250 days ago1723747869IN
0x0c9fe8E4...aD980A53e
0.03 ETH0.000001650.00312833
Join ETH74690142024-08-15 18:50:43250 days ago1723747843IN
0x0c9fe8E4...aD980A53e
0.01 ETH0.000001060.00314076
Join ETH74690132024-08-15 18:50:41250 days ago1723747841IN
0x0c9fe8E4...aD980A53e
0.03 ETH0.000002070.00314186
Join ETH74690102024-08-15 18:50:35250 days ago1723747835IN
0x0c9fe8E4...aD980A53e
0.04 ETH0.00000210.00314008
Join ETH74689922024-08-15 18:49:59250 days ago1723747799IN
0x0c9fe8E4...aD980A53e
0.04 ETH0.000033520.04265184
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
113513312024-11-13 15:41:17160 days ago1731512477
0x0c9fe8E4...aD980A53e
0.05 ETH
86318962024-09-11 16:53:27223 days ago1726073607
0x0c9fe8E4...aD980A53e
0.01 ETH
79265522024-08-26 9:01:59240 days ago1724662919
0x0c9fe8E4...aD980A53e
0.01 ETH
78341032024-08-24 5:40:21242 days ago1724478021
0x0c9fe8E4...aD980A53e
0.01 ETH
77884192024-08-23 4:17:33243 days ago1724386653
0x0c9fe8E4...aD980A53e
0.01 ETH
77500362024-08-22 6:58:07244 days ago1724309887
0x0c9fe8E4...aD980A53e
0.01 ETH
77117032024-08-21 9:40:21245 days ago1724233221
0x0c9fe8E4...aD980A53e
0.02 ETH
77084212024-08-21 7:50:57245 days ago1724226657
0x0c9fe8E4...aD980A53e
0.01 ETH
76858792024-08-20 19:19:33245 days ago1724181573
0x0c9fe8E4...aD980A53e
0.01 ETH
76856962024-08-20 19:13:27245 days ago1724181207
0x0c9fe8E4...aD980A53e
0.01 ETH
76424962024-08-19 19:13:27246 days ago1724094807
0x0c9fe8E4...aD980A53e
0.15 ETH
76424812024-08-19 19:12:57246 days ago1724094777
0x0c9fe8E4...aD980A53e
0.01 ETH
75992802024-08-18 19:12:55247 days ago1724008375
0x0c9fe8E4...aD980A53e
0.01 ETH
75616822024-08-17 22:19:39248 days ago1723933179
0x0c9fe8E4...aD980A53e
0.01 ETH
75202942024-08-16 23:20:03249 days ago1723850403
0x0c9fe8E4...aD980A53e
0.01 ETH
74910902024-08-16 7:06:35250 days ago1723791995
0x0c9fe8E4...aD980A53e
0.02 ETH
74696302024-08-15 19:11:15250 days ago1723749075
0x0c9fe8E4...aD980A53e
0.1 ETH
74695662024-08-15 19:09:07250 days ago1723748947
0x0c9fe8E4...aD980A53e
0.01 ETH
74693982024-08-15 19:03:31250 days ago1723748611
0x0c9fe8E4...aD980A53e
0.1 ETH
74690412024-08-15 18:51:37250 days ago1723747897
0x0c9fe8E4...aD980A53e
0.01 ETH
74690272024-08-15 18:51:09250 days ago1723747869
0x0c9fe8E4...aD980A53e
0.03 ETH
74690142024-08-15 18:50:43250 days ago1723747843
0x0c9fe8E4...aD980A53e
0.01 ETH
74690132024-08-15 18:50:41250 days ago1723747841
0x0c9fe8E4...aD980A53e
0.03 ETH
74690102024-08-15 18:50:35250 days ago1723747835
0x0c9fe8E4...aD980A53e
0.04 ETH
74689922024-08-15 18:49:59250 days ago1723747799
0x0c9fe8E4...aD980A53e
0.04 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MultipleLongGame

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 15 : MultipleLongGame.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "./LongGame.sol";
import "./interfaces/IERC20.sol";

contract MultipleLongGame {

    uint256 public entryFee;
    uint256 private eventId;

    address public immutable WETH;
    address public immutable longGame;

    // Events
    event MultipleJoinedGame(uint256 eventId, address participant, uint256 count, string referralCode);


    constructor(address _WETH, address _longGame) {
        WETH = _WETH;
        longGame = _longGame;
        entryFee = ILongGame(longGame).entryFee();
    }

    receive() external payable {
        assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract
    }

    // external function when someone joined the game
    function joinETH(uint256 count, string calldata referralCode) external payable {

        require(msg.value == count * entryFee, "Incorrect entry fee");
        IWETH(WETH).deposit{value: msg.value}();
        IERC20(WETH).approve(longGame, msg.value);
        for (uint256 i = 0; i < count; i++) {
            ILongGame(longGame).joinWETH(msg.sender);
        }
        eventId++;
        emit MultipleJoinedGame(eventId, msg.sender, count, referralCode);
    }

    // external function when someone joined the game
    function joinWETH(uint256 count, string calldata referralCode) external {

        TransferHelper.safeTransferFrom(WETH, msg.sender, address(this), count * entryFee);
        IERC20(WETH).approve(longGame, count * entryFee);
        for (uint256 i = 0; i < count; i++) {
            ILongGame(longGame).joinWETH(msg.sender);
        }
        eventId++;
        emit MultipleJoinedGame(eventId, msg.sender, count, referralCode);
    }
}

File 2 of 15 : LongGame.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "openzeppelin-contracts/contracts/access/Ownable.sol";
import "./interfaces/IWETH.sol";
import "./interfaces/IFewWrappedToken.sol";
import "./libraries/TransferHelper.sol";
import "./interfaces/IERC20.sol";
import "./interfaces/ILongGame.sol";
import "./interfaces/ILongToken.sol";
import "./libraries/BlastManager.sol";

contract LongGame is ILongGame, Ownable , BlastManager{
    
    uint256 public override constant CYCLE = 3;
    address public immutable override WETH;
    address public immutable override fwWETH;

    bool public override longGameStarted = false; // global switch, onlyOwner
    uint256 public override entryFee = 0.01 ether;
    uint256 public override payout = entryFee * 2;
    uint256 public override endWhenExceed = 24 hours;
    address public override tokenAddress = address(0);
    address public override teamAddress = address(0); 
    uint256 public override tokenPerPlay = 10000 * 1 ether;
    uint256 public override gameCount;

    struct Game {
        uint256 lastParticipantTime; // no change after construct
        uint256 topPosIdx; // the relative idx of top position
        uint256 pool;
        address[] queue;
        mapping(address => uint256) inQueueCount;
        mapping(address => uint256) claimed;
    }

    mapping (uint256 => Game) public override games;

    // EVENTS
    event JoinedGame(address participant, uint256 round, uint256 position); 
    event PayoutSuccess(address participant, uint256 round, uint256 position, uint256 payout); 
    event GameStarted(uint256 round); 
    event TokenRewardClaim(address participant, uint256 round, uint256 amount);

    /**
     * Start function implementation
     */
    constructor(address _WETH, address _fwWETH) Ownable(msg.sender) BlastManager() {
        WETH = _WETH;
        fwWETH = _fwWETH;
    }

    receive() external payable {
        assert(msg.sender == WETH); // only accept ETH via fallback from the WETH contract
    }

    /**
     * A series of public reading function for values
     */

    function getTotalParticipantSize(uint256 _round) external override view returns (uint256) {
        return games[_round-1].queue.length;
    }

    function setLongGameStarted(bool _start) external override onlyOwner {
        longGameStarted = _start;
    }

    function setEntryFee(uint256 _entryFee) external override onlyOwner {
        entryFee = _entryFee;
    }

    function setEndWhenExceed(uint256 _endWhenExceed) external override onlyOwner {
        endWhenExceed = _endWhenExceed;
    }

    function setTokenAddress(address _tokenContractAddr) external override onlyOwner {
        tokenAddress = _tokenContractAddr;
    }

    function setTeamAddress(address _teamAddr) external override onlyOwner {
        teamAddress = _teamAddr;
    }

    function setTokenPerPlay(uint256 _tokenPerPlay) external override onlyOwner {
        tokenPerPlay = _tokenPerPlay;
    }

    function claimToken(uint256 _round) external override {
        require(_round <= gameCount, "Round does not exit");
        Game storage game = games[_round - 1];

        require(block.timestamp >= game.lastParticipantTime + endWhenExceed, "Round has not ended");
        require(game.inQueueCount[msg.sender] > 0, "Not play in this round");
        require(game.claimed[msg.sender] == 0, "Already claimed");
        require(tokenAddress != address(0), "Token address not set yet" );
        require(teamAddress != address(0), "Team addresss not set yet" );

        uint256 claimAmount = tokenPerPlay * game.inQueueCount[msg.sender];
        ILongToken(tokenAddress).mint(msg.sender, claimAmount);
        ILongToken(tokenAddress).mint(teamAddress, claimAmount * 15 / 100);
        game.claimed[msg.sender] = claimAmount;

        emit TokenRewardClaim(msg.sender, _round, claimAmount); 
    }

    // external function when someone joined the game
    function joinETH(address _participant) external override payable {
        require(msg.value == entryFee, "Incorrect entry fee");

        IWETH(WETH).deposit{value: msg.value}();

        join(_participant);
    }

    // external function when someone joined the game
    function joinWETH(address _participant) external override {
        TransferHelper.safeTransferFrom(WETH, msg.sender, address(this), entryFee);

        join(_participant);
    }

    function join(address _participant) private {
        require(longGameStarted, "Game not started");
        IERC20(WETH).approve(fwWETH, entryFee);
        IFewWrappedToken(fwWETH).wrapTo(entryFee, address(this));

        Game storage current_game;

        if(gameCount == 0) {
            // no active game, create new rounds
            startNewGame();
        }

        current_game = games[gameCount - 1];
        // if current_game lastParticipantTime is out of bound, create new game
        if(block.timestamp >= current_game.lastParticipantTime + endWhenExceed) {
            startNewGame();
        }
        current_game = games[gameCount - 1];

        /**
         * 1. push address to global queue, 2.update game info 3. update participant map 
         */
        current_game.queue.push(_participant);
        current_game.inQueueCount[_participant] += 1;

        current_game.pool += entryFee;
        current_game.lastParticipantTime = block.timestamp;

        if (current_game.queue.length > CYCLE && 
            (current_game.queue.length) % CYCLE == 1) {
                // pop & pay the top participant
                popParticipant();
        }

        emit JoinedGame(_participant, gameCount, current_game.queue.length);
    }

    function popParticipant() private {
        require(IFewWrappedToken(fwWETH).balanceOf(address(this)) >= payout, "Insufficient balance in contract");

        Game storage game = games[gameCount - 1];
        require(game.pool >= payout, "Insufficient balance in current pool");
        address participant = game.queue[game.topPosIdx];
        game.pool = game.pool - payout;
        game.topPosIdx = game.topPosIdx + 1;
        game.inQueueCount[participant] -= 1;

        IFewWrappedToken(fwWETH).unwrapTo(payout, participant);
        emit PayoutSuccess(participant, gameCount, game.topPosIdx, payout);
    }

    // game starts when the first participant pay and joined.
    function startNewGame() private {
        uint256 newGameID = gameCount;
        gameCount++;
        Game storage game = games[newGameID];
        game.lastParticipantTime = block.timestamp;
        emit GameStarted(gameCount);
    }
}

File 3 of 15 : IERC20.sol
pragma solidity ^0.8.0;

interface IERC20 {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);
}

File 4 of 15 : 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 5 of 15 : IWETH.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

interface IWETH {
    function deposit() external payable;
    function transfer(address to, uint value) external returns (bool);
    function withdraw(uint) external;
}

File 6 of 15 : IFewWrappedToken.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import "../interfaces/IFewERC20.sol";

interface IFewWrappedToken is IFewERC20 {
    event Mint(address indexed minter, uint256 amount, address indexed to);
    event Burn(address indexed burner, uint256 amount, address indexed to);
    event Wrap(address indexed sender, uint256 amount, address indexed to);
    event Unwrap(address indexed sender, uint256 amount, address indexed to);

    function factory() external view returns (address);
    function token() external view returns (address);

    function burn(uint256 amount) external;
    function wrapTo(uint256 amount, address to) external returns (uint256);
    function wrap(uint256 amount) external returns (uint256);
    function unwrapTo(uint256 amount, address to) external returns (uint256);
    function unwrap(uint256 amount) external returns (uint256);
}

File 7 of 15 : TransferHelper.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import '../interfaces/IERC20Minimal.sol';

/// @title TransferHelper
/// @notice Contains helper methods for interacting with ERC20 tokens that do not consistently return true/false
library TransferHelper {
    /// @notice Transfers tokens from msg.sender to a recipient
    /// @dev Calls transfer on token contract, errors with TF if transfer fails
    /// @param token The contract address of the token which will be transferred
    /// @param to The recipient of the transfer
    /// @param value The value of the transfer
    function safeTransfer(
        address token,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) =
            token.call(abi.encodeWithSelector(IERC20Minimal.transfer.selector, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TF');
    }

    function safeTransferETH(
        address to,
        uint256 value
    ) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, 'TransferHelper::safeTransferETH: ETH transfer failed');
    }

    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint256 value
    ) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            'TransferHelper::transferFrom: transferFrom failed'
        );
    }
}

File 8 of 15 : ILongGame.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

interface ILongGame {
    function CYCLE() external pure returns (uint256);
    function WETH() external view returns (address);
    function fwWETH() external view returns (address);
    function longGameStarted() external view returns (bool);
    function entryFee() external view returns (uint256);
    function payout() external view returns (uint256);
    function endWhenExceed() external view returns (uint256);
    function tokenAddress() external view returns (address);
    function teamAddress() external view returns (address);
    function gameCount() external view returns (uint256);
    function tokenPerPlay() external view returns (uint256);
    function games(uint256 round) external view returns (
            uint256 lastParticipantTime,
            uint256 topPosIdx,
            uint256 pool
        );
    function getTotalParticipantSize(uint256 _round) external view returns (uint256);

    function setLongGameStarted(bool start) external; 
    function setEntryFee(uint256 _entryFee) external;
    function setEndWhenExceed(uint256 _endWhenExceed) external;
    function setTokenAddress(address tokenContractAddr) external;
    function setTeamAddress(address teamAddr) external;
    function setTokenPerPlay(uint256 tokenPerPlay) external;

    function claimToken(uint256 round) external;
    function joinETH(address _participant) external payable;
    function joinWETH(address _participant) external;
}

File 9 of 15 : ILongToken.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

interface ILongToken {
    function mint(address to, uint value) external;
}

File 10 of 15 : BlastManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IBlast} from "../interfaces/IBlast.sol";
import {IBlastPoints} from "../interfaces/IBlastPoints.sol";

contract BlastManager {
    IBlast public constant BLAST =
        IBlast(0x4300000000000000000000000000000000000002);
    address public manager;

    modifier onlyManager() {
        require(msg.sender == manager, "Blast: not manager");
        _;
    }

    constructor() {
        manager = msg.sender;
        BLAST.configureClaimableGas();
    }

    function claimGas(
        address recipient,
        bool isMax
    ) external onlyManager returns (uint256) {
        if (isMax) {
            return BLAST.claimMaxGas(address(this), recipient);
        } else {
            return BLAST.claimAllGas(address(this), recipient);
        }
    }

    function setManager(address _manager) external onlyManager {
        manager = _manager;
    }

    function setGasMode(address blastGas) external onlyManager {
        IBlast(blastGas).configureClaimableGas();
    }

    function setPointsOperator(
        address blastPoints,
        address operator
    ) external onlyManager {
        IBlastPoints(blastPoints).configurePointsOperator(operator);
    }
}

File 11 of 15 : 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 12 of 15 : IFewERC20.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import "./IERC20.sol";

interface IFewERC20 is IERC20 {
    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}

File 13 of 15 : IERC20Minimal.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

/// @title Minimal ERC20 interface for Uniswap
/// @notice Contains a subset of the full ERC20 interface that is used in Uniswap V3
interface IERC20Minimal {
    /// @notice Returns the balance of a token
    /// @param account The account for which to look up the number of tokens it has, i.e. its balance
    /// @return The number of tokens held by the account
    function balanceOf(address account) external view returns (uint256);

    /// @notice Transfers the amount of token from the `msg.sender` to the recipient
    /// @param recipient The account that will receive the amount transferred
    /// @param amount The number of tokens to send from the sender to the recipient
    /// @return Returns true for a successful transfer, false for an unsuccessful transfer
    function transfer(address recipient, uint256 amount) external returns (bool);

    /// @notice Returns the current allowance given to a spender by an owner
    /// @param owner The account of the token owner
    /// @param spender The account of the token spender
    /// @return The current allowance granted by `owner` to `spender`
    function allowance(address owner, address spender) external view returns (uint256);

    /// @notice Sets the allowance of a spender from the `msg.sender` to the value `amount`
    /// @param spender The account which will be allowed to spend a given amount of the owners tokens
    /// @param amount The amount of tokens allowed to be used by `spender`
    /// @return Returns true for a successful approval, false for unsuccessful
    function approve(address spender, uint256 amount) external returns (bool);

    /// @notice Transfers `amount` tokens from `sender` to `recipient` up to the allowance given to the `msg.sender`
    /// @param sender The account from which the transfer will be initiated
    /// @param recipient The recipient of the transfer
    /// @param amount The amount of the transfer
    /// @return Returns true for a successful transfer, false for unsuccessful
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /// @notice Event emitted when tokens are transferred from one address to another, either via `#transfer` or `#transferFrom`.
    /// @param from The account from which the tokens were sent, i.e. the balance decreased
    /// @param to The account to which the tokens were sent, i.e. the balance increased
    /// @param value The amount of tokens that were transferred
    event Transfer(address indexed from, address indexed to, uint256 value);

    /// @notice Event emitted when the approval amount for the spender of a given owner's tokens changes.
    /// @param owner The account that approved spending of its tokens
    /// @param spender The account for which the spending allowance was modified
    /// @param value The new allowance from the owner to the spender
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 14 of 15 : IBlast.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

enum YieldMode {
    AUTOMATIC,
    DISABLED,
    CLAIMABLE
}

enum GasMode {
    VOID,
    CLAIMABLE
}

interface IBlast {
    // configure
    function configureContract(
        address contractAddress,
        YieldMode _yield,
        GasMode gasMode,
        address governor
    ) external;

    function configure(
        YieldMode _yield,
        GasMode gasMode,
        address governor
    ) external;

    // base configuration options
    function configureClaimableYield() external;

    function configureClaimableYieldOnBehalf(address contractAddress) external;

    function configureAutomaticYield() external;

    function configureAutomaticYieldOnBehalf(address contractAddress) external;

    function configureVoidYield() external;

    function configureVoidYieldOnBehalf(address contractAddress) external;

    function configureClaimableGas() external;

    function configureClaimableGasOnBehalf(address contractAddress) external;

    function configureVoidGas() external;

    function configureVoidGasOnBehalf(address contractAddress) external;

    function configureGovernor(address _governor) external;

    function configureGovernorOnBehalf(
        address _newGovernor,
        address contractAddress
    ) external;

    // claim yield
    function claimYield(
        address contractAddress,
        address recipientOfYield,
        uint256 amount
    ) external returns (uint256);

    function claimAllYield(
        address contractAddress,
        address recipientOfYield
    ) external returns (uint256);

    // claim gas
    function claimAllGas(
        address contractAddress,
        address recipientOfGas
    ) external returns (uint256);

    function claimGasAtMinClaimRate(
        address contractAddress,
        address recipientOfGas,
        uint256 minClaimRateBips
    ) external returns (uint256);

    function claimMaxGas(
        address contractAddress,
        address recipientOfGas
    ) external returns (uint256);

    function claimGas(
        address contractAddress,
        address recipientOfGas,
        uint256 gasToClaim,
        uint256 gasSecondsToConsume
    ) external returns (uint256);

    // read functions
    function readClaimableYield(
        address contractAddress
    ) external view returns (uint256);

    function readYieldConfiguration(
        address contractAddress
    ) external view returns (uint8);

    function readGasParams(
        address contractAddress
    )
        external
        view
        returns (
            uint256 etherSeconds,
            uint256 etherBalance,
            uint256 lastUpdated,
            GasMode
        );
}

File 15 of 15 : IBlastPoints.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IBlastPoints {
    /**
     * @notice Blast standard: configure for blast point operator address
     * @param operator the blast points operator address
     */
    function configurePointsOperator(address operator) external;
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "v2-core/=lib/v2-core/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_WETH","type":"address"},{"internalType":"address","name":"_longGame","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"eventId","type":"uint256"},{"indexed":false,"internalType":"address","name":"participant","type":"address"},{"indexed":false,"internalType":"uint256","name":"count","type":"uint256"},{"indexed":false,"internalType":"string","name":"referralCode","type":"string"}],"name":"MultipleJoinedGame","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"entryFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"string","name":"referralCode","type":"string"}],"name":"joinETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"count","type":"uint256"},{"internalType":"string","name":"referralCode","type":"string"}],"name":"joinWETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"longGame","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c060405234801561001057600080fd5b506040516109e13803806109e183398101604081905261002f916100ca565b6001600160a01b03808316608052811660a0819052604080516301cba98760e21b8152905163072ea61c916004808201926020929091908290030181865afa15801561007f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100a391906100fd565b600055506101169050565b80516001600160a01b03811681146100c557600080fd5b919050565b600080604083850312156100dd57600080fd5b6100e6836100ae565b91506100f4602084016100ae565b90509250929050565b60006020828403121561010f57600080fd5b5051919050565b60805160a0516108686101796000396000818161014c015281816101d8015281816102950152818161043f01526104ff015260008181605e0152818161010001528181610173015281816101a9015281816103b9015261046d01526108686000f3fe60806040526004361061004e5760003560e01c8063072ea61c14610092578063786925c8146100bb5780637c4a9cf0146100db578063ad5c4648146100ee578063e51598fd1461013a57600080fd5b3661008d57336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461008b5761008b6106ad565b005b600080fd5b34801561009e57600080fd5b506100a860005481565b6040519081526020015b60405180910390f35b3480156100c757600080fd5b5061008b6100d63660046106c3565b61016e565b61008b6100e93660046106c3565b610361565b3480156100fa57600080fd5b506101227f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100b2565b34801561014657600080fd5b506101227f000000000000000000000000000000000000000000000000000000000000000081565b6101a77f00000000000000000000000000000000000000000000000000000000000000003330600054876101a29190610755565b61056f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663095ea7b37f0000000000000000000000000000000000000000000000000000000000000000600054866102059190610755565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610250573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102749190610772565b5060005b8381101561030557604051630c64d36d60e21b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906331934db490602401600060405180830381600087803b1580156102e157600080fd5b505af11580156102f5573d6000803e3d6000fd5b5050600190920191506102789050565b50600180549060006103168361079b565b91905055507f539e129f3f7609499ddc9099607d41846a523b2457d82fce38dbbd9fe42a521e600154338585856040516103549594939291906107b4565b60405180910390a1505050565b60005461036e9084610755565b34146103b75760405162461bcd60e51b8152602060048201526013602482015272496e636f727265637420656e7472792066656560681b60448201526064015b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561041257600080fd5b505af1158015610426573d6000803e3d6000fd5b505060405163095ea7b360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301523460248301527f000000000000000000000000000000000000000000000000000000000000000016935063095ea7b3925060440190506020604051808303816000875af11580156104ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104de9190610772565b5060005b8381101561030557604051630c64d36d60e21b81523360048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906331934db490602401600060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b5050600190920191506104e29050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916105d39190610803565b6000604051808303816000865af19150503d8060008114610610576040519150601f19603f3d011682016040523d82523d6000602084013e610615565b606091505b509150915081801561063f57508051158061063f57508080602001905181019061063f9190610772565b6106a55760405162461bcd60e51b815260206004820152603160248201527f5472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472604482015270185b9cd9995c919c9bdb4819985a5b1959607a1b60648201526084016103ae565b505050505050565b634e487b7160e01b600052600160045260246000fd5b6000806000604084860312156106d857600080fd5b83359250602084013567ffffffffffffffff808211156106f757600080fd5b818601915086601f83011261070b57600080fd5b81358181111561071a57600080fd5b87602082850101111561072c57600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761076c5761076c61073f565b92915050565b60006020828403121561078457600080fd5b8151801515811461079457600080fd5b9392505050565b6000600182016107ad576107ad61073f565b5060010190565b8581526001600160a01b0385166020820152604081018490526080606082018190528101829052818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b6000825160005b81811015610824576020818601810151858301520161080a565b50600092019182525091905056fea2646970667358221220d609705c7d0ec3f54962c5366c9ed649a2b90bd83b7a1be0f8a608c58d7c3ed664736f6c6343000817003300000000000000000000000043000000000000000000000000000000000000040000000000000000000000002c2c95edd6f9be3fb1534b9705e231fb57ecfe02

Deployed Bytecode

0x60806040526004361061004e5760003560e01c8063072ea61c14610092578063786925c8146100bb5780637c4a9cf0146100db578063ad5c4648146100ee578063e51598fd1461013a57600080fd5b3661008d57336001600160a01b037f0000000000000000000000004300000000000000000000000000000000000004161461008b5761008b6106ad565b005b600080fd5b34801561009e57600080fd5b506100a860005481565b6040519081526020015b60405180910390f35b3480156100c757600080fd5b5061008b6100d63660046106c3565b61016e565b61008b6100e93660046106c3565b610361565b3480156100fa57600080fd5b506101227f000000000000000000000000430000000000000000000000000000000000000481565b6040516001600160a01b0390911681526020016100b2565b34801561014657600080fd5b506101227f0000000000000000000000002c2c95edd6f9be3fb1534b9705e231fb57ecfe0281565b6101a77f00000000000000000000000043000000000000000000000000000000000000043330600054876101a29190610755565b61056f565b7f00000000000000000000000043000000000000000000000000000000000000046001600160a01b031663095ea7b37f0000000000000000000000002c2c95edd6f9be3fb1534b9705e231fb57ecfe02600054866102059190610755565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610250573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102749190610772565b5060005b8381101561030557604051630c64d36d60e21b81523360048201527f0000000000000000000000002c2c95edd6f9be3fb1534b9705e231fb57ecfe026001600160a01b0316906331934db490602401600060405180830381600087803b1580156102e157600080fd5b505af11580156102f5573d6000803e3d6000fd5b5050600190920191506102789050565b50600180549060006103168361079b565b91905055507f539e129f3f7609499ddc9099607d41846a523b2457d82fce38dbbd9fe42a521e600154338585856040516103549594939291906107b4565b60405180910390a1505050565b60005461036e9084610755565b34146103b75760405162461bcd60e51b8152602060048201526013602482015272496e636f727265637420656e7472792066656560681b60448201526064015b60405180910390fd5b7f00000000000000000000000043000000000000000000000000000000000000046001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561041257600080fd5b505af1158015610426573d6000803e3d6000fd5b505060405163095ea7b360e01b81526001600160a01b037f0000000000000000000000002c2c95edd6f9be3fb1534b9705e231fb57ecfe02811660048301523460248301527f000000000000000000000000430000000000000000000000000000000000000416935063095ea7b3925060440190506020604051808303816000875af11580156104ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104de9190610772565b5060005b8381101561030557604051630c64d36d60e21b81523360048201527f0000000000000000000000002c2c95edd6f9be3fb1534b9705e231fb57ecfe026001600160a01b0316906331934db490602401600060405180830381600087803b15801561054b57600080fd5b505af115801561055f573d6000803e3d6000fd5b5050600190920191506104e29050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916105d39190610803565b6000604051808303816000865af19150503d8060008114610610576040519150601f19603f3d011682016040523d82523d6000602084013e610615565b606091505b509150915081801561063f57508051158061063f57508080602001905181019061063f9190610772565b6106a55760405162461bcd60e51b815260206004820152603160248201527f5472616e7366657248656c7065723a3a7472616e7366657246726f6d3a207472604482015270185b9cd9995c919c9bdb4819985a5b1959607a1b60648201526084016103ae565b505050505050565b634e487b7160e01b600052600160045260246000fd5b6000806000604084860312156106d857600080fd5b83359250602084013567ffffffffffffffff808211156106f757600080fd5b818601915086601f83011261070b57600080fd5b81358181111561071a57600080fd5b87602082850101111561072c57600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761076c5761076c61073f565b92915050565b60006020828403121561078457600080fd5b8151801515811461079457600080fd5b9392505050565b6000600182016107ad576107ad61073f565b5060010190565b8581526001600160a01b0385166020820152604081018490526080606082018190528101829052818360a0830137600081830160a090810191909152601f909201601f19160101949350505050565b6000825160005b81811015610824576020818601810151858301520161080a565b50600092019182525091905056fea2646970667358221220d609705c7d0ec3f54962c5366c9ed649a2b90bd83b7a1be0f8a608c58d7c3ed664736f6c63430008170033

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

00000000000000000000000043000000000000000000000000000000000000040000000000000000000000002c2c95edd6f9be3fb1534b9705e231fb57ecfe02

-----Decoded View---------------
Arg [0] : _WETH (address): 0x4300000000000000000000000000000000000004
Arg [1] : _longGame (address): 0x2C2c95EDd6F9be3Fb1534b9705E231fb57EcFE02

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000004300000000000000000000000000000000000004
Arg [1] : 0000000000000000000000002c2c95edd6f9be3fb1534b9705e231fb57ecfe02


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