//SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.17;






/// @title A XETA Black contract
/// @notice Use this contract to manage XETA Black
contract XetaBlack is Ownable, Pausable {
    uint8 private constant CUSTOM_POOL = 0;

    IERC20 public usdcToken;

    mapping(uint8 => uint) public accountCost;
    mapping(uint8 => uint) public accountCreationFee;
    mapping(uint8 => uint) public accountMembershipFee;

    mapping(uint8 => uint) public poolCost;
    mapping(uint8 => uint) public poolCreationFee;
    mapping(uint8 => uint) public poolManagementFee;

    address public gaxsysWallet;
    address public blackOpsWallet;

    uint public customPoolCreationFeePercent = 2500; // 2.5%

    /// @notice Accounts
    event CreatingAccountsEvent(address indexed userWallet, uint indexed amount, uint8 indexed _type);
    event RenewAccountsEvent(address indexed userWallet, bytes24[] accountIds, uint8[] tokenTypes, uint8 indexed months);
    event WithdrawAccountsEvent(address indexed userWallet, uint indexed sum);
    event WithdrawAccountsByIdsEvent(address indexed userWallet, bytes24[] accountIds, uint[] sum);

    /// @notice Pools
    event CreatingPoolsEvent(address indexed userWallet, uint indexed amount, uint8 indexed _type, uint _poolPrincipal);
    event RenewPoolsEvent(address indexed userWallet, bytes24 indexed poolId, uint8 indexed tokenType, uint managementFee);
    event WithdrawPoolsEvent(address indexed userWallet, bytes24[] poolIds, uint[] amount, bool[] liquidates);

    event SetAccountCostEvent(uint8 indexed _type, uint indexed cost);
    event SetAccountCreationFeeEvent(uint8 indexed _type, uint indexed fee);
    event SetAccountMembershipFeeEvent(uint8 indexed _type, uint indexed fee);

    event SetPoolCostEvent(uint8 indexed _type, uint indexed cost);
    event SetPoolCreationFeeEvent(uint8 indexed _type, uint indexed fee);
    event SetPoolManagementFeeEvent(uint8 indexed _type, uint indexed fee);

    event SetCustomPoolCreationFeePercentEvent(uint indexed fee);

    event SetGaxsysWalletEvent(address indexed newAddress);
    event SetBlackOpsWalletEvent(address indexed newAddress);

    constructor(address _usdcToken, address _gaxsysWallet, address _blackOpsWallet) {
        require(_usdcToken != address(0x0));
        require(_gaxsysWallet != address(0x0));
        require(_blackOpsWallet != address(0x0));

        usdcToken = IERC20(_usdcToken);
        gaxsysWallet = _gaxsysWallet;
        blackOpsWallet = _blackOpsWallet;

        accountCost[0] = 1000 * (10 ** 6); // 1000 USDC Account
        accountCost[1] = 500 * (10 ** 6);  //  500 USDC Account
        accountCost[2] = 250 * (10 ** 6);  //  250 USDC Account

        accountCreationFee[0] = 2500 * (10 ** 4); // 25 USDC
        accountCreationFee[1] = 1250 * (10 ** 4); // 12.5 USDC
        accountCreationFee[2] =  625 * (10 ** 4); // 6.25 USDC

        accountMembershipFee[0] = 25 * (10 ** 6); // 25 USDC
        accountMembershipFee[1] = 25 * (10 ** 6); // 25 USDC
        accountMembershipFee[2] = 25 * (10 ** 6); // 25 USDC

        poolCost[1] =   1000 * (10 ** 6); //   1000 USDC Pool
        poolCost[2] =  10000 * (10 ** 6); //  10000 USDC Pool
        poolCost[3] =  25000 * (10 ** 6); //  25000 USDC Pool
        poolCost[4] =  50000 * (10 ** 6); //  50000 USDC Pool
        poolCost[5] = 100000 * (10 ** 6); // 100000 USDC Pool
        poolCost[6] = 250000 * (10 ** 6); // 250000 USDC Pool

        poolCreationFee[1] =   25 * (10 ** 6); //   25 USDC
        poolCreationFee[2] =  250 * (10 ** 6); //  250 USDC
        poolCreationFee[3] =  625 * (10 ** 6); //  625 USDC
        poolCreationFee[4] = 1250 * (10 ** 6); // 1250 USDC
        poolCreationFee[5] = 2500 * (10 ** 6); // 2500 USDC
        poolCreationFee[6] = 6250 * (10 ** 6); // 6250 USDC

        poolManagementFee[1] =   25 * (10 ** 6); //   25 USDC
        poolManagementFee[2] =  250 * (10 ** 6); //  250 USDC
        poolManagementFee[3] =  625 * (10 ** 6); //  625 USDC
        poolManagementFee[4] = 1250 * (10 ** 6); // 1250 USDC
        poolManagementFee[5] = 2500 * (10 ** 6); // 2500 USDC
        poolManagementFee[6] = 6250 * (10 ** 6); // 6250 USDC
    }

    /// @notice Use this function to create accounts. A user should pay create fee and create cost (initial size)
    function createAccounts(uint8 _type, uint amount, uint _accountPrincipal, uint _accountCreationFee, uint _accountMembershipFee) external whenNotPaused {
        require(amount > 0 && amount <= 1000, "Illegal amount"); // 1000 accounts max per operation to prevent overflow
        require(_accountCreationFee > 0 && _accountCreationFee == accountCreationFee[_type], "Invalid account creation fee");
        require(_accountMembershipFee > 0 && _accountMembershipFee == accountMembershipFee[_type], "Invalid account management fee");
        require(_accountPrincipal > 0 && _accountPrincipal == accountCost[_type], "Invalid account principal (cost)");
        uint sumAmount = (accountCost[_type] + accountCreationFee[_type] + accountMembershipFee[_type]) * amount;
        require(usdcToken.balanceOf(msg.sender) >= sumAmount, "Insufficient balance");
        require(usdcToken.allowance(msg.sender, address(this)) >= sumAmount, "Insufficient allowance");

        bool res = usdcToken.transferFrom(msg.sender, gaxsysWallet, accountCost[_type] * amount)
            && usdcToken.transferFrom(msg.sender, blackOpsWallet, (accountCreationFee[_type] + accountMembershipFee[_type]) * amount);
        require(res == true, "Error in payment transfer");

        emit CreatingAccountsEvent(msg.sender, amount, _type);
    }

    /// @notice A user with accounts should pay a membership fee for each account every 28 days
    /// @dev There is no info about account IDs. So, this should be verified on the backend
    function renewAccounts(bytes24[] memory accountIds, uint8[] memory tokenTypes, uint8 months, uint sumMembershipFee) external whenNotPaused {
        require(months > 0 && months < 14, "Invalid month amount");
        require(accountIds.length == tokenTypes.length, "Account and types array length mismatch");
        uint _sumMembershipFee = 0;
        for (uint8 i = 0; i < tokenTypes.length; i++) {
            _sumMembershipFee += accountMembershipFee[tokenTypes[i]];
        }
        require(_sumMembershipFee > 0 && _sumMembershipFee * months == sumMembershipFee, "Invalid management fee");
        require(accountIds.length > 0, "Illegal number of accounts");

        bool res = usdcToken.transferFrom(msg.sender, blackOpsWallet, sumMembershipFee);
        require(res == true, "Error in payment transfer");

        emit RenewAccountsEvent(msg.sender, accountIds, tokenTypes, months);
    }

    /// @dev Backend should listen to this event and send a request to GAXSYS
    function withdrawAccounts(uint sum) external whenNotPaused {
        emit WithdrawAccountsEvent(msg.sender, sum);
    }

    /// @dev Backend should listen to this event and send a request to GAXSYS
    function withdrawAccountsByIds(bytes24[] memory accountIds, uint[] memory sum) external whenNotPaused {
        require(accountIds.length == sum.length, "Accounts and sum array length mismatch");

        emit WithdrawAccountsByIdsEvent(msg.sender, accountIds, sum);
    }

    /// @notice Use this function to create pools. A user should pay create fee and create cost (processing fee)
    function createPools(uint8 _type, uint amount, uint _poolPrincipal, uint _poolCreationFee) external whenNotPaused {
        require(amount > 0 && amount <= 1000, "Illegal amount"); // 1000 pools max per operation to prevent overflow
        require(_poolPrincipal > 0, "Invalid pool cost (principal)");
        require(_poolCreationFee > 0, "Invalid pool creation fee");

        uint sumAmount;
        uint poolsCost;
        uint creationFees;
        if (_type != CUSTOM_POOL) {
            require(_poolCreationFee == poolCreationFee[_type], "Invalid pool creation fee");
            require(_poolPrincipal == poolCost[_type], "Invalid pool principal");
            sumAmount = (poolCost[_type] + poolCreationFee[_type]) * amount;
            poolsCost = poolCost[_type] * amount;
            creationFees = poolCreationFee[_type] * amount;
        } else {
            // Custom pool
            require(_poolPrincipal >= 250000 * (10 ** 6) && _poolPrincipal < 1e18, "Invalid pool cost (principal)"); // 250000 USDC min and prevent overflow
            sumAmount = amount * _poolPrincipal * (100000 + customPoolCreationFeePercent) / 100000; // 100% + 2.5% creation fee
            poolsCost = _poolPrincipal * amount;
            creationFees = sumAmount - poolsCost; // 2.5% creation fee
        }
        require(usdcToken.balanceOf(msg.sender) >= sumAmount, "Insufficient balance");
        require(usdcToken.allowance(msg.sender, address(this)) >= sumAmount, "Insufficient allowance");

        bool res = usdcToken.transferFrom(msg.sender, gaxsysWallet, poolsCost)
            && usdcToken.transferFrom(msg.sender, blackOpsWallet, creationFees);
        require(res == true, "Error in payment transfer");

        emit CreatingPoolsEvent(msg.sender, amount, _type, _poolPrincipal);
    }

    /// @notice A user with pools should pay a management fee for each pool every 28 days
    /// @dev There is no info about pool id. So, this should be verified on the backend
    function renewPool(bytes24 poolId, uint8 tokenType, uint managementFee) external whenNotPaused {
        require(managementFee >= poolManagementFee[tokenType], "Invalid management fee");

        bool res = usdcToken.transferFrom(msg.sender, blackOpsWallet, managementFee);
        require(res == true, "Error in payment transfer");

        emit RenewPoolsEvent(msg.sender, poolId, tokenType, managementFee);
    }

    /// @notice Makes a request to withdraw pools
    function withdrawPool(bytes24[] memory poolIds, uint[] memory amount, bool[] memory liquidates) external whenNotPaused {
        require(poolIds.length > 0, "Illegal number of pools");
        require(poolIds.length == amount.length, "Pools and amount array length mismatch");
        require(poolIds.length == liquidates.length, "Pools and liquidates array length mismatch");

        emit WithdrawPoolsEvent(msg.sender, poolIds, amount, liquidates);
    }

    /// @dev If a user sends other tokens to this smart contract, the owner can transfer it to himself.
    function withdrawToken(address _tokenContract, address _recipient, uint _amount) external onlyOwner {
        IERC20 tokenContract = IERC20(_tokenContract);

        // transfer the token from address of this contract
        // to address of the user (executing the withdrawToken() function)
        tokenContract.transfer(_recipient, _amount);
    }

    /// @dev Due to the nature of smart contracts and the fact they're immutable, for the interest of the community and
    /// @dev the ecosystem, we decided to add an option to disable critical contract functionality in case of an emergency.
    function pause() external onlyOwner {
        _pause();
    }

    /// @dev Due to the nature of smart contracts and the fact they're immutable, for the interest of the community and
    /// @dev the ecosystem, we decided to add an option to disable critical contract functionality in case of an emergency.
    function unpause() external onlyOwner {
        _unpause();
    }

    /// @notice The owner can change the gaxsys wallet (creation fee should be transfered here).
    function setGaxsysWallet(address newAddress) external onlyOwner {
        require(newAddress != address(0x0));
        gaxsysWallet = newAddress;
        emit SetGaxsysWalletEvent(newAddress);
    }

    /// @notice The owner can change the black ops wallet (management fee should be transfered here).
    function setBlackOpsWallet(address newAddress) external onlyOwner {
        require(newAddress != address(0x0));
        blackOpsWallet = newAddress;
        emit SetBlackOpsWalletEvent(newAddress);
    }

    /// @notice Sets the account cost in USDC
    function setAccountCost(uint8 _type, uint cost) external onlyOwner {
        accountCost[_type] = cost;
        emit SetAccountCostEvent(_type, cost);
    }

    /// @notice Sets the account creation fee in USDC
    function setAccountCreationFee(uint8 _type, uint fee) external onlyOwner {
        accountCreationFee[_type] = fee;
        emit SetAccountCreationFeeEvent(_type, fee);
    }

    /// @notice Sets the account membership fee in USDC
    function setAccountMembershipFee(uint8 _type, uint cost) external onlyOwner {
        accountMembershipFee[_type] = cost;
        emit SetAccountMembershipFeeEvent(_type, cost);
    }

    /// @notice Sets the pool cost in USDC
    function setPoolCost(uint8 _type, uint cost) external onlyOwner {
        require(_type != CUSTOM_POOL, "Illegal pool type");
        poolCost[_type] = cost;
        emit SetPoolCostEvent(_type, cost);
    }

    /// @notice Sets the pool creation fee in USDC
    function setPoolCreationFee(uint8 _type, uint fee) external onlyOwner {
        require(_type != CUSTOM_POOL, "Illegal pool type");
        poolCreationFee[_type] = fee;
        emit SetPoolCreationFeeEvent(_type, fee);
    }

    /// @notice Sets the pool management fee in USDC
    function setPoolManagementFee(uint8 _type, uint fee) external onlyOwner {
        require(_type != CUSTOM_POOL, "Illegal pool type");
        poolManagementFee[_type] = fee;
        emit SetPoolManagementFeeEvent(_type, fee);
    }

    /// @notice Sets the custom pool creation fee in percents multiplied by 1000 (ex. 2500 is 2.5%)
    function SetCustomPoolCreationFeePercent(uint fee) external onlyOwner {
        customPoolCreationFeePercent = fee;
        emit SetCustomPoolCreationFeePercentEvent(fee);
    }

    /// @notice Returns account cost and fees
    /// @param _type Account type
    function getAccountTypeDetails(uint8 _type) external view returns(uint[3] memory) {
        return [
            accountCost[_type],
            accountCreationFee[_type],
            accountMembershipFee[_type]
        ];
    }

    /// @notice Returns pool cost and fees
    /// @param _type Account type
    function getPoolTypeDetails(uint8 _type) external view returns(uint[3] memory) {
        return [
            poolCost[_type],
            poolCreationFee[_type],
            poolManagementFee[_type]
        ];
    }
}
[{"inputs":[{"internalType":"address","name":"_usdcToken","type":"address"},{"internalType":"address","name":"_gaxsysWallet","type":"address"},{"internalType":"address","name":"_blackOpsWallet","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userWallet","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint8","name":"_type","type":"uint8"}],"name":"CreatingAccountsEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userWallet","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint8","name":"_type","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"_poolPrincipal","type":"uint256"}],"name":"CreatingPoolsEvent","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userWallet","type":"address"},{"indexed":false,"internalType":"bytes24[]","name":"accountIds","type":"bytes24[]"},{"indexed":false,"internalType":"uint8[]","name":"tokenTypes","type":"uint8[]"},{"indexed":true,"internalType":"uint8","name":"months","type":"uint8"}],"name":"RenewAccountsEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userWallet","type":"address"},{"indexed":true,"internalType":"bytes24","name":"poolId","type":"bytes24"},{"indexed":true,"internalType":"uint8","name":"tokenType","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"managementFee","type":"uint256"}],"name":"RenewPoolsEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"_type","type":"uint8"},{"indexed":true,"internalType":"uint256","name":"cost","type":"uint256"}],"name":"SetAccountCostEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"_type","type":"uint8"},{"indexed":true,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetAccountCreationFeeEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"_type","type":"uint8"},{"indexed":true,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetAccountMembershipFeeEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetBlackOpsWalletEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetCustomPoolCreationFeePercentEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetGaxsysWalletEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"_type","type":"uint8"},{"indexed":true,"internalType":"uint256","name":"cost","type":"uint256"}],"name":"SetPoolCostEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"_type","type":"uint8"},{"indexed":true,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetPoolCreationFeeEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"_type","type":"uint8"},{"indexed":true,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetPoolManagementFeeEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userWallet","type":"address"},{"indexed":false,"internalType":"bytes24[]","name":"accountIds","type":"bytes24[]"},{"indexed":false,"internalType":"uint256[]","name":"sum","type":"uint256[]"}],"name":"WithdrawAccountsByIdsEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userWallet","type":"address"},{"indexed":true,"internalType":"uint256","name":"sum","type":"uint256"}],"name":"WithdrawAccountsEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"userWallet","type":"address"},{"indexed":false,"internalType":"bytes24[]","name":"poolIds","type":"bytes24[]"},{"indexed":false,"internalType":"uint256[]","name":"amount","type":"uint256[]"},{"indexed":false,"internalType":"bool[]","name":"liquidates","type":"bool[]"}],"name":"WithdrawPoolsEvent","type":"event"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SetCustomPoolCreationFeePercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"accountCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"accountCreationFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"accountMembershipFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blackOpsWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_type","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"_accountPrincipal","type":"uint256"},{"internalType":"uint256","name":"_accountCreationFee","type":"uint256"},{"internalType":"uint256","name":"_accountMembershipFee","type":"uint256"}],"name":"createAccounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_type","type":"uint8"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"_poolPrincipal","type":"uint256"},{"internalType":"uint256","name":"_poolCreationFee","type":"uint256"}],"name":"createPools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"customPoolCreationFeePercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gaxsysWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_type","type":"uint8"}],"name":"getAccountTypeDetails","outputs":[{"internalType":"uint256[3]","name":"","type":"uint256[3]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_type","type":"uint8"}],"name":"getPoolTypeDetails","outputs":[{"internalType":"uint256[3]","name":"","type":"uint256[3]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"poolCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"poolCreationFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"","type":"uint8"}],"name":"poolManagementFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes24[]","name":"accountIds","type":"bytes24[]"},{"internalType":"uint8[]","name":"tokenTypes","type":"uint8[]"},{"internalType":"uint8","name":"months","type":"uint8"},{"internalType":"uint256","name":"sumMembershipFee","type":"uint256"}],"name":"renewAccounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes24","name":"poolId","type":"bytes24"},{"internalType":"uint8","name":"tokenType","type":"uint8"},{"internalType":"uint256","name":"managementFee","type":"uint256"}],"name":"renewPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_type","type":"uint8"},{"internalType":"uint256","name":"cost","type":"uint256"}],"name":"setAccountCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_type","type":"uint8"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setAccountCreationFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_type","type":"uint8"},{"internalType":"uint256","name":"cost","type":"uint256"}],"name":"setAccountMembershipFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setBlackOpsWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"setGaxsysWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_type","type":"uint8"},{"internalType":"uint256","name":"cost","type":"uint256"}],"name":"setPoolCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_type","type":"uint8"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setPoolCreationFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_type","type":"uint8"},{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setPoolManagementFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdcToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"sum","type":"uint256"}],"name":"withdrawAccounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes24[]","name":"accountIds","type":"bytes24[]"},{"internalType":"uint256[]","name":"sum","type":"uint256[]"}],"name":"withdrawAccountsByIds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes24[]","name":"poolIds","type":"bytes24[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"},{"internalType":"bool[]","name":"liquidates","type":"bool[]"}],"name":"withdrawPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenContract","type":"address"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"}]