ETH Price: $3,194.74 (+1.93%)

Contract

0xcD01644d5DF4452EAe646b5a9DB41DeBCbCAc4Ad
 

Overview

ETH Balance

0.000212575616603946 ETH

ETH Value

$0.68 (@ $3,194.74/ETH)

Sponsored

Transaction Hash
Method
Block
From
To
Value
Play128329712024-06-28 3:45:2916 days ago1719546329IN
0xcD01644d...BCbCAc4Ad
0.00000149 ETH0.000000370.001005
Play128087282024-06-27 14:17:2316 days ago1719497843IN
0xcD01644d...BCbCAc4Ad
0.00000186 ETH0.000000370.001005
Play128087092024-06-27 14:16:4516 days ago1719497805IN
0xcD01644d...BCbCAc4Ad
0.00000186 ETH0.000000370.001005
Play127613162024-06-26 11:56:5917 days ago1719403019IN
0xcD01644d...BCbCAc4Ad
0.00000146 ETH0.000000360.001005
Play127572102024-06-26 9:40:0717 days ago1719394807IN
0xcD01644d...BCbCAc4Ad
0.00000143 ETH0.000000370.001005
Play127100772024-06-25 7:29:0118 days ago1719300541IN
0xcD01644d...BCbCAc4Ad
0.00000146 ETH0.000000370.001005
Play127097782024-06-25 7:19:0318 days ago1719299943IN
0xcD01644d...BCbCAc4Ad
0.00000148 ETH0.000000370.001005
Play127097652024-06-25 7:18:3718 days ago1719299917IN
0xcD01644d...BCbCAc4Ad
0.00000147 ETH0.000000370.001005
Play127096922024-06-25 7:16:1118 days ago1719299771IN
0xcD01644d...BCbCAc4Ad
0.00000147 ETH0.000000370.001005
Play127096742024-06-25 7:15:3518 days ago1719299735IN
0xcD01644d...BCbCAc4Ad
0.00000147 ETH0.000000370.001005
Play127096552024-06-25 7:14:5718 days ago1719299697IN
0xcD01644d...BCbCAc4Ad
0.00000147 ETH0.000000370.001005
Play126543952024-06-24 0:32:5720 days ago1719189177IN
0xcD01644d...BCbCAc4Ad
0.00000141 ETH0.000000370.001005
Play126543842024-06-24 0:32:3520 days ago1719189155IN
0xcD01644d...BCbCAc4Ad
0.00000141 ETH0.000000370.001005
Play126543732024-06-24 0:32:1320 days ago1719189133IN
0xcD01644d...BCbCAc4Ad
0.00000142 ETH0.000000370.001005
Play126543572024-06-24 0:31:4120 days ago1719189101IN
0xcD01644d...BCbCAc4Ad
0.00000142 ETH0.000000370.001005
Play126543492024-06-24 0:31:2520 days ago1719189085IN
0xcD01644d...BCbCAc4Ad
0.00000141 ETH0.000000370.001005
Play126543392024-06-24 0:31:0520 days ago1719189065IN
0xcD01644d...BCbCAc4Ad
0.00000142 ETH0.000000370.001005
Play126543312024-06-24 0:30:4920 days ago1719189049IN
0xcD01644d...BCbCAc4Ad
0.00000141 ETH0.000000370.001005
Play126543132024-06-24 0:30:1320 days ago1719189013IN
0xcD01644d...BCbCAc4Ad
0.00000141 ETH0.000000370.001005
Play126543032024-06-24 0:29:5320 days ago1719188993IN
0xcD01644d...BCbCAc4Ad
0.00000142 ETH0.000000370.001005
Play126542802024-06-24 0:29:0720 days ago1719188947IN
0xcD01644d...BCbCAc4Ad
0.00000141 ETH0.000000370.001005
Play126542212024-06-24 0:27:0920 days ago1719188829IN
0xcD01644d...BCbCAc4Ad
0.00000141 ETH0.000000370.001005
Play126542132024-06-24 0:26:5320 days ago1719188813IN
0xcD01644d...BCbCAc4Ad
0.00000141 ETH0.000000370.001005
Play126542052024-06-24 0:26:3720 days ago1719188797IN
0xcD01644d...BCbCAc4Ad
0.00000141 ETH0.000000370.001005
Play126541882024-06-24 0:26:0320 days ago1719188763IN
0xcD01644d...BCbCAc4Ad
0.0000014 ETH0.000000350.001005
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Value
128329712024-06-28 3:45:2916 days ago1719546329
0xcD01644d...BCbCAc4Ad
0.00000023 ETH
128087282024-06-27 14:17:2316 days ago1719497843
0xcD01644d...BCbCAc4Ad
0.00000028 ETH
128087092024-06-27 14:16:4516 days ago1719497805
0xcD01644d...BCbCAc4Ad
0.0000003 ETH
127613162024-06-26 11:56:5917 days ago1719403019
0xcD01644d...BCbCAc4Ad
0.00000024 ETH
127572102024-06-26 9:40:0717 days ago1719394807
0xcD01644d...BCbCAc4Ad
0.00000023 ETH
127100772024-06-25 7:29:0118 days ago1719300541
0xcD01644d...BCbCAc4Ad
0.00000022 ETH
127097782024-06-25 7:19:0318 days ago1719299943
0xcD01644d...BCbCAc4Ad
0.00000024 ETH
127097652024-06-25 7:18:3718 days ago1719299917
0xcD01644d...BCbCAc4Ad
0.00000024 ETH
127096922024-06-25 7:16:1118 days ago1719299771
0xcD01644d...BCbCAc4Ad
0.00000024 ETH
127096742024-06-25 7:15:3518 days ago1719299735
0xcD01644d...BCbCAc4Ad
0.00000024 ETH
127096552024-06-25 7:14:5718 days ago1719299697
0xcD01644d...BCbCAc4Ad
0.00000024 ETH
126543952024-06-24 0:32:5720 days ago1719189177
0xcD01644d...BCbCAc4Ad
0.00000023 ETH
126543842024-06-24 0:32:3520 days ago1719189155
0xcD01644d...BCbCAc4Ad
0.00000023 ETH
126543732024-06-24 0:32:1320 days ago1719189133
0xcD01644d...BCbCAc4Ad
0.00000024 ETH
126543572024-06-24 0:31:4120 days ago1719189101
0xcD01644d...BCbCAc4Ad
0.00000023 ETH
126543492024-06-24 0:31:2520 days ago1719189085
0xcD01644d...BCbCAc4Ad
0.00000022 ETH
126543392024-06-24 0:31:0520 days ago1719189065
0xcD01644d...BCbCAc4Ad
0.00000024 ETH
126543312024-06-24 0:30:4920 days ago1719189049
0xcD01644d...BCbCAc4Ad
0.00000022 ETH
126543132024-06-24 0:30:1320 days ago1719189013
0xcD01644d...BCbCAc4Ad
0.00000023 ETH
126543032024-06-24 0:29:5320 days ago1719188993
0xcD01644d...BCbCAc4Ad
0.00000024 ETH
126542802024-06-24 0:29:0720 days ago1719188947
0xcD01644d...BCbCAc4Ad
0.00000022 ETH
126542212024-06-24 0:27:0920 days ago1719188829
0xcD01644d...BCbCAc4Ad
0.00000024 ETH
126542132024-06-24 0:26:5320 days ago1719188813
0xcD01644d...BCbCAc4Ad
0.00000023 ETH
126542052024-06-24 0:26:3720 days ago1719188797
0xcD01644d...BCbCAc4Ad
0.00000022 ETH
126541882024-06-24 0:26:0320 days ago1719188763
0xcD01644d...BCbCAc4Ad
0.00000023 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ZapankiRPSKroma

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion, MIT license
File 1 of 11 : ZapankiRPSKroma.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./common/ZapankiGamesKroma.sol";

