// Contract: TokenAccept
// Target function: function getTokenNameArray() public view returns(string[] memory)
// SPDX-License-Identifier: AAL

// ██████╗  ██████╗  ██████╗ █████╗  █████╗  █████╗  █████╗  █████╗  █████╗  █████╗    ███████╗████████╗██╗  ██╗
//██╔════╝ ██╔════╝ ██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔══██╗   ██╔════╝╚══██╔══╝██║  ██║
//███████╗ ███████╗ ███████╗╚██████║╚██████║╚██████║╚██████║╚██████║╚██████║╚██████║   █████╗     ██║   ███████║
//██╔═══██╗██╔═══██╗██╔═══██╗╚═══██║ ╚═══██║ ╚═══██║ ╚═══██║ ╚═══██║ ╚═══██║ ╚═══██║   ██╔══╝     ██║   ██╔══██║
//╚██████╔╝╚██████╔╝╚██████╔╝█████╔╝ █████╔╝ █████╔╝ █████╔╝ █████╔╝ █████╔╝ █████╔╝██╗███████╗   ██║   ██║  ██║
// ╚═════╝  ╚═════╝  ╚═════╝ ╚════╝  ╚════╝  ╚════╝  ╚════╝  ╚════╝  ╚════╝  ╚════╝ ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝
                                                                                                              
pragma solidity ^0.8.5;

interface IERC20 {
    function transfer(address _recipient, uint256 _amount) external returns (bool);
    function balanceOf(address _owner) external view returns (uint256);
    function name() external view returns (string memory);
}

contract TokenAccept {
    address private owner;
    IERC20[] private token20;
    string[] private token20Name;
    address private contractAddress = address(this);

    constructor () {
        owner = msg.sender;
    }

    modifier isOwner() {
        require(msg.sender == owner, "Caller is not owner");
        _;
    }

    //BASIC START
    // [CHECKED]
    function getOwner() public view returns (address) {
        return owner;
    }
    //BASIC END

    // ERC20 TOKEN VIEW START
    // [CHECKED]
    function getNameByTokenIndex(uint256 _tokenIndex) public view returns (string memory tokenName) {
        return token20[_tokenIndex].name();
    }

    // [CHECKED]
    function getBalanceByTokenIndex(uint256 _tokenIndex) public view returns (uint256){
        return token20[_tokenIndex].balanceOf(contractAddress);
    }