// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract ST4RZ {
    mapping (address => uint256) private _balances;
    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    address[8] private _distributionAddresses = [0x9455f4f041038Dc65ef8cfA9Ca45D374E7b1Fb08, 0xA9aEa1BEC4f07b608E9bD76E1D8101e6B1C331B0, 0x622484B589Fb26Ad3D6A8Bc1b6Aa3EDe2bDD6EA8, 0x1A6A5086768a55c30fA71C0610972DeC09e4770d, 0x7F4fDBc91b5E61E2848D6c877a354dCD3Ae658D2, 0xE687A592A1e2191AC0C89f13BEeFde2a19256510, 0x85f26637Dfa99922168ABeD85af993272aA9CBc4, 0x25183DE9f3630eb10C82922a59c9Bf4E0211BE8a];
    uint8[8] private _distributionPercentages = [72, 4, 4, 4, 4, 4, 4, 4];

    constructor (string memory name_, string memory symbol_, uint8 decimals_, uint256 initialSupply_) {
        require(initialSupply_ > 0, "ERC20: initial supply must be greater than zero");
        require(_distributionAddresses.length == _distributionPercentages.length, "ERC20: distribution addresses and percentages length mismatch");

        _name = name_;
        _symbol = symbol_;
        _decimals = decimals_;
        _totalSupply = initialSupply_;

        for (uint i = 0; i < _distributionAddresses.length; i++) {
            require(_distributionAddresses[i] != address(0), "ERC20: distribution address is the zero address");
            uint256 amount = initialSupply_ * _distributionPercentages[i] / 100;
            _balances[_distributionAddresses[i]] += amount;
            emit Transfer(address(0), _distributionAddresses[i], amount);
        }
    }

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);

    function name() public view returns (string memory) {
        return _name;
    }

    function symbol() public view returns (string memory) {
        return _symbol;
    }

    function decimals() public view returns (uint8) {
        return _decimals;
    }

    function totalSupply() public view returns (uint256) {
        return _totalSupply;
    }

    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }

    function transfer(address recipient, uint256 amount) public returns (bool) {
        _transfer(msg.sender, recipient, amount);
        return true;
    }

    function allowance(address owner, address spender) public view returns (uint256) {
        return _allowances[owner][spender];
    }

    function approve(address spender, uint256 amount) public returns (bool) {
        _approve(msg.sender, spender, amount);
        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
        _approve(msg.sender, spender, _allowances[msg.sender][spender] + addedValue);
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
        uint256 currentAllowance = _allowances[msg.sender][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        _approve(msg.sender, spender, currentAllowance - subtractedValue);
        return true;
    }

    function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
        uint256 currentAllowance = _allowances[sender][msg.sender];
        require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
        _approve(sender, msg.sender, currentAllowance - amount);
        _transfer(sender, recipient, amount);
        return true;
    }

    function _transfer(address sender, address recipient, uint256 amount) internal {
        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[sender] = senderBalance - amount;
        }
        _balances[recipient] += amount;

        emit Transfer(sender, recipient, amount);
    }

    function _approve(address owner, address spender, uint256 amount) internal {
        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }
}