// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

// Contract Info (Name, symbol, and supply)
contract EXTREME {
    string private constant _symbol = "0XP";
    string private constant _name = "EXTREME";
    uint8 private constant _decimals = 18;
    uint256 private _totalSupply = 1000000000000 * 10**uint256(_decimals);
    address private _devAddress;

    // Declarations and Identifiers; interactions with functions
    mapping(address => uint256) private _balances;
    mapping(address => mapping(address => uint256)) private _allowances;
    address private _owner;

    // Events and Emissions
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    modifier onlyOwner() {
        require(msg.sender == _owner, "Only the contract owner can call this function.");
        _;
    }

    // Dev receives total supply from contract creation after contract deployment
    constructor() {
        _owner = msg.sender;
        _devAddress = msg.sender;
        _balances[msg.sender] = _totalSupply;
        emit Transfer(address(0), msg.sender, _totalSupply);
    }

    // Enables viewing of total supply on Etherscan in the "Contract" > "Read" section
    function totalSupply() public view returns (uint256) {
        return _totalSupply;
    }

    // Enables viewing of dev/creator address on Etherscan in the "Contract" > "Read" section
    function getDevAddress() public view returns (address) {
        return _devAddress;
    }

    // Enables viewing of token symbol on Etherscan in the "Contract" > "Read" section
    function symbol() public pure returns (string memory) {
        return _symbol;
    }

    // Enables viewing of token name on Etherscan in the "Contract" > "Read" section
    function name() public pure returns (string memory) {
        return _name;
    }

    // Enables viewing of token decimals (18 for proficient fractionalization) on Etherscan in the "Contract" > "Read" section
    function decimals() public pure returns (uint8) {
        return _decimals;
    }

    // Enables renouncement, AKA official decentralization
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    // Enables viewing of token balance of specified address on Etherscan in the "Contract" > "Read" section
    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }

    // Transfer function
    function transfer(address recipient, uint256 amount) public returns (bool) {
        _transfer(msg.sender, recipient, amount);
        return true;
    }

    // Specifies allowance per address (There are no limitations)
    function allowance(address owner, address spender) public view returns (uint256) {
        return _allowances[owner][spender];
    }

    // Approval of token use
    function approve(address spender, uint256 amount) public returns (bool) {
        _approve(msg.sender, spender, amount);
        return true;
    }

    // Transaction function
    function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
        _transfer(sender, recipient, amount);
        uint256 currentAllowance = _allowances[sender][msg.sender];
        require(currentAllowance >= amount, "Transfer amount exceeds allowance");
        _approve(sender, msg.sender, currentAllowance - amount);
        return true;
    }

    // Enables transfer of contract ownership
    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0), "New owner cannot be the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }

    // Additional transaction functions below
    function _transfer(address sender, address recipient, uint256 amount) internal {
        require(sender != address(0), "Transfer from the zero address");
        require(recipient != address(0), "Transfer to the zero address");
        uint256 senderBalance = _balances[sender];
        require(senderBalance >= amount, "Transfer amount exceeds balance");
        _balances[sender] = senderBalance - amount;
        _balances[recipient] += amount;
        emit Transfer(sender, recipient, amount);
    }

    // Approval of token use
    function _approve(address owner, address spender, uint256 amount) internal {
        require(owner != address(0), "Approve from the zero address");
        require(spender != address(0), "Approve to the zero address");
        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    // thanPks foAr dyoUr, welcoLme to the safe havYen.
}