eth/eth_constants.hpp¶
Namespaces¶
| Name |
|---|
| eth |
Attributes¶
| Name | |
|---|---|
| size_t | kAbiWordSize EVM ABI encoding constants (ABI spec: https://docs.soliditylang.org/en/latest/abi-spec.html). |
| size_t | kAbiAddressSize Ethereum address is 20 bytes. |
| size_t | kAbiAddressPadding 12 bytes of left-padding |
| size_t | kAbiBoolByteIndex Canonical bool lives in rightmost byte (index 31). |
| uint8_t | kRlpListPrefixMin EVM / RLP encoding thresholds. |
| size_t | kTypedTxPrefixSize EIP-2718 typed transaction envelope. |
| uint64_t | kDefaultChainId Default chain ID used when none is specified (Ethereum mainnet). |
| size_t | kKeccak256Size Keccak-256 digest size (bytes). |
Attributes Documentation¶
variable kAbiWordSize¶
EVM ABI encoding constants (ABI spec: https://docs.soliditylang.org/en/latest/abi-spec.html).
Every ABI head/tail slot is 32 bytes
variable kAbiAddressSize¶
Ethereum address is 20 bytes.
variable kAbiAddressPadding¶
12 bytes of left-padding
variable kAbiBoolByteIndex¶
Canonical bool lives in rightmost byte (index 31).
variable kRlpListPrefixMin¶
EVM / RLP encoding thresholds.
First byte >= 0xC0 signals an RLP list
variable kTypedTxPrefixSize¶
EIP-2718 typed transaction envelope.
One type-byte precedes the RLP payload
variable kDefaultChainId¶
Default chain ID used when none is specified (Ethereum mainnet).
variable kKeccak256Size¶
Keccak-256 digest size (bytes).
Source code¶
// Copyright 2025 GeniusVentures
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include <cstddef>
#include <cstdint>
namespace eth {
static constexpr size_t kAbiWordSize = 32;
static constexpr size_t kAbiAddressSize = 20;
static constexpr size_t kAbiAddressPadding = kAbiWordSize - kAbiAddressSize;
static constexpr size_t kAbiBoolByteIndex = kAbiWordSize - 1;
static constexpr uint8_t kRlpListPrefixMin = 0xC0U;
static constexpr size_t kTypedTxPrefixSize = 1;
static constexpr uint64_t kDefaultChainId = 1ULL;
static constexpr size_t kKeccak256Size = 32;
} // namespace eth
Updated on 2026-04-13 at 23:22:46 -0700