contract ZapankiRPSKroma is ZapankiGamesKroma {
    using SafeERC20 for IERC20;

    constructor(
        address _vrfCoordinator,
        IBankroll _bankroll,
        address _trustedForwarder,
        address _vrfDepositor
    ) ZapankiGamesKroma(_vrfCoordinator, _bankroll, _trustedForwarder, _vrfDepositor) {}

    struct RPSGame {
        uint256 wager;
        uint256 stopGain;
        uint256 stopLoss;
        uint256 vrfId;
        address tokenAddress;
        uint64 blockNumber;
        uint32 numBets;
        uint8 action;
    }

    mapping(address => RPSGame) rpsGames;
    mapping(uint256 => address) vrfPendingPlayer;

    event RPSFulfilled(
        address indexed playerAddress,
        uint256 wager,
        uint256 payout,
        address tokenAddress,
        uint8[] outcomes,
        uint8[] randomActions,
        uint256[] payouts,
        uint32 numGames,
        uint256 l2eAmount
    );

    event RPSRefund(address indexed player, uint256 wager, address tokenAddress);

    /**
     * @dev function to get current request player is await from VRF, returns 0 if none
     * @param player address of the player to get the state
     */
    function getCurrentUserState(address player) external view returns (RPSGame memory) {
        return (rpsGames[player]);
    }

    function play(
        uint256 wager,
        address tokenAddress,
        uint8 action,
        uint32 numBets,
        uint256 stopGain,
        uint256 stopLoss
    ) external payable nonReentrant {
        address msgSender = _msgSender();
        require(action < 3, "Invalid action");
        require(rpsGames[msgSender].vrfId == 0, "Waiting VRF request");
        require(0 < numBets && numBets <= 100, "Invalid numBets");

        _checkMaxWager(wager, tokenAddress);
        _processWager(tokenAddress, wager * numBets, 1100000, msgSender);
        uint256 id = _requestRandomWords(numBets);

        rpsGames[msgSender] = RPSGame(
            wager,
            stopGain,
            stopLoss,
            id,
            tokenAddress,
            uint64(block.number),
            numBets,
            action
        );
        vrfPendingPlayer[id] = msgSender;

        callback.onPlay(6, msgSender, tokenAddress, wager, numBets);
    }

    function refund() external nonReentrant {
        address msgSender = _msgSender();
        RPSGame storage game = rpsGames[msgSender];
        require(rpsGames[msgSender].vrfId != 0, "Not waiting VRF request");
        require(game.blockNumber + BLOCK_REFUND_COOLDOWN + 10 <= block.number, "Too early");

        uint256 wager = game.wager * game.numBets;
        address tokenAddress = game.tokenAddress;

        delete (vrfPendingPlayer[game.vrfId]);
        delete (rpsGames[msgSender]);

        if (tokenAddress == address(0)) {
            (bool success, ) = payable(msgSender).call{value: wager}("");
            require(success, "Transfer failed");
        } else {
            IERC20(tokenAddress).safeTransfer(msgSender, wager);
        }
        emit RPSRefund(msgSender, wager, tokenAddress);
    }

    function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override {
        address playerAddress = vrfPendingPlayer[requestId];
        if (playerAddress == address(0)) return;
        RPSGame storage game = rpsGames[playerAddress];
        if (block.number > game.blockNumber + BLOCK_REFUND_COOLDOWN) revert();

        uint8[] memory randomActions = new uint8[](game.numBets);
        uint8[] memory outcomes = new uint8[](game.numBets);
        uint256[] memory payouts = new uint256[](game.numBets);
        int256 totalValue;
        uint256 payout;
        uint32 gamePlayed;

        address tokenAddress = game.tokenAddress;

        for (gamePlayed = 0; gamePlayed < game.numBets; gamePlayed++) {
            if (totalValue >= int256(game.stopGain)) {
                break;
            }
            if (totalValue <= -int256(game.stopLoss)) {
                break;
            }

            randomActions[gamePlayed] = uint8(randomWords[gamePlayed] % 3);
            outcomes[gamePlayed] = _calculateResult(game.action, randomActions[gamePlayed]);

            if (outcomes[gamePlayed] == 2) {
                payout += (game.wager * 99) / 100;
                totalValue -= int256((game.wager) / 100);
                payouts[gamePlayed] = (game.wager * 99) / 100;
                continue;
            }

            if (outcomes[gamePlayed] == 1) {
                payout += (game.wager * 198) / 100;
                totalValue += int256((game.wager * 98) / 100);
                payouts[gamePlayed] = (game.wager * 198) / 100;
                continue;
            }

            totalValue -= int256(game.wager);
        }

        payout += (game.numBets - gamePlayed) * game.wager;

        _transferToBankroll(tokenAddress, game.wager * game.numBets);
        if (payout != 0) {
            _payoutBankrollToPlayer(playerAddress, payout, tokenAddress);
        }

        uint256 l2eAmount = bankroll.payoutL2E(playerAddress, tokenAddress, game.wager * gamePlayed, payout);

        emit RPSFulfilled(
            playerAddress,
            game.wager,
            payout,
            game.tokenAddress,
            outcomes,
            randomActions,
            payouts,
            gamePlayed,
            l2eAmount
        );

        callback.onEnd(6, playerAddress, tokenAddress, game.wager, gamePlayed, payout);

        delete (vrfPendingPlayer[requestId]);
        delete (rpsGames[playerAddress]);
    }

    function _calculateResult(uint8 playerPick, uint8 rngPick) internal pure returns (uint8 result) {
        if (playerPick == rngPick) {
            return 2; // Draw
        }

        if ((playerPick + 1) % 3 == rngPick) {
            return 0; // Loss
        } else {
            return 1; // Win
        }
    }

    function _checkMaxWager(uint256 wager, address tokenAddress) internal view {
        uint256 balance;
        if (tokenAddress == address(0)) {
            balance = address(bankroll).balance;
        } else {
            balance = IERC20(tokenAddress).balanceOf(address(bankroll));
        }
        uint256 maxWager = (balance * 1683629) / 100000000;
        require(wager <= maxWager, "Too many wager");
    }
}

File 2 of 11 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

File 3 of 11 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 4 of 11 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

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

    /**
     * @dev An operation with an ERC20 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.
     */
    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.
     */
    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.
     */
    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 Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            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 silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

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

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

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

