// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; /* CAI - Celi Artificial Intelligence Segurança máxima por simplicidade: - Sem governança - Sem mint - Sem burn - Sem taxas - Sem pausas - Sem blacklist - Propriedade renunciada no deploy */ contract CAI { // ======================== // DADOS DO TOKEN // ======================== string public constant name = "Celi Artificial Intelligence"; string public constant symbol = "CAI"; uint8 public constant decimals = 9; // 🔧 AJUSTE AQUI SE QUISER MUDAR O SUPPLY uint256 public constant totalSupply = 1_000_000_000 * 10**decimals; // ======================== // STORAGE // ======================== mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; // ======================== // EVENTS // ======================== event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); // ======================== // CONSTRUCTOR // ======================== constructor() { address initialHolder = 0x0e79B11e461EC4c8DEd3De43f58bb9b74561F185; _balances[initialHolder] = totalSupply; emit Transfer(address(0), initialHolder, totalSupply); } // ======================== // ERC20 FUNÇÕES PADRÃO // ======================== function balanceOf(address account) external view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) external view returns (uint256) { return _allowances[owner][spender]; } function transfer(address to, uint256 amount) external returns (bool) { _transfer(msg.sender, to, amount); return true; } function approve(address spender, uint256 amount) external returns (bool) { _approve(msg.sender, spender, amount); return true; } function transferFrom(address from, address to, uint256 amount) external returns (bool) { uint256 currentAllowance = _allowances[from][msg.sender]; require(currentAllowance >= amount, "CAI: allowance insuficiente"); unchecked { _allowances[from][msg.sender] = currentAllowance - amount; } _transfer(from, to, amount); return true; } // ======================== // FUNÇÕES INTERNAS SEGURAS // ======================== function _transfer(address from, address to, uint256 amount) internal { require(from != address(0), "CAI: origem invalida"); require(to != address(0), "CAI: destino invalido"); uint256 balance = _balances[from]; require(balance >= amount, "CAI: saldo insuficiente"); unchecked { _balances[from] = balance - amount; _balances[to] += amount; } emit Transfer(from, to, amount); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "CAI: owner invalido"); require(spender != address(0), "CAI: spender invalido"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } }