ETH Price: $2,952.95 (+0.18%)

Contract

0x03D6ec933E452283a0CaC468F487F327d1baE9ba

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Resolve136219032025-05-07 0:57:25262 days ago1746579445IN
0x03D6ec93...7d1baE9ba
0 ETH0.000000110.00101637
Resolve136213192025-05-07 0:37:57263 days ago1746578277IN
0x03D6ec93...7d1baE9ba
0 ETH0.000000070.00100959

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Royale

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
No with 200 runs

Other Settings:
cancun EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {ISignatureTransfer} from "@uniswap/permit2/src/interfaces/ISignatureTransfer.sol";

/// @title Royale
/// @notice Battle Royale between N players.
contract Royale is ReentrancyGuard {
    using SafeERC20 for IERC20;

    /*//////////////////////////////////////////////////////////////
                                 TYPES
    //////////////////////////////////////////////////////////////*/

    struct Game {
        uint128 players;
        uint128 capacity;
        address resolver;
        address creator;
        uint256 amount;
        address token;
        bool settled;
    }

    /*//////////////////////////////////////////////////////////////
                                STORAGE
    //////////////////////////////////////////////////////////////*/

    /// @dev lobbyId is created by keccak256(abi.encodePacked(resolver, token, amount, capacity))
    mapping(bytes32 lobbyId => uint256 count) public lobby;

    /// @dev playerLobbyKey is created by keccak256(abi.encodePacked(player, lobbyId))
    mapping(bytes32 playerLobbyKey => uint256 count) public countOf;

    /// @dev gameId is created by keccak256(abi.encodePacked(lobbyId, count))
    mapping(bytes32 gameId => Game game) public games;

    /// @dev Maps hash of player address and gameId to a boolean indicating if they joined
    /// @dev playerGameKey is created by keccak256(abi.encodePacked(player, gameId))
    mapping(bytes32 playerGameKey => bool joined) public joined;

    /// @dev The Permit2 contract address
    ISignatureTransfer public immutable permit2;

    /*//////////////////////////////////////////////////////////////
                                EVENTS
    //////////////////////////////////////////////////////////////*/

    event Created(bytes32 gameId, address player, address resolver, address token, uint256 amount, uint128 capacity);
    event Joined(bytes32 gameId, address creator, address player, uint128 players);
    event Resolved(bytes32 gameId, address[] winners, uint256[] amounts);

    /*//////////////////////////////////////////////////////////////
                                ERRORS
    //////////////////////////////////////////////////////////////*/

    error InvalidResolver();
    error AlreadySettled();
    error InvalidWinner();
    error InvalidSignature();
    error PlayerAlreadyJoined();
    error InvalidPayouts();
    error InvalidCapacity();
    error NotStarted();
    error NotOldestOpenGame();

    /*//////////////////////////////////////////////////////////////
                            INITIALIZATION
    //////////////////////////////////////////////////////////////*/

    /// @param _permit2 0x000000000022D473030F116dDEE9F6B43aC78BA3
    constructor(address _permit2) {
        permit2 = ISignatureTransfer(_permit2);
    }

    /*//////////////////////////////////////////////////////////////
                               GAME LOGIC
    //////////////////////////////////////////////////////////////*/

    /// @notice Join a game or create a new one using standard ERC20 approval
    function join(address resolver, address token, uint256 amount, uint128 capacity)
        public
        nonReentrant
        returns (bytes32)
    {
        // Safe transfer tokens from player to contract
        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

        return _join(resolver, token, amount, capacity);
    }

    /// @notice Join a game or create a new one using Permit2
    function joinWithPermit(
        address resolver,
        address token,
        uint128 capacity,
        ISignatureTransfer.PermitTransferFrom calldata permit,
        ISignatureTransfer.SignatureTransferDetails calldata transferDetails,
        bytes calldata signature
    ) public nonReentrant returns (bytes32) {
        // Transfer tokens using Permit2's SignatureTransfer
        permit2.permitTransferFrom(permit, transferDetails, msg.sender, signature);

        // Use the amount from the permit details
        return _join(resolver, token, permit.permitted.amount, capacity);
    }

    /// @notice Internal join function
    /// @param resolver The backend signer that will resolve the game
    /// @param token The ERC20 token to be used
    /// @param amount Amount of tokens to bet
    /// @param capacity Maximum number of players in the game
    function _join(address resolver, address token, uint256 amount, uint128 capacity) internal returns (bytes32) {
        if (resolver == address(0)) revert InvalidResolver();
        if (capacity < 2) revert InvalidCapacity();

        // Key for finding matching games
        bytes32 lobbyId = keccak256(abi.encodePacked(resolver, token, amount, capacity));
        uint256 count = lobby[lobbyId];

        bytes32 playerLobbyKey = keccak256(abi.encodePacked(msg.sender, lobbyId));
        uint256 lastJoinedCount = countOf[playerLobbyKey];

        uint256 nextCount = count > lastJoinedCount ? count + 1 : lastJoinedCount + 1;

        // Get the next game
        bytes32 nextGameId = keccak256(abi.encodePacked(lobbyId, nextCount));
        Game storage game = games[nextGameId];
        bytes32 playerGameKey = keccak256(abi.encodePacked(msg.sender, nextGameId));

        joined[playerGameKey] = true;
        countOf[playerLobbyKey] = nextCount;

        // Check if we need to create a new game
        if (game.players == 0) {
            // Create new game
            games[nextGameId] = Game({
                players: 1,
                capacity: capacity,
                resolver: resolver,
                creator: msg.sender,
                amount: amount,
                token: token,
                settled: false
            });

            emit Created(nextGameId, msg.sender, resolver, token, amount, capacity);
        } else {
            // Join existing game
            game.players++;

            if (game.players == game.capacity) {
                lobby[lobbyId]++;
            }

            emit Joined(nextGameId, game.creator, msg.sender, game.players);
        }

        return nextGameId;
    }

    /// @notice Internal function to verify resolver signature
    /// @param signer The address that should have signed the message
    /// @param messageHash The hash of the message to verify
    /// @param signature The signature to verify
    function _verifySignature(address signer, bytes32 messageHash, bytes calldata signature) internal pure {
        bytes32 signedHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", messageHash));

        // Extract signature components
        require(signature.length == 65, "Invalid signature length");
        bytes32 r;
        bytes32 s;
        uint8 v;
        assembly {
            r := calldataload(signature.offset)
            s := calldataload(add(signature.offset, 32))
            v := byte(0, calldataload(add(signature.offset, 64)))
        }

        // Verify signature is from signer
        if (ecrecover(signedHash, v, r, s) != signer) revert InvalidSignature();
    }

    /// @notice Resolve a game with multiple winners and their payouts
    /// @param gameId The id of the game
    /// @param winners List of winners
    /// @param amounts Amount to pay each winner
    /// @param signature The signature of the resolver
    function resolve(bytes32 gameId, address[] calldata winners, uint256[] calldata amounts, bytes calldata signature)
        public
        nonReentrant
    {
        Game storage game = games[gameId];

        bytes32 lobbyId = keccak256(abi.encodePacked(game.resolver, game.token, game.amount, game.capacity));
        uint256 count = lobby[lobbyId];

        // Verify game state
        if (game.settled) revert AlreadySettled();
        if (game.players == 0) revert NotStarted();
        // Resolving games that are not full should only be possible for the oldest open game
        if (game.players < game.capacity) {
            bytes32 oldestOpenGameId = keccak256(abi.encodePacked(lobbyId, count + 1));
            if (oldestOpenGameId != gameId) revert NotOldestOpenGame();
        }

        // Verify winners and amounts
        if (winners.length != amounts.length) revert InvalidPayouts();
        uint256 totalPayout;
        for (uint256 i = 0; i < winners.length; i++) {
            // Verify winner is a player
            bytes32 playerGameKey = keccak256(abi.encodePacked(winners[i], gameId));
            if (!joined[playerGameKey]) revert InvalidWinner();
            totalPayout += amounts[i];
        }

        // Verify total payout doesn't exceed total pot
        uint256 totalPot = game.amount * game.players;
        if (totalPayout > totalPot) revert InvalidPayouts();

        // Verify resolver signature
        bytes32 messageHash = keccak256(abi.encodePacked(gameId, winners, amounts));
        _verifySignature(game.resolver, messageHash, signature);

        // Mark game as settled
        game.settled = true;

        if (game.players < game.capacity) {
            lobby[lobbyId]++;
        }

        // Distribute payouts
        IERC20 token = IERC20(game.token);
        for (uint256 i = 0; i < winners.length; i++) {
            token.safeTransfer(winners[i], amounts[i]);
        }

        // Send remaining tokens to resolver
        uint256 remaining = totalPot - totalPayout;
        if (remaining > 0) {
            token.safeTransfer(game.resolver, remaining);
        }

        emit Resolved(gameId, winners, amounts);
    }

    /// @notice Check if a player is in a game
    /// @param gameId The id of the game
    /// @param player The address of the player to check
    function isPlayerInGame(bytes32 gameId, address player) public view returns (bool) {
        bytes32 playerGameKey = keccak256(abi.encodePacked(player, gameId));
        return joined[playerGameKey];
    }

    /// @notice Get the number of players in the current game for a lobby
    /// @notice Specifically, this returns the player count of the oldest open game.
    /// @param resolver The resolver of the lobby
    /// @param token The token of the lobby
    /// @param amount The amount of the lobby
    /// @param capacity The capacity of the lobby
    function getPlayerCount(address resolver, address token, uint256 amount, uint128 capacity)
        public
        view
        returns (uint128)
    {
        bytes32 lobbyId = keccak256(abi.encodePacked(resolver, token, amount, capacity));
        uint256 oldestOpenGameIndex = lobby[lobbyId] + 1;
        bytes32 gameId = keccak256(abi.encodePacked(lobbyId, oldestOpenGameIndex));
        // Returns 0 if the game doesn't exist or hasn't been created yet
        return games[gameId].players;
    }
}

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

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
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);
}

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

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";

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

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.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 EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * 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;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IEIP712} from "./IEIP712.sol";

