11// SPDX-License-Identifier: MIT
2- pragma solidity ^ 0.8.4 ;
2+ pragma solidity ^ 0.8.4 ;
3+
4+ /// @title IERC20
5+ /// @author CodesenSys
6+ /// @notice Full EIP-20 interface plus the mint/burn extensions
7+ /// specific to CodesenSysToken.
8+ /// Solady's ERC20 already satisfies the core surface —
9+ /// this interface lets external contracts and off-chain
10+ /// tooling reference the complete ABI from a single file.
11+ interface IERC20 {
12+
13+ // =========================================================================
14+ // Events (EIP-20 required)
15+ // =========================================================================
16+
17+ /// @notice Emitted on every successful transfer, including mints (from == 0)
18+ /// and burns (to == 0).
19+ event Transfer (address indexed from , address indexed to , uint256 value );
20+
21+ /// @notice Emitted when an owner updates a spender's allowance via approve()
22+ /// or when a transferFrom() reduces it.
23+ event Approval (address indexed owner , address indexed spender , uint256 value );
24+
25+ // =========================================================================
26+ // EIP-20 Core
27+ // =========================================================================
28+
29+ /// @notice Human-readable name of the token (e.g. "CodesenSys Token").
30+ function name () external view returns (string memory );
31+
32+ /// @notice Short ticker symbol (e.g. "CSS").
33+ function symbol () external view returns (string memory );
34+
35+ /// @notice Number of decimal places used to represent token amounts.
36+ /// CSS uses 18, matching Ether convention.
37+ function decimals () external view returns (uint8 );
38+
39+ /// @notice Total tokens currently in existence (minted minus burned).
40+ function totalSupply () external view returns (uint256 );
41+
42+ /// @notice Token balance held by `account`.
43+ function balanceOf (address account ) external view returns (uint256 );
44+
45+ /// @notice Transfer `amount` from the caller to `to`.
46+ /// @return success True on success; implementations MUST revert on failure.
47+ function transfer (address to , uint256 amount ) external returns (bool success );
48+
49+ /// @notice Remaining tokens that `spender` is allowed to move on behalf of `owner`.
50+ function allowance (address owner , address spender ) external view returns (uint256 );
51+
52+ /// @notice Approve `spender` to transfer up to `amount` from the caller's balance.
53+ /// @dev Setting to zero and then to the new value is the safe pattern for
54+ /// non-zero → non-zero updates on ERC-20 contracts that track old allowances.
55+ /// @return success True on success.
56+ function approve (address spender , uint256 amount ) external returns (bool success );
57+
58+ /// @notice Move `amount` from `from` to `to` using the caller's allowance.
59+ /// @return success True on success.
60+ function transferFrom (address from , address to , uint256 amount ) external returns (bool success );
61+
62+ // =========================================================================
63+ // Extensions — CodesenSysToken specific
64+ // =========================================================================
65+
66+ /// @notice Mint `amount` new tokens to `to`. Restricted to OWNER.
67+ /// @dev Reverts with Errors.ExceedsCap if totalSupply + amount > MAX_SUPPLY.
68+ function mint (address to , uint256 amount ) external ;
69+
70+ /// @notice Burn `amount` tokens from the caller's own balance.
71+ function burn (uint256 amount ) external ;
72+ }
0 commit comments