ETH Price: $3,200.64 (+2.11%)

Contract

0xe10375734af5ff393F12898EF2B9CBEb43aa9166
 

Overview

ETH Balance

0.00072055690887079 ETH

ETH Value

$2.31 (@ $3,200.64/ETH)

Sponsored

Transaction Hash
Method
Block
From
To
Value
Play135122822024-07-13 21:09:118 hrs ago1720904951IN
0xe1037573...b43aa9166
0.00000138 ETH0.000000310.001005
Play135122692024-07-13 21:08:458 hrs ago1720904925IN
0xe1037573...b43aa9166
0.00000138 ETH0.000000310.001005
Play135122592024-07-13 21:08:258 hrs ago1720904905IN
0xe1037573...b43aa9166
0.00000138 ETH0.000000310.001005
Play135122432024-07-13 21:07:538 hrs ago1720904873IN
0xe1037573...b43aa9166
0.00000138 ETH0.000000310.001005
Play135122302024-07-13 21:07:278 hrs ago1720904847IN
0xe1037573...b43aa9166
0.00000138 ETH0.000000310.001005
Play135122182024-07-13 21:07:038 hrs ago1720904823IN
0xe1037573...b43aa9166
0.00000138 ETH0.000000310.001005
Play135122072024-07-13 21:06:418 hrs ago1720904801IN
0xe1037573...b43aa9166
0.00000138 ETH0.000000310.001005
Play135107162024-07-13 20:16:599 hrs ago1720901819IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135106972024-07-13 20:16:219 hrs ago1720901781IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135106802024-07-13 20:15:479 hrs ago1720901747IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135106652024-07-13 20:15:179 hrs ago1720901717IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135106522024-07-13 20:14:519 hrs ago1720901691IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135106362024-07-13 20:14:199 hrs ago1720901659IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135106232024-07-13 20:13:539 hrs ago1720901633IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135106102024-07-13 20:13:279 hrs ago1720901607IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135105972024-07-13 20:13:019 hrs ago1720901581IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135105842024-07-13 20:12:359 hrs ago1720901555IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135105732024-07-13 20:12:139 hrs ago1720901533IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play135104932024-07-13 20:09:339 hrs ago1720901373IN
0xe1037573...b43aa9166
0.00000138 ETH0.00000030.001005
Play134125822024-07-11 13:45:512 days ago1720705551IN
0xe1037573...b43aa9166
0.00000166 ETH0.000000310.001005
Play134125692024-07-11 13:45:252 days ago1720705525IN
0xe1037573...b43aa9166
0.00000166 ETH0.000000310.001005
Play134125562024-07-11 13:44:592 days ago1720705499IN
0xe1037573...b43aa9166
0.00000166 ETH0.000000310.001005
Play134125382024-07-11 13:44:232 days ago1720705463IN
0xe1037573...b43aa9166
0.00000166 ETH0.000000310.001005
Play133182782024-07-09 9:22:234 days ago1720516943IN
0xe1037573...b43aa9166
0.00000148 ETH0.000000310.001005
Play133182642024-07-09 9:21:554 days ago1720516915IN
0xe1037573...b43aa9166
0.00000148 ETH0.000000310.001005
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To Value
135122822024-07-13 21:09:118 hrs ago1720904951
0xe1037573...b43aa9166
0.00000023 ETH
135122692024-07-13 21:08:458 hrs ago1720904925
0xe1037573...b43aa9166
0.00000023 ETH
135122592024-07-13 21:08:258 hrs ago1720904905
0xe1037573...b43aa9166
0.00000023 ETH
135122432024-07-13 21:07:538 hrs ago1720904873
0xe1037573...b43aa9166
0.00000022 ETH
135122302024-07-13 21:07:278 hrs ago1720904847
0xe1037573...b43aa9166
0.00000023 ETH
135122182024-07-13 21:07:038 hrs ago1720904823
0xe1037573...b43aa9166
0.00000023 ETH
135122072024-07-13 21:06:418 hrs ago1720904801
0xe1037573...b43aa9166
0.00000023 ETH
135107162024-07-13 20:16:599 hrs ago1720901819
0xe1037573...b43aa9166
0.00000022 ETH
135106972024-07-13 20:16:219 hrs ago1720901781
0xe1037573...b43aa9166
0.00000022 ETH
135106802024-07-13 20:15:479 hrs ago1720901747
0xe1037573...b43aa9166
0.00000022 ETH
135106652024-07-13 20:15:179 hrs ago1720901717
0xe1037573...b43aa9166
0.00000022 ETH
135106522024-07-13 20:14:519 hrs ago1720901691
0xe1037573...b43aa9166
0.00000021 ETH
135106362024-07-13 20:14:199 hrs ago1720901659
0xe1037573...b43aa9166
0.00000022 ETH
135106232024-07-13 20:13:539 hrs ago1720901633
0xe1037573...b43aa9166
0.00000021 ETH
135106102024-07-13 20:13:279 hrs ago1720901607
0xe1037573...b43aa9166
0.00000022 ETH
135105972024-07-13 20:13:019 hrs ago1720901581
0xe1037573...b43aa9166
0.00000022 ETH
135105842024-07-13 20:12:359 hrs ago1720901555
0xe1037573...b43aa9166
0.00000022 ETH
135105732024-07-13 20:12:139 hrs ago1720901533
0xe1037573...b43aa9166
0.00000022 ETH
135104932024-07-13 20:09:339 hrs ago1720901373
0xe1037573...b43aa9166
0.00000023 ETH
134125822024-07-11 13:45:512 days ago1720705551
0xe1037573...b43aa9166
0.00000025 ETH
134125692024-07-11 13:45:252 days ago1720705525
0xe1037573...b43aa9166
0.00000027 ETH
134125562024-07-11 13:44:592 days ago1720705499
0xe1037573...b43aa9166
0.00000029 ETH
134125382024-07-11 13:44:232 days ago1720705463
0xe1037573...b43aa9166
0.00000027 ETH
133182782024-07-09 9:22:234 days ago1720516943
0xe1037573...b43aa9166
0.00000027 ETH
133182642024-07-09 9:21:554 days ago1720516915
0xe1037573...b43aa9166
0.00000028 ETH
View All Internal Transactions

Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ZapankiCanRaceKroma

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

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