/// @title SignatureTransfer
/// @notice Handles ERC20 token transfers through signature based actions
/// @dev Requires user's token approval on the Permit2 contract
interface ISignatureTransfer is IEIP712 {
    /// @notice Thrown when the requested amount for a transfer is larger than the permissioned amount
    /// @param maxAmount The maximum amount a spender can request to transfer
    error InvalidAmount(uint256 maxAmount);

    /// @notice Thrown when the number of tokens permissioned to a spender does not match the number of tokens being transferred
    /// @dev If the spender does not need to transfer the number of tokens permitted, the spender can request amount 0 to be transferred
    error LengthMismatch();

    /// @notice Emits an event when the owner successfully invalidates an unordered nonce.
    event UnorderedNonceInvalidation(address indexed owner, uint256 word, uint256 mask);

    /// @notice The token and amount details for a transfer signed in the permit transfer signature
    struct TokenPermissions {
        // ERC20 token address
        address token;
        // the maximum amount that can be spent
        uint256 amount;
    }

    /// @notice The signed permit message for a single token transfer
    struct PermitTransferFrom {
        TokenPermissions permitted;
        // a unique value for every token owner's signature to prevent signature replays
        uint256 nonce;
        // deadline on the permit signature
        uint256 deadline;
    }

    /// @notice Specifies the recipient address and amount for batched transfers.
    /// @dev Recipients and amounts correspond to the index of the signed token permissions array.
    /// @dev Reverts if the requested amount is greater than the permitted signed amount.
    struct SignatureTransferDetails {
        // recipient address
        address to;
        // spender requested amount
        uint256 requestedAmount;
    }

    /// @notice Used to reconstruct the signed permit message for multiple token transfers
    /// @dev Do not need to pass in spender address as it is required that it is msg.sender
    /// @dev Note that a user still signs over a spender address
    struct PermitBatchTransferFrom {
        // the tokens and corresponding amounts permitted for a transfer
        TokenPermissions[] permitted;
        // a unique value for every token owner's signature to prevent signature replays
        uint256 nonce;
        // deadline on the permit signature
        uint256 deadline;
    }

    /// @notice A map from token owner address and a caller specified word index to a bitmap. Used to set bits in the bitmap to prevent against signature replay protection
    /// @dev Uses unordered nonces so that permit messages do not need to be spent in a certain order
    /// @dev The mapping is indexed first by the token owner, then by an index specified in the nonce
    /// @dev It returns a uint256 bitmap
    /// @dev The index, or wordPosition is capped at type(uint248).max
    function nonceBitmap(address, uint256) external view returns (uint256);

