ETH Price: $3,488.93 (-0.13%)

Contract

0x944C504f7eEab8586E47d6484A5dD95563b88b4E
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Sponsored

Transaction Hash
Method
Block
From
To
Value
Collect Vrf Fee115388112024-05-29 4:46:4924 days ago1716958009IN
0x944C504f...563b88b4E
0 ETH0.000000040.00100005
Play115182172024-05-28 17:20:2124 days ago1716916821IN
0x944C504f...563b88b4E
0.00009796 ETH0.000000340.001005
Play115181992024-05-28 17:19:4524 days ago1716916785IN
0x944C504f...563b88b4E
0.00009796 ETH0.000000350.001005
Play115181122024-05-28 17:16:5124 days ago1716916611IN
0x944C504f...563b88b4E
0.00009837 ETH0.000000340.001005
Play115180432024-05-28 17:14:3324 days ago1716916473IN
0x944C504f...563b88b4E
0.0001007 ETH0.000000340.001005
Play115061892024-05-28 10:39:2525 days ago1716892765IN
0x944C504f...563b88b4E
0.00009423 ETH0.000000340.001005
Play115061632024-05-28 10:38:3325 days ago1716892713IN
0x944C504f...563b88b4E
0.00009423 ETH0.000000340.001005
Play114439662024-05-27 0:05:1926 days ago1716768319IN
0x944C504f...563b88b4E
0.00002179 ETH0.000000350.00100525
Play114439512024-05-27 0:04:4926 days ago1716768289IN
0x944C504f...563b88b4E
0.00002253 ETH0.000000350.00100525
Play114439362024-05-27 0:04:1926 days ago1716768259IN
0x944C504f...563b88b4E
0.00002201 ETH0.000000350.00100525
Play114439222024-05-27 0:03:5126 days ago1716768231IN
0x944C504f...563b88b4E
0.0000245 ETH0.000000350.00100525
Play114439072024-05-27 0:03:2126 days ago1716768201IN
0x944C504f...563b88b4E
0.00002404 ETH0.000000350.00100525
Play114438912024-05-27 0:02:4926 days ago1716768169IN
0x944C504f...563b88b4E
0.0000244 ETH0.000000350.00100525
Play114438762024-05-27 0:02:1926 days ago1716768139IN
0x944C504f...563b88b4E
0.00002283 ETH0.000000350.00100525
Play114438522024-05-27 0:01:3126 days ago1716768091IN
0x944C504f...563b88b4E
0.00002224 ETH0.000000350.00100525
Play114438072024-05-27 0:00:0126 days ago1716768001IN
0x944C504f...563b88b4E
0.00002317 ETH0.000000350.00100525
Play114437072024-05-26 23:56:4126 days ago1716767801IN
0x944C504f...563b88b4E
0.00002676 ETH0.000000340.001005
Play114436952024-05-26 23:56:1726 days ago1716767777IN
0x944C504f...563b88b4E
0.00002295 ETH0.000000340.001005
Play114436882024-05-26 23:56:0326 days ago1716767763IN
0x944C504f...563b88b4E
0.00002295 ETH0.000000350.00100525
Play114436842024-05-26 23:55:5526 days ago1716767755IN
0x944C504f...563b88b4E
0.00002295 ETH0.000000340.001005
Play114436742024-05-26 23:55:3526 days ago1716767735IN
0x944C504f...563b88b4E
0.00002168 ETH0.000000350.00100525
Play114436672024-05-26 23:55:2126 days ago1716767721IN
0x944C504f...563b88b4E
0.00002421 ETH0.000000340.001005
Play114436612024-05-26 23:55:0926 days ago1716767709IN
0x944C504f...563b88b4E
0.00002457 ETH0.000000350.00100525
Play114436582024-05-26 23:55:0326 days ago1716767703IN
0x944C504f...563b88b4E
0.00002421 ETH0.000000340.001005
Play114436482024-05-26 23:54:4326 days ago1716767683IN
0x944C504f...563b88b4E
0.00002421 ETH0.000000340.001005
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
115388112024-05-29 4:46:4924 days ago1716958009
0x944C504f...563b88b4E
0.02046378 ETH
115182172024-05-28 17:20:2124 days ago1716916821
0x944C504f...563b88b4E
0.00001917 ETH
115181992024-05-28 17:19:4524 days ago1716916785
0x944C504f...563b88b4E
0.00001465 ETH
115181122024-05-28 17:16:5124 days ago1716916611
0x944C504f...563b88b4E
0.00001453 ETH
115180432024-05-28 17:14:3324 days ago1716916473
0x944C504f...563b88b4E
0.00001751 ETH
115061892024-05-28 10:39:2525 days ago1716892765
0x944C504f...563b88b4E
0.00001342 ETH
115061632024-05-28 10:38:3325 days ago1716892713
0x944C504f...563b88b4E
0.00001778 ETH
114439662024-05-27 0:05:1926 days ago1716768319
0x944C504f...563b88b4E
0.00000343 ETH
114439512024-05-27 0:04:4926 days ago1716768289
0x944C504f...563b88b4E
0.00000437 ETH
114439362024-05-27 0:04:1926 days ago1716768259
0x944C504f...563b88b4E
0.00000349 ETH
114439222024-05-27 0:03:5126 days ago1716768231
0x944C504f...563b88b4E
0.00000599 ETH
114439072024-05-27 0:03:2126 days ago1716768201
0x944C504f...563b88b4E
0.00000362 ETH
114438912024-05-27 0:02:4926 days ago1716768169
0x944C504f...563b88b4E
0.00000436 ETH
114438762024-05-27 0:02:1926 days ago1716768139
0x944C504f...563b88b4E
0.00000249 ETH
114438522024-05-27 0:01:3126 days ago1716768091
0x944C504f...563b88b4E
0.00000483 ETH
114438072024-05-27 0:00:0126 days ago1716768001
0x944C504f...563b88b4E
0.00000405 ETH
114437072024-05-26 23:56:4126 days ago1716767801
0x944C504f...563b88b4E
0.00000303 ETH
114436952024-05-26 23:56:1726 days ago1716767777
0x944C504f...563b88b4E
0.00000258 ETH
114436882024-05-26 23:56:0326 days ago1716767763
0x944C504f...563b88b4E
0.00000287 ETH
114436842024-05-26 23:55:5526 days ago1716767755
0x944C504f...563b88b4E
0.00000456 ETH
114436742024-05-26 23:55:3526 days ago1716767735
0x944C504f...563b88b4E
0.00000256 ETH
114436672024-05-26 23:55:2126 days ago1716767721
0x944C504f...563b88b4E
0.0000071 ETH
114436612024-05-26 23:55:0926 days ago1716767709
0x944C504f...563b88b4E
0.0000065 ETH
114436582024-05-26 23:55:0326 days ago1716767703
0x944C504f...563b88b4E
0.00000575 ETH
114436482024-05-26 23:54:4326 days ago1716767683
0x944C504f...563b88b4E
0.00000232 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ZapankiRangeKroma

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion, GNU GPLv3 license
File 1 of 10 : ZapankiRangeKroma.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;

