ETH Price: $3,396.84 (+0.81%)

Contract

0x3Dd348B8D7dDe0373E94e01B36B6F4885cdabdAa
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Start New Bet160717682022-11-28 23:27:23759 days ago1669678043IN
0x3Dd348B8...85cdabdAa
0 ETH0.0033030610.11779241
Start New Bet160717632022-11-28 23:26:23759 days ago1669677983IN
0x3Dd348B8...85cdabdAa
0 ETH0.0034333710.52158653
Start New Bet160717562022-11-28 23:24:59759 days ago1669677899IN
0x3Dd348B8...85cdabdAa
0 ETH0.00324239.92730514
Start New Bet160717502022-11-28 23:23:47759 days ago1669677827IN
0x3Dd348B8...85cdabdAa
0 ETH0.0035815510.42261165
Choose Winner160717302022-11-28 23:19:47759 days ago1669677587IN
0x3Dd348B8...85cdabdAa
0 ETH0.00066869.83568252
Choose Winner160717272022-11-28 23:19:11759 days ago1669677551IN
0x3Dd348B8...85cdabdAa
0 ETH0.0007697410.57679393
Choose Winner160717262022-11-28 23:18:59759 days ago1669677539IN
0x3Dd348B8...85cdabdAa
0 ETH0.0007772210.67957301
Choose Winner160717232022-11-28 23:18:23759 days ago1669677503IN
0x3Dd348B8...85cdabdAa
0 ETH0.0007009310.31324056
Choose Winner160717212022-11-28 23:17:59759 days ago1669677479IN
0x3Dd348B8...85cdabdAa
0 ETH0.0007016510.32371957
Start New Bet160631572022-11-27 18:37:11760 days ago1669574231IN
0x3Dd348B8...85cdabdAa
0 ETH0.0032989110.10209592
Start New Bet160631502022-11-27 18:35:47760 days ago1669574147IN
0x3Dd348B8...85cdabdAa
0 ETH0.0034312110.50532819
Start New Bet160631392022-11-27 18:33:35760 days ago1669574015IN
0x3Dd348B8...85cdabdAa
0 ETH0.0035435410.84845272
Start New Bet160631322022-11-27 18:32:11760 days ago1669573931IN
0x3Dd348B8...85cdabdAa
0 ETH0.0035330810.82000088
Start New Bet160631242022-11-27 18:30:35760 days ago1669573835IN
0x3Dd348B8...85cdabdAa
0 ETH0.0035303210.27568863
Withdraw Asset160631112022-11-27 18:27:59760 days ago1669573679IN
0x3Dd348B8...85cdabdAa
0 ETH0.0003482110.68185505
Choose Winner160631082022-11-27 18:27:23760 days ago1669573643IN
0x3Dd348B8...85cdabdAa
0 ETH0.000974710.32553099
Place Bet160570172022-11-26 22:03:35761 days ago1669500215IN
0x3Dd348B8...85cdabdAa
0.5 ETH0.0017894710.21872676
Choose Winner160569912022-11-26 21:58:23761 days ago1669499903IN
0x3Dd348B8...85cdabdAa
0 ETH0.0008463811.62985894
Choose Winner160569902022-11-26 21:58:11761 days ago1669499891IN
0x3Dd348B8...85cdabdAa
0 ETH0.0007611411.19901368
Choose Winner160569862022-11-26 21:57:23761 days ago1669499843IN
0x3Dd348B8...85cdabdAa
0 ETH0.00065159.58584653
Choose Winner160569842022-11-26 21:56:59761 days ago1669499819IN
0x3Dd348B8...85cdabdAa
0 ETH0.000704869.6853263
Start New Bet160569652022-11-26 21:53:11761 days ago1669499591IN
0x3Dd348B8...85cdabdAa
0 ETH0.0037240110.67267469
Start New Bet160519292022-11-26 4:59:23762 days ago1669438763IN
0x3Dd348B8...85cdabdAa
0 ETH0.0031839.7468176
Start New Bet160519202022-11-26 4:57:35762 days ago1669438655IN
0x3Dd348B8...85cdabdAa
0 ETH0.003129869.58653762
Start New Bet160519172022-11-26 4:56:59762 days ago1669438619IN
0x3Dd348B8...85cdabdAa
0 ETH0.0034484510.55617029
View all transactions

Latest 17 internal transactions

Advanced mode:
Parent Transaction Hash Block
From
To
160631112022-11-27 18:27:59760 days ago1669573679
0x3Dd348B8...85cdabdAa
0.16842222 ETH
160631082022-11-27 18:27:23760 days ago1669573643
0x3Dd348B8...85cdabdAa
0.4875 ETH
160459082022-11-25 8:48:59763 days ago1669366139
0x3Dd348B8...85cdabdAa
0.02925 ETH
160459042022-11-25 8:48:11763 days ago1669366091
0x3Dd348B8...85cdabdAa
0.01372222 ETH
160459042022-11-25 8:48:11763 days ago1669366091
0x3Dd348B8...85cdabdAa
0.01372222 ETH
160459042022-11-25 8:48:11763 days ago1669366091
0x3Dd348B8...85cdabdAa
0.021125 ETH
160459042022-11-25 8:48:11763 days ago1669366091
0x3Dd348B8...85cdabdAa
0.01408333 ETH
160459022022-11-25 8:47:47763 days ago1669366067
0x3Dd348B8...85cdabdAa
0.01425 ETH
160459022022-11-25 8:47:47763 days ago1669366067
0x3Dd348B8...85cdabdAa
0.02925 ETH
160459022022-11-25 8:47:47763 days ago1669366067
0x3Dd348B8...85cdabdAa
0.014625 ETH
160350362022-11-23 20:20:35764 days ago1669234835
0x3Dd348B8...85cdabdAa
0.02925 ETH
160350322022-11-23 20:19:47764 days ago1669234787
0x3Dd348B8...85cdabdAa
0.02925 ETH
160288512022-11-22 23:34:23765 days ago1669160063
0x3Dd348B8...85cdabdAa
0.00975 ETH
160134272022-11-20 19:51:11767 days ago1668973871
0x3Dd348B8...85cdabdAa
0.1872 ETH
160134272022-11-20 19:51:11767 days ago1668973871
0x3Dd348B8...85cdabdAa
0.0608 ETH
160134272022-11-20 19:51:11767 days ago1668973871
0x3Dd348B8...85cdabdAa
0.0608 ETH
160134272022-11-20 19:51:11767 days ago1668973871
0x3Dd348B8...85cdabdAa
0.312 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BettingPlatform

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion
File 1 of 10 : BettingPlatform.sol
// SPDX-License-Identifier: None
pragma solidity ^0.8.10;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IBettingPlatform.sol";
//import "hardhat/console.sol";

