ETH Price: $3,172.71 (+1.63%)

Contract

0xc2Db4555bCcE20E09b20a03d0f1FD68F2381BD66
 

Overview

ETH Balance

0.001355363621669036 ETH

ETH Value

$4.30 (@ $3,172.71/ETH)

Sponsored

Transaction Hash
Method
Block
From
To
Value
Play135104592024-07-13 20:08:257 hrs ago1720901305IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135104492024-07-13 20:08:057 hrs ago1720901285IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135104392024-07-13 20:07:457 hrs ago1720901265IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135104282024-07-13 20:07:237 hrs ago1720901243IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135104192024-07-13 20:07:057 hrs ago1720901225IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135104082024-07-13 20:06:437 hrs ago1720901203IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135103962024-07-13 20:06:197 hrs ago1720901179IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135103862024-07-13 20:05:597 hrs ago1720901159IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135103762024-07-13 20:05:397 hrs ago1720901139IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135103642024-07-13 20:05:157 hrs ago1720901115IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135103492024-07-13 20:04:457 hrs ago1720901085IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135103392024-07-13 20:04:257 hrs ago1720901065IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135103282024-07-13 20:04:037 hrs ago1720901043IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135103112024-07-13 20:03:297 hrs ago1720901009IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135102972024-07-13 20:03:017 hrs ago1720900981IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135102852024-07-13 20:02:377 hrs ago1720900957IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135102752024-07-13 20:02:177 hrs ago1720900937IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135102522024-07-13 20:01:317 hrs ago1720900891IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play135102412024-07-13 20:01:097 hrs ago1720900869IN
0xc2Db4555...F2381BD66
0.00000138 ETH0.000000350.001005
Play133785102024-07-10 18:50:073 days ago1720637407IN
0xc2Db4555...F2381BD66
0.00000171 ETH0.000000350.001005
Play133784332024-07-10 18:47:333 days ago1720637253IN
0xc2Db4555...F2381BD66
0.00000171 ETH0.000000350.001005
Play133784162024-07-10 18:46:593 days ago1720637219IN
0xc2Db4555...F2381BD66
0.00000171 ETH0.000000350.001005
Play133784002024-07-10 18:46:273 days ago1720637187IN
0xc2Db4555...F2381BD66
0.00000171 ETH0.000000350.001005
Play133783692024-07-10 18:45:253 days ago1720637125IN
0xc2Db4555...F2381BD66
0.00000171 ETH0.000000350.001005
Play133783532024-07-10 18:44:533 days ago1720637093IN
0xc2Db4555...F2381BD66
0.00000171 ETH0.000000330.001005
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Value
135104592024-07-13 20:08:257 hrs ago1720901305
0xc2Db4555...F2381BD66
0.00000023 ETH
135104492024-07-13 20:08:057 hrs ago1720901285
0xc2Db4555...F2381BD66
0.00000023 ETH
135104392024-07-13 20:07:457 hrs ago1720901265
0xc2Db4555...F2381BD66
0.00000022 ETH
135104282024-07-13 20:07:237 hrs ago1720901243
0xc2Db4555...F2381BD66
0.00000022 ETH
135104192024-07-13 20:07:057 hrs ago1720901225
0xc2Db4555...F2381BD66
0.00000022 ETH
135104082024-07-13 20:06:437 hrs ago1720901203
0xc2Db4555...F2381BD66
0.00000023 ETH
135103962024-07-13 20:06:197 hrs ago1720901179
0xc2Db4555...F2381BD66
0.00000022 ETH
135103862024-07-13 20:05:597 hrs ago1720901159
0xc2Db4555...F2381BD66
0.00000022 ETH
135103762024-07-13 20:05:397 hrs ago1720901139
0xc2Db4555...F2381BD66
0.00000022 ETH
135103642024-07-13 20:05:157 hrs ago1720901115
0xc2Db4555...F2381BD66
0.00000022 ETH
135103492024-07-13 20:04:457 hrs ago1720901085
0xc2Db4555...F2381BD66
0.00000023 ETH
135103392024-07-13 20:04:257 hrs ago1720901065
0xc2Db4555...F2381BD66
0.00000022 ETH
135103282024-07-13 20:04:037 hrs ago1720901043
0xc2Db4555...F2381BD66
0.00000022 ETH
135103112024-07-13 20:03:297 hrs ago1720901009
0xc2Db4555...F2381BD66
0.00000022 ETH
135102972024-07-13 20:03:017 hrs ago1720900981
0xc2Db4555...F2381BD66
0.00000022 ETH
135102852024-07-13 20:02:377 hrs ago1720900957
0xc2Db4555...F2381BD66
0.00000022 ETH
135102752024-07-13 20:02:177 hrs ago1720900937
0xc2Db4555...F2381BD66
0.00000022 ETH
135102522024-07-13 20:01:317 hrs ago1720900891
0xc2Db4555...F2381BD66
0.00000022 ETH
135102412024-07-13 20:01:097 hrs ago1720900869
0xc2Db4555...F2381BD66
0.00000022 ETH
133785102024-07-10 18:50:073 days ago1720637407
0xc2Db4555...F2381BD66
0.00000037 ETH
133784332024-07-10 18:47:333 days ago1720637253
0xc2Db4555...F2381BD66
0.00000032 ETH
133784162024-07-10 18:46:593 days ago1720637219
0xc2Db4555...F2381BD66
0.00000033 ETH
133784002024-07-10 18:46:273 days ago1720637187
0xc2Db4555...F2381BD66
0.00000032 ETH
133783692024-07-10 18:45:253 days ago1720637125
0xc2Db4555...F2381BD66
0.00000032 ETH
133783532024-07-10 18:44:533 days ago1720637093
0xc2Db4555...F2381BD66
0.00000034 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ZapankiSlotsKroma

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

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