import "./common/ZapankiGamesKroma.sol";

contract ZapankiRangeKroma is ZapankiGamesKroma {
    using SafeERC20 for IERC20;

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

    struct RangeGame {
        uint256 wager;
        uint256 stopGain;
        uint256 stopLoss;
        uint256 vrfId;
        address tokenAddress;
        uint64 blockNumber;
        uint32 numBets;
        uint32 multiplier;
        bool isOver;
    }

    mapping(address => RangeGame) rangeGames;
    mapping(uint256 => address) vrfPendingPlayer;
    struct RangeFulfilledData {
        address playerAddress;
        uint256 wager;
        uint256 payout;
        address tokenAddress;
        uint32 multiplier;
        bool isOver;
        uint256[] rangeOutcomes;
        uint256[] payouts;
        uint32 numGames;
        uint256 l2eAmount;
    }
    event RangeFulfilled(RangeFulfilledData eventData);
    event RangeRefund(address indexed player, uint256 wager, address tokenAddress);

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

    function play(
        uint256 wager,
        uint32 multiplier,
        address tokenAddress,
        bool isOver,
        uint32 numBets,
        uint256 stopGain,
        uint256 stopLoss
    ) external payable nonReentrant {
        address msgSender = _msgSender();
        require(10421 <= multiplier && multiplier <= 9900000, "Invalid multiplier");
        require(rangeGames[msgSender].vrfId == 0, "Waiting VRF request");
        require(0 < numBets && numBets <= 100, "Invalid numBets");

        _checkMaxWager(wager, tokenAddress, multiplier);
        _processWager(tokenAddress, wager * numBets, 1000000, msgSender);

        uint256 id = _requestRandomWords(numBets);

        rangeGames[msgSender] = RangeGame(
            wager,
            stopGain,
            stopLoss,
            id,
            tokenAddress,
            uint64(block.number),
            numBets,
            multiplier,
            isOver
        );
        vrfPendingPlayer[id] = msgSender;
    }

    /**
     * @dev Function to refund user in case of VRF request failling
     */
    function refund() external nonReentrant {
        address msgSender = _msgSender();
        RangeGame storage game = rangeGames[msgSender];
        require(rangeGames[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;

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

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

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

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

        uint256 winChance = 99000000000 / game.multiplier;
        uint256 numberToRollOver = 10000000 - winChance;
        uint256 gamePayout = (game.multiplier * game.wager) / 10000;

        address tokenAddress = game.tokenAddress;

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

            rangeOutcomes[gamePlayed] = randomWords[gamePlayed] % 10000000;
            if (rangeOutcomes[gamePlayed] >= numberToRollOver && game.isOver == true) {
                totalValue += int256(gamePayout - game.wager);
                payout += gamePayout;
                payouts[gamePlayed] = gamePayout;
                continue;
            }

            if (rangeOutcomes[gamePlayed] <= winChance && game.isOver == false) {
                totalValue += int256(gamePayout - game.wager);
                payout += gamePayout;
                payouts[gamePlayed] = gamePayout;
                continue;
            }

            totalValue -= int256(game.wager);
        }

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

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

        delete (vrfPendingPlayer[requestId]);
        uint256 totalWager = game.wager * game.numBets;
        uint256 l2eAmount = bankroll.payoutL2E(playerAddress, tokenAddress, totalWager, payout);

        RangeFulfilledData memory data = RangeFulfilledData(
            playerAddress,
            game.wager,
            payout,
            tokenAddress,
            game.multiplier,
            game.isOver,
            rangeOutcomes,
            payouts,
            gamePlayed,
            l2eAmount
        );

        emit RangeFulfilled(data);

        delete (rangeGames[playerAddress]);
    }

    /**
     * @dev calculates the maximum wager allowed based on the bankroll size
     */
    function _checkMaxWager(uint256 wager, address tokenAddress, uint256 multiplier) internal view {
        uint256 balance;
        if (tokenAddress == address(0)) {
            balance = address(bankroll).balance;
        } else {
            balance = IERC20(tokenAddress).balanceOf(address(bankroll));
        }
        uint256 maxWager = (balance * (11000 - 10890)) / (multiplier - 10000);
        require(wager <= maxWager, "Too many wager");
    }
}

File 2 of 10 : 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 10 : 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 10 : 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 10 : 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 10 : 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 10 : 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/IKromaGasPriceOracle.sol";

abstract contract ZapankiGamesKroma is ReentrancyGuard {
    using SafeERC20 for IERC20;

    IKromaGasPriceOracle private constant KROMA_GAS_ORACLE =
        IKromaGasPriceOracle(0x420000000000000000000000000000000000000F);

    ISupraRouter public vrfCoordinator;
    address public vrfDepositor;
    IBankroll public bankroll;
    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;
        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 _usedL1Gas = 6300 + KROMA_GAS_ORACLE.overhead();
        uint256 _l1GasFee = (KROMA_GAS_ORACLE.l1BaseFee() * _usedL1Gas * KROMA_GAS_ORACLE.scalar()) /
            10 ** (KROMA_GAS_ORACLE.DECIMALS());
        fee = (1000065 * 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 10 : 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 10 : IKromaGasPriceOracle.sol
interface IKromaGasPriceOracle {
    function l1BaseFee() external view returns (uint256);

    function overhead() external view returns (uint256);

    function scalar() external view returns (uint256);

    function DECIMALS() external view returns (uint256);
}

File 10 of 10 : 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":[{"components":[{"internalType":"address","name":"playerAddress","type":"address"},{"internalType":"uint256","name":"wager","type":"uint256"},{"internalType":"uint256","name":"payout","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint32","name":"multiplier","type":"uint32"},{"internalType":"bool","name":"isOver","type":"bool"},{"internalType":"uint256[]","name":"rangeOutcomes","type":"uint256[]"},{"internalType":"uint256[]","name":"payouts","type":"uint256[]"},{"internalType":"uint32","name":"numGames","type":"uint32"},{"internalType":"uint256","name":"l2eAmount","type":"uint256"}],"indexed":false,"internalType":"struct ZapankiRangeKroma.RangeFulfilledData","name":"eventData","type":"tuple"}],"name":"RangeFulfilled","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":"RangeRefund","type":"event"},{"inputs":[],"name":"bankroll","outputs":[{"internalType":"contract IBankroll","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":"uint32","name":"multiplier","type":"uint32"},{"internalType":"bool","name":"isOver","type":"bool"}],"internalType":"struct ZapankiRangeKroma.RangeGame","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":"uint32","name":"multiplier","type":"uint32"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"bool","name":"isOver","type":"bool"},{"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"}]

60806040523480156200001157600080fd5b50604051620021d5380380620021d58339810160408190526200003491620000a6565b6001600081905580546001600160a01b03199081166001600160a01b039687161790915560038054821694861694909417909355600480548416928516929092179091556002805490921692169190911790556200010e565b6001600160a01b0381168114620000a357600080fd5b50565b60008060008060808587031215620000bd57600080fd5b8451620000ca816200008d565b6020860151909450620000dd816200008d565b6040860151909350620000f0816200008d565b606086015190925062000103816200008d565b939692955090935050565b6120b7806200011e6000396000f3fe6080604052600436106100a75760003560e01c806376fca03d1161006457806376fca03d146101875780637da0a877146102a057806380cfa527146102c05780638bd16114146102e4578063a3e56fa814610304578063a50ce2f71461032457600080fd5b80630c657eb0146100ac5780631f330218146100e95780631fe543e3146100fe578063572b6c051461011e578063590e1ae31461015d57806374b0a78914610172575b600080fd5b3480156100b857600080fd5b506003546100cc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100fc6100f7366004611a51565b610344565b005b34801561010a57600080fd5b506100fc610119366004611adc565b61067b565b34801561012a57600080fd5b5061014d610139366004611ba5565b6004546001600160a01b0391821691161490565b60405190151581526020016100e0565b34801561016957600080fd5b506100fc6106a0565b34801561017e57600080fd5b506100fc61092f565b34801561019357600080fd5b506102936101a2366004611ba5565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810191909152506001600160a01b03908116600090815260086020908152604091829020825161012081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201549283166080820152600160a01b83046001600160401b031660a0820152600160e01b90920463ffffffff90811660c084015260059091015490811660e0830152640100000000900460ff16151561010082015290565b6040516100e09190611bc2565b3480156102ac57600080fd5b506004546100cc906001600160a01b031681565b3480156102cc57600080fd5b506102d660065481565b6040519081526020016100e0565b3480156102f057600080fd5b506102d66102ff366004611c59565b610a9a565b34801561031057600080fd5b506001546100cc906001600160a01b031681565b34801561033057600080fd5b506002546100cc906001600160a01b031681565b61034c610c9d565b6000610356610cc7565b90508663ffffffff166128b511158015610379575062970fe08763ffffffff1611155b6103bf5760405162461bcd60e51b815260206004820152601260248201527124b73b30b634b21036bab63a34b83634b2b960711b60448201526064015b60405180910390fd5b6001600160a01b0381166000908152600860205260409020600301541561041e5760405162461bcd60e51b815260206004820152601360248201527215d85a5d1a5b99c8159491881c995c5d595cdd606a1b60448201526064016103b6565b8363ffffffff16600010801561043b575060648463ffffffff1611155b6104795760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206e756d4265747360881b60448201526064016103b6565b61048a88878963ffffffff16610cee565b6104a88661049e63ffffffff87168b611c88565b620f424084610def565b60006104b385610f3f565b90506040518061012001604052808a8152602001858152602001848152602001828152602001886001600160a01b03168152602001436001600160401b031681526020018663ffffffff1681526020018963ffffffff16815260200187151581525060086000846001600160a01b03166001600160a01b031681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060a08201518160040160146101000a8154816001600160401b0302191690836001600160401b0316021790555060c082015181600401601c6101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160050160006101000a81548163ffffffff021916908363ffffffff1602179055506101008201518160050160046101000a81548160ff021916908315150217905550905050816009600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555050506106726001600055565b50505050505050565b6001546001600160a01b0316331461069257600080fd5b61069c8282611011565b5050565b6106a8610c9d565b60006106b2610cc7565b6001600160a01b038116600090815260086020526040812060038101549293509190036107215760405162461bcd60e51b815260206004820152601760248201527f4e6f742077616974696e6720565246207265717565737400000000000000000060448201526064016103b6565b60048101544390610745906103e890600160a01b90046001600160401b0316611c9f565b61075090600a611c9f565b6001600160401b031611156107935760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b60448201526064016103b6565b600481015481546000916107b591600160e01b90910463ffffffff1690611c88565b60048301549091506001600160a01b031680610866576000846001600160a01b03168360405160006040518083038185875af1925050503d8060008114610818576040519150601f19603f3d011682016040523d82523d6000602084013e61081d565b606091505b50509050806108605760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016103b6565b5061087a565b61087a6001600160a01b03821685846115a6565b604080518381526001600160a01b0383811660208301528616917f97708e28150f34c8526fef7a5eb506b2b08e2e667a559124edb8697980df604f910160405180910390a25050600390810154600090815260096020908152604080832080546001600160a01b03191690556001600160a01b039490941682526008905291822082815560018181018490556002820184905591810183905560048101839055600501805464ffffffffff191690559055565b565b610937610c9d565b600360009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ae9190611cc6565b6001600160a01b0316336001600160a01b0316146109fa5760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b60448201526064016103b6565b60068054600091829055604051909190339083908381818185875af1925050503d8060008114610a46576040519150601f19603f3d011682016040523d82523d6000602084013e610a4b565b606091505b5050905080610a8e5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b60448201526064016103b6565b505061092d6001600055565b600080600f602160991b016001600160a01b0316630c18c1626040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ae2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b069190611ce3565b610b129061189c611cfc565b90506000600f602160991b016001600160a01b0316632e0f26256040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7f9190611ce3565b610b8a90600a611df3565b600f602160991b016001600160a01b031663f45e65d86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf39190611ce3565b83600f602160991b016001600160a01b031663519b4bd36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5d9190611ce3565b610c679190611c88565b610c719190611c88565b610c7b9190611e15565b905080610c8b85620f4281611c88565b610c959190611cfc565b949350505050565b600260005403610cc057604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6004546000906001600160a01b03163303610ce9575060131936013560601c90565b503390565b60006001600160a01b038316610d1157506003546001600160a01b031631610d82565b6003546040516370a0823160e01b81526001600160a01b039182166004820152908416906370a0823190602401602060405180830381865afa158015610d5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7f9190611ce3565b90505b6000610d9061271084611e29565b610d9b83606e611c88565b610da59190611e15565b905080851115610de85760405162461bcd60e51b815260206004820152600e60248201526d2a37b79036b0b73c903bb0b3b2b960911b60448201526064016103b6565b5050505050565b600354604051632ff5fe7360e21b81523060048201526001600160a01b0386811660248301529091169063bfd7f9cc90604401602060405180830381865afa158015610e3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e639190611e3c565b610ea45760405162461bcd60e51b8152602060048201526012602482015271151bdad95b881b9bdd08185c1c1c9bdd995960721b60448201526064016103b6565b82600003610ef45760405162461bcd60e51b815260206004820152601c60248201527f5761676572206d7573742062652067726561746572207468616e20300000000060448201526064016103b6565b6001600160a01b038416610f1a57610f15610f0f8434611e29565b8361160a565b610f39565b610f24348361160a565b610f396001600160a01b03851682308661168c565b50505050565b6001805460025460405163d291ba0960e01b815260806004820152602860848201527f72617746756c66696c6c52616e646f6d576f7264732875696e743235362c756960a4820152676e743235365b5d2960c01b60c482015260ff8516602482015260448101939093526001600160a01b03908116606484015260009291169063d291ba099060e4016020604051808303816000875af1158015610fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100b9190611ce3565b92915050565b6000828152600960205260409020546001600160a01b03168061103357505050565b6001600160a01b0381166000908152600860205260409020600481015461106d906103e890600160a01b90046001600160401b0316611c9f565b6001600160401b03164311156110835750505050565b6004810154600090819081908190600160e01b900463ffffffff166001600160401b038111156110b5576110b5611ac6565b6040519080825280602002602001820160405280156110de578160200160208202803683370190505b506004860154909150600090600160e01b900463ffffffff166001600160401b0381111561110e5761110e611ac6565b604051908082528060200260200182016040528015611137578160200160208202803683370190505b5060058701549091506000906111589063ffffffff1664170cdc1e00611e59565b64ffffffffff16905060006111708262989680611e29565b885460058a0154919250600091612710916111909163ffffffff16611c88565b61119a9190611e15565b60048a0154600097509091506001600160a01b03165b60048a015463ffffffff600160e01b909104811690881610156113415789600101548912156113415789600201546111e790611e7d565b89131561134157629896808c8863ffffffff168151811061120a5761120a611e99565b602002602001015161121c9190611eaf565b868863ffffffff168151811061123457611234611e99565b60200260200101818152505082868863ffffffff168151811061125957611259611e99565b602002602001015110158015611280575060058a0154640100000000900460ff1615156001145b156112d35789546112919083611e29565b61129b908a611ec3565b98506112a78289611cfc565b975081858863ffffffff16815181106112c2576112c2611e99565b60200260200101818152505061132f565b83868863ffffffff16815181106112ec576112ec611e99565b60200260200101511115801561130f575060058a0154640100000000900460ff16155b156113205789546112919083611e29565b895461132c908a611ee3565b98505b8661133981611f03565b9750506111b0565b895460048b0154611360908990600160e01b900463ffffffff16611f26565b63ffffffff166113709190611c88565b61137a9089611cfc565b60048b01548b549199506113a79183916113a291600160e01b90910463ffffffff1690611c88565b6116c5565b87156113b8576113b88b8983611780565b60008d815260096020526040812080546001600160a01b031916905560048b01548b546113f291600160e01b900463ffffffff1690611c88565b60035460405160016292610160e01b031981526001600160a01b038f81166004830152858116602483015260448201849052606482018d90529293506000929091169063ff6d9eff906084016020604051808303816000875af115801561145d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114819190611ce3565b905060006040518061014001604052808f6001600160a01b031681526020018e6000015481526020018c8152602001856001600160a01b031681526020018e60050160009054906101000a900463ffffffff1663ffffffff1681526020018e60050160049054906101000a900460ff16151581526020018a81526020018981526020018b63ffffffff1681526020018381525090507f8796220875a792521dbd0c98d237f91e8d7f59f8a477af4d30995874aef93be8816040516115459190611f7e565b60405180910390a15050506001600160a01b03909a1660009081526008602052604081208181556001810182905560028101829055600381018290556004810191909155600501805464ffffffffff19169055505050505050505050505050565b6040516001600160a01b0383811660248301526044820183905261160591859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506117ea565b505050565b600061161582610a9a565b90508083101561165e5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207672662066656560601b60448201526064016103b6565b61167061166b8285611e29565b61184d565b80600660008282546116829190611cfc565b9091555050505050565b6040516001600160a01b038481166024830152838116604483015260648201839052610f399186918216906323b872dd906084016115d3565b6001600160a01b038216611766576003546040516000916001600160a01b03169083908381818185875af1925050503d8060008114611720576040519150601f19603f3d011682016040523d82523d6000602084013e611725565b606091505b50509050806116055760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016103b6565b60035461069c906001600160a01b038481169116836115a6565b6003546040516336012f6160e11b81526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b1580156117d657600080fd5b505af1158015610672573d6000803e3d6000fd5b60006117ff6001600160a01b038416836118de565b905080516000141580156118245750808060200190518101906118229190611e3c565b155b1561160557604051635274afe760e01b81526001600160a01b03841660048201526024016103b6565b80156118db57604051600090339083908381818185875af1925050503d8060008114611895576040519150601f19603f3d011682016040523d82523d6000602084013e61189a565b606091505b505090508061069c5760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016103b6565b50565b60606118ec838360006118f3565b9392505050565b6060814710156119185760405163cd78605960e01b81523060048201526024016103b6565b600080856001600160a01b031684866040516119349190612052565b60006040518083038185875af1925050503d8060008114611971576040519150601f19603f3d011682016040523d82523d6000602084013e611976565b606091505b5091509150611986868383611990565b9695505050505050565b6060826119a5576119a0826119ec565b6118ec565b81511580156119bc57506001600160a01b0384163b155b156119e557604051639996b31560e01b81526001600160a01b03851660048201526024016103b6565b50806118ec565b8051156119fc5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b803563ffffffff81168114611a2957600080fd5b919050565b6001600160a01b03811681146118db57600080fd5b80151581146118db57600080fd5b600080600080600080600060e0888a031215611a6c57600080fd5b87359650611a7c60208901611a15565b95506040880135611a8c81611a2e565b94506060880135611a9c81611a43565b9350611aaa60808901611a15565b925060a0880135915060c0880135905092959891949750929550565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215611aef57600080fd5b823591506020808401356001600160401b0380821115611b0e57600080fd5b818601915086601f830112611b2257600080fd5b813581811115611b3457611b34611ac6565b8060051b604051601f19603f83011681018181108582111715611b5957611b59611ac6565b604052918252848201925083810185019189831115611b7757600080fd5b938501935b82851015611b9557843584529385019392850192611b7c565b8096505050505050509250929050565b600060208284031215611bb757600080fd5b81356118ec81611a2e565b6000610120820190508251825260208301516020830152604083015160408301526060830151606083015260018060a01b0360808401511660808301526001600160401b0360a08401511660a083015260c0830151611c2960c084018263ffffffff169052565b5060e0830151611c4160e084018263ffffffff169052565b5061010083810151801515848301525b505092915050565b600060208284031215611c6b57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761100b5761100b611c72565b6001600160401b03818116838216019080821115611cbf57611cbf611c72565b5092915050565b600060208284031215611cd857600080fd5b81516118ec81611a2e565b600060208284031215611cf557600080fd5b5051919050565b8082018082111561100b5761100b611c72565b600181815b80851115611d4a578160001904821115611d3057611d30611c72565b80851615611d3d57918102915b93841c9390800290611d14565b509250929050565b600082611d615750600161100b565b81611d6e5750600061100b565b8160018114611d845760028114611d8e57611daa565b600191505061100b565b60ff841115611d9f57611d9f611c72565b50506001821b61100b565b5060208310610133831016604e8410600b8410161715611dcd575081810a61100b565b611dd78383611d0f565b8060001904821115611deb57611deb611c72565b029392505050565b60006118ec8383611d52565b634e487b7160e01b600052601260045260246000fd5b600082611e2457611e24611dff565b500490565b8181038181111561100b5761100b611c72565b600060208284031215611e4e57600080fd5b81516118ec81611a43565b600064ffffffffff80841680611e7157611e71611dff565b92169190910492915050565b6000600160ff1b8201611e9257611e92611c72565b5060000390565b634e487b7160e01b600052603260045260246000fd5b600082611ebe57611ebe611dff565b500690565b8082018281126000831280158216821582161715611c5157611c51611c72565b8181036000831280158383131683831282161715611cbf57611cbf611c72565b600063ffffffff808316818103611f1c57611f1c611c72565b6001019392505050565b63ffffffff828116828216039080821115611cbf57611cbf611c72565b600081518084526020808501945080840160005b83811015611f7357815187529582019590820190600101611f57565b509495945050505050565b60208152611f986020820183516001600160a01b03169052565b602082015160408201526040820151606082015260006060830151611fc860808401826001600160a01b03169052565b50608083015163ffffffff811660a08401525060a083015180151560c08401525060c08301516101408060e0850152612005610160850183611f43565b915060e0850151610100601f1986850301818701526120248483611f43565b9350808701519150506101206120418187018363ffffffff169052565b959095015193019290925250919050565b6000825160005b818110156120735760208186018101518583015201612059565b50600092019182525091905056fea26469706673582212204e69cebeac4d34010a79cd62fe0ebde31c57f417096382a2e5f8944fe546be8064736f6c63430008140033000000000000000000000000589b45f2c65796fc60b1b61802b10d7c7de86cc70000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c2120000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c21200000000000000000000000027280e40b343995210ce79ca04000e753fa6d031

Deployed Bytecode

0x6080604052600436106100a75760003560e01c806376fca03d1161006457806376fca03d146101875780637da0a877146102a057806380cfa527146102c05780638bd16114146102e4578063a3e56fa814610304578063a50ce2f71461032457600080fd5b80630c657eb0146100ac5780631f330218146100e95780631fe543e3146100fe578063572b6c051461011e578063590e1ae31461015d57806374b0a78914610172575b600080fd5b3480156100b857600080fd5b506003546100cc906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100fc6100f7366004611a51565b610344565b005b34801561010a57600080fd5b506100fc610119366004611adc565b61067b565b34801561012a57600080fd5b5061014d610139366004611ba5565b6004546001600160a01b0391821691161490565b60405190151581526020016100e0565b34801561016957600080fd5b506100fc6106a0565b34801561017e57600080fd5b506100fc61092f565b34801561019357600080fd5b506102936101a2366004611ba5565b6040805161012081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810191909152506001600160a01b03908116600090815260086020908152604091829020825161012081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201549283166080820152600160a01b83046001600160401b031660a0820152600160e01b90920463ffffffff90811660c084015260059091015490811660e0830152640100000000900460ff16151561010082015290565b6040516100e09190611bc2565b3480156102ac57600080fd5b506004546100cc906001600160a01b031681565b3480156102cc57600080fd5b506102d660065481565b6040519081526020016100e0565b3480156102f057600080fd5b506102d66102ff366004611c59565b610a9a565b34801561031057600080fd5b506001546100cc906001600160a01b031681565b34801561033057600080fd5b506002546100cc906001600160a01b031681565b61034c610c9d565b6000610356610cc7565b90508663ffffffff166128b511158015610379575062970fe08763ffffffff1611155b6103bf5760405162461bcd60e51b815260206004820152601260248201527124b73b30b634b21036bab63a34b83634b2b960711b60448201526064015b60405180910390fd5b6001600160a01b0381166000908152600860205260409020600301541561041e5760405162461bcd60e51b815260206004820152601360248201527215d85a5d1a5b99c8159491881c995c5d595cdd606a1b60448201526064016103b6565b8363ffffffff16600010801561043b575060648463ffffffff1611155b6104795760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206e756d4265747360881b60448201526064016103b6565b61048a88878963ffffffff16610cee565b6104a88661049e63ffffffff87168b611c88565b620f424084610def565b60006104b385610f3f565b90506040518061012001604052808a8152602001858152602001848152602001828152602001886001600160a01b03168152602001436001600160401b031681526020018663ffffffff1681526020018963ffffffff16815260200187151581525060086000846001600160a01b03166001600160a01b031681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060a08201518160040160146101000a8154816001600160401b0302191690836001600160401b0316021790555060c082015181600401601c6101000a81548163ffffffff021916908363ffffffff16021790555060e08201518160050160006101000a81548163ffffffff021916908363ffffffff1602179055506101008201518160050160046101000a81548160ff021916908315150217905550905050816009600083815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555050506106726001600055565b50505050505050565b6001546001600160a01b0316331461069257600080fd5b61069c8282611011565b5050565b6106a8610c9d565b60006106b2610cc7565b6001600160a01b038116600090815260086020526040812060038101549293509190036107215760405162461bcd60e51b815260206004820152601760248201527f4e6f742077616974696e6720565246207265717565737400000000000000000060448201526064016103b6565b60048101544390610745906103e890600160a01b90046001600160401b0316611c9f565b61075090600a611c9f565b6001600160401b031611156107935760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b60448201526064016103b6565b600481015481546000916107b591600160e01b90910463ffffffff1690611c88565b60048301549091506001600160a01b031680610866576000846001600160a01b03168360405160006040518083038185875af1925050503d8060008114610818576040519150601f19603f3d011682016040523d82523d6000602084013e61081d565b606091505b50509050806108605760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016103b6565b5061087a565b61087a6001600160a01b03821685846115a6565b604080518381526001600160a01b0383811660208301528616917f97708e28150f34c8526fef7a5eb506b2b08e2e667a559124edb8697980df604f910160405180910390a25050600390810154600090815260096020908152604080832080546001600160a01b03191690556001600160a01b039490941682526008905291822082815560018181018490556002820184905591810183905560048101839055600501805464ffffffffff191690559055565b565b610937610c9d565b600360009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ae9190611cc6565b6001600160a01b0316336001600160a01b0316146109fa5760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b60448201526064016103b6565b60068054600091829055604051909190339083908381818185875af1925050503d8060008114610a46576040519150601f19603f3d011682016040523d82523d6000602084013e610a4b565b606091505b5050905080610a8e5760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b60448201526064016103b6565b505061092d6001600055565b600080600f602160991b016001600160a01b0316630c18c1626040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ae2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b069190611ce3565b610b129061189c611cfc565b90506000600f602160991b016001600160a01b0316632e0f26256040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7f9190611ce3565b610b8a90600a611df3565b600f602160991b016001600160a01b031663f45e65d86040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf39190611ce3565b83600f602160991b016001600160a01b031663519b4bd36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5d9190611ce3565b610c679190611c88565b610c719190611c88565b610c7b9190611e15565b905080610c8b85620f4281611c88565b610c959190611cfc565b949350505050565b600260005403610cc057604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6004546000906001600160a01b03163303610ce9575060131936013560601c90565b503390565b60006001600160a01b038316610d1157506003546001600160a01b031631610d82565b6003546040516370a0823160e01b81526001600160a01b039182166004820152908416906370a0823190602401602060405180830381865afa158015610d5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7f9190611ce3565b90505b6000610d9061271084611e29565b610d9b83606e611c88565b610da59190611e15565b905080851115610de85760405162461bcd60e51b815260206004820152600e60248201526d2a37b79036b0b73c903bb0b3b2b960911b60448201526064016103b6565b5050505050565b600354604051632ff5fe7360e21b81523060048201526001600160a01b0386811660248301529091169063bfd7f9cc90604401602060405180830381865afa158015610e3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e639190611e3c565b610ea45760405162461bcd60e51b8152602060048201526012602482015271151bdad95b881b9bdd08185c1c1c9bdd995960721b60448201526064016103b6565b82600003610ef45760405162461bcd60e51b815260206004820152601c60248201527f5761676572206d7573742062652067726561746572207468616e20300000000060448201526064016103b6565b6001600160a01b038416610f1a57610f15610f0f8434611e29565b8361160a565b610f39565b610f24348361160a565b610f396001600160a01b03851682308661168c565b50505050565b6001805460025460405163d291ba0960e01b815260806004820152602860848201527f72617746756c66696c6c52616e646f6d576f7264732875696e743235362c756960a4820152676e743235365b5d2960c01b60c482015260ff8516602482015260448101939093526001600160a01b03908116606484015260009291169063d291ba099060e4016020604051808303816000875af1158015610fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100b9190611ce3565b92915050565b6000828152600960205260409020546001600160a01b03168061103357505050565b6001600160a01b0381166000908152600860205260409020600481015461106d906103e890600160a01b90046001600160401b0316611c9f565b6001600160401b03164311156110835750505050565b6004810154600090819081908190600160e01b900463ffffffff166001600160401b038111156110b5576110b5611ac6565b6040519080825280602002602001820160405280156110de578160200160208202803683370190505b506004860154909150600090600160e01b900463ffffffff166001600160401b0381111561110e5761110e611ac6565b604051908082528060200260200182016040528015611137578160200160208202803683370190505b5060058701549091506000906111589063ffffffff1664170cdc1e00611e59565b64ffffffffff16905060006111708262989680611e29565b885460058a0154919250600091612710916111909163ffffffff16611c88565b61119a9190611e15565b60048a0154600097509091506001600160a01b03165b60048a015463ffffffff600160e01b909104811690881610156113415789600101548912156113415789600201546111e790611e7d565b89131561134157629896808c8863ffffffff168151811061120a5761120a611e99565b602002602001015161121c9190611eaf565b868863ffffffff168151811061123457611234611e99565b60200260200101818152505082868863ffffffff168151811061125957611259611e99565b602002602001015110158015611280575060058a0154640100000000900460ff1615156001145b156112d35789546112919083611e29565b61129b908a611ec3565b98506112a78289611cfc565b975081858863ffffffff16815181106112c2576112c2611e99565b60200260200101818152505061132f565b83868863ffffffff16815181106112ec576112ec611e99565b60200260200101511115801561130f575060058a0154640100000000900460ff16155b156113205789546112919083611e29565b895461132c908a611ee3565b98505b8661133981611f03565b9750506111b0565b895460048b0154611360908990600160e01b900463ffffffff16611f26565b63ffffffff166113709190611c88565b61137a9089611cfc565b60048b01548b549199506113a79183916113a291600160e01b90910463ffffffff1690611c88565b6116c5565b87156113b8576113b88b8983611780565b60008d815260096020526040812080546001600160a01b031916905560048b01548b546113f291600160e01b900463ffffffff1690611c88565b60035460405160016292610160e01b031981526001600160a01b038f81166004830152858116602483015260448201849052606482018d90529293506000929091169063ff6d9eff906084016020604051808303816000875af115801561145d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114819190611ce3565b905060006040518061014001604052808f6001600160a01b031681526020018e6000015481526020018c8152602001856001600160a01b031681526020018e60050160009054906101000a900463ffffffff1663ffffffff1681526020018e60050160049054906101000a900460ff16151581526020018a81526020018981526020018b63ffffffff1681526020018381525090507f8796220875a792521dbd0c98d237f91e8d7f59f8a477af4d30995874aef93be8816040516115459190611f7e565b60405180910390a15050506001600160a01b03909a1660009081526008602052604081208181556001810182905560028101829055600381018290556004810191909155600501805464ffffffffff19169055505050505050505050505050565b6040516001600160a01b0383811660248301526044820183905261160591859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506117ea565b505050565b600061161582610a9a565b90508083101561165e5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207672662066656560601b60448201526064016103b6565b61167061166b8285611e29565b61184d565b80600660008282546116829190611cfc565b9091555050505050565b6040516001600160a01b038481166024830152838116604483015260648201839052610f399186918216906323b872dd906084016115d3565b6001600160a01b038216611766576003546040516000916001600160a01b03169083908381818185875af1925050503d8060008114611720576040519150601f19603f3d011682016040523d82523d6000602084013e611725565b606091505b50509050806116055760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016103b6565b60035461069c906001600160a01b038481169116836115a6565b6003546040516336012f6160e11b81526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b1580156117d657600080fd5b505af1158015610672573d6000803e3d6000fd5b60006117ff6001600160a01b038416836118de565b905080516000141580156118245750808060200190518101906118229190611e3c565b155b1561160557604051635274afe760e01b81526001600160a01b03841660048201526024016103b6565b80156118db57604051600090339083908381818185875af1925050503d8060008114611895576040519150601f19603f3d011682016040523d82523d6000602084013e61189a565b606091505b505090508061069c5760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016103b6565b50565b60606118ec838360006118f3565b9392505050565b6060814710156119185760405163cd78605960e01b81523060048201526024016103b6565b600080856001600160a01b031684866040516119349190612052565b60006040518083038185875af1925050503d8060008114611971576040519150601f19603f3d011682016040523d82523d6000602084013e611976565b606091505b5091509150611986868383611990565b9695505050505050565b6060826119a5576119a0826119ec565b6118ec565b81511580156119bc57506001600160a01b0384163b155b156119e557604051639996b31560e01b81526001600160a01b03851660048201526024016103b6565b50806118ec565b8051156119fc5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b803563ffffffff81168114611a2957600080fd5b919050565b6001600160a01b03811681146118db57600080fd5b80151581146118db57600080fd5b600080600080600080600060e0888a031215611a6c57600080fd5b87359650611a7c60208901611a15565b95506040880135611a8c81611a2e565b94506060880135611a9c81611a43565b9350611aaa60808901611a15565b925060a0880135915060c0880135905092959891949750929550565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215611aef57600080fd5b823591506020808401356001600160401b0380821115611b0e57600080fd5b818601915086601f830112611b2257600080fd5b813581811115611b3457611b34611ac6565b8060051b604051601f19603f83011681018181108582111715611b5957611b59611ac6565b604052918252848201925083810185019189831115611b7757600080fd5b938501935b82851015611b9557843584529385019392850192611b7c565b8096505050505050509250929050565b600060208284031215611bb757600080fd5b81356118ec81611a2e565b6000610120820190508251825260208301516020830152604083015160408301526060830151606083015260018060a01b0360808401511660808301526001600160401b0360a08401511660a083015260c0830151611c2960c084018263ffffffff169052565b5060e0830151611c4160e084018263ffffffff169052565b5061010083810151801515848301525b505092915050565b600060208284031215611c6b57600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761100b5761100b611c72565b6001600160401b03818116838216019080821115611cbf57611cbf611c72565b5092915050565b600060208284031215611cd857600080fd5b81516118ec81611a2e565b600060208284031215611cf557600080fd5b5051919050565b8082018082111561100b5761100b611c72565b600181815b80851115611d4a578160001904821115611d3057611d30611c72565b80851615611d3d57918102915b93841c9390800290611d14565b509250929050565b600082611d615750600161100b565b81611d6e5750600061100b565b8160018114611d845760028114611d8e57611daa565b600191505061100b565b60ff841115611d9f57611d9f611c72565b50506001821b61100b565b5060208310610133831016604e8410600b8410161715611dcd575081810a61100b565b611dd78383611d0f565b8060001904821115611deb57611deb611c72565b029392505050565b60006118ec8383611d52565b634e487b7160e01b600052601260045260246000fd5b600082611e2457611e24611dff565b500490565b8181038181111561100b5761100b611c72565b600060208284031215611e4e57600080fd5b81516118ec81611a43565b600064ffffffffff80841680611e7157611e71611dff565b92169190910492915050565b6000600160ff1b8201611e9257611e92611c72565b5060000390565b634e487b7160e01b600052603260045260246000fd5b600082611ebe57611ebe611dff565b500690565b8082018281126000831280158216821582161715611c5157611c51611c72565b8181036000831280158383131683831282161715611cbf57611cbf611c72565b600063ffffffff808316818103611f1c57611f1c611c72565b6001019392505050565b63ffffffff828116828216039080821115611cbf57611cbf611c72565b600081518084526020808501945080840160005b83811015611f7357815187529582019590820190600101611f57565b509495945050505050565b60208152611f986020820183516001600160a01b03169052565b602082015160408201526040820151606082015260006060830151611fc860808401826001600160a01b03169052565b50608083015163ffffffff811660a08401525060a083015180151560c08401525060c08301516101408060e0850152612005610160850183611f43565b915060e0850151610100601f1986850301818701526120248483611f43565b9350808701519150506101206120418187018363ffffffff169052565b959095015193019290925250919050565b6000825160005b818110156120735760208186018101518583015201612059565b50600092019182525091905056fea26469706673582212204e69cebeac4d34010a79cd62fe0ebde31c57f417096382a2e5f8944fe546be8064736f6c63430008140033

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.