contract BettingPlatform is Ownable, IBettingPlatform {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    /// @notice The platform fee.
    uint16 public platformFee;

    /// @notice The mapping of betting pools.
    mapping(uint256 => BettingPool) private bettingPools;

    /// @notice The minimum amount that players bet.
    uint256 public minBetAmount;

    /// @notice PlayerBetInfo of players by bettingId
    /// @dev bettingId => player => betPlayer information.
    mapping(uint256 => mapping(address => PlayerBetInfo)) public playerInfos;

    /// @notice Bet player list by betting id and side id.
    /// @dev bettingId => sideId => betPlayer list.
    mapping(uint256 => mapping(uint256 => address[])) private betPlayers;

    /// @notice Token holding infos for discount.
    mapping(address => DiscountTokenInfo) public thresholdTokenInfos;

    /// @notice Betting Id.
    uint256 private bettingId;

    /// @notice Betting count that under betting.
    uint256 public placedBettingCnt;

    /// @notice Holding tokens for discount that added to platform.
    EnumerableSet.AddressSet private holdingTokens;

    constructor (
        uint256 minBetAmount_,
        uint16 platformFee_
    ) {
        minBetAmount = minBetAmount_;
        platformFee = platformFee_;
    }

    modifier onlyNoPlacedBetting() {
        require (placedBettingCnt == 0, "placed bettings exist.");
        _;
    }

    /// @inheritdoc	IBetAdminActions
    function updateBetCondition(
        uint256 bettingId_,
        string memory newBetCondition_
    ) external onlyOwner {
        require (bettingId_ < bettingId, "invalid betting id");
        BettingPool storage bettingPool = bettingPools[bettingId_];
        require (bettingPool.finished == false, "betting is finished");
        require (bettingPool.startTime > block.timestamp, "betting is already started");

        bettingPool.betConditionStr = newBetCondition_;
    }

    /// @inheritdoc	IBetAdminActions
    function updateBetConditionImg(
        uint256 bettingId_,
        string memory newBetConditionImg_
    ) external onlyOwner {
        require (bettingId_ < bettingId, "invalid betting id");
        BettingPool storage bettingPool = bettingPools[bettingId_];
        require (bettingPool.finished == false, "betting is finished");
        require (bettingPool.startTime > block.timestamp, "betting is already started");

        bettingPool.betConditionImg = newBetConditionImg_;
    }

    /// @inheritdoc	IBetAdminActions
    function updatePlatformFee(uint16 newFee_) external override onlyOwner onlyNoPlacedBetting {
        platformFee = newFee_;
        emit UpdatePlatfromFee(newFee_);
    }

    /// @inheritdoc IBetAdminActions
    function updateMinBetAmount(uint256 newMinAmount_) external override onlyOwner {
        minBetAmount = newMinAmount_;
        emit UpdateMinBetAmount(newMinAmount_);
    }

    /// @inheritdoc IBetAdminActions
    function updateHoldingToken(
        address tokenAddr_,
        DiscountTokenInfo memory discountTokenInfo_
    ) external override onlyOwner {
        thresholdTokenInfos[tokenAddr_] = discountTokenInfo_;
        if (holdingTokens.contains(tokenAddr_) == false) {
            holdingTokens.add(tokenAddr_);
        }
    }

    /// @inheritdoc IBettingPlatform
    function getHoldingTokens() external view override returns (address[] memory) {
        return holdingTokens.values();
    }

    /// @inheritdoc IBettingPlatform
    function getBetAmountBySide(uint256 bettingId_) external view override returns (BetAmountInfo[] memory) {
        require (bettingId_ < bettingId, "invalid betting Id");

        BettingPool storage bettingPool = bettingPools[bettingId_];
        uint256 sideCnt = bettingPool.betSides.length;
        BetAmountInfo[] memory bettingAmounts = new BetAmountInfo[](sideCnt);

        for (uint256 i = 0; i < sideCnt; i ++) {
            bettingAmounts[i] = BetAmountInfo({
                sideId: i,
                sideDescription: bettingPool.betSides[i],
                totalBetAmount: bettingPool.betedAmounts[i]
            });
        }

        return bettingAmounts;
    }

    /// @inheritdoc IBettingPlatform
    function getAllBettingList() external view override returns (BettingInfo[] memory) {
        BettingInfo[] memory bettings = new BettingInfo[](bettingId);

        if (bettingId == 0) {
            return bettings;
        }

        for (uint256 id = 0; id < bettingId; id ++) {
            BettingPool storage bettingPool = bettingPools[id];
            bettings[id] = BettingInfo({
                bettingId: id,
                startTime: bettingPool.startTime,
                endTime: bettingPool.endTime,
                winBetSideId: bettingPool.winBetSideId,
                finished: bettingPool.finished,
                betConditionStr: bettingPool.betConditionStr,
                betConditionImg: bettingPool.betConditionImg
            });
        }

        return bettings;
    }

    /// @inheritdoc IBettingPlatform
    function getPlacedBettingList() external view override returns (IBettingPool[] memory) {
        IBettingPool[] memory pools = new IBettingPool[](placedBettingCnt);

        if (placedBettingCnt == 0) {
            return pools;
        }

        uint256 index = 0;
        for (uint256 id = 0; id < bettingId; id ++) {
            BettingPool storage bettingPool = bettingPools[id];
            if (bettingPool.finished == false) {
                pools[index].bettingId = id;
                pools[index].startTime = bettingPool.startTime;
                pools[index].endTime = bettingPool.endTime;
                pools[index].betConditionStr = bettingPool.betConditionStr;
                pools[index].betConditionImg = bettingPool.betConditionImg;

                uint256 sideCnt = bettingPool.betSides.length;
                // pools[index].betSides = new string[](sideCnt);
                pools[index].betSides = new IBetSide[](sideCnt);

                for (uint256 sideId = 0; sideId < sideCnt; sideId ++) {
                    pools[index].betSides[sideId] = IBetSide({
                        betSideId: sideId,
                        betSide: bettingPool.betSides[sideId]
                    });
                }

                index ++;
            }
        }

        return pools;
    }

    /// @inheritdoc	IBetAdminActions
    function startNewBet(
        string memory betConditionStr_,
        string memory betConditionImg_,
        string[] memory betSides_,
        uint256 startTime_,
        uint256 endTime_
    ) external override onlyOwner {
        require (betSides_.length >= 2, "too small sides");
        require (startTime_ >= block.timestamp, "wrong start time");
        require (endTime_ > startTime_, "wrong end time");

        BettingPool storage bettingPool = bettingPools[bettingId];
        bettingPool.startTime = startTime_;
        bettingPool.endTime = endTime_;
        bettingPool.betConditionStr = betConditionStr_;
        bettingPool.betConditionImg = betConditionImg_;
        bettingPool.winBetSideId = -1;
        uint256 sideCnt = betSides_.length;
        
        bettingPool.betSides = new string[](sideCnt);
        bettingPool.betedAmounts = new uint256[](sideCnt);
        for (uint256 i = 0; i < sideCnt; i ++) {
            bettingPool.betSides[i] = betSides_[i];
        }

        bettingId ++;
        placedBettingCnt ++;

        emit StartNewBet(betConditionStr_, betConditionImg_, betSides_, startTime_, endTime_);
    }

    /// @inheritdoc	IBetAdminActions
    function stopBet(uint256 bettingId_) external override onlyOwner {
        require (bettingId_ < bettingId, "invalid bettingId");
        require (bettingPools[bettingId_].finished == false, "already finished");

        BettingPool storage bettingPool = bettingPools[bettingId_];
        // refund all asset to all players.
        uint256 sideCnt = bettingPool.betSides.length;
        for (uint256 sideId = 0; sideId < sideCnt; sideId ++) {
            uint256 playerCnt = betPlayers[bettingId_][sideId].length;
            for (uint256 playerId = 0; playerId < playerCnt; playerId ++) {
                address player = betPlayers[bettingId_][sideId][playerId];
                PlayerBetInfo memory playerInfo = playerInfos[bettingId_][player];
                payable(player).transfer(playerInfo.betAmount);
            }    
        }

        bettingPool.finished = true;
        placedBettingCnt --;
        emit StopBet(bettingId_);
    }

    /// @inheritdoc	IBetAdminActions
    function chooseWinner(
        uint256 bettingId_,
        uint256 sideId_
    ) external override onlyOwner {
        uint256 curTime = block.timestamp;
        require (bettingId_ < bettingId, "invalid bettingId");
        BettingPool storage bettingPool = bettingPools[bettingId_];
        require (bettingPool.finished == false, "already finished");
        require (curTime >= bettingPool.endTime, "betting is not finished");
        require (sideId_ < bettingPool.betSides.length, "invalid betting side");
        uint256 winSideAmount = bettingPool.betedAmounts[sideId_];
        uint256 rewardsAmount = bettingPool.totalBetAmount - winSideAmount;
        uint256 winnersCnt = betPlayers[bettingId_][sideId_].length;

        for (uint256 i = 0; i < winnersCnt; i ++) {
            address player = betPlayers[bettingId_][sideId_][i];
            PlayerBetInfo memory playerInfo = playerInfos[bettingId_][player];
            uint256 rewards = playerInfo.betAmount;
            rewards += (rewardsAmount * playerInfo.betAmount / winSideAmount);
            _giveRewards(playerInfo, player, rewards);
        }
        bettingPool.finished = true;
        bettingPool.winBetSideId = int256(sideId_);
        placedBettingCnt --;
        emit ChooseWinner(bettingId_, sideId_);
    }

    /// @inheritdoc	IBetAdminActions
    function withdrawAsset() external onlyOwner onlyNoPlacedBetting {
        uint256 balance = address(this).balance;
        if (balance == 0) return;
        payable(owner()).transfer(balance);
    }

    /// @inheritdoc IBettingPlatform
    function placeBet(
        uint256 bettingId_,
        uint256 sideId_,
        address holdingTokenAddr_
    ) external payable override {
        uint256 curTime = block.timestamp;
        uint256 betAmount = msg.value;
        address player = msg.sender;
        require (bettingId_ < bettingId, "invalid bettingId");
        BettingPool storage bettingPool = bettingPools[bettingId_];
        require (bettingPool.finished == false, "already finished");
        require (bettingPool.startTime <= curTime, "betting is not begun.");
        require (bettingPool.endTime > curTime, "betting time is over.");
        require (sideId_ < bettingPool.betSides.length, "invalid betting side");
        require (betAmount >= minBetAmount, "less than min amount");
        require (playerInfos[bettingId_][player].betAmount == 0, "already bet");

        betPlayers[bettingId_][sideId_].push(player);
        playerInfos[bettingId_][player] = PlayerBetInfo({
            holdingToken: holdingTokenAddr_,
            betAmount: betAmount,
            betSideId: sideId_
        });
        bettingPool.betedAmounts[sideId_] += betAmount;
        bettingPool.totalBetAmount += betAmount;

        emit PlaceBet(player, bettingId_, sideId_, betAmount);
    }

    receive() external payable {}

    /// @notice Give rewards took platform fee.
    /// @param player_ The address of a player that should receive rewards.
    /// @param amount_ The amount of rewards
    function _giveRewards(
        PlayerBetInfo memory playerInfo_,
        address player_,
        uint256 amount_
    ) internal {
        address token = playerInfo_.holdingToken;
        uint256 feeRate = platformFee;
        uint256 rewardsAmount = amount_;

        if (token != address(0)) {
            uint256 balance = IERC20(token).balanceOf(player_);
            DiscountTokenInfo memory discountTokenInfo = thresholdTokenInfos[token];
            if (balance >= discountTokenInfo.maxHoldCnt) {
                feeRate = feeRate * (1000 - discountTokenInfo.maxRakeDiscount) / 1000;
            } else if (balance >= discountTokenInfo.minHoldCnt) {
                feeRate = feeRate * (1000 - discountTokenInfo.minRakeDiscount) / 1000;
            }
        }

        uint256 fee = amount_ * feeRate / 1000;
        rewardsAmount = amount_ - fee;

        payable(player_).transfer(rewardsAmount);
    }
}

