Skip to content

eth/eth_constants.hpp

Namespaces

Name
eth

Attributes

Name
constexpr size_t kAbiWordSize
EVM ABI encoding constants (ABI spec: https://docs.soliditylang.org/en/latest/abi-spec.html)
constexpr size_t kAbiAddressSize
Ethereum address is 20 bytes.
constexpr size_t kAbiAddressPadding
12 bytes of left-padding
constexpr size_t kAbiBoolByteIndex
Canonical bool lives in rightmost byte (index 31)
constexpr uint8_t kRlpListPrefixMin
EVM / RLP encoding thresholds.
constexpr size_t kTypedTxPrefixSize
EIP-2718 typed transaction envelope.
constexpr uint64_t kDefaultChainId
Default chain ID used when none is specified (Ethereum mainnet)
constexpr size_t kKeccak256Size
Keccak-256 digest size (bytes)

Attributes Documentation

variable kAbiWordSize

static constexpr size_t kAbiWordSize = 32;

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

static constexpr size_t kAbiAddressSize = 20;

Ethereum address is 20 bytes.

variable kAbiAddressPadding

static constexpr size_t kAbiAddressPadding = kAbiWordSize - kAbiAddressSize;

12 bytes of left-padding

variable kAbiBoolByteIndex

static constexpr size_t kAbiBoolByteIndex = kAbiWordSize - 1;

Canonical bool lives in rightmost byte (index 31)

variable kRlpListPrefixMin

static constexpr uint8_t kRlpListPrefixMin = 0xC0U;

EVM / RLP encoding thresholds.

First byte >= 0xC0 signals an RLP list

variable kTypedTxPrefixSize

static constexpr size_t kTypedTxPrefixSize = 1;

EIP-2718 typed transaction envelope.

One type-byte precedes the RLP payload

variable kDefaultChainId

static constexpr uint64_t kDefaultChainId = 1ULL;

Default chain ID used when none is specified (Ethereum mainnet)

variable kKeccak256Size

static constexpr size_t kKeccak256Size = 32;

Keccak-256 digest size (bytes)

Source code

// Copyright 2026 Genius Ventures, Inc.
// SPDX-License-Identifier: MIT

#ifndef EVMRELAY_INCLUDE_ETH_ETH_CONSTANTS_HPP
#define EVMRELAY_INCLUDE_ETH_ETH_CONSTANTS_HPP

#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


#endif // EVMRELAY_INCLUDE_ETH_ETH_CONSTANTS_HPP

Updated on 2026-08-06 at 13:59:18 +0000