ETH Price: $2,939.38 (-0.60%)

Contract

0xDD7F09089ECA6759232c0c088326Dc2cBC04971F
Transaction Hash
Block
From
To
Resolve135944322025-05-06 9:41:43264 days ago1746524503IN
0xDD7F0908...cBC04971F
0 ETH0.000000070.00100102
Resolve135944282025-05-06 9:41:35264 days ago1746524495IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100102
Resolve135944242025-05-06 9:41:27264 days ago1746524487IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100102
Resolve135944212025-05-06 9:41:21264 days ago1746524481IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100102
Resolve135944182025-05-06 9:41:15264 days ago1746524475IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100102
Resolve135944142025-05-06 9:41:07264 days ago1746524467IN
0xDD7F0908...cBC04971F
0 ETH0.00000010.00100102
Resolve135944112025-05-06 9:41:01264 days ago1746524461IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100102
Resolve135944072025-05-06 9:40:53264 days ago1746524453IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135944032025-05-06 9:40:45264 days ago1746524445IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135943992025-05-06 9:40:37264 days ago1746524437IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135943952025-05-06 9:40:29264 days ago1746524429IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135943922025-05-06 9:40:23264 days ago1746524423IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135943892025-05-06 9:40:17264 days ago1746524417IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135943862025-05-06 9:40:11264 days ago1746524411IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135943822025-05-06 9:40:03264 days ago1746524403IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135943782025-05-06 9:39:55264 days ago1746524395IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135943752025-05-06 9:39:49264 days ago1746524389IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135943712025-05-06 9:39:41264 days ago1746524381IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100103
Resolve135943682025-05-06 9:39:35264 days ago1746524375IN
0xDD7F0908...cBC04971F
0 ETH0.000000090.00100104
Resolve135943642025-05-06 9:39:27264 days ago1746524367IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100104
Resolve135943612025-05-06 9:39:21264 days ago1746524361IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100104
Resolve135943582025-05-06 9:39:15264 days ago1746524355IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100104
Resolve135943542025-05-06 9:39:07264 days ago1746524347IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100104
Resolve135943512025-05-06 9:39:01264 days ago1746524341IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100104
Resolve135943472025-05-06 9:38:53264 days ago1746524333IN
0xDD7F0908...cBC04971F
0 ETH0.000000080.00100104
View all transactions

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:
Duel

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 Duel
/// @notice A duel between two players resolved by a third party resolver.
contract Duel is ReentrancyGuard {
    using SafeERC20 for IERC20;

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

    struct Game {
        address player1;
        address player2;
        address resolver;
        uint256 amount;
        uint256 fee;
        address token;
        bool settled;
    }

    struct Count {
        uint128 created;
        uint128 played;
    }

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

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

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

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

    event Created(bytes32 gameId, address player1, address resolver, address token, uint256 amount, uint256 fee);
    event Joined(bytes32 gameId, address player1, address player2);
    event Resolved(bytes32 gameId, address winner);
    event Cancelled(bytes32 gameId);

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

    error InvalidResolver();
    error InsufficientValue();
    error AlreadySettled();
    error NotStarted();
    error InvalidWinner();
    error InvalidSignature();
    error NotResolver();
    error AlreadyResolved();

    /*//////////////////////////////////////////////////////////////
                            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, uint256 fee) public nonReentrant returns (bytes32) {
        // Safe transfer tokens from player to contract
        IERC20(token).safeTransferFrom(msg.sender, address(this), amount);

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

    /// @notice Join a game or create a new one using Permit2
    function joinWithPermit(
        address resolver,
        address token,
        uint256 amount,
        uint256 fee,
        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);

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

    /// @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 fee Fee taken by the protocol
    function _join(address resolver, address token, uint256 amount, uint256 fee) internal returns (bytes32) {
        if (resolver == address(0)) revert InvalidResolver();
        if (amount <= fee) revert InsufficientValue();

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

        // Get the next game to be played
        bytes32 nextGameId = keccak256(abi.encodePacked(lobbyId, count.played));
        Game storage game = games[nextGameId];

        // If there's an available game
        if (game.player1 != address(0) && game.player2 == address(0)) {
            // If trying to join own game, create new one instead
            if (game.player1 == msg.sender) {
                bytes32 newGameId = keccak256(abi.encodePacked(lobbyId, count.created));

                games[newGameId] = Game({
                    player1: msg.sender,
                    player2: address(0),
                    resolver: resolver,
                    amount: amount,
                    fee: fee,
                    token: token,
                    settled: false
                });

                count.created++;
                emit Created(newGameId, msg.sender, resolver, token, amount, fee);
                return newGameId;
            }

            // Join existing game
            game.player2 = msg.sender;
            count.played++;
            emit Joined(nextGameId, game.player1, msg.sender);
            return nextGameId;
        }

        // Create first game or new game after previous one is filled
        bytes32 gameId = keccak256(abi.encodePacked(lobbyId, count.created));

        games[gameId] = Game({
            player1: msg.sender,
            player2: address(0),
            resolver: resolver,
            amount: amount,
            fee: fee,
            token: token,
            settled: false
        });

        count.created++;
        emit Created(gameId, msg.sender, resolver, token, amount, fee);
        return gameId;
    }

    /// @notice Resolve a game with the winner
    /// @param gameId The id of the game
    /// @param winner The winner of the game, address(0) if draw
    /// @param signature The signature of the resolver
    function resolve(bytes32 gameId, address winner, bytes calldata signature) public nonReentrant {
        Game storage game = games[gameId];

        // Verify game state
        if (game.settled) revert AlreadySettled();
        if (game.player2 == address(0)) revert NotStarted();

        // Verify winner is valid
        if (winner != address(0) && winner != game.player1 && winner != game.player2) revert InvalidWinner();

        // Verify resolver signature
        bytes32 messageHash = keccak256(abi.encodePacked(gameId, winner));
        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 resolver
        if (ecrecover(signedHash, v, r, s) != game.resolver) revert InvalidSignature();

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

        IERC20 token = IERC20(game.token);

        if (winner == address(0)) {
            // Draw - return full amount to both players
            token.safeTransfer(game.player1, game.amount);
            token.safeTransfer(game.player2, game.amount);
        } else {
            // Winner takes prize pool (total amount minus fee)
            token.safeTransfer(winner, game.amount * 2 - game.fee);
            // Transfer fees to resolver
            token.safeTransfer(game.resolver, game.fee);
        }
        emit Resolved(gameId, winner);
    }

    /// @notice Cancel a game with resolver signature
    /// @param gameId The id of the game
    /// @param signature The signature from the resolver permitting the cancellation
    function cancel(bytes32 gameId, bytes calldata signature) public nonReentrant {
        Game storage game = games[gameId];

        // Verify game state
        if (game.settled) revert AlreadyResolved();

        // Verify resolver signature for cancellation
        bytes32 messageHash = keccak256(abi.encodePacked(gameId, "CANCEL"));
        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 resolver
        if (ecrecover(signedHash, v, r, s) != game.resolver) revert InvalidSignature();

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

        // Return tokens to players
        IERC20 token = IERC20(game.token);
        if (game.player1 != address(0)) {
            token.safeTransfer(game.player1, game.amount);
        }
        if (game.player2 != address(0)) {
            token.safeTransfer(game.player2, game.amount);
        }

        emit Cancelled(gameId);
    }

    /// @notice Cancel a game directly by the resolver
    /// @param gameId The id of the game
    function forceCancel(bytes32 gameId) public nonReentrant {
        Game storage game = games[gameId];

        // Only resolver can force cancel
        if (msg.sender != game.resolver) revert NotResolver();

        // Verify game state
        if (game.settled) revert AlreadyResolved();

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

        // Return tokens to players
        IERC20 token = IERC20(game.token);
        if (game.player1 != address(0)) {
            token.safeTransfer(game.player1, game.amount);
        }
        if (game.player2 != address(0)) {
            token.safeTransfer(game.player2, game.amount);
        }

        emit Cancelled(gameId);
    }
}

// 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":"AlreadyResolved","type":"error"},{"inputs":[],"name":"AlreadySettled","type":"error"},{"inputs":[],"name":"InsufficientValue","type":"error"},{"inputs":[],"name":"InvalidResolver","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidWinner","type":"error"},{"inputs":[],"name":"NotResolver","type":"error"},{"inputs":[],"name":"NotStarted","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"}],"name":"Cancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"player1","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":"uint256","name":"fee","type":"uint256"}],"name":"Created","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"player1","type":"address"},{"indexed":false,"internalType":"address","name":"player2","type":"address"}],"name":"Joined","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"gameId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"winner","type":"address"}],"name":"Resolved","type":"event"},{"inputs":[{"internalType":"bytes32","name":"gameId","type":"bytes32"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"forceCancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"gameId","type":"bytes32"}],"name":"games","outputs":[{"internalType":"address","name":"player1","type":"address"},{"internalType":"address","name":"player2","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fee","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":"uint256","name":"fee","type":"uint256"}],"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":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"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":"lobbyId","type":"bytes32"}],"name":"lobby","outputs":[{"internalType":"uint128","name":"created","type":"uint128"},{"internalType":"uint128","name":"played","type":"uint128"}],"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":"winner","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"resolve","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561000f575f5ffd5b506040516128a43803806128a4833981810160405281019061003191906100d0565b60015f819055508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1681525050506100fb565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61009f82610076565b9050919050565b6100af81610095565b81146100b9575f5ffd5b50565b5f815190506100ca816100a6565b92915050565b5f602082840312156100e5576100e4610072565b5b5f6100f2848285016100bc565b91505092915050565b60805161278a61011a5f395f81816101c50152610f89015261278a5ff3fe608060405234801561000f575f5ffd5b5060043610610086575f3560e01c8063efea38c011610059578063efea38c0146100fc578063f3145c1b1461012c578063f579f8821461015d578063f6da08241461019357610086565b806312261ee71461008a578063302bacf3146100a8578063357f126f146100c45780636f3e1d6c146100e0575b5f5ffd5b6100926101c3565b60405161009f9190611bc7565b60405180910390f35b6100c260048036038101906100bd9190611c7c565b6101e7565b005b6100de60048036038101906100d99190611cd9565b6105af565b005b6100fa60048036038101906100f59190611d3f565b610874565b005b61011660048036038101906101119190611de3565b610e0d565b6040516101239190611e56565b60405180910390f35b61014660048036038101906101419190611cd9565b610e61565b604051610154929190611e99565b60405180910390f35b61017760048036038101906101729190611cd9565b610eb7565b60405161018a9796959493929190611ef8565b60405180910390f35b6101ad60048036038101906101a89190611fa5565b610f7e565b6040516101ba9190611e56565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b6101ef611037565b5f60025f8581526020019081526020015f2090508060050160149054906101000a900460ff161561024c576040517f6d5703c200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8460405160200161025e91906120d9565b6040516020818303038152906040528051906020012090505f816040516020016102889190612148565b604051602081830303815290604052805190602001209050604185859050146102e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102dd906121c7565b60405180910390fd5b5f5f5f873592506020880135915060408801355f1a9050856002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166001858386866040515f81526020016040526040516103599493929190612200565b6020604051602081039080840390855afa158015610379573d5f5f3e3d5ffd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16146103d0576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018660050160146101000a81548160ff0219169083151502179055505f866005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff16875f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104bb576104ba875f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b5b5f73ffffffffffffffffffffffffffffffffffffffff16876001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056457610563876001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b5b7fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb708a6040516105939190611e56565b60405180910390a1505050505050506105aa6110fa565b505050565b6105b7611037565b5f60025f8381526020019081526020015f209050806002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610653576040517fba2a9fc200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060050160149054906101000a900460ff161561069c576040517f6d5703c200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018160050160146101000a81548160ff0219169083151502179055505f816005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff16825f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078757610786825f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b5b5f73ffffffffffffffffffffffffffffffffffffffff16826001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108305761082f826001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b5b7fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb708360405161085f9190611e56565b60405180910390a150506108716110fa565b50565b61087c611037565b5f60025f8681526020019081526020015f2090508060050160149054906101000a900460ff16156108d9576040517f560ff90000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff16816001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610961576040517f6f312cbd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156109eb5750805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015610a465750806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15610a7d576040517f93a5f3c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8585604051602001610a91929190612288565b6040516020818303038152906040528051906020012090505f81604051602001610abb9190612148565b60405160208183030381529060405280519060200120905060418585905014610b19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b10906121c7565b60405180910390fd5b5f5f5f873592506020880135915060408801355f1a9050856002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166001858386866040515f8152602001604052604051610b8c9493929190612200565b6020604051602081039080840390855afa158015610bac573d5f5f3e3d5ffd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614610c03576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018660050160146101000a81548160ff0219169083151502179055505f866005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1603610d2257610ccb875f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b610d1d876001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b610dbf565b610d6c8a886004015460028a60030154610d3c91906122e0565b610d469190612321565b8373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b610dbe876002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600401548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b5b7ffa13ec2d9f73e6468f091c84ce4897a1b8413f734b0fe76fb605209475f6a33f8b8b604051610df0929190612354565b60405180910390a150505050505050610e076110fa565b50505050565b5f610e16611037565b610e433330858773ffffffffffffffffffffffffffffffffffffffff16611103909392919063ffffffff16565b610e4f85858585611185565b9050610e596110fa565b949350505050565b6001602052805f5260405f205f91509050805f015f9054906101000a90046fffffffffffffffffffffffffffffffff1690805f0160109054906101000a90046fffffffffffffffffffffffffffffffff16905082565b6002602052805f5260405f205f91509050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806003015490806004015490806005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060050160149054906101000a900460ff16905087565b5f610f87611037565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166330f28b7a86863387876040518663ffffffff1660e01b8152600401610fe89594939291906124fb565b5f604051808303815f87803b158015610fff575f5ffd5b505af1158015611011573d5f5f3e3d5ffd5b5050505061102189898989611185565b905061102b6110fa565b98975050505050505050565b60025f5403611072576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025f81905550565b6110f5838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040516024016110ae929190612548565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611ab2565b505050565b60015f81905550565b61117f848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016111389392919061256f565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611ab2565b50505050565b5f5f73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036111eb576040517f6da3f65400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818311611224576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8585858560405160200161123c94939291906125c4565b6040516020818303038152906040528051906020012090505f60015f8381526020019081526020015f2090505f82825f0160109054906101000a90046fffffffffffffffffffffffffffffffff1660405160200161129b929190612645565b6040516020818303038152906040528051906020012090505f60025f8381526020019081526020015f2090505f73ffffffffffffffffffffffffffffffffffffffff16815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415801561137357505f73ffffffffffffffffffffffffffffffffffffffff16816001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156117c6573373ffffffffffffffffffffffffffffffffffffffff16815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036116b5575f84845f015f9054906101000a90046fffffffffffffffffffffffffffffffff166040516020016113ff929190612645565b6040516020818303038152906040528051906020012090506040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018881526020018a73ffffffffffffffffffffffffffffffffffffffff1681526020015f151581525060025f8381526020019081526020015f205f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c08201518160050160146101000a81548160ff021916908315150217905550905050835f015f81819054906101000a90046fffffffffffffffffffffffffffffffff168092919061163090612670565b91906101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550507f372d338a1d2eca947e5d001a965e3e14a692f17bc7ca8bd9eca5742bde4c401c81338c8c8c8c6040516116a0969594939291906126a7565b60405180910390a18095505050505050611aaa565b33816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550825f01601081819054906101000a90046fffffffffffffffffffffffffffffffff168092919061172690612670565b91906101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550507f9fbdb33f4c1416db2a3c3245e57f4ab866e90c09d495ce926bb58f4d4261bd7982825f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16336040516117b293929190612706565b60405180910390a181945050505050611aaa565b5f84845f015f9054906101000a90046fffffffffffffffffffffffffffffffff166040516020016117f8929190612645565b6040516020818303038152906040528051906020012090506040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018881526020018a73ffffffffffffffffffffffffffffffffffffffff1681526020015f151581525060025f8381526020019081526020015f205f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c08201518160050160146101000a81548160ff021916908315150217905550905050835f015f81819054906101000a90046fffffffffffffffffffffffffffffffff1680929190611a2990612670565b91906101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550507f372d338a1d2eca947e5d001a965e3e14a692f17bc7ca8bd9eca5742bde4c401c81338c8c8c8c604051611a99969594939291906126a7565b60405180910390a180955050505050505b949350505050565b5f5f60205f8451602086015f885af180611ad1576040513d5f823e3d81fd5b3d92505f519150505f8214611aea576001811415611b05565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b15611b4757836040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401611b3e919061273b565b60405180910390fd5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f611b8f611b8a611b8584611b4d565b611b6c565b611b4d565b9050919050565b5f611ba082611b75565b9050919050565b5f611bb182611b96565b9050919050565b611bc181611ba7565b82525050565b5f602082019050611bda5f830184611bb8565b92915050565b5f5ffd5b5f5ffd5b5f819050919050565b611bfa81611be8565b8114611c04575f5ffd5b50565b5f81359050611c1581611bf1565b92915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f840112611c3c57611c3b611c1b565b5b8235905067ffffffffffffffff811115611c5957611c58611c1f565b5b602083019150836001820283011115611c7557611c74611c23565b5b9250929050565b5f5f5f60408486031215611c9357611c92611be0565b5b5f611ca086828701611c07565b935050602084013567ffffffffffffffff811115611cc157611cc0611be4565b5b611ccd86828701611c27565b92509250509250925092565b5f60208284031215611cee57611ced611be0565b5b5f611cfb84828501611c07565b91505092915050565b5f611d0e82611b4d565b9050919050565b611d1e81611d04565b8114611d28575f5ffd5b50565b5f81359050611d3981611d15565b92915050565b5f5f5f5f60608587031215611d5757611d56611be0565b5b5f611d6487828801611c07565b9450506020611d7587828801611d2b565b935050604085013567ffffffffffffffff811115611d9657611d95611be4565b5b611da287828801611c27565b925092505092959194509250565b5f819050919050565b611dc281611db0565b8114611dcc575f5ffd5b50565b5f81359050611ddd81611db9565b92915050565b5f5f5f5f60808587031215611dfb57611dfa611be0565b5b5f611e0887828801611d2b565b9450506020611e1987828801611d2b565b9350506040611e2a87828801611dcf565b9250506060611e3b87828801611dcf565b91505092959194509250565b611e5081611be8565b82525050565b5f602082019050611e695f830184611e47565b92915050565b5f6fffffffffffffffffffffffffffffffff82169050919050565b611e9381611e6f565b82525050565b5f604082019050611eac5f830185611e8a565b611eb96020830184611e8a565b9392505050565b611ec981611d04565b82525050565b611ed881611db0565b82525050565b5f8115159050919050565b611ef281611ede565b82525050565b5f60e082019050611f0b5f83018a611ec0565b611f186020830189611ec0565b611f256040830188611ec0565b611f326060830187611ecf565b611f3f6080830186611ecf565b611f4c60a0830185611ec0565b611f5960c0830184611ee9565b98975050505050505050565b5f5ffd5b5f60808284031215611f7e57611f7d611f65565b5b81905092915050565b5f60408284031215611f9c57611f9b611f65565b5b81905092915050565b5f5f5f5f5f5f5f5f610160898b031215611fc257611fc1611be0565b5b5f611fcf8b828c01611d2b565b9850506020611fe08b828c01611d2b565b9750506040611ff18b828c01611dcf565b96505060606120028b828c01611dcf565b95505060806120138b828c01611f69565b9450506101006120258b828c01611f87565b93505061014089013567ffffffffffffffff81111561204757612046611be4565b5b6120538b828c01611c27565b92509250509295985092959890939650565b5f819050919050565b61207f61207a82611be8565b612065565b82525050565b5f81905092915050565b7f43414e43454c00000000000000000000000000000000000000000000000000005f82015250565b5f6120c3600683612085565b91506120ce8261208f565b600682019050919050565b5f6120e4828461206e565b6020820191506120f3826120b7565b915081905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000005f82015250565b5f612132601c83612085565b915061213d826120fe565b601c82019050919050565b5f61215282612126565b915061215e828461206e565b60208201915081905092915050565b5f82825260208201905092915050565b7f496e76616c6964207369676e6174757265206c656e67746800000000000000005f82015250565b5f6121b160188361216d565b91506121bc8261217d565b602082019050919050565b5f6020820190508181035f8301526121de816121a5565b9050919050565b5f60ff82169050919050565b6121fa816121e5565b82525050565b5f6080820190506122135f830187611e47565b61222060208301866121f1565b61222d6040830185611e47565b61223a6060830184611e47565b95945050505050565b5f8160601b9050919050565b5f61225982612243565b9050919050565b5f61226a8261224f565b9050919050565b61228261227d82611d04565b612260565b82525050565b5f612293828561206e565b6020820191506122a38284612271565b6014820191508190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6122ea82611db0565b91506122f583611db0565b925082820261230381611db0565b9150828204841483151761231a576123196122b3565b5b5092915050565b5f61232b82611db0565b915061233683611db0565b925082820390508181111561234e5761234d6122b3565b5b92915050565b5f6040820190506123675f830185611e47565b6123746020830184611ec0565b9392505050565b5f82905092915050565b5f6123936020840184611d2b565b905092915050565b6123a481611d04565b82525050565b5f6123b86020840184611dcf565b905092915050565b6123c981611db0565b82525050565b604082016123df5f830183612385565b6123eb5f85018261239b565b506123f960208301836123aa565b61240660208501826123c0565b50505050565b6080820161241c5f83018361237b565b6124285f8501826123cf565b5061243660408301836123aa565b61244360408501826123c0565b5061245160608301836123aa565b61245e60608501826123c0565b50505050565b604082016124745f830183612385565b6124805f85018261239b565b5061248e60208301836123aa565b61249b60208501826123c0565b50505050565b5f82825260208201905092915050565b828183375f83830152505050565b5f601f19601f8301169050919050565b5f6124da83856124a1565b93506124e78385846124b1565b6124f0836124bf565b840190509392505050565b5f6101008201905061250f5f83018861240c565b61251c6080830187612464565b61252960c0830186611ec0565b81810360e083015261253c8184866124cf565b90509695505050505050565b5f60408201905061255b5f830185611ec0565b6125686020830184611ecf565b9392505050565b5f6060820190506125825f830186611ec0565b61258f6020830185611ec0565b61259c6040830184611ecf565b949350505050565b5f819050919050565b6125be6125b982611db0565b6125a4565b82525050565b5f6125cf8287612271565b6014820191506125df8286612271565b6014820191506125ef82856125ad565b6020820191506125ff82846125ad565b60208201915081905095945050505050565b5f8160801b9050919050565b5f61262782612611565b9050919050565b61263f61263a82611e6f565b61261d565b82525050565b5f612650828561206e565b602082019150612660828461262e565b6010820191508190509392505050565b5f61267a82611e6f565b91506fffffffffffffffffffffffffffffffff820361269c5761269b6122b3565b5b600182019050919050565b5f60c0820190506126ba5f830189611e47565b6126c76020830188611ec0565b6126d46040830187611ec0565b6126e16060830186611ec0565b6126ee6080830185611ecf565b6126fb60a0830184611ecf565b979650505050505050565b5f6060820190506127195f830186611e47565b6127266020830185611ec0565b6127336040830184611ec0565b949350505050565b5f60208201905061274e5f830184611ec0565b9291505056fea2646970667358221220d80ec6f929c6bb300c26ba6da40d3e31f228348535a20c85f15248c6e15359b664736f6c634300081c0033000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3

Deployed Bytecode

0x608060405234801561000f575f5ffd5b5060043610610086575f3560e01c8063efea38c011610059578063efea38c0146100fc578063f3145c1b1461012c578063f579f8821461015d578063f6da08241461019357610086565b806312261ee71461008a578063302bacf3146100a8578063357f126f146100c45780636f3e1d6c146100e0575b5f5ffd5b6100926101c3565b60405161009f9190611bc7565b60405180910390f35b6100c260048036038101906100bd9190611c7c565b6101e7565b005b6100de60048036038101906100d99190611cd9565b6105af565b005b6100fa60048036038101906100f59190611d3f565b610874565b005b61011660048036038101906101119190611de3565b610e0d565b6040516101239190611e56565b60405180910390f35b61014660048036038101906101419190611cd9565b610e61565b604051610154929190611e99565b60405180910390f35b61017760048036038101906101729190611cd9565b610eb7565b60405161018a9796959493929190611ef8565b60405180910390f35b6101ad60048036038101906101a89190611fa5565b610f7e565b6040516101ba9190611e56565b60405180910390f35b7f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba381565b6101ef611037565b5f60025f8581526020019081526020015f2090508060050160149054906101000a900460ff161561024c576040517f6d5703c200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8460405160200161025e91906120d9565b6040516020818303038152906040528051906020012090505f816040516020016102889190612148565b604051602081830303815290604052805190602001209050604185859050146102e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102dd906121c7565b60405180910390fd5b5f5f5f873592506020880135915060408801355f1a9050856002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166001858386866040515f81526020016040526040516103599493929190612200565b6020604051602081039080840390855afa158015610379573d5f5f3e3d5ffd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff16146103d0576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018660050160146101000a81548160ff0219169083151502179055505f866005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff16875f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104bb576104ba875f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b5b5f73ffffffffffffffffffffffffffffffffffffffff16876001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056457610563876001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b5b7fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb708a6040516105939190611e56565b60405180910390a1505050505050506105aa6110fa565b505050565b6105b7611037565b5f60025f8381526020019081526020015f209050806002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610653576040517fba2a9fc200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060050160149054906101000a900460ff161561069c576040517f6d5703c200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018160050160146101000a81548160ff0219169083151502179055505f816005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff16825f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078757610786825f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b5b5f73ffffffffffffffffffffffffffffffffffffffff16826001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108305761082f826001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b5b7fbaa1eb22f2a492ba1a5fea61b8df4d27c6c8b5f3971e63bb58fa14ff72eedb708360405161085f9190611e56565b60405180910390a150506108716110fa565b50565b61087c611037565b5f60025f8681526020019081526020015f2090508060050160149054906101000a900460ff16156108d9576040517f560ff90000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff16816001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610961576040517f6f312cbd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156109eb5750805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015610a465750806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15610a7d576040517f93a5f3c700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8585604051602001610a91929190612288565b6040516020818303038152906040528051906020012090505f81604051602001610abb9190612148565b60405160208183030381529060405280519060200120905060418585905014610b19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b10906121c7565b60405180910390fd5b5f5f5f873592506020880135915060408801355f1a9050856002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166001858386866040515f8152602001604052604051610b8c9493929190612200565b6020604051602081039080840390855afa158015610bac573d5f5f3e3d5ffd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff1614610c03576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60018660050160146101000a81548160ff0219169083151502179055505f866005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f73ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1603610d2257610ccb875f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b610d1d876001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600301548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b610dbf565b610d6c8a886004015460028a60030154610d3c91906122e0565b610d469190612321565b8373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b610dbe876002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688600401548373ffffffffffffffffffffffffffffffffffffffff1661107b9092919063ffffffff16565b5b7ffa13ec2d9f73e6468f091c84ce4897a1b8413f734b0fe76fb605209475f6a33f8b8b604051610df0929190612354565b60405180910390a150505050505050610e076110fa565b50505050565b5f610e16611037565b610e433330858773ffffffffffffffffffffffffffffffffffffffff16611103909392919063ffffffff16565b610e4f85858585611185565b9050610e596110fa565b949350505050565b6001602052805f5260405f205f91509050805f015f9054906101000a90046fffffffffffffffffffffffffffffffff1690805f0160109054906101000a90046fffffffffffffffffffffffffffffffff16905082565b6002602052805f5260405f205f91509050805f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806002015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806003015490806004015490806005015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060050160149054906101000a900460ff16905087565b5f610f87611037565b7f000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba373ffffffffffffffffffffffffffffffffffffffff166330f28b7a86863387876040518663ffffffff1660e01b8152600401610fe89594939291906124fb565b5f604051808303815f87803b158015610fff575f5ffd5b505af1158015611011573d5f5f3e3d5ffd5b5050505061102189898989611185565b905061102b6110fa565b98975050505050505050565b60025f5403611072576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60025f81905550565b6110f5838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040516024016110ae929190612548565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611ab2565b505050565b60015f81905550565b61117f848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016111389392919061256f565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611ab2565b50505050565b5f5f73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036111eb576040517f6da3f65400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b818311611224576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8585858560405160200161123c94939291906125c4565b6040516020818303038152906040528051906020012090505f60015f8381526020019081526020015f2090505f82825f0160109054906101000a90046fffffffffffffffffffffffffffffffff1660405160200161129b929190612645565b6040516020818303038152906040528051906020012090505f60025f8381526020019081526020015f2090505f73ffffffffffffffffffffffffffffffffffffffff16815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415801561137357505f73ffffffffffffffffffffffffffffffffffffffff16816001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156117c6573373ffffffffffffffffffffffffffffffffffffffff16815f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036116b5575f84845f015f9054906101000a90046fffffffffffffffffffffffffffffffff166040516020016113ff929190612645565b6040516020818303038152906040528051906020012090506040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018881526020018a73ffffffffffffffffffffffffffffffffffffffff1681526020015f151581525060025f8381526020019081526020015f205f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c08201518160050160146101000a81548160ff021916908315150217905550905050835f015f81819054906101000a90046fffffffffffffffffffffffffffffffff168092919061163090612670565b91906101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550507f372d338a1d2eca947e5d001a965e3e14a692f17bc7ca8bd9eca5742bde4c401c81338c8c8c8c6040516116a0969594939291906126a7565b60405180910390a18095505050505050611aaa565b33816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550825f01601081819054906101000a90046fffffffffffffffffffffffffffffffff168092919061172690612670565b91906101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550507f9fbdb33f4c1416db2a3c3245e57f4ab866e90c09d495ce926bb58f4d4261bd7982825f015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16336040516117b293929190612706565b60405180910390a181945050505050611aaa565b5f84845f015f9054906101000a90046fffffffffffffffffffffffffffffffff166040516020016117f8929190612645565b6040516020818303038152906040528051906020012090506040518060e001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020018b73ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018881526020018a73ffffffffffffffffffffffffffffffffffffffff1681526020015f151581525060025f8381526020019081526020015f205f820151815f015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550606082015181600301556080820151816004015560a0820151816005015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c08201518160050160146101000a81548160ff021916908315150217905550905050835f015f81819054906101000a90046fffffffffffffffffffffffffffffffff1680929190611a2990612670565b91906101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550507f372d338a1d2eca947e5d001a965e3e14a692f17bc7ca8bd9eca5742bde4c401c81338c8c8c8c604051611a99969594939291906126a7565b60405180910390a180955050505050505b949350505050565b5f5f60205f8451602086015f885af180611ad1576040513d5f823e3d81fd5b3d92505f519150505f8214611aea576001811415611b05565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b15611b4757836040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401611b3e919061273b565b60405180910390fd5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f611b8f611b8a611b8584611b4d565b611b6c565b611b4d565b9050919050565b5f611ba082611b75565b9050919050565b5f611bb182611b96565b9050919050565b611bc181611ba7565b82525050565b5f602082019050611bda5f830184611bb8565b92915050565b5f5ffd5b5f5ffd5b5f819050919050565b611bfa81611be8565b8114611c04575f5ffd5b50565b5f81359050611c1581611bf1565b92915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f840112611c3c57611c3b611c1b565b5b8235905067ffffffffffffffff811115611c5957611c58611c1f565b5b602083019150836001820283011115611c7557611c74611c23565b5b9250929050565b5f5f5f60408486031215611c9357611c92611be0565b5b5f611ca086828701611c07565b935050602084013567ffffffffffffffff811115611cc157611cc0611be4565b5b611ccd86828701611c27565b92509250509250925092565b5f60208284031215611cee57611ced611be0565b5b5f611cfb84828501611c07565b91505092915050565b5f611d0e82611b4d565b9050919050565b611d1e81611d04565b8114611d28575f5ffd5b50565b5f81359050611d3981611d15565b92915050565b5f5f5f5f60608587031215611d5757611d56611be0565b5b5f611d6487828801611c07565b9450506020611d7587828801611d2b565b935050604085013567ffffffffffffffff811115611d9657611d95611be4565b5b611da287828801611c27565b925092505092959194509250565b5f819050919050565b611dc281611db0565b8114611dcc575f5ffd5b50565b5f81359050611ddd81611db9565b92915050565b5f5f5f5f60808587031215611dfb57611dfa611be0565b5b5f611e0887828801611d2b565b9450506020611e1987828801611d2b565b9350506040611e2a87828801611dcf565b9250506060611e3b87828801611dcf565b91505092959194509250565b611e5081611be8565b82525050565b5f602082019050611e695f830184611e47565b92915050565b5f6fffffffffffffffffffffffffffffffff82169050919050565b611e9381611e6f565b82525050565b5f604082019050611eac5f830185611e8a565b611eb96020830184611e8a565b9392505050565b611ec981611d04565b82525050565b611ed881611db0565b82525050565b5f8115159050919050565b611ef281611ede565b82525050565b5f60e082019050611f0b5f83018a611ec0565b611f186020830189611ec0565b611f256040830188611ec0565b611f326060830187611ecf565b611f3f6080830186611ecf565b611f4c60a0830185611ec0565b611f5960c0830184611ee9565b98975050505050505050565b5f5ffd5b5f60808284031215611f7e57611f7d611f65565b5b81905092915050565b5f60408284031215611f9c57611f9b611f65565b5b81905092915050565b5f5f5f5f5f5f5f5f610160898b031215611fc257611fc1611be0565b5b5f611fcf8b828c01611d2b565b9850506020611fe08b828c01611d2b565b9750506040611ff18b828c01611dcf565b96505060606120028b828c01611dcf565b95505060806120138b828c01611f69565b9450506101006120258b828c01611f87565b93505061014089013567ffffffffffffffff81111561204757612046611be4565b5b6120538b828c01611c27565b92509250509295985092959890939650565b5f819050919050565b61207f61207a82611be8565b612065565b82525050565b5f81905092915050565b7f43414e43454c00000000000000000000000000000000000000000000000000005f82015250565b5f6120c3600683612085565b91506120ce8261208f565b600682019050919050565b5f6120e4828461206e565b6020820191506120f3826120b7565b915081905092915050565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000005f82015250565b5f612132601c83612085565b915061213d826120fe565b601c82019050919050565b5f61215282612126565b915061215e828461206e565b60208201915081905092915050565b5f82825260208201905092915050565b7f496e76616c6964207369676e6174757265206c656e67746800000000000000005f82015250565b5f6121b160188361216d565b91506121bc8261217d565b602082019050919050565b5f6020820190508181035f8301526121de816121a5565b9050919050565b5f60ff82169050919050565b6121fa816121e5565b82525050565b5f6080820190506122135f830187611e47565b61222060208301866121f1565b61222d6040830185611e47565b61223a6060830184611e47565b95945050505050565b5f8160601b9050919050565b5f61225982612243565b9050919050565b5f61226a8261224f565b9050919050565b61228261227d82611d04565b612260565b82525050565b5f612293828561206e565b6020820191506122a38284612271565b6014820191508190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6122ea82611db0565b91506122f583611db0565b925082820261230381611db0565b9150828204841483151761231a576123196122b3565b5b5092915050565b5f61232b82611db0565b915061233683611db0565b925082820390508181111561234e5761234d6122b3565b5b92915050565b5f6040820190506123675f830185611e47565b6123746020830184611ec0565b9392505050565b5f82905092915050565b5f6123936020840184611d2b565b905092915050565b6123a481611d04565b82525050565b5f6123b86020840184611dcf565b905092915050565b6123c981611db0565b82525050565b604082016123df5f830183612385565b6123eb5f85018261239b565b506123f960208301836123aa565b61240660208501826123c0565b50505050565b6080820161241c5f83018361237b565b6124285f8501826123cf565b5061243660408301836123aa565b61244360408501826123c0565b5061245160608301836123aa565b61245e60608501826123c0565b50505050565b604082016124745f830183612385565b6124805f85018261239b565b5061248e60208301836123aa565b61249b60208501826123c0565b50505050565b5f82825260208201905092915050565b828183375f83830152505050565b5f601f19601f8301169050919050565b5f6124da83856124a1565b93506124e78385846124b1565b6124f0836124bf565b840190509392505050565b5f6101008201905061250f5f83018861240c565b61251c6080830187612464565b61252960c0830186611ec0565b81810360e083015261253c8184866124cf565b90509695505050505050565b5f60408201905061255b5f830185611ec0565b6125686020830184611ecf565b9392505050565b5f6060820190506125825f830186611ec0565b61258f6020830185611ec0565b61259c6040830184611ecf565b949350505050565b5f819050919050565b6125be6125b982611db0565b6125a4565b82525050565b5f6125cf8287612271565b6014820191506125df8286612271565b6014820191506125ef82856125ad565b6020820191506125ff82846125ad565b60208201915081905095945050505050565b5f8160801b9050919050565b5f61262782612611565b9050919050565b61263f61263a82611e6f565b61261d565b82525050565b5f612650828561206e565b602082019150612660828461262e565b6010820191508190509392505050565b5f61267a82611e6f565b91506fffffffffffffffffffffffffffffffff820361269c5761269b6122b3565b5b600182019050919050565b5f60c0820190506126ba5f830189611e47565b6126c76020830188611ec0565b6126d46040830187611ec0565b6126e16060830186611ec0565b6126ee6080830185611ecf565b6126fb60a0830184611ecf565b979650505050505050565b5f6060820190506127195f830186611e47565b6127266020830185611ec0565b6127336040830184611ec0565b949350505050565b5f60208201905061274e5f830184611ec0565b9291505056fea2646970667358221220d80ec6f929c6bb300c26ba6da40d3e31f228348535a20c85f15248c6e15359b664736f6c634300081c0033

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.