// SPDX-License-Identifier: MIT pragma solidity 0.8.26; /// @title Standard fixed-supply ERC-20 created with the Boost Legends token creator /// @notice No owner, no minting after deployment, no taxes, no blacklist, no pause. The whole supply goes to the /// deployer. An optional creation fee sent with the deployment is forwarded to the fee recipient. contract BoostLegendsToken { string public name; string public symbol; uint8 public immutable decimals; uint256 public immutable totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); constructor(string memory name_, string memory symbol_, uint8 decimals_, uint256 supply_, address payable feeRecipient_) payable { name = name_; symbol = symbol_; decimals = decimals_; totalSupply = supply_; balanceOf[msg.sender] = supply_; emit Transfer(address(0), msg.sender, supply_); if (msg.value > 0) { (bool ok, ) = feeRecipient_.call{value: msg.value}(""); require(ok, "fee transfer failed"); } } function transfer(address to, uint256 value) external returns (bool) { _transfer(msg.sender, to, value); return true; } function approve(address spender, uint256 value) external returns (bool) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferFrom(address from, address to, uint256 value) external returns (bool) { uint256 allowed = allowance[from][msg.sender]; if (allowed != type(uint256).max) { require(allowed >= value, "insufficient allowance"); unchecked { allowance[from][msg.sender] = allowed - value; } } _transfer(from, to, value); return true; } function _transfer(address from, address to, uint256 value) private { require(to != address(0), "transfer to zero address"); uint256 bal = balanceOf[from]; require(bal >= value, "insufficient balance"); unchecked { balanceOf[from] = bal - value; balanceOf[to] += value; } emit Transfer(from, to, value); } }