File 2 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 10 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @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.
 */
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].
     */
    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 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` 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 amount
    ) external returns (bool);
}

File 5 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../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;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 6 of 10 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @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://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @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, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * 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.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @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`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage);
        }
    }
}

File 7 of 10 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 8 of 10 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 9 of 10 : IBetAdminActions.sol
// SPDX-License-Identifier: None
pragma solidity ^0.8.10;

interface IBetAdminActions {

    struct DiscountTokenInfo {
        uint16 minRakeDiscount;
        uint256 minHoldCnt;
        uint16 maxRakeDiscount;
        uint256 maxHoldCnt;
    }

    /// @notice Update platform fee.
    /// @param newFee_ New platform fee.
    function updatePlatformFee(uint16 newFee_) external;

    /// @notice Update minimum betting amount.
    /// @param newMinAmount_ New min amount for betting.
    function updateMinBetAmount(uint256 newMinAmount_) external;

    /// @notice Update bet condition
    /// @dev If betting is started, can't be called.
    /// @param bettingId_ The id of betting pool.
    /// @param newBetCondition_ The description of betting pool.
    function updateBetCondition(
        uint256 bettingId_,
        string memory newBetCondition_
    ) external;

    /// @notice Update bet img url.
    /// @dev If betting is started, can't be called.
    /// @param bettingId_ The id of betting pool.
    /// @param newBetConditionImg_ The new url of betting pool.
    function updateBetConditionImg(
        uint256 bettingId_,
        string memory newBetConditionImg_
    ) external;

    /// @notice Start new betting.
    /// @param betConditionStr_ The condition string for betting.
    /// @param betConditionImg_ The condition img url for betting.
    /// @param betSides_ Betting cases that users can bet to.
    /// @param startTime_ The timestamp of betting will starts.
    function startNewBet(
        string memory betConditionStr_,
        string memory betConditionImg_,
        string[] memory betSides_,
        uint256 startTime_,
        uint256 endTime_
    ) external;

    /// @notice Stop betting.
    /// @dev Refund all betting amounts to players without fee.
    /// @param bettingId_ The id of betting pool
    function stopBet(
        uint256 bettingId_
    ) external;

    /// @notice Input winner side.
    /// @dev Take fee and divide rewards to winner side.
    /// @param bettingId_ The id of betting pool
    /// @param sideId_ The id of bet sides.
    function chooseWinner(
        uint256 bettingId_,
        uint256 sideId_
    ) external;

    /// @notice withdraw fee amount and ETH.
    /// @dev this function can be call only after betting is finished.
    function withdrawAsset() external;

    function updateHoldingToken(
        address tokenAddr_,
        DiscountTokenInfo memory discountTokenInfo_
    ) external;

    event UpdatePlatformAsset(address indexed newAsset);

    event UpdatePlatfromFee(uint16 newFee);

    event UpdateMinBetAmount(uint256 newMinBetAmount);

    event StartNewBet(
        string betConditionStr,
        string betConditionImg,
        string[] betSides,
        uint256 startTime,
        uint256 endTime
    );

    event StopBet(uint256 bettingId);

    event ChooseWinner(uint256 bettingId, uint256 sideId);
}

File 10 of 10 : IBettingPlatform.sol
// SPDX-License-Identifier: None
pragma solidity ^0.8.10;

import "./IBetAdminActions.sol";

interface IBettingPlatform is IBetAdminActions {

    struct PlayerBetInfo {
        address holdingToken;
        uint256 betAmount;
        uint256 betSideId;
    }

    struct BettingPool {
        uint256 startTime;
        uint256 endTime;
        uint256 totalBetAmount;
        uint256[] betedAmounts;
        string[] betSides;
        string betConditionStr;
        string betConditionImg;
        int256 winBetSideId;
        bool finished;
    }

    struct BetAmountInfo {
        uint256 sideId;
        string sideDescription;
        uint256 totalBetAmount;
    }

    struct IBetSide {
        uint256 betSideId;
        string betSide;
    }

    struct IBettingPool {
        uint256 bettingId;
        uint256 startTime;
        uint256 endTime;
        IBetSide[] betSides;
        string betConditionStr;
        string betConditionImg;
    }

    struct BettingInfo {
        uint256 bettingId;
        uint256 startTime;
        uint256 endTime;
        int256 winBetSideId;
        bool finished;
        string betConditionStr;
        string betConditionImg;
    }

    /// @notice Let users bet to a betting side.
    /// @param bettingId_ Id of betting pool.
    /// @param sideId_ Id of betting sides.
    function placeBet(
        uint256 bettingId_,
        uint256 sideId_,
        address holdingTokenAddr_
    ) external payable;

    /// @notice Get information for placed betting pools.
    /// @return Information for placed betting pools.
    function getPlacedBettingList() external view returns (IBettingPool[] memory);

    /// @notice Get information for all betting pools.
    /// @return Information for all betting pools.
    function getAllBettingList() external view returns (BettingInfo[] memory);

    /// @notice Get information about betting amount by bettingId.
    /// @param bettingId_ The Id of betting.
    function getBetAmountBySide(uint256 bettingId_) external view returns (BetAmountInfo[] memory);

    /// @notice Get holding token list that added to Betting Platform.
    function getHoldingTokens() external view returns (address[] memory);