pragma solidity ^0.8.20;

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

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

    uint256 private _status;

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

    constructor() {
        _status = NOT_ENTERED;
    }

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

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

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

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

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

File 7 of 11 : ZapankiGamesKroma.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "../../../interfaces/ISupraRouter.sol";
import "../../../interfaces/IBankroll.sol";
import "../../../interfaces/ICallback.sol";
import "../../../interfaces/IKromaGasPriceOracle.sol";

abstract contract ZapankiGamesKroma is ReentrancyGuard {
    using SafeERC20 for IERC20;

    IKromaGasPriceOracle private constant KROMA_GAS_ORACLE =
        IKromaGasPriceOracle(0x420000000000000000000000000000000000000F);
    uint256 public constant ECOTONE_GAS_CALC_CONSTANT = 16;

    ISupraRouter public vrfCoordinator;
    address public vrfDepositor;
    IBankroll public bankroll;
    ICallback public callback;
    address public trustedForwarder;

    bytes32 vrfKeyHash;
    uint256 public claimableVRFFee;
    uint64 constant BLOCK_REFUND_COOLDOWN = 1000;
    uint64 vrfSubId;
    uint32 vrfCallbackGasLimit;

    modifier onlyOwner() {
        require(msg.sender == bankroll.owner(), "Not Owner");
        _;
    }

    constructor(address _vrfCoordinator, IBankroll _bankroll, address _trustedForwarder, address _vrfDepositor) {
        vrfCoordinator = ISupraRouter(_vrfCoordinator);
        bankroll = _bankroll;
        callback = ICallback(address(_bankroll));
        trustedForwarder = _trustedForwarder;
        vrfDepositor = _vrfDepositor;
    }

    function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
        return forwarder == trustedForwarder;
    }

    function _msgSender() internal view returns (address sender) {
        if (isTrustedForwarder(msg.sender)) {
            // The assembly code is more direct than the Solidity version using `abi.decode`.
            /// @solidity memory-safe-assembly
            assembly {
                sender := shr(96, calldataload(sub(calldatasize(), 20)))
            }
        } else {
            return msg.sender;
        }
    }

    function _shouldStop(int256 value, uint256 stopGain, uint256 stopLoss) internal pure returns (bool) {
        return value >= int256(stopGain) || value <= -int256(stopLoss);
    }

    function _processWager(address tokenAddress, uint256 wager, uint256 gasAmount, address msgSender) internal {
        require(bankroll.getIsValidWager(address(this), tokenAddress), "Token not approved");
        require(wager != 0, "Wager must be greater than 0");
        if (tokenAddress == address(0)) {
            _chargeVRFFee(msg.value - wager, gasAmount);
        } else {
            _chargeVRFFee(msg.value, gasAmount);
            IERC20(tokenAddress).safeTransferFrom(msgSender, address(this), wager);
        }
    }

    function _transferToBankroll(address tokenAddress, uint256 amount) internal {
        if (tokenAddress == address(0)) {
            (bool success, ) = payable(address(bankroll)).call{value: amount}("");
            require(success, "refund failed");
        } else {
            IERC20(tokenAddress).safeTransfer(address(bankroll), amount);
        }
    }

    function getVRFFee(uint256 gasAmount) public view returns (uint256 fee) {
        uint256 scaledBaseFee = KROMA_GAS_ORACLE.baseFeeScalar() *
            ECOTONE_GAS_CALC_CONSTANT *
            KROMA_GAS_ORACLE.l1BaseFee();
        uint256 scaledBlobBaseFee = KROMA_GAS_ORACLE.blobBaseFeeScalar() * KROMA_GAS_ORACLE.blobBaseFee();
        uint256 _l1GasFee = (6700 * (scaledBaseFee + scaledBlobBaseFee)) /
            (ECOTONE_GAS_CALC_CONSTANT * 10 ** KROMA_GAS_ORACLE.decimals());
        fee = (1000252 * gasAmount) + _l1GasFee;
    }

    function _refundVRFFee(uint256 refundableAmount) internal {
        if (refundableAmount > 0) {
            (bool success, ) = payable(msg.sender).call{value: refundableAmount}("");
            require(success, "refund failed");
        }
    }

    function _chargeVRFFee(uint256 vrfFeeProvided, uint256 gasAmount) internal {
        uint256 _vrfFee = getVRFFee(gasAmount);
        require(vrfFeeProvided >= _vrfFee, "Insufficient vrf fee");
        _refundVRFFee(vrfFeeProvided - _vrfFee);
        claimableVRFFee += _vrfFee;
    }

    function collectVrfFee() external nonReentrant onlyOwner {
        uint256 fee = claimableVRFFee;
        claimableVRFFee = 0;
        (bool success, ) = payable(address(msg.sender)).call{value: fee}("");
        require(success, "transfer failed");
    }

    function _payoutBankrollToPlayer(address player, uint256 payout, address tokenAddress) internal {
        bankroll.transferPayout(player, payout, tokenAddress);
    }

    function _requestRandomWords(uint32 numWords) internal returns (uint256 s_requestId) {
        s_requestId = vrfCoordinator.generateRequest(
            "rawFulfillRandomWords(uint256,uint256[])",
            uint8(numWords),
            1,
            vrfDepositor
        );
    }

    function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;

    function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
        require(msg.sender == address(vrfCoordinator));
        fulfillRandomWords(requestId, randomWords);
    }
}

File 8 of 11 : IBankroll.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IBankroll {
    function getIsGame(address game) external view returns (bool);

    function getIsValidWager(address game, address tokenAddress) external view returns (bool);

    function transferPayout(address player, uint256 payout, address token) external;

    function owner() external view returns (address);

    function payoutL2E(
        address player,
        address wagerToken,
        uint256 wager,
        uint256 payout
    ) external returns (uint256 l2eAmount);
}

File 9 of 11 : ICallback.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ICallback {
    function onPlay(uint32 game, address playerAddress, address tokenAddress, uint256 wager, uint256 numGames) external;

    function onEnd(
        uint32 game,
        address playerAddress,
        address tokenAddress,
        uint256 wager,
        uint256 numGames,
        uint totalPayout
    ) external;
}

File 10 of 11 : IKromaGasPriceOracle.sol
interface IKromaGasPriceOracle {
    //returns the gas price for the network
    function l1BaseFee() external view returns (uint256);

    //returns which fork (Ecotone or Bedrock)  is used by OP Stack L2 for the network
    function isEcotone() external view returns (bool);

    //returns the overhead for the network
    function overhead() external view returns (uint256);

    //returns the scalar value for the network
    function scalar() external view returns (uint256);

    //returns the decimal value for the network
    function decimals() external view returns (uint256);

    //returns the decimal value for the network
    function DECIMALS() external view returns (uint256);

    /// @notice Retrieves the current blob base fee.
    /// @return Current blob base fee.
    function blobBaseFee() external view returns (uint256);

    /// @notice Retrieves the current base fee scalar.
    /// @return Current base fee scalar.
    function baseFeeScalar() external view returns (uint32);

    /// @notice Retrieves the current blob base fee scalar.
    /// @return Current blob base fee scalar.
    function blobBaseFeeScalar() external view returns (uint32);
}

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