import "./common/ZapankiGamesKroma.sol";

contract ZapankiCanRaceKroma is ZapankiGamesKroma {
    using SafeERC20 for IERC20;

    struct CanRaceGame {
        uint256 wager;
        uint256 vrfId;
        address tokenAddress;
        uint64 blockNumber;
        uint8 pickedCanId;
    }

    mapping(address => CanRaceGame) canRaceGames;
    mapping(uint256 => address) vrfPendingPlayer;

    mapping(uint8 => uint64) public canMultipliers;

    event CanRaceFulfilled(
        address indexed playerAddress,
        uint256 wager,
        uint256 payout,
        address tokenAddress,
        uint8 winnerCanId,
        uint64 multiplier,
        uint256 l2eAmount
    );
    event CanRaceRefund(address indexed player, uint256 wager, address tokenAddress);

    constructor(
        address _vrfCoordinator,
        IBankroll _bankroll,
        address _trustedForwarder,
        address _vrfDepositor
    ) ZapankiGamesKroma(_vrfCoordinator, _bankroll, _trustedForwarder, _vrfDepositor) {
        canMultipliers[1] = 19600;
        canMultipliers[2] = 29600;
        canMultipliers[3] = 79600;
        canMultipliers[4] = 149600;
        canMultipliers[5] = 599600;
    }

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

    function getMultipliers() external view returns (uint64[5] memory multipliers) {
        for (uint8 i = 1; i < 5; i++) {
            multipliers[i - 1] = canMultipliers[i];
        }
        return multipliers;
    }

    function getWinner(uint256 randomWord) internal pure returns (uint8 canId) {
        uint256 rand = randomWord % 10000;
        if (rand < 4800) {
            canId = 1;
        } else if (rand < 8000) {
            canId = 2;
        } else if (rand < 9200) {
            canId = 3;
        } else if (rand < 9840) {
            canId = 4;
        } else {
            canId = 5;
        }
    }

    function play(uint256 wager, address tokenAddress, uint8 pickedCanId) external payable nonReentrant {
        address msgSender = _msgSender();
        require(canRaceGames[msgSender].vrfId == 0, "Waiting VRF request");

        _checkMaxWager(wager, tokenAddress, pickedCanId);
        _processWager(tokenAddress, wager, 1100000, msgSender);
        uint256 id = _requestRandomWords(1);

        canRaceGames[msgSender] = CanRaceGame(wager, id, tokenAddress, uint64(block.number), pickedCanId);
        vrfPendingPlayer[id] = msgSender;

        callback.onPlay(4, msgSender, tokenAddress, wager, 1);
    }

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

        uint256 wager = game.wager;
        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 CanRaceRefund(msgSender, wager, tokenAddress);

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

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

        uint8 winnerCanId = getWinner(randomWords[0]);
        uint64 multiplier = canMultipliers[winnerCanId];
        bool isWon = winnerCanId == game.pickedCanId;

        uint64 userMultiplier;
        if (isWon) {
            payout += (game.wager * multiplier) / 10000;
            userMultiplier = multiplier;
        }
        _transferToBankroll(game.tokenAddress, game.wager);
        if (payout != 0) {
            _payoutBankrollToPlayer(playerAddress, payout, game.tokenAddress);
        }

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

        emit CanRaceFulfilled(
            playerAddress,
            game.wager,
            payout,
            game.tokenAddress,
            winnerCanId,
            userMultiplier,
            l2eAmount
        );

        callback.onEnd(4, playerAddress, game.tokenAddress, game.wager, 1, payout);

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

    function _checkMaxWager(uint256 wager, address tokenAddress, uint8 canId) internal view {
        uint256 balance;
        if (tokenAddress == address(0)) {
            balance = address(bankroll).balance;
        } else {
            balance = IERC20(tokenAddress).balanceOf(address(bankroll));
        }
        uint256 maxWager = (balance * (11000 - 10890)) / (canMultipliers[canId] - 10000);
        require(wager <= maxWager, "Too many wager");
    }
}

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

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.20;

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

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

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

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

