Abstract
This proposal introduces a new fungible token standard focused on security, efficiency, and interoperability. It extends traditional ERC-20 functionality with built-in gas rebates, secure signature validation using EIP-712, and optimized transfer mechanisms. The standard includes protections against common attack vectors while maintaining full compatibility with existing token interfaces.
Motivation
Current fungible token standards lack built-in security features and gas optimization mechanisms. This proposal addresses these limitations by incorporating:
- Native gas rebate system to reduce transaction costs
- EIP-712 compliant signatures for gasless approvals
- Strong security measures against common vulnerabilities
- Efficient state management and error handling
Specification
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.
Core Variables
name: Token namesymbol: Token symboldecimals: Number of decimal placestotalSupply: Total token supply_balances: Mapping of address to token balance_allowances: Mapping of owner address to spender address to allowed amount
Features
- Gas rebate system
- EIP-712 signature validation
- Nonce tracking for replay protection
Functions
View Functions
name()
- Returns the token name
- Type:
string
symbol()
- Returns the token symbol
- Type:
string
decimals()
- Returns number of decimals
- Type:
uint8
totalSupply()
- Returns total token supply
- Type:
uint256
balanceOf(address account)
- Returns token balance of specified account
- Type:
uint256
allowance(address owner, address spender)
- Returns remaining allowance for spender
- Type:
uint256
State-Changing Functions
transfer(address to, uint256 amount)
- Transfers tokens to specified address
- Includes gas rebate processing
- Returns:
bool
approve(address spender, uint256 amount)
- Approves spender to spend tokens
- Returns:
bool
transferFrom(address from, address to, uint256 amount)
- Transfers tokens between addresses
- Requires sufficient allowance
- Returns:
bool
permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
- Processes gasless approvals using EIP-712 signatures
- Validates signature and deadline
- No return value
Events
Transfer
- Emitted on token transfers
event Transfer(address indexed from, address indexed to, uint256 value)Approval
- Emitted on approval updates
event Approval(address indexed owner, address indexed spender, uint256 value)GasRebate
- Emitted when gas rebate is processed
event GasRebate(address indexed user, uint256 amount)Gas Rebate System
- Limited to first 10,000 transactions
- Rebate amount = 25% of base transaction cost
- One-time rebate per user
- Requires contract to hold ETH for rebates
Error Handling
Custom errors for common failure cases:
InsufficientBalanceInsufficientAllowanceInvalidSignatureExpiredDeadlineMaxRebatesReachedTransferToZeroAddressApproveToZeroAddress
Rationale
The design choices in this proposal prioritize:
- Security through custom error handling and signature validation
- Gas efficiency via rebate mechanisms
- Interoperability through standard EIP-712 implementation
- User experience through gasless approvals
Backwards Compatibility
This proposal maintains full backwards compatibility with ERC-20 while adding enhanced functionality.
Security Considerations
- Implements nonce tracking for signature validation
- Uses custom errors for efficient error handling
- Includes checks against zero-address transfers
- Limits gas rebates to prevent abuse
- Validates EIP-712 signatures for permit operations
Copyright
Copyright and related rights waived via CC0.