interface ISupraRouter {
    function generateRequest(
        string memory _functionSig,
        uint8 _rngCount,
        uint256 _numConfirmations,
        address _clientWalletAddress
    ) external returns (uint256);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"contract IBankroll","name":"_bankroll","type":"address"},{"internalType":"address","name":"_trustedForwarder","type":"address"},{"internalType":"address","name":"_vrfDepositor","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"playerAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"wager","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint8[]","name":"outcomes","type":"uint8[]"},{"indexed":false,"internalType":"uint8[]","name":"randomActions","type":"uint8[]"},{"indexed":false,"internalType":"uint256[]","name":"payouts","type":"uint256[]"},{"indexed":false,"internalType":"uint32","name":"numGames","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"l2eAmount","type":"uint256"}],"name":"RPSFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"wager","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"}],"name":"RPSRefund","type":"event"},{"inputs":[],"name":"ECOTONE_GAS_CALC_CONSTANT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bankroll","outputs":[{"internalType":"contract IBankroll","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"callback","outputs":[{"internalType":"contract ICallback","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimableVRFFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collectVrfFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"player","type":"address"}],"name":"getCurrentUserState","outputs":[{"components":[{"internalType":"uint256","name":"wager","type":"uint256"},{"internalType":"uint256","name":"stopGain","type":"uint256"},{"internalType":"uint256","name":"stopLoss","type":"uint256"},{"internalType":"uint256","name":"vrfId","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint64","name":"blockNumber","type":"uint64"},{"internalType":"uint32","name":"numBets","type":"uint32"},{"internalType":"uint8","name":"action","type":"uint8"}],"internalType":"struct ZapankiRPSKroma.RPSGame","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"gasAmount","type":"uint256"}],"name":"getVRFFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"wager","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"action","type":"uint8"},{"internalType":"uint32","name":"numBets","type":"uint32"},{"internalType":"uint256","name":"stopGain","type":"uint256"},{"internalType":"uint256","name":"stopLoss","type":"uint256"}],"name":"play","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"requestId","type":"uint256"},{"internalType":"uint256[]","name":"randomWords","type":"uint256[]"}],"name":"rawFulfillRandomWords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"trustedForwarder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfCoordinator","outputs":[{"internalType":"contract ISupraRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vrfDepositor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b50604051620023e4380380620023e48339810160408190526200003491620000af565b6001600081905580546001600160a01b039586166001600160a01b031991821617909155600380549486169482168517905560048054821690941790935560058054928516928416929092179091556002805491909316911617905562000117565b6001600160a01b0381168114620000ac57600080fd5b50565b60008060008060808587031215620000c657600080fd5b8451620000d38162000096565b6020860151909450620000e68162000096565b6040860151909350620000f98162000096565b60608601519092506200010c8162000096565b939692955090935050565b6122bd80620001276000396000f3fe6080604052600436106100dd5760003560e01c806374b0a7891161007f57806380cfa5271161005957806380cfa527146103845780638bd161141461039a578063a3e56fa8146103ba578063a50ce2f7146103da57600080fd5b806374b0a789146101eb57806376fca03d146102005780637da0a8771461036457600080fd5b806333716194116100bb5780633371619414610161578063572b6c0514610184578063590e1ae3146101c3578063698cdd98146101d857600080fd5b8063083b2732146100e25780630c657eb01461011f5780631fe543e31461013f575b600080fd5b3480156100ee57600080fd5b50600454610102906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561012b57600080fd5b50600354610102906001600160a01b031681565b34801561014b57600080fd5b5061015f61015a366004611cd0565b6103fa565b005b34801561016d57600080fd5b50610176601081565b604051908152602001610116565b34801561019057600080fd5b506101b361019f366004611dae565b6005546001600160a01b0391821691161490565b6040519015158152602001610116565b3480156101cf57600080fd5b5061015f61041f565b61015f6101e6366004611ddd565b6106ab565b3480156101f757600080fd5b5061015f610a31565b34801561020c57600080fd5b506102ed61021b366004611dae565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810191909152506001600160a01b03908116600090815260096020908152604091829020825161010081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201549283166080820152600160a01b83046001600160401b031660a0820152600160e01b90920463ffffffff1660c08301526005015460ff1660e082015290565b6040516101169190815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a0808301516001600160401b03169082015260c08083015163ffffffff169082015260e09182015160ff16918101919091526101000190565b34801561037057600080fd5b50600554610102906001600160a01b031681565b34801561039057600080fd5b5061017660075481565b3480156103a657600080fd5b506101766103b5366004611e48565b610b9c565b3480156103c657600080fd5b50600154610102906001600160a01b031681565b3480156103e657600080fd5b50600254610102906001600160a01b031681565b6001546001600160a01b0316331461041157600080fd5b61041b8282610e39565b5050565b61042761148f565b60006104316114b9565b6001600160a01b038116600090815260096020526040812060038101549293509190036104a55760405162461bcd60e51b815260206004820152601760248201527f4e6f742077616974696e6720565246207265717565737400000000000000000060448201526064015b60405180910390fd5b600481015443906104c9906103e890600160a01b90046001600160401b0316611e77565b6104d490600a611e77565b6001600160401b031611156105175760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b604482015260640161049c565b6004810154815460009161053991600160e01b90910463ffffffff1690611e9e565b6004808401546003808601546000908152600a6020908152604080832080546001600160a01b03191690556001600160a01b038a8116845260099092528220828155600181018390556002810183905592830182905593820155600501805460ff191690559192501680610642576000846001600160a01b03168360405160006040518083038185875af1925050503d80600081146105f4576040519150601f19603f3d011682016040523d82523d6000602084013e6105f9565b606091505b505090508061063c5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161049c565b50610656565b6106566001600160a01b03821685846114e0565b604080518381526001600160a01b0383811660208301528616917f3bfb737c677f23e1e4af33b4076caf38d1f0edcad523aee85dfa062111aac1d1910160405180910390a2505050506106a96001600055565b565b6106b361148f565b60006106bd6114b9565b905060038560ff16106107035760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21030b1ba34b7b760911b604482015260640161049c565b6001600160a01b038116600090815260096020526040902060030154156107625760405162461bcd60e51b815260206004820152601360248201527215d85a5d1a5b99c8159491881c995c5d595cdd606a1b604482015260640161049c565b8363ffffffff16600010801561077f575060648463ffffffff1611155b6107bd5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206e756d4265747360881b604482015260640161049c565b6107c78787611544565b6107e5866107db63ffffffff87168a611e9e565b6210c8e08461163f565b60006107f085611789565b9050604051806101000160405280898152602001858152602001848152602001828152602001886001600160a01b03168152602001436001600160401b031681526020018663ffffffff1681526020018760ff1681525060096000846001600160a01b03166001600160a01b031681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060a08201518160040160146101000a8154816001600160401b0302191690836001600160401b0316021790555060c082015181600401601c6101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160050160006101000a81548160ff021916908360ff16021790555090505081600a600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600460009054906101000a90046001600160a01b03166001600160a01b03166327ffe8436006848a8c8a6040518663ffffffff1660e01b81526004016109eb95949392919063ffffffff95861681526001600160a01b03948516602082015292909316604083015260608201529116608082015260a00190565b600060405180830381600087803b158015610a0557600080fd5b505af1158015610a19573d6000803e3d6000fd5b505050505050610a296001600055565b505050505050565b610a3961148f565b600360009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab09190611eb5565b6001600160a01b0316336001600160a01b031614610afc5760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b604482015260640161049c565b60078054600091829055604051909190339083908381818185875af1925050503d8060008114610b48576040519150601f19603f3d011682016040523d82523d6000602084013e610b4d565b606091505b5050905080610b905760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015260640161049c565b50506106a96001600055565b600080600f602160991b016001600160a01b031663519b4bd36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610be4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c089190611ed2565b6010600f602160991b016001600160a01b031663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c739190611eeb565b63ffffffff16610c839190611e9e565b610c8d9190611e9e565b90506000600f602160991b016001600160a01b031663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfa9190611ed2565b600f602160991b016001600160a01b03166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d639190611eeb565b63ffffffff16610d739190611e9e565b90506000600f602160991b016001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de09190611ed2565b610deb90600a611fec565b610df6906010611e9e565b610e008385611ff8565b610e0c90611a2c611e9e565b610e169190612021565b905080610e2686620f433c611e9e565b610e309190611ff8565b95945050505050565b6000828152600a60205260409020546001600160a01b031680610e5b57505050565b6001600160a01b03811660009081526009602052604090206004810154610e95906103e890600160a01b90046001600160401b0316611e77565b6001600160401b0316431115610eaa57600080fd5b6004810154600090600160e01b900463ffffffff166001600160401b03811115610ed657610ed6611cba565b604051908082528060200260200182016040528015610eff578160200160208202803683370190505b506004830154909150600090600160e01b900463ffffffff166001600160401b03811115610f2f57610f2f611cba565b604051908082528060200260200182016040528015610f58578160200160208202803683370190505b506004840154909150600090600160e01b900463ffffffff166001600160401b03811115610f8857610f88611cba565b604051908082528060200260200182016040528015610fb1578160200160208202803683370190505b506004850154909150600090819081906001600160a01b03165b600488015463ffffffff600160e01b9091048116908316101561121657876001015484121561121657876002015461100290612035565b8413156112165760038a8363ffffffff168151811061102357611023612051565b60200260200101516110359190612067565b878363ffffffff168151811061104d5761104d612051565b60ff928316602091820292909201015260058901548851611092929190911690899063ffffffff861690811061108557611085612051565b602002602001015161185b565b868363ffffffff16815181106110aa576110aa612051565b602002602001019060ff16908160ff1681525050858263ffffffff16815181106110d6576110d6612051565b602002602001015160ff1660020361116d5787546064906110f8906063611e9e565b6111029190612021565b61110c9084611ff8565b885490935061111d90606490612021565b611127908561207b565b885490945060649061113a906063611e9e565b6111449190612021565b858363ffffffff168151811061115c5761115c612051565b602002602001018181525050611204565b858263ffffffff168151811061118557611185612051565b602002602001015160ff166001036111f55787546064906111a79060c6611e9e565b6111b19190612021565b6111bb9084611ff8565b88549093506064906111ce906062611e9e565b6111d89190612021565b6111e2908561209b565b885490945060649061113a9060c6611e9e565b8754611201908561207b565b93505b8161120e816120c3565b925050610fcb565b87546004890154611235908490600160e01b900463ffffffff166120e6565b63ffffffff166112459190611e9e565b61124f9084611ff8565b6004890154895491945061127c91839161127791600160e01b90910463ffffffff1690611e9e565b6118a6565b821561128d5761128d898483611961565b60035488546000916001600160a01b03169063ff6d9eff908c9085906112ba9063ffffffff891690611e9e565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606481018790526084016020604051808303816000875af1158015611315573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113399190611ed2565b895460048b01546040519293506001600160a01b03808e16937fadf4fec9f1d306abd4f88e655b5326fbec1f24ad5679d3fa7ffb7d1cddda674d9361138e9390928a929116908d908f908e908c908b90612141565b60405180910390a2600480548a5460405163e2382aa160e01b81526006938101939093526001600160a01b038d811660248501528581166044850152606484019190915263ffffffff8616608484015260a48301879052169063e2382aa19060c401600060405180830381600087803b15801561140a57600080fd5b505af115801561141e573d6000803e3d6000fd5b50505060009c8d525050600a60209081526040808d2080546001600160a01b03191690556001600160a01b039a909a168c526009905250505094872087815560018101889055600281018890556003810188905560048101979097555050506005909301805460ff19169055505050565b6002600054036114b257604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6005546000906001600160a01b031633036114db575060131936013560601c90565b503390565b6040516001600160a01b0383811660248301526044820183905261153f91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506119d4565b505050565b60006001600160a01b03821661156757506003546001600160a01b0316316115d8565b6003546040516370a0823160e01b81526001600160a01b039182166004820152908316906370a0823190602401602060405180830381865afa1580156115b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d59190611ed2565b90505b60006305f5e1006115ec836219b0ad611e9e565b6115f69190612021565b9050808411156116395760405162461bcd60e51b815260206004820152600e60248201526d2a37b79036b0b73c903bb0b3b2b960911b604482015260640161049c565b50505050565b600354604051632ff5fe7360e21b81523060048201526001600160a01b0386811660248301529091169063bfd7f9cc90604401602060405180830381865afa15801561168f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b391906121e8565b6116f45760405162461bcd60e51b8152602060048201526012602482015271151bdad95b881b9bdd08185c1c1c9bdd995960721b604482015260640161049c565b826000036117445760405162461bcd60e51b815260206004820152601c60248201527f5761676572206d7573742062652067726561746572207468616e203000000000604482015260640161049c565b6001600160a01b03841661176a5761176561175f843461220a565b83611a37565b611639565b6117743483611a37565b6116396001600160a01b038516823086611ab9565b6001805460025460405163d291ba0960e01b815260806004820152602860848201527f72617746756c66696c6c52616e646f6d576f7264732875696e743235362c756960a4820152676e743235365b5d2960c01b60c482015260ff8516602482015260448101939093526001600160a01b03908116606484015260009291169063d291ba099060e4016020604051808303816000875af1158015611831573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118559190611ed2565b92915050565b60008160ff168360ff160361187257506002611855565b60ff8216600361188385600161221d565b61188d9190612236565b60ff160361189d57506000611855565b50600192915050565b6001600160a01b038216611947576003546040516000916001600160a01b03169083908381818185875af1925050503d8060008114611901576040519150601f19603f3d011682016040523d82523d6000602084013e611906565b606091505b505090508061153f5760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b604482015260640161049c565b60035461041b906001600160a01b038481169116836114e0565b6003546040516336012f6160e11b81526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b1580156119b757600080fd5b505af11580156119cb573d6000803e3d6000fd5b50505050505050565b60006119e96001600160a01b03841683611af2565b90508051600014158015611a0e575080806020019051810190611a0c91906121e8565b155b1561153f57604051635274afe760e01b81526001600160a01b038416600482015260240161049c565b6000611a4282610b9c565b905080831015611a8b5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207672662066656560601b604482015260640161049c565b611a9d611a98828561220a565b611b07565b8060076000828254611aaf9190611ff8565b9091555050505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526116399186918216906323b872dd9060840161150d565b6060611b0083836000611b98565b9392505050565b8015611b9557604051600090339083908381818185875af1925050503d8060008114611b4f576040519150601f19603f3d011682016040523d82523d6000602084013e611b54565b606091505b505090508061041b5760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b604482015260640161049c565b50565b606081471015611bbd5760405163cd78605960e01b815230600482015260240161049c565b600080856001600160a01b03168486604051611bd99190612258565b60006040518083038185875af1925050503d8060008114611c16576040519150601f19603f3d011682016040523d82523d6000602084013e611c1b565b606091505b5091509150611c2b868383611c35565b9695505050505050565b606082611c4a57611c4582611c91565b611b00565b8151158015611c6157506001600160a01b0384163b155b15611c8a57604051639996b31560e01b81526001600160a01b038516600482015260240161049c565b5080611b00565b805115611ca15780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215611ce357600080fd5b823591506020808401356001600160401b0380821115611d0257600080fd5b818601915086601f830112611d1657600080fd5b813581811115611d2857611d28611cba565b8060051b604051601f19603f83011681018181108582111715611d4d57611d4d611cba565b604052918252848201925083810185019189831115611d6b57600080fd5b938501935b82851015611d8957843584529385019392850192611d70565b8096505050505050509250929050565b6001600160a01b0381168114611b9557600080fd5b600060208284031215611dc057600080fd5b8135611b0081611d99565b63ffffffff81168114611b9557600080fd5b60008060008060008060c08789031215611df657600080fd5b863595506020870135611e0881611d99565b9450604087013560ff81168114611e1e57600080fd5b93506060870135611e2e81611dcb565b9598949750929560808101359460a0909101359350915050565b600060208284031215611e5a57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115611e9757611e97611e61565b5092915050565b808202811582820484141761185557611855611e61565b600060208284031215611ec757600080fd5b8151611b0081611d99565b600060208284031215611ee457600080fd5b5051919050565b600060208284031215611efd57600080fd5b8151611b0081611dcb565b600181815b80851115611f43578160001904821115611f2957611f29611e61565b80851615611f3657918102915b93841c9390800290611f0d565b509250929050565b600082611f5a57506001611855565b81611f6757506000611855565b8160018114611f7d5760028114611f8757611fa3565b6001915050611855565b60ff841115611f9857611f98611e61565b50506001821b611855565b5060208310610133831016604e8410600b8410161715611fc6575081810a611855565b611fd08383611f08565b8060001904821115611fe457611fe4611e61565b029392505050565b6000611b008383611f4b565b8082018082111561185557611855611e61565b634e487b7160e01b600052601260045260246000fd5b6000826120305761203061200b565b500490565b6000600160ff1b820161204a5761204a611e61565b5060000390565b634e487b7160e01b600052603260045260246000fd5b6000826120765761207661200b565b500690565b8181036000831280158383131683831282161715611e9757611e97611e61565b80820182811260008312801582168215821617156120bb576120bb611e61565b505092915050565b600063ffffffff8083168181036120dc576120dc611e61565b6001019392505050565b63ffffffff828116828216039080821115611e9757611e97611e61565b600081518084526020808501945080840160005b8381101561213657815160ff1687529582019590820190600101612117565b509495945050505050565b88815260208082018990526001600160a01b0388166040830152610100606083018190526000916121748483018a612103565b915083820360808501526121888289612103565b84810360a0860152875180825282890193509082019060005b818110156121bd578451835293830193918301916001016121a1565b505063ffffffff871660c086015292506121d5915050565b8260e08301529998505050505050505050565b6000602082840312156121fa57600080fd5b81518015158114611b0057600080fd5b8181038181111561185557611855611e61565b60ff818116838216019081111561185557611855611e61565b600060ff8316806122495761224961200b565b8060ff84160691505092915050565b6000825160005b81811015612279576020818601810151858301520161225f565b50600092019182525091905056fea26469706673582212203ae5a45ae0fd5a82c17441abc68d8a9ccaf36076d6278a1bac29cdb1ef2478f264736f6c63430008140033000000000000000000000000589b45f2c65796fc60b1b61802b10d7c7de86cc70000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c2120000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c21200000000000000000000000027280e40b343995210ce79ca04000e753fa6d031

Deployed Bytecode

0x6080604052600436106100dd5760003560e01c806374b0a7891161007f57806380cfa5271161005957806380cfa527146103845780638bd161141461039a578063a3e56fa8146103ba578063a50ce2f7146103da57600080fd5b806374b0a789146101eb57806376fca03d146102005780637da0a8771461036457600080fd5b806333716194116100bb5780633371619414610161578063572b6c0514610184578063590e1ae3146101c3578063698cdd98146101d857600080fd5b8063083b2732146100e25780630c657eb01461011f5780631fe543e31461013f575b600080fd5b3480156100ee57600080fd5b50600454610102906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561012b57600080fd5b50600354610102906001600160a01b031681565b34801561014b57600080fd5b5061015f61015a366004611cd0565b6103fa565b005b34801561016d57600080fd5b50610176601081565b604051908152602001610116565b34801561019057600080fd5b506101b361019f366004611dae565b6005546001600160a01b0391821691161490565b6040519015158152602001610116565b3480156101cf57600080fd5b5061015f61041f565b61015f6101e6366004611ddd565b6106ab565b3480156101f757600080fd5b5061015f610a31565b34801561020c57600080fd5b506102ed61021b366004611dae565b6040805161010081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e0810191909152506001600160a01b03908116600090815260096020908152604091829020825161010081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201549283166080820152600160a01b83046001600160401b031660a0820152600160e01b90920463ffffffff1660c08301526005015460ff1660e082015290565b6040516101169190815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a0808301516001600160401b03169082015260c08083015163ffffffff169082015260e09182015160ff16918101919091526101000190565b34801561037057600080fd5b50600554610102906001600160a01b031681565b34801561039057600080fd5b5061017660075481565b3480156103a657600080fd5b506101766103b5366004611e48565b610b9c565b3480156103c657600080fd5b50600154610102906001600160a01b031681565b3480156103e657600080fd5b50600254610102906001600160a01b031681565b6001546001600160a01b0316331461041157600080fd5b61041b8282610e39565b5050565b61042761148f565b60006104316114b9565b6001600160a01b038116600090815260096020526040812060038101549293509190036104a55760405162461bcd60e51b815260206004820152601760248201527f4e6f742077616974696e6720565246207265717565737400000000000000000060448201526064015b60405180910390fd5b600481015443906104c9906103e890600160a01b90046001600160401b0316611e77565b6104d490600a611e77565b6001600160401b031611156105175760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b604482015260640161049c565b6004810154815460009161053991600160e01b90910463ffffffff1690611e9e565b6004808401546003808601546000908152600a6020908152604080832080546001600160a01b03191690556001600160a01b038a8116845260099092528220828155600181018390556002810183905592830182905593820155600501805460ff191690559192501680610642576000846001600160a01b03168360405160006040518083038185875af1925050503d80600081146105f4576040519150601f19603f3d011682016040523d82523d6000602084013e6105f9565b606091505b505090508061063c5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b604482015260640161049c565b50610656565b6106566001600160a01b03821685846114e0565b604080518381526001600160a01b0383811660208301528616917f3bfb737c677f23e1e4af33b4076caf38d1f0edcad523aee85dfa062111aac1d1910160405180910390a2505050506106a96001600055565b565b6106b361148f565b60006106bd6114b9565b905060038560ff16106107035760405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21030b1ba34b7b760911b604482015260640161049c565b6001600160a01b038116600090815260096020526040902060030154156107625760405162461bcd60e51b815260206004820152601360248201527215d85a5d1a5b99c8159491881c995c5d595cdd606a1b604482015260640161049c565b8363ffffffff16600010801561077f575060648463ffffffff1611155b6107bd5760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206e756d4265747360881b604482015260640161049c565b6107c78787611544565b6107e5866107db63ffffffff87168a611e9e565b6210c8e08461163f565b60006107f085611789565b9050604051806101000160405280898152602001858152602001848152602001828152602001886001600160a01b03168152602001436001600160401b031681526020018663ffffffff1681526020018760ff1681525060096000846001600160a01b03166001600160a01b031681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060a08201518160040160146101000a8154816001600160401b0302191690836001600160401b0316021790555060c082015181600401601c6101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160050160006101000a81548160ff021916908360ff16021790555090505081600a600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600460009054906101000a90046001600160a01b03166001600160a01b03166327ffe8436006848a8c8a6040518663ffffffff1660e01b81526004016109eb95949392919063ffffffff95861681526001600160a01b03948516602082015292909316604083015260608201529116608082015260a00190565b600060405180830381600087803b158015610a0557600080fd5b505af1158015610a19573d6000803e3d6000fd5b505050505050610a296001600055565b505050505050565b610a3961148f565b600360009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab09190611eb5565b6001600160a01b0316336001600160a01b031614610afc5760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b604482015260640161049c565b60078054600091829055604051909190339083908381818185875af1925050503d8060008114610b48576040519150601f19603f3d011682016040523d82523d6000602084013e610b4d565b606091505b5050905080610b905760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015260640161049c565b50506106a96001600055565b600080600f602160991b016001600160a01b031663519b4bd36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610be4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c089190611ed2565b6010600f602160991b016001600160a01b031663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c739190611eeb565b63ffffffff16610c839190611e9e565b610c8d9190611e9e565b90506000600f602160991b016001600160a01b031663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfa9190611ed2565b600f602160991b016001600160a01b03166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d639190611eeb565b63ffffffff16610d739190611e9e565b90506000600f602160991b016001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de09190611ed2565b610deb90600a611fec565b610df6906010611e9e565b610e008385611ff8565b610e0c90611a2c611e9e565b610e169190612021565b905080610e2686620f433c611e9e565b610e309190611ff8565b95945050505050565b6000828152600a60205260409020546001600160a01b031680610e5b57505050565b6001600160a01b03811660009081526009602052604090206004810154610e95906103e890600160a01b90046001600160401b0316611e77565b6001600160401b0316431115610eaa57600080fd5b6004810154600090600160e01b900463ffffffff166001600160401b03811115610ed657610ed6611cba565b604051908082528060200260200182016040528015610eff578160200160208202803683370190505b506004830154909150600090600160e01b900463ffffffff166001600160401b03811115610f2f57610f2f611cba565b604051908082528060200260200182016040528015610f58578160200160208202803683370190505b506004840154909150600090600160e01b900463ffffffff166001600160401b03811115610f8857610f88611cba565b604051908082528060200260200182016040528015610fb1578160200160208202803683370190505b506004850154909150600090819081906001600160a01b03165b600488015463ffffffff600160e01b9091048116908316101561121657876001015484121561121657876002015461100290612035565b8413156112165760038a8363ffffffff168151811061102357611023612051565b60200260200101516110359190612067565b878363ffffffff168151811061104d5761104d612051565b60ff928316602091820292909201015260058901548851611092929190911690899063ffffffff861690811061108557611085612051565b602002602001015161185b565b868363ffffffff16815181106110aa576110aa612051565b602002602001019060ff16908160ff1681525050858263ffffffff16815181106110d6576110d6612051565b602002602001015160ff1660020361116d5787546064906110f8906063611e9e565b6111029190612021565b61110c9084611ff8565b885490935061111d90606490612021565b611127908561207b565b885490945060649061113a906063611e9e565b6111449190612021565b858363ffffffff168151811061115c5761115c612051565b602002602001018181525050611204565b858263ffffffff168151811061118557611185612051565b602002602001015160ff166001036111f55787546064906111a79060c6611e9e565b6111b19190612021565b6111bb9084611ff8565b88549093506064906111ce906062611e9e565b6111d89190612021565b6111e2908561209b565b885490945060649061113a9060c6611e9e565b8754611201908561207b565b93505b8161120e816120c3565b925050610fcb565b87546004890154611235908490600160e01b900463ffffffff166120e6565b63ffffffff166112459190611e9e565b61124f9084611ff8565b6004890154895491945061127c91839161127791600160e01b90910463ffffffff1690611e9e565b6118a6565b821561128d5761128d898483611961565b60035488546000916001600160a01b03169063ff6d9eff908c9085906112ba9063ffffffff891690611e9e565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606481018790526084016020604051808303816000875af1158015611315573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113399190611ed2565b895460048b01546040519293506001600160a01b03808e16937fadf4fec9f1d306abd4f88e655b5326fbec1f24ad5679d3fa7ffb7d1cddda674d9361138e9390928a929116908d908f908e908c908b90612141565b60405180910390a2600480548a5460405163e2382aa160e01b81526006938101939093526001600160a01b038d811660248501528581166044850152606484019190915263ffffffff8616608484015260a48301879052169063e2382aa19060c401600060405180830381600087803b15801561140a57600080fd5b505af115801561141e573d6000803e3d6000fd5b50505060009c8d525050600a60209081526040808d2080546001600160a01b03191690556001600160a01b039a909a168c526009905250505094872087815560018101889055600281018890556003810188905560048101979097555050506005909301805460ff19169055505050565b6002600054036114b257604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6005546000906001600160a01b031633036114db575060131936013560601c90565b503390565b6040516001600160a01b0383811660248301526044820183905261153f91859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506119d4565b505050565b60006001600160a01b03821661156757506003546001600160a01b0316316115d8565b6003546040516370a0823160e01b81526001600160a01b039182166004820152908316906370a0823190602401602060405180830381865afa1580156115b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d59190611ed2565b90505b60006305f5e1006115ec836219b0ad611e9e565b6115f69190612021565b9050808411156116395760405162461bcd60e51b815260206004820152600e60248201526d2a37b79036b0b73c903bb0b3b2b960911b604482015260640161049c565b50505050565b600354604051632ff5fe7360e21b81523060048201526001600160a01b0386811660248301529091169063bfd7f9cc90604401602060405180830381865afa15801561168f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b391906121e8565b6116f45760405162461bcd60e51b8152602060048201526012602482015271151bdad95b881b9bdd08185c1c1c9bdd995960721b604482015260640161049c565b826000036117445760405162461bcd60e51b815260206004820152601c60248201527f5761676572206d7573742062652067726561746572207468616e203000000000604482015260640161049c565b6001600160a01b03841661176a5761176561175f843461220a565b83611a37565b611639565b6117743483611a37565b6116396001600160a01b038516823086611ab9565b6001805460025460405163d291ba0960e01b815260806004820152602860848201527f72617746756c66696c6c52616e646f6d576f7264732875696e743235362c756960a4820152676e743235365b5d2960c01b60c482015260ff8516602482015260448101939093526001600160a01b03908116606484015260009291169063d291ba099060e4016020604051808303816000875af1158015611831573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118559190611ed2565b92915050565b60008160ff168360ff160361187257506002611855565b60ff8216600361188385600161221d565b61188d9190612236565b60ff160361189d57506000611855565b50600192915050565b6001600160a01b038216611947576003546040516000916001600160a01b03169083908381818185875af1925050503d8060008114611901576040519150601f19603f3d011682016040523d82523d6000602084013e611906565b606091505b505090508061153f5760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b604482015260640161049c565b60035461041b906001600160a01b038481169116836114e0565b6003546040516336012f6160e11b81526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b1580156119b757600080fd5b505af11580156119cb573d6000803e3d6000fd5b50505050505050565b60006119e96001600160a01b03841683611af2565b90508051600014158015611a0e575080806020019051810190611a0c91906121e8565b155b1561153f57604051635274afe760e01b81526001600160a01b038416600482015260240161049c565b6000611a4282610b9c565b905080831015611a8b5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207672662066656560601b604482015260640161049c565b611a9d611a98828561220a565b611b07565b8060076000828254611aaf9190611ff8565b9091555050505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526116399186918216906323b872dd9060840161150d565b6060611b0083836000611b98565b9392505050565b8015611b9557604051600090339083908381818185875af1925050503d8060008114611b4f576040519150601f19603f3d011682016040523d82523d6000602084013e611b54565b606091505b505090508061041b5760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b604482015260640161049c565b50565b606081471015611bbd5760405163cd78605960e01b815230600482015260240161049c565b600080856001600160a01b03168486604051611bd99190612258565b60006040518083038185875af1925050503d8060008114611c16576040519150601f19603f3d011682016040523d82523d6000602084013e611c1b565b606091505b5091509150611c2b868383611c35565b9695505050505050565b606082611c4a57611c4582611c91565b611b00565b8151158015611c6157506001600160a01b0384163b155b15611c8a57604051639996b31560e01b81526001600160a01b038516600482015260240161049c565b5080611b00565b805115611ca15780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215611ce357600080fd5b823591506020808401356001600160401b0380821115611d0257600080fd5b818601915086601f830112611d1657600080fd5b813581811115611d2857611d28611cba565b8060051b604051601f19603f83011681018181108582111715611d4d57611d4d611cba565b604052918252848201925083810185019189831115611d6b57600080fd5b938501935b82851015611d8957843584529385019392850192611d70565b8096505050505050509250929050565b6001600160a01b0381168114611b9557600080fd5b600060208284031215611dc057600080fd5b8135611b0081611d99565b63ffffffff81168114611b9557600080fd5b60008060008060008060c08789031215611df657600080fd5b863595506020870135611e0881611d99565b9450604087013560ff81168114611e1e57600080fd5b93506060870135611e2e81611dcb565b9598949750929560808101359460a0909101359350915050565b600060208284031215611e5a57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115611e9757611e97611e61565b5092915050565b808202811582820484141761185557611855611e61565b600060208284031215611ec757600080fd5b8151611b0081611d99565b600060208284031215611ee457600080fd5b5051919050565b600060208284031215611efd57600080fd5b8151611b0081611dcb565b600181815b80851115611f43578160001904821115611f2957611f29611e61565b80851615611f3657918102915b93841c9390800290611f0d565b509250929050565b600082611f5a57506001611855565b81611f6757506000611855565b8160018114611f7d5760028114611f8757611fa3565b6001915050611855565b60ff841115611f9857611f98611e61565b50506001821b611855565b5060208310610133831016604e8410600b8410161715611fc6575081810a611855565b611fd08383611f08565b8060001904821115611fe457611fe4611e61565b029392505050565b6000611b008383611f4b565b8082018082111561185557611855611e61565b634e487b7160e01b600052601260045260246000fd5b6000826120305761203061200b565b500490565b6000600160ff1b820161204a5761204a611e61565b5060000390565b634e487b7160e01b600052603260045260246000fd5b6000826120765761207661200b565b500690565b8181036000831280158383131683831282161715611e9757611e97611e61565b80820182811260008312801582168215821617156120bb576120bb611e61565b505092915050565b600063ffffffff8083168181036120dc576120dc611e61565b6001019392505050565b63ffffffff828116828216039080821115611e9757611e97611e61565b600081518084526020808501945080840160005b8381101561213657815160ff1687529582019590820190600101612117565b509495945050505050565b88815260208082018990526001600160a01b0388166040830152610100606083018190526000916121748483018a612103565b915083820360808501526121888289612103565b84810360a0860152875180825282890193509082019060005b818110156121bd578451835293830193918301916001016121a1565b505063ffffffff871660c086015292506121d5915050565b8260e08301529998505050505050505050565b6000602082840312156121fa57600080fd5b81518015158114611b0057600080fd5b8181038181111561185557611855611e61565b60ff818116838216019081111561185557611855611e61565b600060ff8316806122495761224961200b565b8060ff84160691505092915050565b6000825160005b81811015612279576020818601810151858301520161225f565b50600092019182525091905056fea26469706673582212203ae5a45ae0fd5a82c17441abc68d8a9ccaf36076d6278a1bac29cdb1ef2478f264736f6c63430008140033

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

000000000000000000000000589b45f2c65796fc60b1b61802b10d7c7de86cc70000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c2120000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c21200000000000000000000000027280e40b343995210ce79ca04000e753fa6d031

-----Decoded View---------------
Arg [0] : _vrfCoordinator (address): 0x589b45F2c65796fc60b1b61802B10d7C7de86cc7
Arg [1] : _bankroll (address): 0x4334b45B8eb99b68c37d75ccad4a1559B865c212
Arg [2] : _trustedForwarder (address): 0x4334b45B8eb99b68c37d75ccad4a1559B865c212
Arg [3] : _vrfDepositor (address): 0x27280E40b343995210cE79CA04000e753Fa6d031

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000589b45f2c65796fc60b1b61802b10d7c7de86cc7
Arg [1] : 0000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c212
Arg [2] : 0000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c212
Arg [3] : 00000000000000000000000027280e40b343995210ce79ca04000e753fa6d031


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
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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