    /// @notice Transfers a token using a signed permit message
    /// @dev Reverts if the requested amount is greater than the permitted signed amount
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails The spender's requested transfer details for the permitted token
    /// @param signature The signature to verify
        function permitTransferFrom(
        PermitTransferFrom memory permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external;

    /// @notice Transfers a token using a signed permit message
    /// @notice Includes extra data provided by the caller to verify signature over
    /// @dev The witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition
    /// @dev Reverts if the requested amount is greater than the permitted signed amount
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails The spender's requested transfer details for the permitted token
    /// @param witness Extra data to include when checking the user signature
    /// @param witnessTypeString The EIP-712 type definition for remaining string stub of the typehash
    /// @param signature The signature to verify
    function permitWitnessTransferFrom(
        PermitTransferFrom memory permit,
        SignatureTransferDetails calldata transferDetails,
        address owner,
        bytes32 witness,
        string calldata witnessTypeString,
        bytes calldata signature
    ) external;

    /// @notice Transfers multiple tokens using a signed permit message
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails Specifies the recipient and requested amount for the token transfer
    /// @param signature The signature to verify
    function permitTransferFrom(
        PermitBatchTransferFrom memory permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes calldata signature
    ) external;

    /// @notice Transfers multiple tokens using a signed permit message
    /// @dev The witness type string must follow EIP712 ordering of nested structs and must include the TokenPermissions type definition
    /// @notice Includes extra data provided by the caller to verify signature over
    /// @param permit The permit data signed over by the owner
    /// @param owner The owner of the tokens to transfer
    /// @param transferDetails Specifies the recipient and requested amount for the token transfer
    /// @param witness Extra data to include when checking the user signature
    /// @param witnessTypeString The EIP-712 type definition for remaining string stub of the typehash
    /// @param signature The signature to verify
    function permitWitnessTransferFrom(
        PermitBatchTransferFrom memory permit,
        SignatureTransferDetails[] calldata transferDetails,
        address owner,
        bytes32 witness,
        string calldata witnessTypeString,
        bytes calldata signature
    ) external;

    /// @notice Invalidates the bits specified in mask for the bitmap at the word position
    /// @dev The wordPos is maxed at type(uint248).max
    /// @param wordPos A number to index the nonceBitmap at
    /// @param mask A bitmap masked against msg.sender's current bitmap at the word position
    function invalidateUnorderedNonces(uint256 wordPos, uint256 mask) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IEIP712 {
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 8 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";

File 9 of 10 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../utils/introspection/IERC165.sol";

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@uniswap/permit2/=lib/permit2/",
    "ds-test/=lib/permit2/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-gas-snapshot/=lib/permit2/lib/forge-gas-snapshot/src/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "permit2/=lib/permit2/",
    "solmate/=lib/permit2/lib/solmate/"
  ],
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_permit2","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadySettled","type":"error"},{"inputs":[],"name":"InvalidCapacity","type":"error"},{"inputs":[],"name":"InvalidPayouts","type":"error"},{"inputs":[],"name":"InvalidResolver","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidWinner","type":"error"},{"inputs":[],"name":"NotOldestOpenGame","type":"error"},{"inputs":[],"name":"NotStarted","type":"error"},{"inputs":[],"name":"PlayerAlreadyJoined","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"address","name":"resolver","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint128","name":"capacity","type":"uint128"}],"name":"Created","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint128","name":"players","type":"uint128"}],"name":"Joined","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"},{"indexed":false,"internalType":"address[]","name":"winners","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"Resolved","type":"event"},{"inputs":[{"internalType":"bytes32","name":"playerLobbyKey","type":"bytes32"}],"name":"countOf","outputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"games","outputs":[{"internalType":"uint128","name":"players","type":"uint128"},{"internalType":"uint128","name":"capacity","type":"uint128"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"bool","name":"settled","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint128","name":"capacity","type":"uint128"}],"name":"getPlayerCount","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"address","name":"player","type":"address"}],"name":"isPlayerInGame","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint128","name":"capacity","type":"uint128"}],"name":"join","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint128","name":"capacity","type":"uint128"},{"components":[{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ISignatureTransfer.TokenPermissions","name":"permitted","type":"tuple"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct ISignatureTransfer.PermitTransferFrom","name":"permit","type":"tuple"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"requestedAmount","type":"uint256"}],"internalType":"struct ISignatureTransfer.SignatureTransferDetails","name":"transferDetails","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"joinWithPermit","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"playerGameKey","type":"bytes32"}],"name":"joined","outputs":[{"internalType":"bool","name":"joined","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"lobbyId","type":"bytes32"}],"name":"lobby","outputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"permit2","outputs":[{"internalType":"contract ISignatureTransfer","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"address[]","name":"winners","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"resolve","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561000f575f5ffd5b506040516126de3803806126de833981810160405281019061003191906100d0565b60015f819055508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1681525050506100fb565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61009f82610076565b9050919050565b6100af81610095565b81146100b9575f5ffd5b50565b5f815190506100ca816100a6565b92915050565b5f602082840312156100e5576100e4610072565b5b5f6100f2848285016100bc565b91505092915050565b6080516125c461011a5f395f8181610262015261092201526125c45ff3fe608060405234801561000f575f5ffd5b506004361061009c575f3560e01c8063d26a088011610064578063d26a08801461016a578063e003a04f1461019a578063f3145c1b146101ca578063f579f882146101fa578063fa399d87146102305761009c565b806312261ee7146100a05780634e977d3a146100be5780639f70ed81146100da578063a8f1aed81461010a578063ad076c2b1461013a575b5f5ffd5b6100a8610260565b6040516100b59190611621565b60405180910390f35b6100d860048036038101906100d39190611780565b610284565b005b6100f460048036038101906100ef9190611844565b610902565b6040516101019190611887565b60405180910390f35b610124600480360381019061011f9190611960565b610917565b6040516101319190611a1b565b60405180910390f35b610154600480360381019061014f9190611a5e565b6109d5565b6040516101619190611a1b565b60405180910390f35b610184600480360381019061017f9190611ac2565b610a29565b6040516101919190611b1a565b60405180910390f35b6101b460048036038101906101af9190611844565b610a7d565b6040516101c19190611b1a565b60405180910390f35b6101e460048036038101906101df9190611844565b610a9a565b6040516101f19190611887565b60405180910390f35b610214600480360381019061020f9190611844565b610aaf565b6040516102279796959493929190611b51565b60405180910390f35b61024a60048036038101906102459190611a5e565b610b8d565b6040516102579190611bbe565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b61028c610c46565b5f60035f8981526020019081526020015f2090505f816001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360030154845f0160109054906101000a90046fffffffffffffffffffffffffffffffff166040516020016103219493929190611c70565b6040516020818303038152906040528051906020012090505f60015f8381526020019081526020015f205490508260040160149054906101000a900460ff1615610397576040517f560ff90000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f835f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1603610400576040517f6f312cbd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825f0160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16835f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1610156104dc575f826001836104789190611cea565b604051602001610489929190611d3d565b6040516020818303038152906040528051906020012090508a81146104da576040517f567aaa4a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b86869050898990501461051b576040517f663493a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f5f90505b8a8a9050811015610608575f8b8b838181106105405761053f611d68565b5b90506020020160208101906105559190611d95565b8d604051602001610567929190611dc0565b60405160208183030381529060405280519060200120905060045f8281526020019081526020015f205f9054906101000a900460ff166105d3576040517f93a5f3c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8989838181106105e6576105e5611d68565b5b90506020020135836105f89190611cea565b9250508080600101915050610521565b505f845f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16856003015461064a9190611deb565b905080821115610686576040517f663493a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8c8c8c8c8c6040516020016106a0959493929190611f54565b6040516020818303038152906040528051906020012090506106e7866001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828a8a610c8a565b60018660040160146101000a81548160ff021916908315150217905550855f0160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16865f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1610156107945760015f8681526020019081526020015f205f81548092919061078e90611f8c565b91905055505b5f866004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f5f90505b8d8d9050811015610843576108368e8e838181106107e1576107e0611d68565b5b90506020020160208101906107f69190611d95565b8d8d8481811061080957610808611d68565b5b905060200201358473ffffffffffffffffffffffffffffffffffffffff16610dcb9092919063ffffffff16565b80806001019150506107c0565b505f84846108519190611fd3565b90505f8111156108aa576108a9886001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff16610dcb9092919063ffffffff16565b5b7fd8cd1beddc95638884fcf5a71e3c476ed63af5f25746b5f32fa4a193eea134518f8f8f8f8f6040516108e1959493929190612102565b60405180910390a150505050505050506108f9610e4a565b50505050505050565b6002602052805f5260405f205f915090505481565b5f610920610c46565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166330f28b7a86863387876040518663ffffffff1660e01b81526004016109819594939291906122a4565b5f604051808303815f87803b158015610998575f5ffd5b505af11580156109aa573d5f5f3e3d5ffd5b505050506109c08888875f016020013589610e53565b90506109ca610e4a565b979650505050505050565b5f6109de610c46565b610a0b3330858773ffffffffffffffffffffffffffffffffffffffff1661148a909392919063ffffffff16565b610a1785858585610e53565b9050610a21610e4a565b949350505050565b5f5f8284604051602001610a3e929190611dc0565b60405160208183030381529060405280519060200120905060045f8281526020019081526020015f205f9054906101000a900460ff1691505092915050565b6004602052805f5260405f205f915054906101000a900460ff1681565b6001602052805f5260405f205f915090505481565b6003602052805f5260405f205f91509050805f015f9054906101000a90046fffffffffffffffffffffffffffffffff1690805f0160109054906101000a90046fffffffffffffffffffffffffffffffff1690806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806003015490806004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040160149054906101000a900460ff16905087565b5f5f85858585604051602001610ba69493929190611c70565b6040516020818303038152906040528051906020012090505f6001805f8481526020019081526020015f2054610bdc9190611cea565b90505f8282604051602001610bf2929190611d3d565b60405160208183030381529060405280519060200120905060035f8281526020019081526020015f205f015f9054906101000a90046fffffffffffffffffffffffffffffffff169350505050949350505050565b60025f5403610c81576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025f81905550565b5f83604051602001610c9c9190612345565b60405160208183030381529060405280519060200120905060418383905014610cfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf1906123c4565b60405180910390fd5b5f5f5f853592506020860135915060408601355f1a90508773ffffffffffffffffffffffffffffffffffffffff166001858386866040515f8152602001604052604051610d4a94939291906123fd565b6020604051602081039080840390855afa158015610d6a573d5f5f3e3d5ffd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614610dc1576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050505050565b610e45838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610dfe929190612440565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061150c565b505050565b60015f81905550565b5f5f73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603610eb9576040517f6da3f65400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002826fffffffffffffffffffffffffffffffff161015610f06576040517f31278a8700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f85858585604051602001610f1e9493929190611c70565b6040516020818303038152906040528051906020012090505f60015f8381526020019081526020015f205490505f3383604051602001610f5f929190611dc0565b6040516020818303038152906040528051906020012090505f60025f8381526020019081526020015f205490505f818411610fa657600182610fa19190611cea565b610fb4565b600184610fb39190611cea565b5b90505f8582604051602001610fca929190611d3d565b6040516020818303038152906040528051906020012090505f60035f8381526020019081526020015f2090505f338360405160200161100a929190611dc0565b604051602081830303815290604052805190602001209050600160045f8381526020019081526020015f205f6101000a81548160ff0219169083151502179055508360025f8881526020019081526020015f20819055505f825f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1603611304576040518060e0016040528060016fffffffffffffffffffffffffffffffff1681526020018b6fffffffffffffffffffffffffffffffff1681526020018e73ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018c81526020018d73ffffffffffffffffffffffffffffffffffffffff1681526020015f151581525060035f8581526020019081526020015f205f820151815f015f6101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506020820151815f0160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506040820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816002015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816003015560a0820151816004015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c08201518160040160146101000a81548160ff0219169083151502179055509050507fd48b8a5a0e7874d3c28e4253d140b837708a1fa04ed28e02c2ac6e6d807eece083338f8f8f8f6040516112f796959493929190612467565b60405180910390a1611477565b815f015f81819054906101000a90046fffffffffffffffffffffffffffffffff1680929190611332906124c6565b91906101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555050815f0160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16825f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16036113f85760015f8981526020019081526020015f205f8154809291906113f290611f8c565b91905055505b7f11a7445c9c0be6978dca39f73f24ed6517d6e3300338c1096bfb354fbe1d305683836002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633855f015f9054906101000a90046fffffffffffffffffffffffffffffffff1660405161146e94939291906124fd565b60405180910390a15b8298505050505050505050949350505050565b611506848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016114bf93929190612540565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061150c565b50505050565b5f5f60205f8451602086015f885af18061152b576040513d5f823e3d81fd5b3d92505f519150505f821461154457600181141561155f565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b156115a157836040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016115989190612575565b60405180910390fd5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f6115e96115e46115df846115a7565b6115c6565b6115a7565b9050919050565b5f6115fa826115cf565b9050919050565b5f61160b826115f0565b9050919050565b61161b81611601565b82525050565b5f6020820190506116345f830184611612565b92915050565b5f5ffd5b5f5ffd5b5f819050919050565b61165481611642565b811461165e575f5ffd5b50565b5f8135905061166f8161164b565b92915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f84011261169657611695611675565b5b8235905067ffffffffffffffff8111156116b3576116b2611679565b5b6020830191508360208202830111156116cf576116ce61167d565b5b9250929050565b5f5f83601f8401126116eb576116ea611675565b5b8235905067ffffffffffffffff81111561170857611707611679565b5b6020830191508360208202830111156117245761172361167d565b5b9250929050565b5f5f83601f8401126117405761173f611675565b5b8235905067ffffffffffffffff81111561175d5761175c611679565b5b6020830191508360018202830111156117795761177861167d565b5b9250929050565b5f5f5f5f5f5f5f6080888a03121561179b5761179a61163a565b5b5f6117a88a828b01611661565b975050602088013567ffffffffffffffff8111156117c9576117c861163e565b5b6117d58a828b01611681565b9650965050604088013567ffffffffffffffff8111156117f8576117f761163e565b5b6118048a828b016116d6565b9450945050606088013567ffffffffffffffff8111156118275761182661163e565b5b6118338a828b0161172b565b925092505092959891949750929550565b5f602082840312156118595761185861163a565b5b5f61186684828501611661565b91505092915050565b5f819050919050565b6118818161186f565b82525050565b5f60208201905061189a5f830184611878565b92915050565b5f6118aa826115a7565b9050919050565b6118ba816118a0565b81146118c4575f5ffd5b50565b5f813590506118d5816118b1565b92915050565b5f6fffffffffffffffffffffffffffffffff82169050919050565b6118ff816118db565b8114611909575f5ffd5b50565b5f8135905061191a816118f6565b92915050565b5f5ffd5b5f6080828403121561193957611938611920565b5b81905092915050565b5f6040828403121561195757611956611920565b5b81905092915050565b5f5f5f5f5f5f5f610140888a03121561197c5761197b61163a565b5b5f6119898a828b016118c7565b975050602061199a8a828b016118c7565b96505060406119ab8a828b0161190c565b95505060606119bc8a828b01611924565b94505060e06119cd8a828b01611942565b93505061012088013567ffffffffffffffff8111156119ef576119ee61163e565b5b6119fb8a828b0161172b565b925092505092959891949750929550565b611a1581611642565b82525050565b5f602082019050611a2e5f830184611a0c565b92915050565b611a3d8161186f565b8114611a47575f5ffd5b50565b5f81359050611a5881611a34565b92915050565b5f5f5f5f60808587031215611a7657611a7561163a565b5b5f611a83878288016118c7565b9450506020611a94878288016118c7565b9350506040611aa587828801611a4a565b9250506060611ab68782880161190c565b91505092959194509250565b5f5f60408385031215611ad857611ad761163a565b5b5f611ae585828601611661565b9250506020611af6858286016118c7565b9150509250929050565b5f8115159050919050565b611b1481611b00565b82525050565b5f602082019050611b2d5f830184611b0b565b92915050565b611b3c816118db565b82525050565b611b4b816118a0565b82525050565b5f60e082019050611b645f83018a611b33565b611b716020830189611b33565b611b7e6040830188611b42565b611b8b6060830187611b42565b611b986080830186611878565b611ba560a0830185611b42565b611bb260c0830184611b0b565b98975050505050505050565b5f602082019050611bd15f830184611b33565b92915050565b5f8160601b9050919050565b5f611bed82611bd7565b9050919050565b5f611bfe82611be3565b9050919050565b611c16611c11826118a0565b611bf4565b82525050565b5f819050919050565b611c36611c318261186f565b611c1c565b82525050565b5f8160801b9050919050565b5f611c5282611c3c565b9050919050565b611c6a611c65826118db565b611c48565b82525050565b5f611c7b8287611c05565b601482019150611c8b8286611c05565b601482019150611c9b8285611c25565b602082019150611cab8284611c59565b60108201915081905095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611cf48261186f565b9150611cff8361186f565b9250828201905080821115611d1757611d16611cbd565b5b92915050565b5f819050919050565b611d37611d3282611642565b611d1d565b82525050565b5f611d488285611d26565b602082019150611d588284611c25565b6020820191508190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611daa57611da961163a565b5b5f611db7848285016118c7565b91505092915050565b5f611dcb8285611c05565b601482019150611ddb8284611d26565b6020820191508190509392505050565b5f611df58261186f565b9150611e008361186f565b9250828202611e0e8161186f565b91508282048414831517611e2557611e24611cbd565b5b5092915050565b5f81905092915050565b5f819050919050565b611e48816118a0565b82525050565b5f611e598383611e3f565b60208301905092915050565b5f611e7360208401846118c7565b905092915050565b5f602082019050919050565b5f611e928385611e2c565b9350611e9d82611e36565b805f5b85811015611ed557611eb28284611e65565b611ebc8882611e4e565b9750611ec783611e7b565b925050600181019050611ea0565b5085925050509392505050565b5f81905092915050565b5f5ffd5b82818337505050565b5f611f048385611ee2565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115611f3757611f36611eec565b5b602083029250611f48838584611ef0565b82840190509392505050565b5f611f5f8288611d26565b602082019150611f70828688611e87565b9150611f7d828486611ef9565b91508190509695505050505050565b5f611f968261186f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611fc857611fc7611cbd565b5b600182019050919050565b5f611fdd8261186f565b9150611fe88361186f565b925082820390508181111561200057611fff611cbd565b5b92915050565b5f82825260208201905092915050565b61201f816118a0565b82525050565b5f6120308383612016565b60208301905092915050565b5f6120478385612006565b935061205282611e36565b805f5b8581101561208a576120678284611e65565b6120718882612025565b975061207c83611e7b565b925050600181019050612055565b5085925050509392505050565b5f82825260208201905092915050565b5f6120b28385612097565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156120e5576120e4611eec565b5b6020830292506120f6838584611ef0565b82840190509392505050565b5f6060820190506121155f830188611a0c565b818103602083015261212881868861203c565b9050818103604083015261213d8184866120a7565b90509695505050505050565b5f82905092915050565b5f6121616020840184611a4a565b905092915050565b6121728161186f565b82525050565b604082016121885f830183611e65565b6121945f850182612016565b506121a26020830183612153565b6121af6020850182612169565b50505050565b608082016121c55f830183612149565b6121d15f850182612178565b506121df6040830183612153565b6121ec6040850182612169565b506121fa6060830183612153565b6122076060850182612169565b50505050565b6040820161221d5f830183611e65565b6122295f850182612016565b506122376020830183612153565b6122446020850182612169565b50505050565b5f82825260208201905092915050565b828183375f83830152505050565b5f601f19601f8301169050919050565b5f612283838561224a565b935061229083858461225a565b61229983612268565b840190509392505050565b5f610100820190506122b85f8301886121b5565b6122c5608083018761220d565b6122d260c0830186611b42565b81810360e08301526122e5818486612278565b90509695505050505050565b5f81905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000005f82015250565b5f61232f601c836122f1565b915061233a826122fb565b601c82019050919050565b5f61234f82612323565b915061235b8284611d26565b60208201915081905092915050565b5f82825260208201905092915050565b7f496e76616c6964207369676e6174757265206c656e67746800000000000000005f82015250565b5f6123ae60188361236a565b91506123b98261237a565b602082019050919050565b5f6020820190508181035f8301526123db816123a2565b9050919050565b5f60ff82169050919050565b6123f7816123e2565b82525050565b5f6080820190506124105f830187611a0c565b61241d60208301866123ee565b61242a6040830185611a0c565b6124376060830184611a0c565b95945050505050565b5f6040820190506124535f830185611b42565b6124606020830184611878565b9392505050565b5f60c08201905061247a5f830189611a0c565b6124876020830188611b42565b6124946040830187611b42565b6124a16060830186611b42565b6124ae6080830185611878565b6124bb60a0830184611b33565b979650505050505050565b5f6124d0826118db565b91506fffffffffffffffffffffffffffffffff82036124f2576124f1611cbd565b5b600182019050919050565b5f6080820190506125105f830187611a0c565b61251d6020830186611b42565b61252a6040830185611b42565b6125376060830184611b33565b95945050505050565b5f6060820190506125535f830186611b42565b6125606020830185611b42565b61256d6040830184611878565b949350505050565b5f6020820190506125885f830184611b42565b9291505056fea2646970667358221220c2f49e8325f093db4cffb2a2bd654a683f8673d105eb4aa6f143bc7e793219e564736f6c634300081c0033000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3