import "./common/ZapankiGamesKroma.sol";

contract ZapankiSlotsKroma is ZapankiGamesKroma {
    using SafeERC20 for IERC20;

    struct SlotsGame {
        uint256 wager;
        uint256 stopGain;
        uint256 stopLoss;
        uint256 vrfId;
        address tokenAddress;
        uint64 blockNumber;
        uint32 numBets;
    }

    mapping(address => SlotsGame) slotsGames;
    mapping(uint256 => address) vrfPendingPlayer;

    mapping(uint16 => uint16) slotsMultipliers;
    uint16 numOutcomes;

    event SlotsFulfilled(
        address indexed playerAddress,
        uint256 wager,
        uint256 payout,
        address tokenAddress,
        uint16[] slotIDs,
        uint256[] multipliers,
        uint256[] payouts,
        uint32 numGames,
        uint256 l2eAmount
    );
    event SlotsRefund(address indexed player, uint256 wager, address tokenAddress);

    constructor(
        address _vrfCoordinator,
        IBankroll _bankroll,
        address _trustedForwarder,
        address _vrfDepositor
    ) ZapankiGamesKroma(_vrfCoordinator, _bankroll, _trustedForwarder, _vrfDepositor) {
        _setSlotsMultipliers(
            [
                5,
                3,
                3,
                3,
                3,
                3,
                3,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                2,
                10,
                10,
                12,
                12,
                20,
                20,
                45,
                100
            ],
            [
                0,
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20,
                21,
                22,
                23,
                24,
                25,
                26,
                27,
                28,
                29,
                30,
                31,
                32,
                33,
                34,
                35,
                36,
                37,
                38,
                39,
                40,
                41,
                42,
                43,
                44,
                45,
                46,
                47,
                48,
                114,
                117,
                171,
                173,
                228,
                229,
                285,
                342
            ],
            343
        );
    }

    function getCurrentUserState(address player) external view returns (SlotsGame memory) {
        return (slotsGames[player]);
    }

    function getMultipliers() external view returns (uint16[] memory) {
        uint16[] memory multipliers = new uint16[](numOutcomes);
        for (uint16 i = 0; i < numOutcomes; i++) {
            multipliers[i] = slotsMultipliers[i];
        }
        return multipliers;
    }

    function play(
        uint256 wager,
        address tokenAddress,
        uint32 numBets,
        uint256 stopGain,
        uint256 stopLoss
    ) external payable nonReentrant {
        address msgSender = _msgSender();
        require(slotsGames[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);

        slotsGames[msgSender] = SlotsGame(wager, stopGain, stopLoss, id, tokenAddress, uint64(block.number), numBets);
        vrfPendingPlayer[id] = msgSender;

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

    function refund() external nonReentrant {
        address msgSender = _msgSender();
        SlotsGame storage game = slotsGames[msgSender];
        require(game.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;

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

        delete (vrfPendingPlayer[game.vrfId]);
        delete (slotsGames[msgSender]);
    }

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

        uint256 payout;
        int256 totalValue;
        uint32 gamePlayed;
        uint16[] memory slotID = new uint16[](game.numBets);
        uint256[] memory multipliers = new uint256[](game.numBets);
        uint256[] memory payouts = new uint256[](game.numBets);

        for (gamePlayed = 0; gamePlayed < game.numBets; gamePlayed++) {
            if (_shouldStop(totalValue, game.stopGain, game.stopLoss)) {
                break;
            }

            slotID[gamePlayed] = uint16(randomWords[gamePlayed] % numOutcomes);
            multipliers[gamePlayed] = slotsMultipliers[slotID[gamePlayed]];

            if (multipliers[gamePlayed] != 0) {
                totalValue += int256(game.wager * multipliers[gamePlayed]) - int256(game.wager);
                payout += game.wager * multipliers[gamePlayed];
                payouts[gamePlayed] = game.wager * multipliers[gamePlayed];
            } else {
                totalValue -= int256(game.wager);
            }
        }

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

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

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

        emit SlotsFulfilled(
            playerAddress,
            game.wager,
            payout,
            game.tokenAddress,
            slotID,
            multipliers,
            payouts,
            gamePlayed,
            l2eAmount
        );

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

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

    function _setSlotsMultipliers(
        uint8[57] memory _multipliers,
        uint16[57] memory _outcomeNum,
        uint16 _numOutcomes
    ) internal {
        numOutcomes = _numOutcomes;
        for (uint16 i = 0; i < _multipliers.length; i++) {
            slotsMultipliers[_outcomeNum[i]] = _multipliers[i];
        }
    }

    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 * 55770) / 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":"uint16[]","name":"slotIDs","type":"uint16[]"},{"indexed":false,"internalType":"uint256[]","name":"multipliers","type":"uint256[]"},{"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":"SlotsFulfilled","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":"SlotsRefund","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":"struct ZapankiSlotsKroma.SlotsGame","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMultipliers","outputs":[{"internalType":"uint16[]","name":"","type":"uint16[]"}],"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":"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"}]

60806040523480156200001157600080fd5b5060405162002a3638038062002a368339810160408190526200003491620006b1565b83838383600160008190555083600160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082600360006101000a8154816001600160a01b0302191690836001600160a01b0316021790555082600460006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600560006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600260006101000a8154816001600160a01b0302191690836001600160a01b0316021790555050505050620005dd604051806107200160405280600560ff168152602001600360ff168152602001600360ff168152602001600360ff168152602001600360ff168152602001600360ff168152602001600360ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600260ff168152602001600a60ff168152602001600a60ff168152602001600c60ff168152602001600c60ff168152602001601460ff168152602001601460ff168152602001602d60ff168152602001606460ff16815250604051806107200160405280600061ffff168152602001600161ffff168152602001600261ffff168152602001600361ffff168152602001600461ffff168152602001600561ffff168152602001600661ffff168152602001600761ffff168152602001600861ffff168152602001600961ffff168152602001600a61ffff168152602001600b61ffff168152602001600c61ffff168152602001600d61ffff168152602001600e61ffff168152602001600f61ffff168152602001601061ffff168152602001601161ffff168152602001601261ffff168152602001601361ffff168152602001601461ffff168152602001601561ffff168152602001601661ffff168152602001601761ffff168152602001601861ffff168152602001601961ffff168152602001601a61ffff168152602001601b61ffff168152602001601c61ffff168152602001601d61ffff168152602001601e61ffff168152602001601f61ffff168152602001602061ffff168152602001602161ffff168152602001602261ffff168152602001602361ffff168152602001602461ffff168152602001602561ffff168152602001602661ffff168152602001602761ffff168152602001602861ffff168152602001602961ffff168152602001602a61ffff168152602001602b61ffff168152602001602c61ffff168152602001602d61ffff168152602001602e61ffff168152602001602f61ffff168152602001603061ffff168152602001607261ffff168152602001607561ffff16815260200160ab61ffff16815260200160ad61ffff16815260200160e461ffff16815260200160e561ffff16815260200161011d61ffff16815260200161015661ffff16815250610157620005e760201b60201c565b505050506200075f565b600c805461ffff191661ffff831617905560005b60398161ffff1610156200069257838161ffff166039811062000622576200062262000719565b602002015160ff16600b6000858461ffff166039811062000647576200064762000719565b602002015161ffff1661ffff16815260200190815260200160002060006101000a81548161ffff021916908361ffff160217905550808062000689906200072f565b915050620005fb565b50505050565b6001600160a01b0381168114620006ae57600080fd5b50565b60008060008060808587031215620006c857600080fd5b8451620006d58162000698565b6020860151909450620006e88162000698565b6040860151909350620006fb8162000698565b60608601519092506200070e8162000698565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b600061ffff8083168181036200075557634e487b7160e01b600052601160045260246000fd5b6001019392505050565b6122c7806200076f6000396000f3fe6080604052600436106100e85760003560e01c806376fca03d1161008a5780638bd16114116100595780638bd16114146102d9578063a3e56fa8146102f9578063a50ce2f714610319578063ad5dba7d1461033957600080fd5b806376fca03d146101f857806379873f8a146102815780637da0a877146102a357806380cfa527146102c357600080fd5b806333716194116100c6578063337161941461016c578063572b6c051461018f578063590e1ae3146101ce57806374b0a789146101e357600080fd5b8063083b2732146100ed5780630c657eb01461012a5780631fe543e31461014a575b600080fd5b3480156100f957600080fd5b5060045461010d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013657600080fd5b5060035461010d906001600160a01b031681565b34801561015657600080fd5b5061016a610165366004611d02565b61034c565b005b34801561017857600080fd5b50610181601081565b604051908152602001610121565b34801561019b57600080fd5b506101be6101aa366004611de0565b6005546001600160a01b0391821691161490565b6040519015158152602001610121565b3480156101da57600080fd5b5061016a610371565b3480156101ef57600080fd5b5061016a6105f8565b34801561020457600080fd5b50610218610213366004611de0565b610763565b6040516101219190815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a0808301516001600160401b03169082015260c09182015163ffffffff169181019190915260e00190565b34801561028d57600080fd5b50610296610840565b6040516101219190611e3c565b3480156102af57600080fd5b5060055461010d906001600160a01b031681565b3480156102cf57600080fd5b5061018160075481565b3480156102e557600080fd5b506101816102f4366004611e4f565b6108fb565b34801561030557600080fd5b5060015461010d906001600160a01b031681565b34801561032557600080fd5b5060025461010d906001600160a01b031681565b61016a610347366004611e7a565b610b98565b6001546001600160a01b0316331461036357600080fd5b61036d8282610eaf565b5050565b6103796114f1565b600061038361151b565b6001600160a01b038116600090815260096020526040812060038101549293509190036103f75760405162461bcd60e51b815260206004820152601760248201527f4e6f742077616974696e6720565246207265717565737400000000000000000060448201526064015b60405180910390fd5b6004810154439061041b906103e890600160a01b90046001600160401b0316611ee2565b61042690600a611ee2565b6001600160401b031611156104695760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b60448201526064016103ee565b6004810154815460009161048b91600160e01b90910463ffffffff1690611f09565b60048301549091506001600160a01b03168061053c576000846001600160a01b03168360405160006040518083038185875af1925050503d80600081146104ee576040519150601f19603f3d011682016040523d82523d6000602084013e6104f3565b606091505b50509050806105365760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016103ee565b50610550565b6105506001600160a01b0382168584611542565b604080518381526001600160a01b0383811660208301528616917f5d30657a1415f2eca4af426a9aff0a5f3875a54ae40c4b1bc524a42765346eb6910160405180910390a250506003908101546000908152600a6020908152604080832080546001600160a01b03191690556001600160a01b03949094168252600990529182208281556001810183905560028101839055908101829055600401556105f66001600055565b565b6106006114f1565b600360009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610653573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106779190611f20565b6001600160a01b0316336001600160a01b0316146106c35760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b60448201526064016103ee565b60078054600091829055604051909190339083908381818185875af1925050503d806000811461070f576040519150601f19603f3d011682016040523d82523d6000602084013e610714565b606091505b50509050806107575760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b60448201526064016103ee565b50506105f66001600055565b6107bb6040518060e001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff1681525090565b506001600160a01b03908116600090815260096020908152604091829020825160e08101845281548152600182015492810192909252600281015492820192909252600382015460608201526004909101549182166080820152600160a01b82046001600160401b031660a0820152600160e01b90910463ffffffff1660c082015290565b600c5460609060009061ffff166001600160401b0381111561086457610864611cec565b60405190808252806020026020018201604052801561088d578160200160208202803683370190505b50905060005b600c5461ffff90811690821610156108f55761ffff8082166000818152600b6020526040902054845192169184919081106108d0576108d0611f3d565b61ffff90921660209283029190910190910152806108ed81611f53565b915050610893565b50919050565b600080600f602160991b016001600160a01b031663519b4bd36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109679190611f74565b6010600f602160991b016001600160a01b031663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d29190611f8d565b63ffffffff166109e29190611f09565b6109ec9190611f09565b90506000600f602160991b016001600160a01b031663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a599190611f74565b600f602160991b016001600160a01b03166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac29190611f8d565b63ffffffff16610ad29190611f09565b90506000600f602160991b016001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3f9190611f74565b610b4a90600a61208e565b610b55906010611f09565b610b5f838561209a565b610b6b90611a2c611f09565b610b7591906120c3565b905080610b8586620f433c611f09565b610b8f919061209a565b95945050505050565b610ba06114f1565b6000610baa61151b565b6001600160a01b03811660009081526009602052604090206003015490915015610c0c5760405162461bcd60e51b815260206004820152601360248201527215d85a5d1a5b99c8159491881c995c5d595cdd606a1b60448201526064016103ee565b8363ffffffff166000108015610c29575060648463ffffffff1611155b610c675760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206e756d4265747360881b60448201526064016103ee565b610c7186866115a6565b610c8f85610c8563ffffffff871689611f09565b6210c8e0846116a0565b6000610c9a856117ea565b90506040518060e00160405280888152602001858152602001848152602001828152602001876001600160a01b03168152602001436001600160401b031681526020018663ffffffff1681525060096000846001600160a01b03166001600160a01b031681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060a08201518160040160146101000a8154816001600160401b0302191690836001600160401b0316021790555060c082015181600401601c6101000a81548163ffffffff021916908363ffffffff16021790555090505081600a600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600460009054906101000a90046001600160a01b03166001600160a01b03166327ffe843600384898b8a6040518663ffffffff1660e01b8152600401610e6a95949392919063ffffffff95861681526001600160a01b03948516602082015292909316604083015260608201529116608082015260a00190565b600060405180830381600087803b158015610e8457600080fd5b505af1158015610e98573d6000803e3d6000fd5b505050505050610ea86001600055565b5050505050565b6000828152600a60205260409020546001600160a01b031680610ed157505050565b6001600160a01b03811660009081526009602052604090206004810154610f0b906103e890600160a01b90046001600160401b0316611ee2565b6001600160401b0316431115610f215750505050565b6004810154600090819081908190600160e01b900463ffffffff166001600160401b03811115610f5357610f53611cec565b604051908082528060200260200182016040528015610f7c578160200160208202803683370190505b506004860154909150600090600160e01b900463ffffffff166001600160401b03811115610fac57610fac611cec565b604051908082528060200260200182016040528015610fd5578160200160208202803683370190505b506004870154909150600090600160e01b900463ffffffff166001600160401b0381111561100557611005611cec565b60405190808252806020026020018201604052801561102e578160200160208202803683370190505b509050600093505b600487015463ffffffff600160e01b909104811690851610156112645761106685886001015489600201546118bc565b61126457600c54895161ffff909116908a9063ffffffff871690811061108e5761108e611f3d565b60200260200101516110a091906120d7565b838563ffffffff16815181106110b8576110b8611f3d565b602002602001019061ffff16908161ffff1681525050600b6000848663ffffffff16815181106110ea576110ea611f3d565b602002602001015161ffff1661ffff16815260200190815260200160002060009054906101000a900461ffff1661ffff16828563ffffffff168151811061113357611133611f3d565b602002602001018181525050818463ffffffff168151811061115757611157611f3d565b6020026020010151600014611243578660000154828563ffffffff168151811061118357611183611f3d565b6020026020010151886000015461119a9190611f09565b6111a491906120eb565b6111ae908661210b565b9450818463ffffffff16815181106111c8576111c8611f3d565b602002602001015187600001546111df9190611f09565b6111e9908761209a565b9550818463ffffffff168151811061120357611203611f3d565b6020026020010151876000015461121a9190611f09565b818563ffffffff168151811061123257611232611f3d565b602002602001018181525050611252565b865461124f90866120eb565b94505b8361125c81612133565b945050611036565b86546004880154611283908690600160e01b900463ffffffff1661214c565b63ffffffff166112939190611f09565b61129d908761209a565b600488015488549197506112d3916001600160a01b038216916112ce91600160e01b90910463ffffffff1690611f09565b6118df565b85156112f45760048701546112f490899088906001600160a01b031661199a565b600354600488015488546000926001600160a01b039081169263ff6d9eff928d929091169061132a9063ffffffff8b1690611f09565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606481018a90526084016020604051808303816000875af1158015611385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a99190611f74565b885460048a01546040519293506001600160a01b03808d16937f507f63e68342b81e92d284c88ffe251096edeb27d073c7d5794619dad6642143936113fe9390928d929116908a908a908a908e908b90612199565b60405180910390a260048054898201548a5460405163e2382aa160e01b81526003948101949094526001600160a01b038d811660248601529182166044850152606484015263ffffffff8816608484015260a483018a9052169063e2382aa19060c401600060405180830381600087803b15801561147b57600080fd5b505af115801561148f573d6000803e3d6000fd5b50505060009b8c525050600a60209081526040808c2080546001600160a01b03191690556001600160a01b03999099168b5260099052505050938620868155600181018790556002810187905560038101879055600401959095555050505050565b60026000540361151457604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6005546000906001600160a01b0316330361153d575060131936013560601c90565b503390565b6040516001600160a01b038381166024830152604482018390526115a191859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611a0d565b505050565b60006001600160a01b0382166115c957506003546001600160a01b03163161163a565b6003546040516370a0823160e01b81526001600160a01b039182166004820152908316906370a0823190602401602060405180830381865afa158015611613573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116379190611f74565b90505b60006305f5e10061164d8361d9da611f09565b61165791906120c3565b90508084111561169a5760405162461bcd60e51b815260206004820152600e60248201526d2a37b79036b0b73c903bb0b3b2b960911b60448201526064016103ee565b50505050565b600354604051632ff5fe7360e21b81523060048201526001600160a01b0386811660248301529091169063bfd7f9cc90604401602060405180830381865afa1580156116f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117149190612211565b6117555760405162461bcd60e51b8152602060048201526012602482015271151bdad95b881b9bdd08185c1c1c9bdd995960721b60448201526064016103ee565b826000036117a55760405162461bcd60e51b815260206004820152601c60248201527f5761676572206d7573742062652067726561746572207468616e20300000000060448201526064016103ee565b6001600160a01b0384166117cb576117c66117c08434612233565b83611a70565b61169a565b6117d53483611a70565b61169a6001600160a01b038516823086611af2565b6001805460025460405163d291ba0960e01b815260806004820152602860848201527f72617746756c66696c6c52616e646f6d576f7264732875696e743235362c756960a4820152676e743235365b5d2960c01b60c482015260ff8516602482015260448101939093526001600160a01b03908116606484015260009291169063d291ba099060e4016020604051808303816000875af1158015611892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b69190611f74565b92915050565b600082841215806118d557506118d182612246565b8413155b90505b9392505050565b6001600160a01b038216611980576003546040516000916001600160a01b03169083908381818185875af1925050503d806000811461193a576040519150601f19603f3d011682016040523d82523d6000602084013e61193f565b606091505b50509050806115a15760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016103ee565b60035461036d906001600160a01b03848116911683611542565b6003546040516336012f6160e11b81526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b1580156119f057600080fd5b505af1158015611a04573d6000803e3d6000fd5b50505050505050565b6000611a226001600160a01b03841683611b2b565b90508051600014158015611a47575080806020019051810190611a459190612211565b155b156115a157604051635274afe760e01b81526001600160a01b03841660048201526024016103ee565b6000611a7b826108fb565b905080831015611ac45760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207672662066656560601b60448201526064016103ee565b611ad6611ad18285612233565b611b39565b8060076000828254611ae8919061209a565b9091555050505050565b6040516001600160a01b03848116602483015283811660448301526064820183905261169a9186918216906323b872dd9060840161156f565b60606118d883836000611bca565b8015611bc757604051600090339083908381818185875af1925050503d8060008114611b81576040519150601f19603f3d011682016040523d82523d6000602084013e611b86565b606091505b505090508061036d5760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016103ee565b50565b606081471015611bef5760405163cd78605960e01b81523060048201526024016103ee565b600080856001600160a01b03168486604051611c0b9190612262565b60006040518083038185875af1925050503d8060008114611c48576040519150601f19603f3d011682016040523d82523d6000602084013e611c4d565b606091505b5091509150611c5d868383611c67565b9695505050505050565b606082611c7c57611c7782611cc3565b6118d8565b8151158015611c9357506001600160a01b0384163b155b15611cbc57604051639996b31560e01b81526001600160a01b03851660048201526024016103ee565b50806118d8565b805115611cd35780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215611d1557600080fd5b823591506020808401356001600160401b0380821115611d3457600080fd5b818601915086601f830112611d4857600080fd5b813581811115611d5a57611d5a611cec565b8060051b604051601f19603f83011681018181108582111715611d7f57611d7f611cec565b604052918252848201925083810185019189831115611d9d57600080fd5b938501935b82851015611dbb57843584529385019392850192611da2565b8096505050505050509250929050565b6001600160a01b0381168114611bc757600080fd5b600060208284031215611df257600080fd5b81356118d881611dcb565b600081518084526020808501945080840160005b83811015611e3157815161ffff1687529582019590820190600101611e11565b509495945050505050565b6020815260006118d86020830184611dfd565b600060208284031215611e6157600080fd5b5035919050565b63ffffffff81168114611bc757600080fd5b600080600080600060a08688031215611e9257600080fd5b853594506020860135611ea481611dcb565b93506040860135611eb481611e68565b94979396509394606081013594506080013592915050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115611f0257611f02611ecc565b5092915050565b80820281158282048414176118b6576118b6611ecc565b600060208284031215611f3257600080fd5b81516118d881611dcb565b634e487b7160e01b600052603260045260246000fd5b600061ffff808316818103611f6a57611f6a611ecc565b6001019392505050565b600060208284031215611f8657600080fd5b5051919050565b600060208284031215611f9f57600080fd5b81516118d881611e68565b600181815b80851115611fe5578160001904821115611fcb57611fcb611ecc565b80851615611fd857918102915b93841c9390800290611faf565b509250929050565b600082611ffc575060016118b6565b81612009575060006118b6565b816001811461201f576002811461202957612045565b60019150506118b6565b60ff84111561203a5761203a611ecc565b50506001821b6118b6565b5060208310610133831016604e8410600b8410161715612068575081810a6118b6565b6120728383611faa565b806000190482111561208657612086611ecc565b029392505050565b60006118d88383611fed565b808201808211156118b6576118b6611ecc565b634e487b7160e01b600052601260045260246000fd5b6000826120d2576120d26120ad565b500490565b6000826120e6576120e66120ad565b500690565b8181036000831280158383131683831282161715611f0257611f02611ecc565b808201828112600083128015821682158216171561212b5761212b611ecc565b505092915050565b600063ffffffff808316818103611f6a57611f6a611ecc565b63ffffffff828116828216039080821115611f0257611f02611ecc565b600081518084526020808501945080840160005b83811015611e315781518752958201959082019060010161217d565b888152602081018890526001600160a01b0387166040820152610100606082018190526000906121cb83820189611dfd565b905082810360808401526121df8188612169565b905082810360a08401526121f38187612169565b63ffffffff9590951660c0840152505060e001529695505050505050565b60006020828403121561222357600080fd5b815180151581146118d857600080fd5b818103818111156118b6576118b6611ecc565b6000600160ff1b820161225b5761225b611ecc565b5060000390565b6000825160005b818110156122835760208186018101518583015201612269565b50600092019182525091905056fea2646970667358221220eb81f50790cdfe31a0e9540e1a4eb923e2d6e12d694bfb30a2f600bd984c910f64736f6c63430008140033000000000000000000000000589b45f2c65796fc60b1b61802b10d7c7de86cc70000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c2120000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c21200000000000000000000000027280e40b343995210ce79ca04000e753fa6d031

Deployed Bytecode

0x6080604052600436106100e85760003560e01c806376fca03d1161008a5780638bd16114116100595780638bd16114146102d9578063a3e56fa8146102f9578063a50ce2f714610319578063ad5dba7d1461033957600080fd5b806376fca03d146101f857806379873f8a146102815780637da0a877146102a357806380cfa527146102c357600080fd5b806333716194116100c6578063337161941461016c578063572b6c051461018f578063590e1ae3146101ce57806374b0a789146101e357600080fd5b8063083b2732146100ed5780630c657eb01461012a5780631fe543e31461014a575b600080fd5b3480156100f957600080fd5b5060045461010d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013657600080fd5b5060035461010d906001600160a01b031681565b34801561015657600080fd5b5061016a610165366004611d02565b61034c565b005b34801561017857600080fd5b50610181601081565b604051908152602001610121565b34801561019b57600080fd5b506101be6101aa366004611de0565b6005546001600160a01b0391821691161490565b6040519015158152602001610121565b3480156101da57600080fd5b5061016a610371565b3480156101ef57600080fd5b5061016a6105f8565b34801561020457600080fd5b50610218610213366004611de0565b610763565b6040516101219190815181526020808301519082015260408083015190820152606080830151908201526080808301516001600160a01b03169082015260a0808301516001600160401b03169082015260c09182015163ffffffff169181019190915260e00190565b34801561028d57600080fd5b50610296610840565b6040516101219190611e3c565b3480156102af57600080fd5b5060055461010d906001600160a01b031681565b3480156102cf57600080fd5b5061018160075481565b3480156102e557600080fd5b506101816102f4366004611e4f565b6108fb565b34801561030557600080fd5b5060015461010d906001600160a01b031681565b34801561032557600080fd5b5060025461010d906001600160a01b031681565b61016a610347366004611e7a565b610b98565b6001546001600160a01b0316331461036357600080fd5b61036d8282610eaf565b5050565b6103796114f1565b600061038361151b565b6001600160a01b038116600090815260096020526040812060038101549293509190036103f75760405162461bcd60e51b815260206004820152601760248201527f4e6f742077616974696e6720565246207265717565737400000000000000000060448201526064015b60405180910390fd5b6004810154439061041b906103e890600160a01b90046001600160401b0316611ee2565b61042690600a611ee2565b6001600160401b031611156104695760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b60448201526064016103ee565b6004810154815460009161048b91600160e01b90910463ffffffff1690611f09565b60048301549091506001600160a01b03168061053c576000846001600160a01b03168360405160006040518083038185875af1925050503d80600081146104ee576040519150601f19603f3d011682016040523d82523d6000602084013e6104f3565b606091505b50509050806105365760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016103ee565b50610550565b6105506001600160a01b0382168584611542565b604080518381526001600160a01b0383811660208301528616917f5d30657a1415f2eca4af426a9aff0a5f3875a54ae40c4b1bc524a42765346eb6910160405180910390a250506003908101546000908152600a6020908152604080832080546001600160a01b03191690556001600160a01b03949094168252600990529182208281556001810183905560028101839055908101829055600401556105f66001600055565b565b6106006114f1565b600360009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610653573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106779190611f20565b6001600160a01b0316336001600160a01b0316146106c35760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b60448201526064016103ee565b60078054600091829055604051909190339083908381818185875af1925050503d806000811461070f576040519150601f19603f3d011682016040523d82523d6000602084013e610714565b606091505b50509050806107575760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b60448201526064016103ee565b50506105f66001600055565b6107bb6040518060e001604052806000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160401b03168152602001600063ffffffff1681525090565b506001600160a01b03908116600090815260096020908152604091829020825160e08101845281548152600182015492810192909252600281015492820192909252600382015460608201526004909101549182166080820152600160a01b82046001600160401b031660a0820152600160e01b90910463ffffffff1660c082015290565b600c5460609060009061ffff166001600160401b0381111561086457610864611cec565b60405190808252806020026020018201604052801561088d578160200160208202803683370190505b50905060005b600c5461ffff90811690821610156108f55761ffff8082166000818152600b6020526040902054845192169184919081106108d0576108d0611f3d565b61ffff90921660209283029190910190910152806108ed81611f53565b915050610893565b50919050565b600080600f602160991b016001600160a01b031663519b4bd36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610943573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109679190611f74565b6010600f602160991b016001600160a01b031663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d29190611f8d565b63ffffffff166109e29190611f09565b6109ec9190611f09565b90506000600f602160991b016001600160a01b031663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a35573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a599190611f74565b600f602160991b016001600160a01b03166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac29190611f8d565b63ffffffff16610ad29190611f09565b90506000600f602160991b016001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3f9190611f74565b610b4a90600a61208e565b610b55906010611f09565b610b5f838561209a565b610b6b90611a2c611f09565b610b7591906120c3565b905080610b8586620f433c611f09565b610b8f919061209a565b95945050505050565b610ba06114f1565b6000610baa61151b565b6001600160a01b03811660009081526009602052604090206003015490915015610c0c5760405162461bcd60e51b815260206004820152601360248201527215d85a5d1a5b99c8159491881c995c5d595cdd606a1b60448201526064016103ee565b8363ffffffff166000108015610c29575060648463ffffffff1611155b610c675760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206e756d4265747360881b60448201526064016103ee565b610c7186866115a6565b610c8f85610c8563ffffffff871689611f09565b6210c8e0846116a0565b6000610c9a856117ea565b90506040518060e00160405280888152602001858152602001848152602001828152602001876001600160a01b03168152602001436001600160401b031681526020018663ffffffff1681525060096000846001600160a01b03166001600160a01b031681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060a08201518160040160146101000a8154816001600160401b0302191690836001600160401b0316021790555060c082015181600401601c6101000a81548163ffffffff021916908363ffffffff16021790555090505081600a600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600460009054906101000a90046001600160a01b03166001600160a01b03166327ffe843600384898b8a6040518663ffffffff1660e01b8152600401610e6a95949392919063ffffffff95861681526001600160a01b03948516602082015292909316604083015260608201529116608082015260a00190565b600060405180830381600087803b158015610e8457600080fd5b505af1158015610e98573d6000803e3d6000fd5b505050505050610ea86001600055565b5050505050565b6000828152600a60205260409020546001600160a01b031680610ed157505050565b6001600160a01b03811660009081526009602052604090206004810154610f0b906103e890600160a01b90046001600160401b0316611ee2565b6001600160401b0316431115610f215750505050565b6004810154600090819081908190600160e01b900463ffffffff166001600160401b03811115610f5357610f53611cec565b604051908082528060200260200182016040528015610f7c578160200160208202803683370190505b506004860154909150600090600160e01b900463ffffffff166001600160401b03811115610fac57610fac611cec565b604051908082528060200260200182016040528015610fd5578160200160208202803683370190505b506004870154909150600090600160e01b900463ffffffff166001600160401b0381111561100557611005611cec565b60405190808252806020026020018201604052801561102e578160200160208202803683370190505b509050600093505b600487015463ffffffff600160e01b909104811690851610156112645761106685886001015489600201546118bc565b61126457600c54895161ffff909116908a9063ffffffff871690811061108e5761108e611f3d565b60200260200101516110a091906120d7565b838563ffffffff16815181106110b8576110b8611f3d565b602002602001019061ffff16908161ffff1681525050600b6000848663ffffffff16815181106110ea576110ea611f3d565b602002602001015161ffff1661ffff16815260200190815260200160002060009054906101000a900461ffff1661ffff16828563ffffffff168151811061113357611133611f3d565b602002602001018181525050818463ffffffff168151811061115757611157611f3d565b6020026020010151600014611243578660000154828563ffffffff168151811061118357611183611f3d565b6020026020010151886000015461119a9190611f09565b6111a491906120eb565b6111ae908661210b565b9450818463ffffffff16815181106111c8576111c8611f3d565b602002602001015187600001546111df9190611f09565b6111e9908761209a565b9550818463ffffffff168151811061120357611203611f3d565b6020026020010151876000015461121a9190611f09565b818563ffffffff168151811061123257611232611f3d565b602002602001018181525050611252565b865461124f90866120eb565b94505b8361125c81612133565b945050611036565b86546004880154611283908690600160e01b900463ffffffff1661214c565b63ffffffff166112939190611f09565b61129d908761209a565b600488015488549197506112d3916001600160a01b038216916112ce91600160e01b90910463ffffffff1690611f09565b6118df565b85156112f45760048701546112f490899088906001600160a01b031661199a565b600354600488015488546000926001600160a01b039081169263ff6d9eff928d929091169061132a9063ffffffff8b1690611f09565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606481018a90526084016020604051808303816000875af1158015611385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a99190611f74565b885460048a01546040519293506001600160a01b03808d16937f507f63e68342b81e92d284c88ffe251096edeb27d073c7d5794619dad6642143936113fe9390928d929116908a908a908a908e908b90612199565b60405180910390a260048054898201548a5460405163e2382aa160e01b81526003948101949094526001600160a01b038d811660248601529182166044850152606484015263ffffffff8816608484015260a483018a9052169063e2382aa19060c401600060405180830381600087803b15801561147b57600080fd5b505af115801561148f573d6000803e3d6000fd5b50505060009b8c525050600a60209081526040808c2080546001600160a01b03191690556001600160a01b03999099168b5260099052505050938620868155600181018790556002810187905560038101879055600401959095555050505050565b60026000540361151457604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6005546000906001600160a01b0316330361153d575060131936013560601c90565b503390565b6040516001600160a01b038381166024830152604482018390526115a191859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611a0d565b505050565b60006001600160a01b0382166115c957506003546001600160a01b03163161163a565b6003546040516370a0823160e01b81526001600160a01b039182166004820152908316906370a0823190602401602060405180830381865afa158015611613573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116379190611f74565b90505b60006305f5e10061164d8361d9da611f09565b61165791906120c3565b90508084111561169a5760405162461bcd60e51b815260206004820152600e60248201526d2a37b79036b0b73c903bb0b3b2b960911b60448201526064016103ee565b50505050565b600354604051632ff5fe7360e21b81523060048201526001600160a01b0386811660248301529091169063bfd7f9cc90604401602060405180830381865afa1580156116f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117149190612211565b6117555760405162461bcd60e51b8152602060048201526012602482015271151bdad95b881b9bdd08185c1c1c9bdd995960721b60448201526064016103ee565b826000036117a55760405162461bcd60e51b815260206004820152601c60248201527f5761676572206d7573742062652067726561746572207468616e20300000000060448201526064016103ee565b6001600160a01b0384166117cb576117c66117c08434612233565b83611a70565b61169a565b6117d53483611a70565b61169a6001600160a01b038516823086611af2565b6001805460025460405163d291ba0960e01b815260806004820152602860848201527f72617746756c66696c6c52616e646f6d576f7264732875696e743235362c756960a4820152676e743235365b5d2960c01b60c482015260ff8516602482015260448101939093526001600160a01b03908116606484015260009291169063d291ba099060e4016020604051808303816000875af1158015611892573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b69190611f74565b92915050565b600082841215806118d557506118d182612246565b8413155b90505b9392505050565b6001600160a01b038216611980576003546040516000916001600160a01b03169083908381818185875af1925050503d806000811461193a576040519150601f19603f3d011682016040523d82523d6000602084013e61193f565b606091505b50509050806115a15760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016103ee565b60035461036d906001600160a01b03848116911683611542565b6003546040516336012f6160e11b81526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b1580156119f057600080fd5b505af1158015611a04573d6000803e3d6000fd5b50505050505050565b6000611a226001600160a01b03841683611b2b565b90508051600014158015611a47575080806020019051810190611a459190612211565b155b156115a157604051635274afe760e01b81526001600160a01b03841660048201526024016103ee565b6000611a7b826108fb565b905080831015611ac45760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207672662066656560601b60448201526064016103ee565b611ad6611ad18285612233565b611b39565b8060076000828254611ae8919061209a565b9091555050505050565b6040516001600160a01b03848116602483015283811660448301526064820183905261169a9186918216906323b872dd9060840161156f565b60606118d883836000611bca565b8015611bc757604051600090339083908381818185875af1925050503d8060008114611b81576040519150601f19603f3d011682016040523d82523d6000602084013e611b86565b606091505b505090508061036d5760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016103ee565b50565b606081471015611bef5760405163cd78605960e01b81523060048201526024016103ee565b600080856001600160a01b03168486604051611c0b9190612262565b60006040518083038185875af1925050503d8060008114611c48576040519150601f19603f3d011682016040523d82523d6000602084013e611c4d565b606091505b5091509150611c5d868383611c67565b9695505050505050565b606082611c7c57611c7782611cc3565b6118d8565b8151158015611c9357506001600160a01b0384163b155b15611cbc57604051639996b31560e01b81526001600160a01b03851660048201526024016103ee565b50806118d8565b805115611cd35780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215611d1557600080fd5b823591506020808401356001600160401b0380821115611d3457600080fd5b818601915086601f830112611d4857600080fd5b813581811115611d5a57611d5a611cec565b8060051b604051601f19603f83011681018181108582111715611d7f57611d7f611cec565b604052918252848201925083810185019189831115611d9d57600080fd5b938501935b82851015611dbb57843584529385019392850192611da2565b8096505050505050509250929050565b6001600160a01b0381168114611bc757600080fd5b600060208284031215611df257600080fd5b81356118d881611dcb565b600081518084526020808501945080840160005b83811015611e3157815161ffff1687529582019590820190600101611e11565b509495945050505050565b6020815260006118d86020830184611dfd565b600060208284031215611e6157600080fd5b5035919050565b63ffffffff81168114611bc757600080fd5b600080600080600060a08688031215611e9257600080fd5b853594506020860135611ea481611dcb565b93506040860135611eb481611e68565b94979396509394606081013594506080013592915050565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115611f0257611f02611ecc565b5092915050565b80820281158282048414176118b6576118b6611ecc565b600060208284031215611f3257600080fd5b81516118d881611dcb565b634e487b7160e01b600052603260045260246000fd5b600061ffff808316818103611f6a57611f6a611ecc565b6001019392505050565b600060208284031215611f8657600080fd5b5051919050565b600060208284031215611f9f57600080fd5b81516118d881611e68565b600181815b80851115611fe5578160001904821115611fcb57611fcb611ecc565b80851615611fd857918102915b93841c9390800290611faf565b509250929050565b600082611ffc575060016118b6565b81612009575060006118b6565b816001811461201f576002811461202957612045565b60019150506118b6565b60ff84111561203a5761203a611ecc565b50506001821b6118b6565b5060208310610133831016604e8410600b8410161715612068575081810a6118b6565b6120728383611faa565b806000190482111561208657612086611ecc565b029392505050565b60006118d88383611fed565b808201808211156118b6576118b6611ecc565b634e487b7160e01b600052601260045260246000fd5b6000826120d2576120d26120ad565b500490565b6000826120e6576120e66120ad565b500690565b8181036000831280158383131683831282161715611f0257611f02611ecc565b808201828112600083128015821682158216171561212b5761212b611ecc565b505092915050565b600063ffffffff808316818103611f6a57611f6a611ecc565b63ffffffff828116828216039080821115611f0257611f02611ecc565b600081518084526020808501945080840160005b83811015611e315781518752958201959082019060010161217d565b888152602081018890526001600160a01b0387166040820152610100606082018190526000906121cb83820189611dfd565b905082810360808401526121df8188612169565b905082810360a08401526121f38187612169565b63ffffffff9590951660c0840152505060e001529695505050505050565b60006020828403121561222357600080fd5b815180151581146118d857600080fd5b818103818111156118b6576118b6611ecc565b6000600160ff1b820161225b5761225b611ecc565b5060000390565b6000825160005b818110156122835760208186018101518583015201612269565b50600092019182525091905056fea2646970667358221220eb81f50790cdfe31a0e9540e1a4eb923e2d6e12d694bfb30a2f600bd984c910f64736f6c63430008140033

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.