Storage Layout
DISCLAIMER // NFA // DYOR
This analysis is based on observations of the contract behavior. We are not smart contract security experts. This document aims to explain what the contract appears to do based on the code. It should not be considered a comprehensive security audit or financial advice. Always verify critical information independently and consult with blockchain security professionals for important decisions.
⊙ generated by robots | curated by humans
| METADATA | |
|---|---|
| Contract Address | 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 (etherscan) |
| Network | Ethereum Mainnet |
| Analysis Date | 2026-02-04 |
Variables
Immutable Constants
Immutable values set at construction and stored in bytecode (not storage slots):
| NAME | TYPE | VALUE | PURPOSE |
|---|---|---|---|
| TOTAL_SUPPLY | uint256 | 1,250,000,000 × 10^18 | Maximum token supply (1.25 billion) |
| BURNING_LIMIT | uint256 | 250,000,000 × 10^18 | Maximum burnable tokens (20% of supply) |
| MINIMUM_PURCHASE_NATIVE | uint256 | 0.0001 ether | Minimum ETH for purchase (prevents dust) |
| BASE_PRICE | uint256 | 0.0001 ether | Initial price per token at launch |
| BUY_DEV_FEE_BPS | uint256 | 5 | Buy dev fee (0.05%) |
| BUY_RESERVE_FEE_BPS | uint256 | 10 | Buy reserve fee (0.10%) |
| BUY_REFLECTION_FEE_BPS | uint256 | 10 | Buy reflection fee (0.10%) |
| REFUND_DEV_FEE_BPS | uint256 | 5 | Refund dev fee (0.05%) |
| REFUND_REFLECTION_FEE_BPS | uint256 | 5 | Refund reflection fee (0.05%) |
| TRANSFER_DEV_FEE_BPS | uint256 | 5 | Transfer dev fee (0.05%) |
| TRANSFER_REFLECTION_FEE_BPS | uint256 | 10 | Transfer reflection fee (0.10%) |
| TRANSFER_RESERVE_FEE_BPS | uint256 | 10 | Transfer reserve fee (0.10%) |
| DEX_SWAP_DEV_FEE_BPS | uint256 | 0 | DEX swap dev fee (0%) |
| DEX_SWAP_REFLECTION_FEE_BPS | uint256 | 0 | DEX swap reflection fee (0%) |
| DEX_SWAP_RESERVE_FEE_BPS | uint256 | 0 | DEX swap reserve fee (0%) |
Storage Slots
| SLOT | VARIABLE NAME | TYPE | CURRENT VALUE | PURPOSE |
|---|---|---|---|---|
| 0 | _status (ReentrancyGuard) | uint256 | 1 | Reentrancy lock (1=not entered, 2=entered) |
| 1 | _balances (ERC20) | mapping(address => uint256) | Dynamic | Token balances per address |
| 2 | _allowances (ERC20) | mapping(address => mapping(address => uint256)) | Dynamic | Approval amounts |
| 3 | _totalSupply (ERC20) | uint256 | Calculated | Total supply (TOTAL_SUPPLY - totalBurned) |
| 4 | _name (ERC20) | string | "ZeroMoon" | Token name |
| 5 | _symbol (ERC20) | string | "zETH" | Token symbol |
| 6 | _nonces (ERC20Permit) | mapping(address => Counters.Counter) | Dynamic | Permit nonce tracking |
| 7 | _hashedName (EIP712) | bytes32 | Hash | EIP-712 domain name hash |
| 8 | _hashedVersion (EIP712) | bytes32 | Hash | EIP-712 domain version hash |
| 9 | _name (EIP712) | ShortString | "ZeroMoon" | EIP-712 domain name |
| 10 | _version (EIP712) | ShortString | "1" | EIP-712 domain version |
| 11 | _owner (Ownable) | address | 0x00 | Contract owner (renounced) |
| 12 | _pendingOwner (Ownable2Step) | address | 0x00 | Pending ownership transfer |
| 13 | totalBurned | uint256 | ~530,784 × 10^18 | Total tokens burned |
| 14 | tokensSold | uint256 | ~3,457,167 × 10^18 | Total tokens sold from initial supply |
| 15 | devAddress | address | Private | Development fee recipient |
| 16 | magnifiedDividendPerShare | uint256 | Dynamic | Magnified dividend per share (×2^128) |
| 17 | totalDividendsDistributed | uint256 | Dynamic | Cumulative dividends distributed |
| 18 | lastDividendPerShare | mapping(address => uint256) | Dynamic | Last recorded dividend per share per user |
| 19 | accumulatedDividends | mapping(address => uint256) | Dynamic | Accumulated unclaimed dividends per user |
| 20 | _isExcludedFromFee | mapping(address => bool) | Dynamic | Fee exemption status per address |
| 21 | _isLiquidityPair | mapping(address => bool) | Dynamic | Cached liquidity pair detection |
| 22 | _isNotLiquidityPair | mapping(address => bool) | Dynamic | Cached non-liquidity pair detection |
Diagrams
Core Storage Architecture
graph TB
subgraph Immutable["Immutable Configuration (Bytecode)"]
Supply[TOTAL_SUPPLY: 1.25B]
BurnLimit[BURNING_LIMIT: 250M]
MinPurchase[MIN_PURCHASE: 0.0001 ETH]
BasePrice[BASE_PRICE: 0.0001 ETH]
Fees[Fee Structure<br/>BPS values]
end
subgraph OpenZeppelin["Inherited Storage (Slots 0-12)"]
Reentrancy[Slot 0: ReentrancyGuard<br/>_status]
ERC20Data[Slots 1-5: ERC20<br/>balances, allowances, supply]
Permit[Slot 6: ERC20Permit<br/>nonces]
EIP712[Slots 7-10: EIP712<br/>domain separator data]
Ownership[Slots 11-12: Ownable2Step<br/>owner, pendingOwner]
end
subgraph Custom["ZeroMoon Storage (Slots 13-22)"]
BurnState[Slot 13: totalBurned]
SoldState[Slot 14: tokensSold]
DevAddr[Slot 15: devAddress]
DivGlobal[Slots 16-17: Global Dividend<br/>magnified share, total distributed]
DivUser[Slots 18-19: User Dividend<br/>last share, accumulated]
FeeExempt[Slot 20: Fee Exemptions]
PairCache[Slots 21-22: Liquidity Pair Cache]
end
Immutable -.->|"Read-only"| OpenZeppelin
Immutable -.->|"Read-only"| Custom
OpenZeppelin -->|"Inherits"| Custom
style Immutable fill:#f5f5f5
style OpenZeppelin fill:#e1f5ff
style Custom fill:#fff4e1
Dividend Tracking System
graph LR
subgraph Global["Global State"]
G1[magnifiedDividendPerShare<br/>Slot 16]
G2[totalDividendsDistributed<br/>Slot 17]
end
subgraph User["Per-User State"]
U1[lastDividendPerShare<br/>Slot 18 + keccak256]
U2[accumulatedDividends<br/>Slot 19 + keccak256]
U3[balanceOf<br/>Slot 1 + keccak256]
end
G1 -->|"Compare delta"| U1
U3 -->|"Multiply"| Delta[Dividend Delta]
Delta -->|"Add to"| U2
U2 -->|"Claim"| Transfer[Transfer to User]
style Global fill:#e1f5ff
style User fill:#e1ffe1
style Delta fill:#fff4e1
style Transfer fill:#ffe1e1
Fee Exemption & Pair Detection
graph TB
subgraph Exemptions["Slot 20: Fee Exemptions"]
E1[address => bool]
E2[Contract Address: true]
E3[Dev Address: true]
E4[Owner Address: was true]
end
subgraph Pairs["Slots 21-22: Pair Cache"]
P1[_isLiquidityPair<br/>address => bool]
P2[_isNotLiquidityPair<br/>address => bool]
end
Transfer[Transfer Function] --> CheckExempt{Exempt?}
CheckExempt -->|Yes| Exemptions
CheckExempt -->|No| CheckPair{Liquidity Pair?}
CheckPair --> Pairs
style Exemptions fill:#e1ffe1
style Pairs fill:#fff4e1
style Transfer fill:#e1f5ff
Storage Access Patterns
High-Frequency Reads
These storage slots are accessed on nearly every transaction:
- Slot 1 (_balances): Read on every transfer, buy, refund
- Slot 16 (magnifiedDividendPerShare): Read on every non-contract transfer
- Slot 18 (lastDividendPerShare): Read/written for every EOA transfer
- Slot 20 (_isExcludedFromFee): Read on every transfer to check exemption
High-Frequency Writes
- Slot 1 (_balances): Updated on every transfer
- Slot 16 (magnifiedDividendPerShare): Incremented when dividends distributed
- Slot 18 (lastDividendPerShare): Updated for sender and recipient on transfers
- Slot 19 (accumulatedDividends): Updated when users interact or claim
Low-Frequency Access
- Slot 13 (totalBurned): Incremented only during refunds (up to burn cap)
- Slot 14 (tokensSold): Incremented only during purchases
- Slot 15 (devAddress): Read only for fee transfers (immutable post-renouncement)
- Slots 21-22 (pair cache): Written once per unique address after detection
Storage Optimization Notes
The contract employs several gas optimization strategies:
- Immutable Configuration: All fee percentages and limits stored as immutable (bytecode), avoiding SLOAD costs
- Pair Caching: Liquidity pair detection results cached to prevent repeated staticcalls
- Unchecked Math: Fee calculations use
uncheckedblocks where overflow is impossible - Magnification: 2^128 multiplier prevents precision loss without expensive fixed-point libraries
- Lazy Dividend Updates: Dividend tracking only updated when users interact, not globally
Gas costs (approximate):
- Token purchase: ~150-200k gas (includes dividend distribution)
- Token refund: ~180-250k gas (includes burn and dividend distribution)
- Standard transfer: ~120-180k gas (includes dividend updates for both parties)
- Dividend claim: ~50-80k gas (depends on accumulated amount)
- View functions: Free (off-chain calls)
Verification Commands
# SET RPC URL
export ETH_RPC_URL=https://eth.llamarpc.com
# READ TOTAL BURNED
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "totalBurned()(uint256)"
# READ TOKENS SOLD
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "tokensSold()(uint256)"
# READ TOTAL SUPPLY (ADJUSTED FOR BURNS)
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "totalSupply()(uint256)"
# READ CONTRACT ETH BALANCE
cast balance 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 --ether
# READ OWNER (SHOULD BE 0x00)
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "owner()(address)"
# READ TOTAL DIVIDENDS DISTRIBUTED
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "getTotalDividendsDistributed()(uint256)"
# READ CIRCULATING SUPPLY
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "getCirculatingSupplyPublic()(uint256)"
# READ USER BALANCE
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "balanceOf(address)(uint256)" <USER_ADDRESS>
# READ PENDING DIVIDENDS FOR USER
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "pendingDividends(address)(uint256)" <USER_ADDRESS>
# READ MAGNIFIED DIVIDEND PER SHARE
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "getMagnifiedDividendPerShare()(uint256)"
# CALCULATE TOKENS FOR ETH
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "calculatezETHForNative(uint256)(uint256)" 100000000000000000 # 0.1 ETH
# CALCULATE ETH FOR TOKENS
cast call 0x41b242c36F7dc5f18be21c1a6B7b5e05b2FD6532 "calculateNativeForZETH(uint256)(uint256)" 1000000000000000000 # 1 token