Deployed Bytecode

0x608060405234801561000f575f5ffd5b506004361061009c575f3560e01c8063d26a088011610064578063d26a08801461016a578063e003a04f1461019a578063f3145c1b146101ca578063f579f882146101fa578063fa399d87146102305761009c565b806312261ee7146100a05780634e977d3a146100be5780639f70ed81146100da578063a8f1aed81461010a578063ad076c2b1461013a575b5f5ffd5b6100a8610260565b6040516100b59190611621565b60405180910390f35b6100d860048036038101906100d39190611780565b610284565b005b6100f460048036038101906100ef9190611844565b610902565b6040516101019190611887565b60405180910390f35b610124600480360381019061011f9190611960565b610917565b6040516101319190611a1b565b60405180910390f35b610154600480360381019061014f9190611a5e565b6109d5565b6040516101619190611a1b565b60405180910390f35b610184600480360381019061017f9190611ac2565b610a29565b6040516101919190611b1a565b60405180910390f35b6101b460048036038101906101af9190611844565b610a7d565b6040516101c19190611b1a565b60405180910390f35b6101e460048036038101906101df9190611844565b610a9a565b6040516101f19190611887565b60405180910390f35b610214600480360381019061020f9190611844565b610aaf565b6040516102279796959493929190611b51565b60405180910390f35b61024a60048036038101906102459190611a5e565b610b8d565b6040516102579190611bbe565b60405180910390f35b7f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba381565b61028c610c46565b5f60035f8981526020019081526020015f2090505f816001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360030154845f0160109054906101000a90046fffffffffffffffffffffffffffffffff166040516020016103219493929190611c70565b6040516020818303038152906040528051906020012090505f60015f8381526020019081526020015f205490508260040160149054906101000a900460ff1615610397576040517f560ff90000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f835f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1603610400576040517f6f312cbd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b825f0160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16835f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1610156104dc575f826001836104789190611cea565b604051602001610489929190611d3d565b6040516020818303038152906040528051906020012090508a81146104da576040517f567aaa4a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b86869050898990501461051b576040517f663493a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f5f90505b8a8a9050811015610608575f8b8b838181106105405761053f611d68565b5b90506020020160208101906105559190611d95565b8d604051602001610567929190611dc0565b60405160208183030381529060405280519060200120905060045f8281526020019081526020015f205f9054906101000a900460ff166105d3576040517f93a5f3c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8989838181106105e6576105e5611d68565b5b90506020020135836105f89190611cea565b9250508080600101915050610521565b505f845f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16856003015461064a9190611deb565b905080821115610686576040517f663493a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8c8c8c8c8c6040516020016106a0959493929190611f54565b6040516020818303038152906040528051906020012090506106e7866001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828a8a610c8a565b60018660040160146101000a81548160ff021916908315150217905550855f0160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16865f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1610156107945760015f8681526020019081526020015f205f81548092919061078e90611f8c565b91905055505b5f866004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f5f90505b8d8d9050811015610843576108368e8e838181106107e1576107e0611d68565b5b90506020020160208101906107f69190611d95565b8d8d8481811061080957610808611d68565b5b905060200201358473ffffffffffffffffffffffffffffffffffffffff16610dcb9092919063ffffffff16565b80806001019150506107c0565b505f84846108519190611fd3565b90505f8111156108aa576108a9886001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff16610dcb9092919063ffffffff16565b5b7fd8cd1beddc95638884fcf5a71e3c476ed63af5f25746b5f32fa4a193eea134518f8f8f8f8f6040516108e1959493929190612102565b60405180910390a150505050505050506108f9610e4a565b50505050505050565b6002602052805f5260405f205f915090505481565b5f610920610c46565b7f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba373ffffffffffffffffffffffffffffffffffffffff166330f28b7a86863387876040518663ffffffff1660e01b81526004016109819594939291906122a4565b5f604051808303815f87803b158015610998575f5ffd5b505af11580156109aa573d5f5f3e3d5ffd5b505050506109c08888875f016020013589610e53565b90506109ca610e4a565b979650505050505050565b5f6109de610c46565b610a0b3330858773ffffffffffffffffffffffffffffffffffffffff1661148a909392919063ffffffff16565b610a1785858585610e53565b9050610a21610e4a565b949350505050565b5f5f8284604051602001610a3e929190611dc0565b60405160208183030381529060405280519060200120905060045f8281526020019081526020015f205f9054906101000a900460ff1691505092915050565b6004602052805f5260405f205f915054906101000a900460ff1681565b6001602052805f5260405f205f915090505481565b6003602052805f5260405f205f91509050805f015f9054906101000a90046fffffffffffffffffffffffffffffffff1690805f0160109054906101000a90046fffffffffffffffffffffffffffffffff1690806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806003015490806004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040160149054906101000a900460ff16905087565b5f5f85858585604051602001610ba69493929190611c70565b6040516020818303038152906040528051906020012090505f6001805f8481526020019081526020015f2054610bdc9190611cea565b90505f8282604051602001610bf2929190611d3d565b60405160208183030381529060405280519060200120905060035f8281526020019081526020015f205f015f9054906101000a90046fffffffffffffffffffffffffffffffff169350505050949350505050565b60025f5403610c81576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025f81905550565b5f83604051602001610c9c9190612345565b60405160208183030381529060405280519060200120905060418383905014610cfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf1906123c4565b60405180910390fd5b5f5f5f853592506020860135915060408601355f1a90508773ffffffffffffffffffffffffffffffffffffffff166001858386866040515f8152602001604052604051610d4a94939291906123fd565b6020604051602081039080840390855afa158015610d6a573d5f5f3e3d5ffd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614610dc1576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050505050565b610e45838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610dfe929190612440565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061150c565b505050565b60015f81905550565b5f5f73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603610eb9576040517f6da3f65400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002826fffffffffffffffffffffffffffffffff161015610f06576040517f31278a8700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f85858585604051602001610f1e9493929190611c70565b6040516020818303038152906040528051906020012090505f60015f8381526020019081526020015f205490505f3383604051602001610f5f929190611dc0565b6040516020818303038152906040528051906020012090505f60025f8381526020019081526020015f205490505f818411610fa657600182610fa19190611cea565b610fb4565b600184610fb39190611cea565b5b90505f8582604051602001610fca929190611d3d565b6040516020818303038152906040528051906020012090505f60035f8381526020019081526020015f2090505f338360405160200161100a929190611dc0565b604051602081830303815290604052805190602001209050600160045f8381526020019081526020015f205f6101000a81548160ff0219169083151502179055508360025f8881526020019081526020015f20819055505f825f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1603611304576040518060e0016040528060016fffffffffffffffffffffffffffffffff1681526020018b6fffffffffffffffffffffffffffffffff1681526020018e73ffffffffffffffffffffffffffffffffffffffff1681526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018c81526020018d73ffffffffffffffffffffffffffffffffffffffff1681526020015f151581525060035f8581526020019081526020015f205f820151815f015f6101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506020820151815f0160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506040820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816002015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816003015560a0820151816004015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c08201518160040160146101000a81548160ff0219169083151502179055509050507fd48b8a5a0e7874d3c28e4253d140b837708a1fa04ed28e02c2ac6e6d807eece083338f8f8f8f6040516112f796959493929190612467565b60405180910390a1611477565b815f015f81819054906101000a90046fffffffffffffffffffffffffffffffff1680929190611332906124c6565b91906101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555050815f0160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16825f015f9054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16036113f85760015f8981526020019081526020015f205f8154809291906113f290611f8c565b91905055505b7f11a7445c9c0be6978dca39f73f24ed6517d6e3300338c1096bfb354fbe1d305683836002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633855f015f9054906101000a90046fffffffffffffffffffffffffffffffff1660405161146e94939291906124fd565b60405180910390a15b8298505050505050505050949350505050565b611506848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016114bf93929190612540565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061150c565b50505050565b5f5f60205f8451602086015f885af18061152b576040513d5f823e3d81fd5b3d92505f519150505f821461154457600181141561155f565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b156115a157836040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016115989190612575565b60405180910390fd5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f6115e96115e46115df846115a7565b6115c6565b6115a7565b9050919050565b5f6115fa826115cf565b9050919050565b5f61160b826115f0565b9050919050565b61161b81611601565b82525050565b5f6020820190506116345f830184611612565b92915050565b5f5ffd5b5f5ffd5b5f819050919050565b61165481611642565b811461165e575f5ffd5b50565b5f8135905061166f8161164b565b92915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f84011261169657611695611675565b5b8235905067ffffffffffffffff8111156116b3576116b2611679565b5b6020830191508360208202830111156116cf576116ce61167d565b5b9250929050565b5f5f83601f8401126116eb576116ea611675565b5b8235905067ffffffffffffffff81111561170857611707611679565b5b6020830191508360208202830111156117245761172361167d565b5b9250929050565b5f5f83601f8401126117405761173f611675565b5b8235905067ffffffffffffffff81111561175d5761175c611679565b5b6020830191508360018202830111156117795761177861167d565b5b9250929050565b5f5f5f5f5f5f5f6080888a03121561179b5761179a61163a565b5b5f6117a88a828b01611661565b975050602088013567ffffffffffffffff8111156117c9576117c861163e565b5b6117d58a828b01611681565b9650965050604088013567ffffffffffffffff8111156117f8576117f761163e565b5b6118048a828b016116d6565b9450945050606088013567ffffffffffffffff8111156118275761182661163e565b5b6118338a828b0161172b565b925092505092959891949750929550565b5f602082840312156118595761185861163a565b5b5f61186684828501611661565b91505092915050565b5f819050919050565b6118818161186f565b82525050565b5f60208201905061189a5f830184611878565b92915050565b5f6118aa826115a7565b9050919050565b6118ba816118a0565b81146118c4575f5ffd5b50565b5f813590506118d5816118b1565b92915050565b5f6fffffffffffffffffffffffffffffffff82169050919050565b6118ff816118db565b8114611909575f5ffd5b50565b5f8135905061191a816118f6565b92915050565b5f5ffd5b5f6080828403121561193957611938611920565b5b81905092915050565b5f6040828403121561195757611956611920565b5b81905092915050565b5f5f5f5f5f5f5f610140888a03121561197c5761197b61163a565b5b5f6119898a828b016118c7565b975050602061199a8a828b016118c7565b96505060406119ab8a828b0161190c565b95505060606119bc8a828b01611924565b94505060e06119cd8a828b01611942565b93505061012088013567ffffffffffffffff8111156119ef576119ee61163e565b5b6119fb8a828b0161172b565b925092505092959891949750929550565b611a1581611642565b82525050565b5f602082019050611a2e5f830184611a0c565b92915050565b611a3d8161186f565b8114611a47575f5ffd5b50565b5f81359050611a5881611a34565b92915050565b5f5f5f5f60808587031215611a7657611a7561163a565b5b5f611a83878288016118c7565b9450506020611a94878288016118c7565b9350506040611aa587828801611a4a565b9250506060611ab68782880161190c565b91505092959194509250565b5f5f60408385031215611ad857611ad761163a565b5b5f611ae585828601611661565b9250506020611af6858286016118c7565b9150509250929050565b5f8115159050919050565b611b1481611b00565b82525050565b5f602082019050611b2d5f830184611b0b565b92915050565b611b3c816118db565b82525050565b611b4b816118a0565b82525050565b5f60e082019050611b645f83018a611b33565b611b716020830189611b33565b611b7e6040830188611b42565b611b8b6060830187611b42565b611b986080830186611878565b611ba560a0830185611b42565b611bb260c0830184611b0b565b98975050505050505050565b5f602082019050611bd15f830184611b33565b92915050565b5f8160601b9050919050565b5f611bed82611bd7565b9050919050565b5f611bfe82611be3565b9050919050565b611c16611c11826118a0565b611bf4565b82525050565b5f819050919050565b611c36611c318261186f565b611c1c565b82525050565b5f8160801b9050919050565b5f611c5282611c3c565b9050919050565b611c6a611c65826118db565b611c48565b82525050565b5f611c7b8287611c05565b601482019150611c8b8286611c05565b601482019150611c9b8285611c25565b602082019150611cab8284611c59565b60108201915081905095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611cf48261186f565b9150611cff8361186f565b9250828201905080821115611d1757611d16611cbd565b5b92915050565b5f819050919050565b611d37611d3282611642565b611d1d565b82525050565b5f611d488285611d26565b602082019150611d588284611c25565b6020820191508190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60208284031215611daa57611da961163a565b5b5f611db7848285016118c7565b91505092915050565b5f611dcb8285611c05565b601482019150611ddb8284611d26565b6020820191508190509392505050565b5f611df58261186f565b9150611e008361186f565b9250828202611e0e8161186f565b91508282048414831517611e2557611e24611cbd565b5b5092915050565b5f81905092915050565b5f819050919050565b611e48816118a0565b82525050565b5f611e598383611e3f565b60208301905092915050565b5f611e7360208401846118c7565b905092915050565b5f602082019050919050565b5f611e928385611e2c565b9350611e9d82611e36565b805f5b85811015611ed557611eb28284611e65565b611ebc8882611e4e565b9750611ec783611e7b565b925050600181019050611ea0565b5085925050509392505050565b5f81905092915050565b5f5ffd5b82818337505050565b5f611f048385611ee2565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115611f3757611f36611eec565b5b602083029250611f48838584611ef0565b82840190509392505050565b5f611f5f8288611d26565b602082019150611f70828688611e87565b9150611f7d828486611ef9565b91508190509695505050505050565b5f611f968261186f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611fc857611fc7611cbd565b5b600182019050919050565b5f611fdd8261186f565b9150611fe88361186f565b925082820390508181111561200057611fff611cbd565b5b92915050565b5f82825260208201905092915050565b61201f816118a0565b82525050565b5f6120308383612016565b60208301905092915050565b5f6120478385612006565b935061205282611e36565b805f5b8581101561208a576120678284611e65565b6120718882612025565b975061207c83611e7b565b925050600181019050612055565b5085925050509392505050565b5f82825260208201905092915050565b5f6120b28385612097565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156120e5576120e4611eec565b5b6020830292506120f6838584611ef0565b82840190509392505050565b5f6060820190506121155f830188611a0c565b818103602083015261212881868861203c565b9050818103604083015261213d8184866120a7565b90509695505050505050565b5f82905092915050565b5f6121616020840184611a4a565b905092915050565b6121728161186f565b82525050565b604082016121885f830183611e65565b6121945f850182612016565b506121a26020830183612153565b6121af6020850182612169565b50505050565b608082016121c55f830183612149565b6121d15f850182612178565b506121df6040830183612153565b6121ec6040850182612169565b506121fa6060830183612153565b6122076060850182612169565b50505050565b6040820161221d5f830183611e65565b6122295f850182612016565b506122376020830183612153565b6122446020850182612169565b50505050565b5f82825260208201905092915050565b828183375f83830152505050565b5f601f19601f8301169050919050565b5f612283838561224a565b935061229083858461225a565b61229983612268565b840190509392505050565b5f610100820190506122b85f8301886121b5565b6122c5608083018761220d565b6122d260c0830186611b42565b81810360e08301526122e5818486612278565b90509695505050505050565b5f81905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000005f82015250565b5f61232f601c836122f1565b915061233a826122fb565b601c82019050919050565b5f61234f82612323565b915061235b8284611d26565b60208201915081905092915050565b5f82825260208201905092915050565b7f496e76616c6964207369676e6174757265206c656e67746800000000000000005f82015250565b5f6123ae60188361236a565b91506123b98261237a565b602082019050919050565b5f6020820190508181035f8301526123db816123a2565b9050919050565b5f60ff82169050919050565b6123f7816123e2565b82525050565b5f6080820190506124105f830187611a0c565b61241d60208301866123ee565b61242a6040830185611a0c565b6124376060830184611a0c565b95945050505050565b5f6040820190506124535f830185611b42565b6124606020830184611878565b9392505050565b5f60c08201905061247a5f830189611a0c565b6124876020830188611b42565b6124946040830187611b42565b6124a16060830186611b42565b6124ae6080830185611878565b6124bb60a0830184611b33565b979650505050505050565b5f6124d0826118db565b91506fffffffffffffffffffffffffffffffff82036124f2576124f1611cbd565b5b600182019050919050565b5f6080820190506125105f830187611a0c565b61251d6020830186611b42565b61252a6040830185611b42565b6125376060830184611b33565b95945050505050565b5f6060820190506125535f830186611b42565b6125606020830185611b42565b61256d6040830184611878565b949350505050565b5f6020820190506125885f830184611b42565b9291505056fea2646970667358221220c2f49e8325f093db4cffb2a2bd654a683f8673d105eb4aa6f143bc7e793219e564736f6c634300081c0033

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

000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3

-----Decoded View---------------
Arg [0] : _permit2 (address): 0x000000000022D473030F116dDEE9F6B43aC78BA3

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.