    event PlaceBet(address indexed player, uint256 bettingId, uint256 sideId, uint256 betAmount);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 2000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"minBetAmount_","type":"uint256"},{"internalType":"uint16","name":"platformFee_","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"bettingId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sideId","type":"uint256"}],"name":"ChooseWinner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"bettingId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sideId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"betAmount","type":"uint256"}],"name":"PlaceBet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"betConditionStr","type":"string"},{"indexed":false,"internalType":"string","name":"betConditionImg","type":"string"},{"indexed":false,"internalType":"string[]","name":"betSides","type":"string[]"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"StartNewBet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"bettingId","type":"uint256"}],"name":"StopBet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinBetAmount","type":"uint256"}],"name":"UpdateMinBetAmount","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAsset","type":"address"}],"name":"UpdatePlatformAsset","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"newFee","type":"uint16"}],"name":"UpdatePlatfromFee","type":"event"},{"inputs":[{"internalType":"uint256","name":"bettingId_","type":"uint256"},{"internalType":"uint256","name":"sideId_","type":"uint256"}],"name":"chooseWinner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllBettingList","outputs":[{"components":[{"internalType":"uint256","name":"bettingId","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"int256","name":"winBetSideId","type":"int256"},{"internalType":"bool","name":"finished","type":"bool"},{"internalType":"string","name":"betConditionStr","type":"string"},{"internalType":"string","name":"betConditionImg","type":"string"}],"internalType":"struct IBettingPlatform.BettingInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"bettingId_","type":"uint256"}],"name":"getBetAmountBySide","outputs":[{"components":[{"internalType":"uint256","name":"sideId","type":"uint256"},{"internalType":"string","name":"sideDescription","type":"string"},{"internalType":"uint256","name":"totalBetAmount","type":"uint256"}],"internalType":"struct IBettingPlatform.BetAmountInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getHoldingTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPlacedBettingList","outputs":[{"components":[{"internalType":"uint256","name":"bettingId","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"components":[{"internalType":"uint256","name":"betSideId","type":"uint256"},{"internalType":"string","name":"betSide","type":"string"}],"internalType":"struct IBettingPlatform.IBetSide[]","name":"betSides","type":"tuple[]"},{"internalType":"string","name":"betConditionStr","type":"string"},{"internalType":"string","name":"betConditionImg","type":"string"}],"internalType":"struct IBettingPlatform.IBettingPool[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minBetAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"bettingId_","type":"uint256"},{"internalType":"uint256","name":"sideId_","type":"uint256"},{"internalType":"address","name":"holdingTokenAddr_","type":"address"}],"name":"placeBet","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"placedBettingCnt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"playerInfos","outputs":[{"internalType":"address","name":"holdingToken","type":"address"},{"internalType":"uint256","name":"betAmount","type":"uint256"},{"internalType":"uint256","name":"betSideId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"betConditionStr_","type":"string"},{"internalType":"string","name":"betConditionImg_","type":"string"},{"internalType":"string[]","name":"betSides_","type":"string[]"},{"internalType":"uint256","name":"startTime_","type":"uint256"},{"internalType":"uint256","name":"endTime_","type":"uint256"}],"name":"startNewBet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bettingId_","type":"uint256"}],"name":"stopBet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"thresholdTokenInfos","outputs":[{"internalType":"uint16","name":"minRakeDiscount","type":"uint16"},{"internalType":"uint256","name":"minHoldCnt","type":"uint256"},{"internalType":"uint16","name":"maxRakeDiscount","type":"uint16"},{"internalType":"uint256","name":"maxHoldCnt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bettingId_","type":"uint256"},{"internalType":"string","name":"newBetCondition_","type":"string"}],"name":"updateBetCondition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bettingId_","type":"uint256"},{"internalType":"string","name":"newBetConditionImg_","type":"string"}],"name":"updateBetConditionImg","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddr_","type":"address"},{"components":[{"internalType":"uint16","name":"minRakeDiscount","type":"uint16"},{"internalType":"uint256","name":"minHoldCnt","type":"uint256"},{"internalType":"uint16","name":"maxRakeDiscount","type":"uint16"},{"internalType":"uint256","name":"maxHoldCnt","type":"uint256"}],"internalType":"struct IBetAdminActions.DiscountTokenInfo","name":"discountTokenInfo_","type":"tuple"}],"name":"updateHoldingToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinAmount_","type":"uint256"}],"name":"updateMinBetAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"newFee_","type":"uint16"}],"name":"updatePlatformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b5060405162002e1738038062002e178339810160408190526200003491620000bb565b6200003f336200006b565b6002919091556000805461ffff909216600160a01b0261ffff60a01b19909216919091179055620000f4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060408385031215620000cf57600080fd5b82519150602083015161ffff81168114620000e957600080fd5b809150509250929050565b612d1380620001046000396000f3fe6080604052600436106101795760003560e01c80638da5cb5b116100cb578063b73bf4561161007f578063f2fde38b11610059578063f2fde38b146104bf578063f56f4a5d146104df578063fa968eea146104ff57600080fd5b8063b73bf45614610414578063d259a76d14610434578063d43526791461044957600080fd5b8063a0f545ca116100b0578063a0f545ca146103b2578063afb06952146103d4578063b0187d34146103f457600080fd5b80638da5cb5b1461030f5780639615f5ce1461033757600080fd5b80633fba23a81161012d578063620993151161010757806362099315146102b8578063715018a6146102da57806379504fc3146102ef57600080fd5b80633fba23a81461024b5780634cc1879b14610278578063588ee1241461029857600080fd5b8063150ffcf51161015e578063150ffcf5146101c357806326232a2e146101e5578063274c199a1461022b57600080fd5b80630204b01b14610185578063078cdb311461019a57600080fd5b3661018057005b600080fd5b610198610193366004612478565b610515565b005b3480156101a657600080fd5b506101b060075481565b6040519081526020015b60405180910390f35b3480156101cf57600080fd5b506101d861093d565b6040516101ba91906124fa565b3480156101f157600080fd5b506000546102189074010000000000000000000000000000000000000000900461ffff1681565b60405161ffff90911681526020016101ba565b34801561023757600080fd5b506101986102463660046126e5565b610d8e565b34801561025757600080fd5b5061026b61026636600461272c565b610eb5565b6040516101ba9190612745565b34801561028457600080fd5b506101986102933660046127c6565b6110b3565b3480156102a457600080fd5b506101986102b33660046128e0565b61139a565b3480156102c457600080fd5b506102cd61167d565b6040516101ba9190612902565b3480156102e657600080fd5b5061019861168e565b3480156102fb57600080fd5b5061019861030a366004612961565b6116a2565b34801561031b57600080fd5b506000546040516001600160a01b0390911681526020016101ba565b34801561034357600080fd5b506103826103523660046129f5565b600560205260009081526040902080546001820154600283015460039093015461ffff9283169391929091169084565b6040516101ba949392919061ffff9485168152602081019390935292166040820152606081019190915260800190565b3480156103be57600080fd5b506103c7611740565b6040516101ba9190612a10565b3480156103e057600080fd5b506101986103ef366004612ac1565b61199e565b34801561040057600080fd5b5061019861040f3660046126e5565b611a78565b34801561042057600080fd5b5061019861042f36600461272c565b611b99565b34801561044057600080fd5b50610198611bd6565b34801561045557600080fd5b5061049a610464366004612adc565b60036020908152600092835260408084209091529082529020805460018201546002909201546001600160a01b03909116919083565b604080516001600160a01b0390941684526020840192909252908201526060016101ba565b3480156104cb57600080fd5b506101986104da3660046129f5565b611c70565b3480156104eb57600080fd5b506101986104fa36600461272c565b611d00565b34801561050b57600080fd5b506101b060025481565b60065442903490339086106105715760405162461bcd60e51b815260206004820152601160248201527f696e76616c69642062657474696e67496400000000000000000000000000000060448201526064015b60405180910390fd5b6000868152600160205260409020600881015460ff16156105d45760405162461bcd60e51b815260206004820152601060248201527f616c72656164792066696e6973686564000000000000000000000000000000006044820152606401610568565b80548410156106255760405162461bcd60e51b815260206004820152601560248201527f62657474696e67206973206e6f7420626567756e2e00000000000000000000006044820152606401610568565b838160010154116106785760405162461bcd60e51b815260206004820152601560248201527f62657474696e672074696d65206973206f7665722e00000000000000000000006044820152606401610568565b600481015486106106cb5760405162461bcd60e51b815260206004820152601460248201527f696e76616c69642062657474696e6720736964650000000000000000000000006044820152606401610568565b60025483101561071d5760405162461bcd60e51b815260206004820152601460248201527f6c657373207468616e206d696e20616d6f756e740000000000000000000000006044820152606401610568565b60008781526003602090815260408083206001600160a01b0386168452909152902060010154156107905760405162461bcd60e51b815260206004820152600b60248201527f616c7265616479206265740000000000000000000000000000000000000000006044820152606401610568565b600460008881526020019081526020016000206000878152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b031602179055506040518060600160405280866001600160a01b0316815260200184815260200187815250600360008981526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015560408201518160020155905050828160030187815481106108af576108af612b08565b9060005260206000200160008282546108c89190612b34565b92505081905550828160020160008282546108e39190612b34565b909155505060408051888152602081018890529081018490526001600160a01b038316907f62e36d9623f0e28977755e3a539c09d94432b633419cd6b0ea789b4fbc23eade9060600160405180910390a250505050505050565b6060600060075467ffffffffffffffff81111561095c5761095c61262e565b6040519080825280602002602001820160405280156109c657816020015b6109b36040518060c001604052806000815260200160008152602001600081526020016060815260200160608152602001606081525090565b81526020019060019003908161097a5790505b509050600754600014156109d957919050565b6000805b600654811015610d86576000818152600160205260409020600881015460ff16610d735781848481518110610a1457610a14612b08565b60209081029190910101515280548451859085908110610a3657610a36612b08565b602002602001015160200181815250508060010154848481518110610a5d57610a5d612b08565b60200260200101516040018181525050806005018054610a7c90612b4c565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa890612b4c565b8015610af55780601f10610aca57610100808354040283529160200191610af5565b820191906000526020600020905b815481529060010190602001808311610ad857829003601f168201915b5050505050848481518110610b0c57610b0c612b08565b602002602001015160800181905250806006018054610b2a90612b4c565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5690612b4c565b8015610ba35780601f10610b7857610100808354040283529160200191610ba3565b820191906000526020600020905b815481529060010190602001808311610b8657829003601f168201915b5050505050848481518110610bba57610bba612b08565b602090810291909101015160a0015260048101548067ffffffffffffffff811115610be757610be761262e565b604051908082528060200260200182016040528015610c2d57816020015b604080518082019091526000815260606020820152815260200190600190039081610c055790505b50858581518110610c4057610c40612b08565b60200260200101516060018190525060005b81811015610d63576040518060400160405280828152602001846004018381548110610c8057610c80612b08565b906000526020600020018054610c9590612b4c565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc190612b4c565b8015610d0e5780601f10610ce357610100808354040283529160200191610d0e565b820191906000526020600020905b815481529060010190602001808311610cf157829003601f168201915b5050505050815250868681518110610d2857610d28612b08565b6020026020010151606001518281518110610d4557610d45612b08565b60200260200101819052508080610d5b90612b81565b915050610c52565b5083610d6e81612b81565b945050505b5080610d7e81612b81565b9150506109dd565b509092915050565b610d96611f2f565b6006548210610de75760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642062657474696e6720696400000000000000000000000000006044820152606401610568565b6000828152600160205260409020600881015460ff1615610e4a5760405162461bcd60e51b815260206004820152601360248201527f62657474696e672069732066696e6973686564000000000000000000000000006044820152606401610568565b80544210610e9a5760405162461bcd60e51b815260206004820152601a60248201527f62657474696e6720697320616c726561647920737461727465640000000000006044820152606401610568565b8151610eaf90600683019060208501906122d9565b50505050565b60606006548210610f085760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642062657474696e6720496400000000000000000000000000006044820152606401610568565b6000828152600160205260408120600481015490918167ffffffffffffffff811115610f3657610f3661262e565b604051908082528060200260200182016040528015610f8b57816020015b610f7860405180606001604052806000815260200160608152602001600081525090565b815260200190600190039081610f545790505b50905060005b828110156110aa576040518060600160405280828152602001856004018381548110610fbf57610fbf612b08565b906000526020600020018054610fd490612b4c565b80601f016020809104026020016040519081016040528092919081815260200182805461100090612b4c565b801561104d5780601f106110225761010080835404028352916020019161104d565b820191906000526020600020905b81548152906001019060200180831161103057829003601f168201915b5050505050815260200185600301838154811061106c5761106c612b08565b906000526020600020015481525082828151811061108c5761108c612b08565b602002602001018190525080806110a290612b81565b915050610f91565b50949350505050565b6110bb611f2f565b60028351101561110d5760405162461bcd60e51b815260206004820152600f60248201527f746f6f20736d616c6c20736964657300000000000000000000000000000000006044820152606401610568565b4282101561115d5760405162461bcd60e51b815260206004820152601060248201527f77726f6e672073746172742074696d65000000000000000000000000000000006044820152606401610568565b8181116111ac5760405162461bcd60e51b815260206004820152600e60248201527f77726f6e6720656e642074696d650000000000000000000000000000000000006044820152606401610568565b6006546000908152600160208181526040909220848155908101839055865190916111de9160058401918901906122d9565b5084516111f490600683019060208801906122d9565b50600019600782015583518067ffffffffffffffff8111156112185761121861262e565b60405190808252806020026020018201604052801561124b57816020015b60608152602001906001900390816112365790505b50805161126291600485019160209091019061235d565b508067ffffffffffffffff81111561127c5761127c61262e565b6040519080825280602002602001820160405280156112a5578160200160208202803683370190505b5080516112bc9160038501916020909101906123b6565b5060005b81811015611327578581815181106112da576112da612b08565b60200260200101518360040182815481106112f7576112f7612b08565b9060005260206000200190805190602001906113149291906122d9565b508061131f81612b81565b9150506112c0565b506006805490600061133883612b81565b90915550506007805490600061134d83612b81565b91905055507fbeaa2d37fed63e82c9288b6af2146c7d941c95576697048d608521fe35890c398787878787604051611389959493929190612b9c565b60405180910390a150505050505050565b6113a2611f2f565b600654429083106113f55760405162461bcd60e51b815260206004820152601160248201527f696e76616c69642062657474696e6749640000000000000000000000000000006044820152606401610568565b6000838152600160205260409020600881015460ff16156114585760405162461bcd60e51b815260206004820152601060248201527f616c72656164792066696e6973686564000000000000000000000000000000006044820152606401610568565b80600101548210156114ac5760405162461bcd60e51b815260206004820152601760248201527f62657474696e67206973206e6f742066696e69736865640000000000000000006044820152606401610568565b600481015483106114ff5760405162461bcd60e51b815260206004820152601460248201527f696e76616c69642062657474696e6720736964650000000000000000000000006044820152606401610568565b600081600301848154811061151657611516612b08565b9060005260206000200154905060008183600201546115359190612c32565b60008781526004602090815260408083208984529091528120549192505b8181101561161c5760008881526004602090815260408083208a8452909152812080548390811061158657611586612b08565b60009182526020808320909101548b83526003825260408084206001600160a01b039283168086529084529381902081516060810183528154909316835260018101549383018490526002015490820152919250866115e58288612c49565b6115ef9190612c68565b6115f99082612b34565b9050611606828483611f89565b505050808061161490612b81565b915050611553565b5060088401805460ff191660011790556007808501879055805490600061164283612c8a565b909155505060408051888152602081018890527f152a13473cd551e9f47e193f0321e1a9c735d01dd04aed9af1fb6c1472658c529101611389565b60606116896008612176565b905090565b611696611f2f565b6116a0600061218a565b565b6116aa611f2f565b6001600160a01b038216600090815260056020908152604091829020835181547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090811661ffff928316178355928501516001830155928401516002820180549093169316929092179055606082015160039091015561172b6008836121f2565b61173c5761173a600883612219565b505b5050565b6060600060065467ffffffffffffffff81111561175f5761175f61262e565b6040519080825280602002602001820160405280156117d257816020015b6117bf6040518060e001604052806000815260200160008152602001600081526020016000815260200160001515815260200160608152602001606081525090565b81526020019060019003908161177d5790505b509050600654600014156117e557919050565b60005b60065481101561199857600081815260016020818152604092839020835160e081018552858152815492810192909252918201549281019290925260078101546060830152600881015460ff161515608083015260058101805491929160a08301919061185490612b4c565b80601f016020809104026020016040519081016040528092919081815260200182805461188090612b4c565b80156118cd5780601f106118a2576101008083540402835291602001916118cd565b820191906000526020600020905b8154815290600101906020018083116118b057829003601f168201915b505050505081526020018260060180546118e690612b4c565b80601f016020809104026020016040519081016040528092919081815260200182805461191290612b4c565b801561195f5780601f106119345761010080835404028352916020019161195f565b820191906000526020600020905b81548152906001019060200180831161194257829003601f168201915b505050505081525083838151811061197957611979612b08565b602002602001018190525050808061199090612b81565b9150506117e8565b50919050565b6119a6611f2f565b600754156119f65760405162461bcd60e51b815260206004820152601660248201527f706c616365642062657474696e67732065786973742e000000000000000000006044820152606401610568565b600080547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000061ffff8416908102919091179091556040519081527f0eb246bd5ded6e7f2b90da02cb479fb3fc79b6b1d188297c97865aed59d6e323906020015b60405180910390a150565b611a80611f2f565b6006548210611ad15760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642062657474696e6720696400000000000000000000000000006044820152606401610568565b6000828152600160205260409020600881015460ff1615611b345760405162461bcd60e51b815260206004820152601360248201527f62657474696e672069732066696e6973686564000000000000000000000000006044820152606401610568565b80544210611b845760405162461bcd60e51b815260206004820152601a60248201527f62657474696e6720697320616c726561647920737461727465640000000000006044820152606401610568565b8151610eaf90600583019060208501906122d9565b611ba1611f2f565b60028190556040518181527ff3038c9ffaea5bdfb87940148d3069fc8665e2ddd1f1ec057d9943932713a10c90602001611a6d565b611bde611f2f565b60075415611c2e5760405162461bcd60e51b815260206004820152601660248201527f706c616365642062657474696e67732065786973742e000000000000000000006044820152606401610568565b4780611c375750565b600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505015801561173c573d6000803e3d6000fd5b611c78611f2f565b6001600160a01b038116611cf45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610568565b611cfd8161218a565b50565b611d08611f2f565b6006548110611d595760405162461bcd60e51b815260206004820152601160248201527f696e76616c69642062657474696e6749640000000000000000000000000000006044820152606401610568565b60008181526001602052604090206008015460ff1615611dbb5760405162461bcd60e51b815260206004820152601060248201527f616c72656164792066696e6973686564000000000000000000000000000000006044820152606401610568565b6000818152600160205260408120600481015490915b81811015611ed2576000848152600460209081526040808320848452909152812054905b81811015611ebd5760008681526004602090815260408083208684529091528120805483908110611e2857611e28612b08565b60009182526020808320909101548983526003825260408084206001600160a01b039283168086529084528185208251606081018452815490941684526001810154948401859052600201548383015290519094509092849280156108fc02929091818181858888f19350505050158015611ea7573d6000803e3d6000fd5b5050508080611eb590612b81565b915050611df5565b50508080611eca90612b81565b915050611dd1565b5060088201805460ff1916600117905560078054906000611ef283612c8a565b90915550506040518381527ff534fba2380cfaeb828ffebbd40e968f778b87216f4364566db43e8bb5fd825f9060200160405180910390a1505050565b6000546001600160a01b031633146116a05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610568565b825160005474010000000000000000000000000000000000000000900461ffff16826001600160a01b0383161561210e576040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152600091908516906370a0823190602401602060405180830381865afa15801561201d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120419190612ca1565b6001600160a01b0385166000908152600560209081526040918290208251608081018452815461ffff9081168252600183015493820193909352600282015490921692820192909252600390910154606082018190529192509082106120d5576103e881604001516103e86120b69190612cba565b6120c49061ffff1686612c49565b6120ce9190612c68565b935061210b565b8060200151821061210b5780516103e8906120f09082612cba565b6120fe9061ffff1686612c49565b6121089190612c68565b93505b50505b60006103e861211d8487612c49565b6121279190612c68565b90506121338186612c32565b6040519092506001600160a01b0387169083156108fc029084906000818181858888f1935050505015801561216c573d6000803e3d6000fd5b5050505050505050565b606060006121838361222e565b9392505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116600090815260018301602052604081205415155b90505b92915050565b6000612210836001600160a01b03841661228a565b60608160000180548060200260200160405190810160405280929190818152602001828054801561227e57602002820191906000526020600020905b81548152602001906001019080831161226a575b50505050509050919050565b60008181526001830160205260408120546122d157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155612213565b506000612213565b8280546122e590612b4c565b90600052602060002090601f016020900481019282612307576000855561234d565b82601f1061232057805160ff191683800117855561234d565b8280016001018555821561234d579182015b8281111561234d578251825591602001919060010190612332565b506123599291506123f0565b5090565b8280548282559060005260206000209081019282156123aa579160200282015b828111156123aa578251805161239a9184916020909101906122d9565b509160200191906001019061237d565b50612359929150612405565b82805482825590600052602060002090810192821561234d579160200282018281111561234d578251825591602001919060010190612332565b5b8082111561235957600081556001016123f1565b808211156123595760006124198282612422565b50600101612405565b50805461242e90612b4c565b6000825580601f1061243e575050565b601f016020900490600052602060002090810190611cfd91906123f0565b80356001600160a01b038116811461247357600080fd5b919050565b60008060006060848603121561248d57600080fd5b83359250602084013591506124a46040850161245c565b90509250925092565b6000815180845260005b818110156124d3576020818501810151868301820152016124b7565b818111156124e5576000602083870101525b50601f01601f19169290920160200192915050565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b8481101561261f57898403603f190186528251805185528881015189860152878101518886015260608082015160c0918701829052805191870182905260e080880192600581901b8901909101918c01865b828110156125d1578984037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff200185528151805185528e01518e85018e90526125be8e8601826124ad565b958f0195945050908d0190600101612574565b5050506080915081830151878203838901526125ed82826124ad565b9250505060a0808301519250868203818801525061260b81836124ad565b978a01979550505091870191600101612522565b50919998505050505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561266d5761266d61262e565b604052919050565b600082601f83011261268657600080fd5b813567ffffffffffffffff8111156126a0576126a061262e565b6126b36020601f19601f84011601612644565b8181528460208386010111156126c857600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156126f857600080fd5b82359150602083013567ffffffffffffffff81111561271657600080fd5b61272285828601612675565b9150509250929050565b60006020828403121561273e57600080fd5b5035919050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156127b857603f19898403018552815160608151855288820151818a87015261279a828701826124ad565b9289015195890195909552509487019492509086019060010161276c565b509098975050505050505050565b600080600080600060a086880312156127de57600080fd5b853567ffffffffffffffff808211156127f657600080fd5b61280289838a01612675565b965060209150818801358181111561281957600080fd5b6128258a828b01612675565b96505060408801358181111561283a57600080fd5b8801601f81018a1361284b57600080fd5b80358281111561285d5761285d61262e565b8060051b61286c858201612644565b918252828101850191858101908d84111561288657600080fd5b86850192505b838310156128c2578235868111156128a45760008081fd5b6128b28f8983890101612675565b835250918601919086019061288c565b9a9d999c50999a60608101359a506080013598975050505050505050565b600080604083850312156128f357600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b818110156129435783516001600160a01b03168352928401929184019160010161291e565b50909695505050505050565b803561ffff8116811461247357600080fd5b60008082840360a081121561297557600080fd5b61297e8461245c565b92506080601f198201121561299257600080fd5b506040516080810181811067ffffffffffffffff821117156129b6576129b661262e565b6040526129c56020850161294f565b8152604084013560208201526129dd6060850161294f565b60408201526080939093013560608401525092909150565b600060208284031215612a0757600080fd5b6122108261245c565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156127b857603f19898403018552815160e0815185528882015189860152878201518886015260608083015181870152506080808301511515818701525060a0808301518282880152612a8f838801826124ad565b9250505060c08083015192508582038187015250612aad81836124ad565b968901969450505090860190600101612a37565b600060208284031215612ad357600080fd5b6122108261294f565b60008060408385031215612aef57600080fd5b82359150612aff6020840161245c565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115612b4757612b47612b1e565b500190565b600181811c90821680612b6057607f821691505b6020821081141561199857634e487b7160e01b600052602260045260246000fd5b6000600019821415612b9557612b95612b1e565b5060010190565b60a081526000612baf60a08301886124ad565b602083820381850152612bc282896124ad565b915083820360408501528187518084528284019150828160051b850101838a0160005b83811015612c1357601f19878403018552612c018383516124ad565b94860194925090850190600101612be5565b5050606087019890985250505050608090910191909152509392505050565b600082821015612c4457612c44612b1e565b500390565b6000816000190483118215151615612c6357612c63612b1e565b500290565b600082612c8557634e487b7160e01b600052601260045260246000fd5b500490565b600081612c9957612c99612b1e565b506000190190565b600060208284031215612cb357600080fd5b5051919050565b600061ffff83811690831681811015612cd557612cd5612b1e565b03939250505056fea2646970667358221220fe8e2c0913bd1ef3f5dfa35c72b34ff1f9dbf9b99a79e11ec11935b75c8be82d64736f6c634300080a0033000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000032

Deployed Bytecode

0x6080604052600436106101795760003560e01c80638da5cb5b116100cb578063b73bf4561161007f578063f2fde38b11610059578063f2fde38b146104bf578063f56f4a5d146104df578063fa968eea146104ff57600080fd5b8063b73bf45614610414578063d259a76d14610434578063d43526791461044957600080fd5b8063a0f545ca116100b0578063a0f545ca146103b2578063afb06952146103d4578063b0187d34146103f457600080fd5b80638da5cb5b1461030f5780639615f5ce1461033757600080fd5b80633fba23a81161012d578063620993151161010757806362099315146102b8578063715018a6146102da57806379504fc3146102ef57600080fd5b80633fba23a81461024b5780634cc1879b14610278578063588ee1241461029857600080fd5b8063150ffcf51161015e578063150ffcf5146101c357806326232a2e146101e5578063274c199a1461022b57600080fd5b80630204b01b14610185578063078cdb311461019a57600080fd5b3661018057005b600080fd5b610198610193366004612478565b610515565b005b3480156101a657600080fd5b506101b060075481565b6040519081526020015b60405180910390f35b3480156101cf57600080fd5b506101d861093d565b6040516101ba91906124fa565b3480156101f157600080fd5b506000546102189074010000000000000000000000000000000000000000900461ffff1681565b60405161ffff90911681526020016101ba565b34801561023757600080fd5b506101986102463660046126e5565b610d8e565b34801561025757600080fd5b5061026b61026636600461272c565b610eb5565b6040516101ba9190612745565b34801561028457600080fd5b506101986102933660046127c6565b6110b3565b3480156102a457600080fd5b506101986102b33660046128e0565b61139a565b3480156102c457600080fd5b506102cd61167d565b6040516101ba9190612902565b3480156102e657600080fd5b5061019861168e565b3480156102fb57600080fd5b5061019861030a366004612961565b6116a2565b34801561031b57600080fd5b506000546040516001600160a01b0390911681526020016101ba565b34801561034357600080fd5b506103826103523660046129f5565b600560205260009081526040902080546001820154600283015460039093015461ffff9283169391929091169084565b6040516101ba949392919061ffff9485168152602081019390935292166040820152606081019190915260800190565b3480156103be57600080fd5b506103c7611740565b6040516101ba9190612a10565b3480156103e057600080fd5b506101986103ef366004612ac1565b61199e565b34801561040057600080fd5b5061019861040f3660046126e5565b611a78565b34801561042057600080fd5b5061019861042f36600461272c565b611b99565b34801561044057600080fd5b50610198611bd6565b34801561045557600080fd5b5061049a610464366004612adc565b60036020908152600092835260408084209091529082529020805460018201546002909201546001600160a01b03909116919083565b604080516001600160a01b0390941684526020840192909252908201526060016101ba565b3480156104cb57600080fd5b506101986104da3660046129f5565b611c70565b3480156104eb57600080fd5b506101986104fa36600461272c565b611d00565b34801561050b57600080fd5b506101b060025481565b60065442903490339086106105715760405162461bcd60e51b815260206004820152601160248201527f696e76616c69642062657474696e67496400000000000000000000000000000060448201526064015b60405180910390fd5b6000868152600160205260409020600881015460ff16156105d45760405162461bcd60e51b815260206004820152601060248201527f616c72656164792066696e6973686564000000000000000000000000000000006044820152606401610568565b80548410156106255760405162461bcd60e51b815260206004820152601560248201527f62657474696e67206973206e6f7420626567756e2e00000000000000000000006044820152606401610568565b838160010154116106785760405162461bcd60e51b815260206004820152601560248201527f62657474696e672074696d65206973206f7665722e00000000000000000000006044820152606401610568565b600481015486106106cb5760405162461bcd60e51b815260206004820152601460248201527f696e76616c69642062657474696e6720736964650000000000000000000000006044820152606401610568565b60025483101561071d5760405162461bcd60e51b815260206004820152601460248201527f6c657373207468616e206d696e20616d6f756e740000000000000000000000006044820152606401610568565b60008781526003602090815260408083206001600160a01b0386168452909152902060010154156107905760405162461bcd60e51b815260206004820152600b60248201527f616c7265616479206265740000000000000000000000000000000000000000006044820152606401610568565b600460008881526020019081526020016000206000878152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b031602179055506040518060600160405280866001600160a01b0316815260200184815260200187815250600360008981526020019081526020016000206000846001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506020820151816001015560408201518160020155905050828160030187815481106108af576108af612b08565b9060005260206000200160008282546108c89190612b34565b92505081905550828160020160008282546108e39190612b34565b909155505060408051888152602081018890529081018490526001600160a01b038316907f62e36d9623f0e28977755e3a539c09d94432b633419cd6b0ea789b4fbc23eade9060600160405180910390a250505050505050565b6060600060075467ffffffffffffffff81111561095c5761095c61262e565b6040519080825280602002602001820160405280156109c657816020015b6109b36040518060c001604052806000815260200160008152602001600081526020016060815260200160608152602001606081525090565b81526020019060019003908161097a5790505b509050600754600014156109d957919050565b6000805b600654811015610d86576000818152600160205260409020600881015460ff16610d735781848481518110610a1457610a14612b08565b60209081029190910101515280548451859085908110610a3657610a36612b08565b602002602001015160200181815250508060010154848481518110610a5d57610a5d612b08565b60200260200101516040018181525050806005018054610a7c90612b4c565b80601f0160208091040260200160405190810160405280929190818152602001828054610aa890612b4c565b8015610af55780601f10610aca57610100808354040283529160200191610af5565b820191906000526020600020905b815481529060010190602001808311610ad857829003601f168201915b5050505050848481518110610b0c57610b0c612b08565b602002602001015160800181905250806006018054610b2a90612b4c565b80601f0160208091040260200160405190810160405280929190818152602001828054610b5690612b4c565b8015610ba35780601f10610b7857610100808354040283529160200191610ba3565b820191906000526020600020905b815481529060010190602001808311610b8657829003601f168201915b5050505050848481518110610bba57610bba612b08565b602090810291909101015160a0015260048101548067ffffffffffffffff811115610be757610be761262e565b604051908082528060200260200182016040528015610c2d57816020015b604080518082019091526000815260606020820152815260200190600190039081610c055790505b50858581518110610c4057610c40612b08565b60200260200101516060018190525060005b81811015610d63576040518060400160405280828152602001846004018381548110610c8057610c80612b08565b906000526020600020018054610c9590612b4c565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc190612b4c565b8015610d0e5780601f10610ce357610100808354040283529160200191610d0e565b820191906000526020600020905b815481529060010190602001808311610cf157829003601f168201915b5050505050815250868681518110610d2857610d28612b08565b6020026020010151606001518281518110610d4557610d45612b08565b60200260200101819052508080610d5b90612b81565b915050610c52565b5083610d6e81612b81565b945050505b5080610d7e81612b81565b9150506109dd565b509092915050565b610d96611f2f565b6006548210610de75760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642062657474696e6720696400000000000000000000000000006044820152606401610568565b6000828152600160205260409020600881015460ff1615610e4a5760405162461bcd60e51b815260206004820152601360248201527f62657474696e672069732066696e6973686564000000000000000000000000006044820152606401610568565b80544210610e9a5760405162461bcd60e51b815260206004820152601a60248201527f62657474696e6720697320616c726561647920737461727465640000000000006044820152606401610568565b8151610eaf90600683019060208501906122d9565b50505050565b60606006548210610f085760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642062657474696e6720496400000000000000000000000000006044820152606401610568565b6000828152600160205260408120600481015490918167ffffffffffffffff811115610f3657610f3661262e565b604051908082528060200260200182016040528015610f8b57816020015b610f7860405180606001604052806000815260200160608152602001600081525090565b815260200190600190039081610f545790505b50905060005b828110156110aa576040518060600160405280828152602001856004018381548110610fbf57610fbf612b08565b906000526020600020018054610fd490612b4c565b80601f016020809104026020016040519081016040528092919081815260200182805461100090612b4c565b801561104d5780601f106110225761010080835404028352916020019161104d565b820191906000526020600020905b81548152906001019060200180831161103057829003601f168201915b5050505050815260200185600301838154811061106c5761106c612b08565b906000526020600020015481525082828151811061108c5761108c612b08565b602002602001018190525080806110a290612b81565b915050610f91565b50949350505050565b6110bb611f2f565b60028351101561110d5760405162461bcd60e51b815260206004820152600f60248201527f746f6f20736d616c6c20736964657300000000000000000000000000000000006044820152606401610568565b4282101561115d5760405162461bcd60e51b815260206004820152601060248201527f77726f6e672073746172742074696d65000000000000000000000000000000006044820152606401610568565b8181116111ac5760405162461bcd60e51b815260206004820152600e60248201527f77726f6e6720656e642074696d650000000000000000000000000000000000006044820152606401610568565b6006546000908152600160208181526040909220848155908101839055865190916111de9160058401918901906122d9565b5084516111f490600683019060208801906122d9565b50600019600782015583518067ffffffffffffffff8111156112185761121861262e565b60405190808252806020026020018201604052801561124b57816020015b60608152602001906001900390816112365790505b50805161126291600485019160209091019061235d565b508067ffffffffffffffff81111561127c5761127c61262e565b6040519080825280602002602001820160405280156112a5578160200160208202803683370190505b5080516112bc9160038501916020909101906123b6565b5060005b81811015611327578581815181106112da576112da612b08565b60200260200101518360040182815481106112f7576112f7612b08565b9060005260206000200190805190602001906113149291906122d9565b508061131f81612b81565b9150506112c0565b506006805490600061133883612b81565b90915550506007805490600061134d83612b81565b91905055507fbeaa2d37fed63e82c9288b6af2146c7d941c95576697048d608521fe35890c398787878787604051611389959493929190612b9c565b60405180910390a150505050505050565b6113a2611f2f565b600654429083106113f55760405162461bcd60e51b815260206004820152601160248201527f696e76616c69642062657474696e6749640000000000000000000000000000006044820152606401610568565b6000838152600160205260409020600881015460ff16156114585760405162461bcd60e51b815260206004820152601060248201527f616c72656164792066696e6973686564000000000000000000000000000000006044820152606401610568565b80600101548210156114ac5760405162461bcd60e51b815260206004820152601760248201527f62657474696e67206973206e6f742066696e69736865640000000000000000006044820152606401610568565b600481015483106114ff5760405162461bcd60e51b815260206004820152601460248201527f696e76616c69642062657474696e6720736964650000000000000000000000006044820152606401610568565b600081600301848154811061151657611516612b08565b9060005260206000200154905060008183600201546115359190612c32565b60008781526004602090815260408083208984529091528120549192505b8181101561161c5760008881526004602090815260408083208a8452909152812080548390811061158657611586612b08565b60009182526020808320909101548b83526003825260408084206001600160a01b039283168086529084529381902081516060810183528154909316835260018101549383018490526002015490820152919250866115e58288612c49565b6115ef9190612c68565b6115f99082612b34565b9050611606828483611f89565b505050808061161490612b81565b915050611553565b5060088401805460ff191660011790556007808501879055805490600061164283612c8a565b909155505060408051888152602081018890527f152a13473cd551e9f47e193f0321e1a9c735d01dd04aed9af1fb6c1472658c529101611389565b60606116896008612176565b905090565b611696611f2f565b6116a0600061218a565b565b6116aa611f2f565b6001600160a01b038216600090815260056020908152604091829020835181547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000090811661ffff928316178355928501516001830155928401516002820180549093169316929092179055606082015160039091015561172b6008836121f2565b61173c5761173a600883612219565b505b5050565b6060600060065467ffffffffffffffff81111561175f5761175f61262e565b6040519080825280602002602001820160405280156117d257816020015b6117bf6040518060e001604052806000815260200160008152602001600081526020016000815260200160001515815260200160608152602001606081525090565b81526020019060019003908161177d5790505b509050600654600014156117e557919050565b60005b60065481101561199857600081815260016020818152604092839020835160e081018552858152815492810192909252918201549281019290925260078101546060830152600881015460ff161515608083015260058101805491929160a08301919061185490612b4c565b80601f016020809104026020016040519081016040528092919081815260200182805461188090612b4c565b80156118cd5780601f106118a2576101008083540402835291602001916118cd565b820191906000526020600020905b8154815290600101906020018083116118b057829003601f168201915b505050505081526020018260060180546118e690612b4c565b80601f016020809104026020016040519081016040528092919081815260200182805461191290612b4c565b801561195f5780601f106119345761010080835404028352916020019161195f565b820191906000526020600020905b81548152906001019060200180831161194257829003601f168201915b505050505081525083838151811061197957611979612b08565b602002602001018190525050808061199090612b81565b9150506117e8565b50919050565b6119a6611f2f565b600754156119f65760405162461bcd60e51b815260206004820152601660248201527f706c616365642062657474696e67732065786973742e000000000000000000006044820152606401610568565b600080547fffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000061ffff8416908102919091179091556040519081527f0eb246bd5ded6e7f2b90da02cb479fb3fc79b6b1d188297c97865aed59d6e323906020015b60405180910390a150565b611a80611f2f565b6006548210611ad15760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642062657474696e6720696400000000000000000000000000006044820152606401610568565b6000828152600160205260409020600881015460ff1615611b345760405162461bcd60e51b815260206004820152601360248201527f62657474696e672069732066696e6973686564000000000000000000000000006044820152606401610568565b80544210611b845760405162461bcd60e51b815260206004820152601a60248201527f62657474696e6720697320616c726561647920737461727465640000000000006044820152606401610568565b8151610eaf90600583019060208501906122d9565b611ba1611f2f565b60028190556040518181527ff3038c9ffaea5bdfb87940148d3069fc8665e2ddd1f1ec057d9943932713a10c90602001611a6d565b611bde611f2f565b60075415611c2e5760405162461bcd60e51b815260206004820152601660248201527f706c616365642062657474696e67732065786973742e000000000000000000006044820152606401610568565b4780611c375750565b600080546040516001600160a01b039091169183156108fc02918491818181858888f1935050505015801561173c573d6000803e3d6000fd5b611c78611f2f565b6001600160a01b038116611cf45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610568565b611cfd8161218a565b50565b611d08611f2f565b6006548110611d595760405162461bcd60e51b815260206004820152601160248201527f696e76616c69642062657474696e6749640000000000000000000000000000006044820152606401610568565b60008181526001602052604090206008015460ff1615611dbb5760405162461bcd60e51b815260206004820152601060248201527f616c72656164792066696e6973686564000000000000000000000000000000006044820152606401610568565b6000818152600160205260408120600481015490915b81811015611ed2576000848152600460209081526040808320848452909152812054905b81811015611ebd5760008681526004602090815260408083208684529091528120805483908110611e2857611e28612b08565b60009182526020808320909101548983526003825260408084206001600160a01b039283168086529084528185208251606081018452815490941684526001810154948401859052600201548383015290519094509092849280156108fc02929091818181858888f19350505050158015611ea7573d6000803e3d6000fd5b5050508080611eb590612b81565b915050611df5565b50508080611eca90612b81565b915050611dd1565b5060088201805460ff1916600117905560078054906000611ef283612c8a565b90915550506040518381527ff534fba2380cfaeb828ffebbd40e968f778b87216f4364566db43e8bb5fd825f9060200160405180910390a1505050565b6000546001600160a01b031633146116a05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610568565b825160005474010000000000000000000000000000000000000000900461ffff16826001600160a01b0383161561210e576040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152600091908516906370a0823190602401602060405180830381865afa15801561201d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120419190612ca1565b6001600160a01b0385166000908152600560209081526040918290208251608081018452815461ffff9081168252600183015493820193909352600282015490921692820192909252600390910154606082018190529192509082106120d5576103e881604001516103e86120b69190612cba565b6120c49061ffff1686612c49565b6120ce9190612c68565b935061210b565b8060200151821061210b5780516103e8906120f09082612cba565b6120fe9061ffff1686612c49565b6121089190612c68565b93505b50505b60006103e861211d8487612c49565b6121279190612c68565b90506121338186612c32565b6040519092506001600160a01b0387169083156108fc029084906000818181858888f1935050505015801561216c573d6000803e3d6000fd5b5050505050505050565b606060006121838361222e565b9392505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116600090815260018301602052604081205415155b90505b92915050565b6000612210836001600160a01b03841661228a565b60608160000180548060200260200160405190810160405280929190818152602001828054801561227e57602002820191906000526020600020905b81548152602001906001019080831161226a575b50505050509050919050565b60008181526001830160205260408120546122d157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155612213565b506000612213565b8280546122e590612b4c565b90600052602060002090601f016020900481019282612307576000855561234d565b82601f1061232057805160ff191683800117855561234d565b8280016001018555821561234d579182015b8281111561234d578251825591602001919060010190612332565b506123599291506123f0565b5090565b8280548282559060005260206000209081019282156123aa579160200282015b828111156123aa578251805161239a9184916020909101906122d9565b509160200191906001019061237d565b50612359929150612405565b82805482825590600052602060002090810192821561234d579160200282018281111561234d578251825591602001919060010190612332565b5b8082111561235957600081556001016123f1565b808211156123595760006124198282612422565b50600101612405565b50805461242e90612b4c565b6000825580601f1061243e575050565b601f016020900490600052602060002090810190611cfd91906123f0565b80356001600160a01b038116811461247357600080fd5b919050565b60008060006060848603121561248d57600080fd5b83359250602084013591506124a46040850161245c565b90509250925092565b6000815180845260005b818110156124d3576020818501810151868301820152016124b7565b818111156124e5576000602083870101525b50601f01601f19169290920160200192915050565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b8481101561261f57898403603f190186528251805185528881015189860152878101518886015260608082015160c0918701829052805191870182905260e080880192600581901b8901909101918c01865b828110156125d1578984037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff200185528151805185528e01518e85018e90526125be8e8601826124ad565b958f0195945050908d0190600101612574565b5050506080915081830151878203838901526125ed82826124ad565b9250505060a0808301519250868203818801525061260b81836124ad565b978a01979550505091870191600101612522565b50919998505050505050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561266d5761266d61262e565b604052919050565b600082601f83011261268657600080fd5b813567ffffffffffffffff8111156126a0576126a061262e565b6126b36020601f19601f84011601612644565b8181528460208386010111156126c857600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156126f857600080fd5b82359150602083013567ffffffffffffffff81111561271657600080fd5b61272285828601612675565b9150509250929050565b60006020828403121561273e57600080fd5b5035919050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156127b857603f19898403018552815160608151855288820151818a87015261279a828701826124ad565b9289015195890195909552509487019492509086019060010161276c565b509098975050505050505050565b600080600080600060a086880312156127de57600080fd5b853567ffffffffffffffff808211156127f657600080fd5b61280289838a01612675565b965060209150818801358181111561281957600080fd5b6128258a828b01612675565b96505060408801358181111561283a57600080fd5b8801601f81018a1361284b57600080fd5b80358281111561285d5761285d61262e565b8060051b61286c858201612644565b918252828101850191858101908d84111561288657600080fd5b86850192505b838310156128c2578235868111156128a45760008081fd5b6128b28f8983890101612675565b835250918601919086019061288c565b9a9d999c50999a60608101359a506080013598975050505050505050565b600080604083850312156128f357600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b818110156129435783516001600160a01b03168352928401929184019160010161291e565b50909695505050505050565b803561ffff8116811461247357600080fd5b60008082840360a081121561297557600080fd5b61297e8461245c565b92506080601f198201121561299257600080fd5b506040516080810181811067ffffffffffffffff821117156129b6576129b661262e565b6040526129c56020850161294f565b8152604084013560208201526129dd6060850161294f565b60408201526080939093013560608401525092909150565b600060208284031215612a0757600080fd5b6122108261245c565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b838110156127b857603f19898403018552815160e0815185528882015189860152878201518886015260608083015181870152506080808301511515818701525060a0808301518282880152612a8f838801826124ad565b9250505060c08083015192508582038187015250612aad81836124ad565b968901969450505090860190600101612a37565b600060208284031215612ad357600080fd5b6122108261294f565b60008060408385031215612aef57600080fd5b82359150612aff6020840161245c565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008219821115612b4757612b47612b1e565b500190565b600181811c90821680612b6057607f821691505b6020821081141561199857634e487b7160e01b600052602260045260246000fd5b6000600019821415612b9557612b95612b1e565b5060010190565b60a081526000612baf60a08301886124ad565b602083820381850152612bc282896124ad565b915083820360408501528187518084528284019150828160051b850101838a0160005b83811015612c1357601f19878403018552612c018383516124ad565b94860194925090850190600101612be5565b5050606087019890985250505050608090910191909152509392505050565b600082821015612c4457612c44612b1e565b500390565b6000816000190483118215151615612c6357612c63612b1e565b500290565b600082612c8557634e487b7160e01b600052601260045260246000fd5b500490565b600081612c9957612c99612b1e565b506000190190565b600060208284031215612cb357600080fd5b5051919050565b600061ffff83811690831681811015612cd557612cd5612b1e565b03939250505056fea2646970667358221220fe8e2c0913bd1ef3f5dfa35c72b34ff1f9dbf9b99a79e11ec11935b75c8be82d64736f6c634300080a0033

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

000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000032

-----Decoded View---------------
Arg [0] : minBetAmount_ (uint256): 100000000000000000
Arg [1] : platformFee_ (uint16): 50

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000016345785d8a0000
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000032


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.