- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
5.6 KiB
WETH9 Creation Analysis
Date: $(date)
Contract: WETH9 (0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2)
Chain: ChainID 138
🔍 Current WETH9 Status
Total Supply
- Raw Value:
0x53444835ec580000wei - Decimal:
6,000,000,000,000,000,000wei - ETH Equivalent: 6.0 ETH
- Notation: 6 × 10¹⁸ wei = 6 ETH
Important Note
The total supply is 6 WETH, not 6 trillion WETH. If you're seeing "6,000,000,000.0T" somewhere, this is likely:
- A display formatting issue in a UI/explorer
- A misinterpretation of the wei value (6,000,000,000,000,000,000 wei)
- A different metric being displayed
📋 How WETH9 Was Created
1. Genesis Pre-Deployment
WETH9 was pre-deployed in the genesis.json file when ChainID 138 was initialized:
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2": {
"balance": "0x0",
"code": "0x6060604052..." // Full WETH9 bytecode
}
Key Points:
- Contract bytecode was deployed at genesis (block 0)
- No initial ETH balance was allocated to the contract
- No initial WETH tokens were minted
- The contract started with
totalSupply = 0
2. WETH9 Creation Mechanism
WETH9 tokens are created through the deposit() function:
function deposit() public payable {
balanceOf[msg.sender] += msg.value;
totalSupply += msg.value;
Deposit(msg.sender, msg.value);
}
How it works:
- User sends ETH to the contract via
deposit() - Contract mints equivalent WETH tokens to the user
totalSupplyincreases by the deposited amount- A
Depositevent is emitted - A
Transferevent is emitted (from address(0) to user)
3. Transaction History
Based on the total supply of 6 WETH, there have been deposit transactions that created these tokens.
Primary Deposit Transaction:
- Transaction Hash:
0xfcd2d771d1c9d27b2ef5c877368928db21c5ec28640419d3d53c911bece94638 - Block Number: 66,895
- From:
0x4A666F96fC8764181194447A7dFdb7d471b301C8 - To:
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2(WETH9) - Function:
deposit()(input:0xd0e30db0) - Value: 6,000,000,000,000,000,000 wei (6 ETH)
- Purpose: Wrapped 6 ETH to WETH9
- Status: ✅ Completed
What Happened:
- User
0x4A666F96fC8764181194447A7dFdb7d471b301C8calleddeposit()on WETH9 - Sent 6 ETH to the contract
- Contract minted 6 WETH tokens to the user
- Total supply increased from 0 to 6 WETH
- Contract balance increased from 0 to 6 ETH
🔢 Understanding the Numbers
Wei to ETH Conversion
- 1 ETH = 10¹⁸ wei
- 6 ETH = 6 × 10¹⁸ wei = 6,000,000,000,000,000,000 wei
Display Formats
Different UIs may display this differently:
- Standard: 6 ETH
- Wei format: 6,000,000,000,000,000,000 wei
- Scientific: 6.0e+18 wei
- Misleading display: 6,000,000,000.0T (if T means "trillion", this would be incorrect)
Why "6,000,000,000.0T" Might Appear
If you're seeing "6,000,000,000.0T WETH" in a UI:
-
Display Bug: The UI might be incorrectly formatting:
6,000,000,000,000,000,000wei- As
6,000,000,000.0T(treating the first 10 digits as the number and "T" as a suffix)
-
Decimal Misplacement:
- Actual: 6,000,000,000,000,000,000 wei = 6 ETH
- Misread: 6,000,000,000.0T (where T might be a formatting artifact)
-
Different Token: You might be looking at a different token or chain
📊 Verification Commands
Check Total Supply
cast call 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
"totalSupply()" \
--rpc-url http://192.168.11.250:8545 | \
xargs -I {} cast --to-unit {} ether
# Output: 6
Check Contract Balance (ETH)
cast balance 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
--rpc-url http://192.168.11.250:8545 | \
xargs -I {} cast --to-unit {} ether
# Output: 6 (the ETH backing the WETH9 tokens)
Check Deposit Events
cast logs --from-block 0 \
--address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
"Deposit(address,uint256)" \
--rpc-url http://192.168.11.250:8545
Check Transfer Events
cast logs --from-block 0 \
--address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
"Transfer(address,address,uint256)" \
--rpc-url http://192.168.11.250:8545
🔄 WETH9 Creation Flow
Genesis Block (Block 0)
├── WETH9 Contract Deployed
│ ├── Bytecode: Pre-deployed
│ ├── Balance: 0 ETH
│ └── Total Supply: 0 WETH
│
Block N (First Deposit)
├── User calls deposit() with 6 ETH
│ ├── Contract receives 6 ETH
│ ├── Contract mints 6 WETH to user
│ ├── Total Supply: 0 → 6 WETH
│ └── Events: Deposit, Transfer
│
Current State
├── Contract Balance: 6 ETH
├── Total Supply: 6 WETH
└── All WETH backed by ETH in contract
✅ Summary
- WETH9 Total Supply: 6 WETH (not 6 trillion)
- Creation Method: Pre-deployed in genesis, tokens created via
deposit() - Current State: 6 ETH deposited, 6 WETH minted
- If seeing "6,000,000,000.0T": This is likely a display formatting issue
Actual Numbers
- Total Supply: 6 WETH
- Backing ETH: 6 ETH
- Wei Value: 6,000,000,000,000,000,000 wei
- Display: Should show as "6 WETH" or "6.0 ETH"
🔍 Troubleshooting
If you're seeing "6,000,000,000.0T WETH":
- Check the source: Which explorer/UI are you using?
- Verify the contract: Ensure you're looking at
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2on ChainID 138 - Check the metric: Are you looking at totalSupply or a different value?
- Verify the chain: Ensure you're on ChainID 138, not a different chain
Last Updated: $(date)