This page is a placeholder. All examples on this page are currently AI-generated and are not correct. This documentation will be completed in the future with accurate, tested examples.
import { Address } from '@tevm/voltaire'function validateRecipient(recipient: Address) { if (recipient.equals(Address.zero())) { throw new Error('Cannot send to zero address') }}
Memory: Each call allocates a new Uint8Array. For repeated use, store the reference:
Copy
Ask AI
// Less efficient (multiple allocations)for (let i = 0; i < 1000; i++) { if (addr.equals(Address.zero())) { // ... }}// More efficient (single allocation)const ZERO = Address.zero()for (let i = 0; i < 1000; i++) { if (addr.equals(ZERO)) { // ... }}
Use isZero() method to check if an address is zero:
Copy
Ask AI
import { Address } from '@tevm/voltaire'const addr = Address("0x0000000000000000000000000000000000000000")if (addr.isZero()) { console.log("Address is zero")}// Equivalent but less clearif (addr.equals(Address.zero())) { console.log("Address is zero")}
Transaction to field: Zero address in transaction to field indicates contract creation.Event logs: Zero address in log topics often represents minting (from) or burning (to).Token standards: ERC-20/ERC-721 use zero address to represent minting/burning:
Copy
Ask AI
// Minting: from = 0x0emit Transfer(address(0), recipient, amount)// Burning: to = 0x0emit Transfer(sender, address(0), amount)
Not a valid EOA: Zero address cannot sign transactions (no private key exists).