// SPDX-License-Identifier: None
pragma solidity ^0.8.10;

interface IBetAdminActions {

    /// @notice Update platform asset.
    /// @param newAsset_ New platform asset address.
    function updatePlatformAsset(address newAsset_) external;

    /// @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 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;

    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);
}
[{"inputs":[{"internalType":"address","name":"platformAsset_","type":"address"},{"internalType":"uint256","name":"minBetAmount_","type":"uint256"},{"internalType":"uint256","name":"discountThreshold_","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":[],"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"}],"name":"placeBet","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"placedBettingCnt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformAsset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"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":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinAmount_","type":"uint256"}],"name":"updateMinBetAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAsset_","type":"address"}],"name":"updatePlatformAsset","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"}]