pragma solidity ^0.8.20;

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

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

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

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

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

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

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

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

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

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

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

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

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.20;

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

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

    uint256 private _status;

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

    constructor() {
        _status = NOT_ENTERED;
    }

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

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

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

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

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

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

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

abstract contract ZapankiGamesKroma is ReentrancyGuard {
    using SafeERC20 for IERC20;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    function owner() external view returns (address);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_vrfCoordinator","type":"address"},{"internalType":"contract IBankroll","name":"_bankroll","type":"address"},{"internalType":"address","name":"_trustedForwarder","type":"address"},{"internalType":"address","name":"_vrfDepositor","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"playerAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"wager","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint8","name":"winnerCanId","type":"uint8"},{"indexed":false,"internalType":"uint64","name":"multiplier","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"l2eAmount","type":"uint256"}],"name":"CanRaceFulfilled","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":"CanRaceRefund","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":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"canMultipliers","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"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":"vrfId","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint64","name":"blockNumber","type":"uint64"},{"internalType":"uint8","name":"pickedCanId","type":"uint8"}],"internalType":"struct ZapankiCanRaceKroma.CanRaceGame","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMultipliers","outputs":[{"internalType":"uint64[5]","name":"multipliers","type":"uint64[5]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"gasAmount","type":"uint256"}],"name":"getVRFFee","outputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"wager","type":"uint256"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint8","name":"pickedCanId","type":"uint8"}],"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"}]

60806040523480156200001157600080fd5b5060405162001fac38038062001fac8339810160408190526200003491620001a0565b6001600081815581546001600160a01b039687166001600160a01b0319918216179092556003805495871695831686179055600480548316909517909455600580549386169382169390931783556002805495909216941693909317909255600b6020527f72c6bfb7988af3a1efa6568f02a999bc52252641c659d85961ca3d372b57d5cf80546001600160401b0319908116614c90179091557fa50eece07c7db1631545c0069bd8f5f54d5935e215d59097edf258a44ba91634805482166173a01790557f64c15cc42be7899b001f818cf4433057002112c418d1d3a67cd5cb453051d33e80548216620136f01790557f12d0c11577e2f0950f57c455c117796550b79f444811db8ba2f69c57b646c78480548216620248601790559190527febae6141bae5521e99e0a8d610356b0f501fea54980b59c84841db43ba7204f480549091166209263017905562000208565b6001600160a01b03811681146200019d57600080fd5b50565b60008060008060808587031215620001b757600080fd5b8451620001c48162000187565b6020860151909450620001d78162000187565b6040860151909350620001ea8162000187565b6060860151909250620001fd8162000187565b939692955090935050565b611d9480620002186000396000f3fe6080604052600436106100f35760003560e01c806379873f8a1161008a578063a3e56fa811610059578063a3e56fa81461037f578063a50ce2f71461039f578063acf341b6146103bf578063b897dcdf1461040d57600080fd5b806379873f8a146103075780637da0a8771461032957806380cfa527146103495780638bd161141461035f57600080fd5b8063572b6c05116100c6578063572b6c051461019a578063590e1ae3146101d957806374b0a789146101ee57806376fca03d1461020357600080fd5b8063083b2732146100f85780630c657eb0146101355780631fe543e3146101555780633371619414610177575b600080fd5b34801561010457600080fd5b50600454610118906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014157600080fd5b50600354610118906001600160a01b031681565b34801561016157600080fd5b506101756101703660046118de565b610420565b005b34801561018357600080fd5b5061018c601081565b60405190815260200161012c565b3480156101a657600080fd5b506101c96101b53660046119bc565b6005546001600160a01b0391821691161490565b604051901515815260200161012c565b3480156101e557600080fd5b50610175610445565b3480156101fa57600080fd5b506101756106a2565b34801561020f57600080fd5b506102b561021e3660046119bc565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152506001600160a01b03908116600090815260096020908152604091829020825160a081018452815481526001820154928101929092526002015492831691810191909152600160a01b82046001600160401b03166060820152600160e01b90910460ff16608082015290565b60405161012c919081518152602080830151908201526040808301516001600160a01b0316908201526060808301516001600160401b03169082015260809182015160ff169181019190915260a00190565b34801561031357600080fd5b5061031c61080d565b60405161012c91906119d9565b34801561033557600080fd5b50600554610118906001600160a01b031681565b34801561035557600080fd5b5061018c60075481565b34801561036b57600080fd5b5061018c61037a366004611a13565b610888565b34801561038b57600080fd5b50600154610118906001600160a01b031681565b3480156103ab57600080fd5b50600254610118906001600160a01b031681565b3480156103cb57600080fd5b506103f56103da366004611a42565b600b602052600090815260409020546001600160401b031681565b6040516001600160401b03909116815260200161012c565b61017561041b366004611a5d565b610b25565b6001546001600160a01b0316331461043757600080fd5b6104418282610d0c565b5050565b61044d611037565b6000610457611061565b6001600160a01b038116600090815260096020526040812060018101549293509190036104cb5760405162461bcd60e51b815260206004820152601760248201527f4e6f742077616974696e6720565246207265717565737400000000000000000060448201526064015b60405180910390fd5b600281015443906104ef906103e890600160a01b90046001600160401b0316611ab1565b6104fa90600a611ab1565b6001600160401b0316111561053d5760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b60448201526064016104c2565b805460028201546001600160a01b0316806105ed576000846001600160a01b03168360405160006040518083038185875af1925050503d806000811461059f576040519150601f19603f3d011682016040523d82523d6000602084013e6105a4565b606091505b50509050806105e75760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016104c2565b50610601565b6106016001600160a01b0382168584611088565b604080518381526001600160a01b0383811660208301528616917f9f0caed56b199598b34820b9d68a95056c977e8e33e4e887472d7b4d0d63a9d5910160405180910390a250506001908101546000908152600a6020908152604080832080546001600160a01b03191690556001600160a01b039490941682526009905291822082815580820183905560020180546001600160e81b03191690559055565b565b6106aa611037565b600360009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107219190611ad8565b6001600160a01b0316336001600160a01b03161461076d5760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b60448201526064016104c2565b60078054600091829055604051909190339083908381818185875af1925050503d80600081146107b9576040519150601f19603f3d011682016040523d82523d6000602084013e6107be565b606091505b50509050806108015760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b60448201526064016104c2565b50506106a06001600055565b6108156118aa565b60015b60058160ff1610156108845760ff81166000908152600b60205260409020546001600160401b03168261084c600184611af5565b60ff166005811061085f5761085f611b0e565b6001600160401b0390921660209290920201528061087c81611b24565b915050610818565b5090565b600080600f602160991b016001600160a01b031663519b4bd36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f49190611b43565b6010600f602160991b016001600160a01b031663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561093b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095f9190611b5c565b63ffffffff1661096f9190611b82565b6109799190611b82565b90506000600f602160991b016001600160a01b031663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e69190611b43565b600f602160991b016001600160a01b03166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4f9190611b5c565b63ffffffff16610a5f9190611b82565b90506000600f602160991b016001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acc9190611b43565b610ad790600a611c7d565b610ae2906010611b82565b610aec8385611c89565b610af890611a2c611b82565b610b029190611cb2565b905080610b1286620f433c611b82565b610b1c9190611c89565b95945050505050565b610b2d611037565b6000610b37611061565b6001600160a01b03811660009081526009602052604090206001015490915015610b995760405162461bcd60e51b815260206004820152601360248201527215d85a5d1a5b99c8159491881c995c5d595cdd606a1b60448201526064016104c2565b610ba48484846110e7565b610bb383856210c8e08461120c565b6000610bbf600161135c565b6040805160a08101825287815260208082018481526001600160a01b038981168486018181526001600160401b034381166060880190815260ff8d811660808a019081528d8716600081815260098b528c81209b518c5598516001808d019190915595516002909b01805494519251909316600160e01b0260ff60e01b1992909516600160a01b026001600160e01b03199094169a88169a909a179290921791909116919091179055878452600a9094529185902080546001600160a01b031916851790556004805495516327ffe84360e01b81528082019190915260248101949094526044840191909152606483018a905260848301919091529293509116906327ffe8439060a401600060405180830381600087803b158015610ce357600080fd5b505af1158015610cf7573d6000803e3d6000fd5b505050505050610d076001600055565b505050565b6000828152600a60205260409020546001600160a01b031680610d2e57505050565b6001600160a01b03811660009081526009602052604090206002810154610d68906103e890600160a01b90046001600160401b0316611ab1565b6001600160401b0316431115610d7e5750505050565b600080610da485600081518110610d9757610d97611b0e565b602002602001015161142e565b60ff8082166000818152600b602052604081205460028801549495506001600160401b031693600160e01b900490921614908115610e1057855461271090610df6906001600160401b03861690611b82565b610e009190611cb2565b610e0a9086611c89565b94508290505b60028601548654610e2a916001600160a01b031690611496565b8415610e4b576002860154610e4b90889087906001600160a01b0316611551565b6003546002870154875460405160016292610160e01b031981526001600160a01b038b811660048301529283166024820152604481019190915260648101889052600092919091169063ff6d9eff906084016020604051808303816000875af1158015610ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee09190611b43565b8754600289015460408051928352602083018a90526001600160a01b039182168382015260ff891660608401526001600160401b038616608084015260a08301849052519293508a16917f36648f0b22ced55099f7a92d8bebe2cbdc8d20eb9eaf808b7fbaef93df4a20749181900360c00190a2600480546002890154895460405163e2382aa160e01b8152808501949094526001600160a01b038c81166024860152918216604485015260648401526001608484015260a48301899052169063e2382aa19060c401600060405180830381600087803b158015610fc357600080fd5b505af1158015610fd7573d6000803e3d6000fd5b50505060009a8b525050600a60209081526040808b2080546001600160a01b03191690556001600160a01b03989098168a52600990525050509285208581556001810195909555505050600290910180546001600160e81b031916905550565b60026000540361105a57604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6005546000906001600160a01b03163303611083575060131936013560601c90565b503390565b6040516001600160a01b03838116602483015260448201839052610d0791859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506115c4565b60006001600160a01b03831661110a57506003546001600160a01b03163161117b565b6003546040516370a0823160e01b81526001600160a01b039182166004820152908416906370a0823190602401602060405180830381865afa158015611154573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111789190611b43565b90505b60ff82166000908152600b60205260408120546111a490612710906001600160401b0316611cc6565b6001600160401b03166111b883606e611b82565b6111c29190611cb2565b9050808511156112055760405162461bcd60e51b815260206004820152600e60248201526d2a37b79036b0b73c903bb0b3b2b960911b60448201526064016104c2565b5050505050565b600354604051632ff5fe7360e21b81523060048201526001600160a01b0386811660248301529091169063bfd7f9cc90604401602060405180830381865afa15801561125c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112809190611ce6565b6112c15760405162461bcd60e51b8152602060048201526012602482015271151bdad95b881b9bdd08185c1c1c9bdd995960721b60448201526064016104c2565b826000036113115760405162461bcd60e51b815260206004820152601c60248201527f5761676572206d7573742062652067726561746572207468616e20300000000060448201526064016104c2565b6001600160a01b0384166113375761133261132c8434611d08565b83611627565b611356565b6113413483611627565b6113566001600160a01b0385168230866116a9565b50505050565b6001805460025460405163d291ba0960e01b815260806004820152602860848201527f72617746756c66696c6c52616e646f6d576f7264732875696e743235362c756960a4820152676e743235365b5d2960c01b60c482015260ff8516602482015260448101939093526001600160a01b03908116606484015260009291169063d291ba099060e4016020604051808303816000875af1158015611404573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114289190611b43565b92915050565b60008061143d61271084611d1b565b90506112c08110156114525760019150611490565b611f408110156114655760029150611490565b6123f08110156114785760039150611490565b61267081101561148b5760049150611490565b600591505b50919050565b6001600160a01b038216611537576003546040516000916001600160a01b03169083908381818185875af1925050503d80600081146114f1576040519150601f19603f3d011682016040523d82523d6000602084013e6114f6565b606091505b5050905080610d075760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016104c2565b600354610441906001600160a01b03848116911683611088565b6003546040516336012f6160e11b81526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b1580156115a757600080fd5b505af11580156115bb573d6000803e3d6000fd5b50505050505050565b60006115d96001600160a01b038416836116e2565b905080516000141580156115fe5750808060200190518101906115fc9190611ce6565b155b15610d0757604051635274afe760e01b81526001600160a01b03841660048201526024016104c2565b600061163282610888565b90508083101561167b5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207672662066656560601b60448201526064016104c2565b61168d6116888285611d08565b6116f7565b806007600082825461169f9190611c89565b9091555050505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526113569186918216906323b872dd906084016110b5565b60606116f083836000611788565b9392505050565b801561178557604051600090339083908381818185875af1925050503d806000811461173f576040519150601f19603f3d011682016040523d82523d6000602084013e611744565b606091505b50509050806104415760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016104c2565b50565b6060814710156117ad5760405163cd78605960e01b81523060048201526024016104c2565b600080856001600160a01b031684866040516117c99190611d2f565b60006040518083038185875af1925050503d8060008114611806576040519150601f19603f3d011682016040523d82523d6000602084013e61180b565b606091505b509150915061181b868383611825565b9695505050505050565b60608261183a5761183582611881565b6116f0565b815115801561185157506001600160a01b0384163b155b1561187a57604051639996b31560e01b81526001600160a01b03851660048201526024016104c2565b50806116f0565b8051156118915780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518060a001604052806005906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156118f157600080fd5b823591506020808401356001600160401b038082111561191057600080fd5b818601915086601f83011261192457600080fd5b813581811115611936576119366118c8565b8060051b604051601f19603f8301168101818110858211171561195b5761195b6118c8565b60405291825284820192508381018501918983111561197957600080fd5b938501935b828510156119975784358452938501939285019261197e565b8096505050505050509250929050565b6001600160a01b038116811461178557600080fd5b6000602082840312156119ce57600080fd5b81356116f0816119a7565b60a08101818360005b6005811015611a0a5781516001600160401b03168352602092830192909101906001016119e2565b50505092915050565b600060208284031215611a2557600080fd5b5035919050565b803560ff81168114611a3d57600080fd5b919050565b600060208284031215611a5457600080fd5b6116f082611a2c565b600080600060608486031215611a7257600080fd5b833592506020840135611a84816119a7565b9150611a9260408501611a2c565b90509250925092565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115611ad157611ad1611a9b565b5092915050565b600060208284031215611aea57600080fd5b81516116f0816119a7565b60ff828116828216039081111561142857611428611a9b565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff8103611b3a57611b3a611a9b565b60010192915050565b600060208284031215611b5557600080fd5b5051919050565b600060208284031215611b6e57600080fd5b815163ffffffff811681146116f057600080fd5b808202811582820484141761142857611428611a9b565b600181815b80851115611bd4578160001904821115611bba57611bba611a9b565b80851615611bc757918102915b93841c9390800290611b9e565b509250929050565b600082611beb57506001611428565b81611bf857506000611428565b8160018114611c0e5760028114611c1857611c34565b6001915050611428565b60ff841115611c2957611c29611a9b565b50506001821b611428565b5060208310610133831016604e8410600b8410161715611c57575081810a611428565b611c618383611b99565b8060001904821115611c7557611c75611a9b565b029392505050565b60006116f08383611bdc565b8082018082111561142857611428611a9b565b634e487b7160e01b600052601260045260246000fd5b600082611cc157611cc1611c9c565b500490565b6001600160401b03828116828216039080821115611ad157611ad1611a9b565b600060208284031215611cf857600080fd5b815180151581146116f057600080fd5b8181038181111561142857611428611a9b565b600082611d2a57611d2a611c9c565b500690565b6000825160005b81811015611d505760208186018101518583015201611d36565b50600092019182525091905056fea2646970667358221220ed908454f953ad9f714c33fcba4e2e41c68852833043b4ff02d8fa7f8d3f80dd64736f6c63430008140033000000000000000000000000589b45f2c65796fc60b1b61802b10d7c7de86cc70000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c2120000000000000000000000004334b45b8eb99b68c37d75ccad4a1559b865c21200000000000000000000000027280e40b343995210ce79ca04000e753fa6d031

Deployed Bytecode

0x6080604052600436106100f35760003560e01c806379873f8a1161008a578063a3e56fa811610059578063a3e56fa81461037f578063a50ce2f71461039f578063acf341b6146103bf578063b897dcdf1461040d57600080fd5b806379873f8a146103075780637da0a8771461032957806380cfa527146103495780638bd161141461035f57600080fd5b8063572b6c05116100c6578063572b6c051461019a578063590e1ae3146101d957806374b0a789146101ee57806376fca03d1461020357600080fd5b8063083b2732146100f85780630c657eb0146101355780631fe543e3146101555780633371619414610177575b600080fd5b34801561010457600080fd5b50600454610118906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561014157600080fd5b50600354610118906001600160a01b031681565b34801561016157600080fd5b506101756101703660046118de565b610420565b005b34801561018357600080fd5b5061018c601081565b60405190815260200161012c565b3480156101a657600080fd5b506101c96101b53660046119bc565b6005546001600160a01b0391821691161490565b604051901515815260200161012c565b3480156101e557600080fd5b50610175610445565b3480156101fa57600080fd5b506101756106a2565b34801561020f57600080fd5b506102b561021e3660046119bc565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152506001600160a01b03908116600090815260096020908152604091829020825160a081018452815481526001820154928101929092526002015492831691810191909152600160a01b82046001600160401b03166060820152600160e01b90910460ff16608082015290565b60405161012c919081518152602080830151908201526040808301516001600160a01b0316908201526060808301516001600160401b03169082015260809182015160ff169181019190915260a00190565b34801561031357600080fd5b5061031c61080d565b60405161012c91906119d9565b34801561033557600080fd5b50600554610118906001600160a01b031681565b34801561035557600080fd5b5061018c60075481565b34801561036b57600080fd5b5061018c61037a366004611a13565b610888565b34801561038b57600080fd5b50600154610118906001600160a01b031681565b3480156103ab57600080fd5b50600254610118906001600160a01b031681565b3480156103cb57600080fd5b506103f56103da366004611a42565b600b602052600090815260409020546001600160401b031681565b6040516001600160401b03909116815260200161012c565b61017561041b366004611a5d565b610b25565b6001546001600160a01b0316331461043757600080fd5b6104418282610d0c565b5050565b61044d611037565b6000610457611061565b6001600160a01b038116600090815260096020526040812060018101549293509190036104cb5760405162461bcd60e51b815260206004820152601760248201527f4e6f742077616974696e6720565246207265717565737400000000000000000060448201526064015b60405180910390fd5b600281015443906104ef906103e890600160a01b90046001600160401b0316611ab1565b6104fa90600a611ab1565b6001600160401b0316111561053d5760405162461bcd60e51b8152602060048201526009602482015268546f6f206561726c7960b81b60448201526064016104c2565b805460028201546001600160a01b0316806105ed576000846001600160a01b03168360405160006040518083038185875af1925050503d806000811461059f576040519150601f19603f3d011682016040523d82523d6000602084013e6105a4565b606091505b50509050806105e75760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b60448201526064016104c2565b50610601565b6106016001600160a01b0382168584611088565b604080518381526001600160a01b0383811660208301528616917f9f0caed56b199598b34820b9d68a95056c977e8e33e4e887472d7b4d0d63a9d5910160405180910390a250506001908101546000908152600a6020908152604080832080546001600160a01b03191690556001600160a01b039490941682526009905291822082815580820183905560020180546001600160e81b03191690559055565b565b6106aa611037565b600360009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107219190611ad8565b6001600160a01b0316336001600160a01b03161461076d5760405162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b60448201526064016104c2565b60078054600091829055604051909190339083908381818185875af1925050503d80600081146107b9576040519150601f19603f3d011682016040523d82523d6000602084013e6107be565b606091505b50509050806108015760405162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b60448201526064016104c2565b50506106a06001600055565b6108156118aa565b60015b60058160ff1610156108845760ff81166000908152600b60205260409020546001600160401b03168261084c600184611af5565b60ff166005811061085f5761085f611b0e565b6001600160401b0390921660209290920201528061087c81611b24565b915050610818565b5090565b600080600f602160991b016001600160a01b031663519b4bd36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f49190611b43565b6010600f602160991b016001600160a01b031663c59859186040518163ffffffff1660e01b8152600401602060405180830381865afa15801561093b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095f9190611b5c565b63ffffffff1661096f9190611b82565b6109799190611b82565b90506000600f602160991b016001600160a01b031663f82061406040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e69190611b43565b600f602160991b016001600160a01b03166368d5dca66040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4f9190611b5c565b63ffffffff16610a5f9190611b82565b90506000600f602160991b016001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610acc9190611b43565b610ad790600a611c7d565b610ae2906010611b82565b610aec8385611c89565b610af890611a2c611b82565b610b029190611cb2565b905080610b1286620f433c611b82565b610b1c9190611c89565b95945050505050565b610b2d611037565b6000610b37611061565b6001600160a01b03811660009081526009602052604090206001015490915015610b995760405162461bcd60e51b815260206004820152601360248201527215d85a5d1a5b99c8159491881c995c5d595cdd606a1b60448201526064016104c2565b610ba48484846110e7565b610bb383856210c8e08461120c565b6000610bbf600161135c565b6040805160a08101825287815260208082018481526001600160a01b038981168486018181526001600160401b034381166060880190815260ff8d811660808a019081528d8716600081815260098b528c81209b518c5598516001808d019190915595516002909b01805494519251909316600160e01b0260ff60e01b1992909516600160a01b026001600160e01b03199094169a88169a909a179290921791909116919091179055878452600a9094529185902080546001600160a01b031916851790556004805495516327ffe84360e01b81528082019190915260248101949094526044840191909152606483018a905260848301919091529293509116906327ffe8439060a401600060405180830381600087803b158015610ce357600080fd5b505af1158015610cf7573d6000803e3d6000fd5b505050505050610d076001600055565b505050565b6000828152600a60205260409020546001600160a01b031680610d2e57505050565b6001600160a01b03811660009081526009602052604090206002810154610d68906103e890600160a01b90046001600160401b0316611ab1565b6001600160401b0316431115610d7e5750505050565b600080610da485600081518110610d9757610d97611b0e565b602002602001015161142e565b60ff8082166000818152600b602052604081205460028801549495506001600160401b031693600160e01b900490921614908115610e1057855461271090610df6906001600160401b03861690611b82565b610e009190611cb2565b610e0a9086611c89565b94508290505b60028601548654610e2a916001600160a01b031690611496565b8415610e4b576002860154610e4b90889087906001600160a01b0316611551565b6003546002870154875460405160016292610160e01b031981526001600160a01b038b811660048301529283166024820152604481019190915260648101889052600092919091169063ff6d9eff906084016020604051808303816000875af1158015610ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee09190611b43565b8754600289015460408051928352602083018a90526001600160a01b039182168382015260ff891660608401526001600160401b038616608084015260a08301849052519293508a16917f36648f0b22ced55099f7a92d8bebe2cbdc8d20eb9eaf808b7fbaef93df4a20749181900360c00190a2600480546002890154895460405163e2382aa160e01b8152808501949094526001600160a01b038c81166024860152918216604485015260648401526001608484015260a48301899052169063e2382aa19060c401600060405180830381600087803b158015610fc357600080fd5b505af1158015610fd7573d6000803e3d6000fd5b50505060009a8b525050600a60209081526040808b2080546001600160a01b03191690556001600160a01b03989098168a52600990525050509285208581556001810195909555505050600290910180546001600160e81b031916905550565b60026000540361105a57604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b6005546000906001600160a01b03163303611083575060131936013560601c90565b503390565b6040516001600160a01b03838116602483015260448201839052610d0791859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506115c4565b60006001600160a01b03831661110a57506003546001600160a01b03163161117b565b6003546040516370a0823160e01b81526001600160a01b039182166004820152908416906370a0823190602401602060405180830381865afa158015611154573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111789190611b43565b90505b60ff82166000908152600b60205260408120546111a490612710906001600160401b0316611cc6565b6001600160401b03166111b883606e611b82565b6111c29190611cb2565b9050808511156112055760405162461bcd60e51b815260206004820152600e60248201526d2a37b79036b0b73c903bb0b3b2b960911b60448201526064016104c2565b5050505050565b600354604051632ff5fe7360e21b81523060048201526001600160a01b0386811660248301529091169063bfd7f9cc90604401602060405180830381865afa15801561125c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112809190611ce6565b6112c15760405162461bcd60e51b8152602060048201526012602482015271151bdad95b881b9bdd08185c1c1c9bdd995960721b60448201526064016104c2565b826000036113115760405162461bcd60e51b815260206004820152601c60248201527f5761676572206d7573742062652067726561746572207468616e20300000000060448201526064016104c2565b6001600160a01b0384166113375761133261132c8434611d08565b83611627565b611356565b6113413483611627565b6113566001600160a01b0385168230866116a9565b50505050565b6001805460025460405163d291ba0960e01b815260806004820152602860848201527f72617746756c66696c6c52616e646f6d576f7264732875696e743235362c756960a4820152676e743235365b5d2960c01b60c482015260ff8516602482015260448101939093526001600160a01b03908116606484015260009291169063d291ba099060e4016020604051808303816000875af1158015611404573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114289190611b43565b92915050565b60008061143d61271084611d1b565b90506112c08110156114525760019150611490565b611f408110156114655760029150611490565b6123f08110156114785760039150611490565b61267081101561148b5760049150611490565b600591505b50919050565b6001600160a01b038216611537576003546040516000916001600160a01b03169083908381818185875af1925050503d80600081146114f1576040519150601f19603f3d011682016040523d82523d6000602084013e6114f6565b606091505b5050905080610d075760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016104c2565b600354610441906001600160a01b03848116911683611088565b6003546040516336012f6160e11b81526001600160a01b03858116600483015260248201859052838116604483015290911690636c025ec290606401600060405180830381600087803b1580156115a757600080fd5b505af11580156115bb573d6000803e3d6000fd5b50505050505050565b60006115d96001600160a01b038416836116e2565b905080516000141580156115fe5750808060200190518101906115fc9190611ce6565b155b15610d0757604051635274afe760e01b81526001600160a01b03841660048201526024016104c2565b600061163282610888565b90508083101561167b5760405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e74207672662066656560601b60448201526064016104c2565b61168d6116888285611d08565b6116f7565b806007600082825461169f9190611c89565b9091555050505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526113569186918216906323b872dd906084016110b5565b60606116f083836000611788565b9392505050565b801561178557604051600090339083908381818185875af1925050503d806000811461173f576040519150601f19603f3d011682016040523d82523d6000602084013e611744565b606091505b50509050806104415760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b60448201526064016104c2565b50565b6060814710156117ad5760405163cd78605960e01b81523060048201526024016104c2565b600080856001600160a01b031684866040516117c99190611d2f565b60006040518083038185875af1925050503d8060008114611806576040519150601f19603f3d011682016040523d82523d6000602084013e61180b565b606091505b509150915061181b868383611825565b9695505050505050565b60608261183a5761183582611881565b6116f0565b815115801561185157506001600160a01b0384163b155b1561187a57604051639996b31560e01b81526001600160a01b03851660048201526024016104c2565b50806116f0565b8051156118915780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518060a001604052806005906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156118f157600080fd5b823591506020808401356001600160401b038082111561191057600080fd5b818601915086601f83011261192457600080fd5b813581811115611936576119366118c8565b8060051b604051601f19603f8301168101818110858211171561195b5761195b6118c8565b60405291825284820192508381018501918983111561197957600080fd5b938501935b828510156119975784358452938501939285019261197e565b8096505050505050509250929050565b6001600160a01b038116811461178557600080fd5b6000602082840312156119ce57600080fd5b81356116f0816119a7565b60a08101818360005b6005811015611a0a5781516001600160401b03168352602092830192909101906001016119e2565b50505092915050565b600060208284031215611a2557600080fd5b5035919050565b803560ff81168114611a3d57600080fd5b919050565b600060208284031215611a5457600080fd5b6116f082611a2c565b600080600060608486031215611a7257600080fd5b833592506020840135611a84816119a7565b9150611a9260408501611a2c565b90509250925092565b634e487b7160e01b600052601160045260246000fd5b6001600160401b03818116838216019080821115611ad157611ad1611a9b565b5092915050565b600060208284031215611aea57600080fd5b81516116f0816119a7565b60ff828116828216039081111561142857611428611a9b565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff8103611b3a57611b3a611a9b565b60010192915050565b600060208284031215611b5557600080fd5b5051919050565b600060208284031215611b6e57600080fd5b815163ffffffff811681146116f057600080fd5b808202811582820484141761142857611428611a9b565b600181815b80851115611bd4578160001904821115611bba57611bba611a9b565b80851615611bc757918102915b93841c9390800290611b9e565b509250929050565b600082611beb57506001611428565b81611bf857506000611428565b8160018114611c0e5760028114611c1857611c34565b6001915050611428565b60ff841115611c2957611c29611a9b565b50506001821b611428565b5060208310610133831016604e8410600b8410161715611c57575081810a611428565b611c618383611b99565b8060001904821115611c7557611c75611a9b565b029392505050565b60006116f08383611bdc565b8082018082111561142857611428611a9b565b634e487b7160e01b600052601260045260246000fd5b600082611cc157611cc1611c9c565b500490565b6001600160401b03828116828216039080821115611ad157611ad1611a9b565b600060208284031215611cf857600080fd5b815180151581146116f057600080fd5b8181038181111561142857611428611a9b565b600082611d2a57611d2a611c9c565b500690565b6000825160005b81811015611d505760208186018101518583015201611d36565b50600092019182525091905056fea2646970667358221220ed908454f953ad9f714c33fcba4e2e41c68852833043b4ff02d8fa7f8d3f80dd64736f6c63430008140033

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.