Expand description
Shared primitive types, syscall indices, and constants used across the Fluentbase stack.
Re-exports§
Modules§
- aliases
- Type aliases for common primitive types.
- bincode
- bytes
- Provides abstractions for working with bytes.
- fd
- hash_
map - A hash map implemented with quadratic probing and SIMD lookup.
- hash_
set - A hash set implemented as a
HashMapwhere the value is(). - hex
- github crates-io docs-rs
- ruint
- Rust
uintcrate using const-generics - system
- utils
- Common Ethereum utilities.
Macros§
- address
- Converts a sequence of string literals containing hex-encoded data
into a new
Addressat compile time. - b64
- Converts a sequence of string literals containing hex-encoded data
into a new
B64at compile time. - b128
- Converts a sequence of string literals containing hex-encoded data
into a new
B128at compile time. - b256
- Converts a sequence of string literals containing hex-encoded data
into a new
B256at compile time. - b512
- Converts a sequence of string literals containing hex-encoded data
into a new
B512at compile time. - bloom
- Converts a sequence of string literals containing hex-encoded data
into a new
Bloomat compile time. - bytes
- Converts a sequence of string literals containing hex-encoded data into a
new
Bytesat compile time. - fixed_
bytes - Converts a sequence of string literals containing hex-encoded data
into a new
FixedBytesat compile time. - hex
- Macro for converting sequence of string literals containing hex-encoded data into an array of bytes.
- try_vec
- Tries to create a
Veccontaining the arguments. - wrap_
fixed_ bytes - Wrap a fixed-size byte array in a newtype, delegating all methods to the
underlying
crate::FixedBytes.
Structs§
- Address
- An Ethereum address, 20 bytes in length.
- Address
Checksum Buffer - Stack-allocated buffer for efficiently computing address checksums.
- BigInt
Conversion Error - The error type that is returned when conversion to or from a integer fails.
- Bloom
- Ethereum 256 byte bloom filter.
- Bytes
- Wrapper type around
bytes::Bytesto support “0x” prefixed hex strings. - Fixed
Bytes - A byte array of fixed length (
[u8; N]). - Function
- An Ethereum ABI function pointer, 24 bytes in length.
- Genesis
Contract - HashMap
- A hash map implemented with quadratic probing and SIMD lookup.
- HashSet
- A hash set implemented as a
HashMapwhere the value is(). - Keccak256
- Simple
Keccak-256hasher. - Log
- A log consists of an address, and some log data.
- LogData
- An Ethereum event log object.
- Sealed
- A consensus hashable item, with its memoized hash.
- Signature
- An Ethereum ECDSA signature.
- Signed
- Signed integer wrapping a
ruint::Uint. - Syscall
Invocation Params - Syscall
Result - Uint
- The ring of numbers modulo $2^{\mathtt{BITS}}$.
Enums§
- Address
Error - Error type for address checksum validation.
- Bloom
Input - Input to the
Bloom::accruemethod. - Bytecode
OrHash - Bytecode
Type - Exit
Code - Exit codes representing various execution outcomes and error conditions.
- Parse
Signed Error - The error type that is returned when parsing a signed integer.
- Sign
- Enum to represent the sign of a 256-bit signed integer.
- Signature
Error - Errors in signature parsing or verification.
- SysFunc
Idx - TxKind
- The
tofield of a transaction. Either a target address, or empty for a contract creation.
Constants§
- BLAK
E3_ BASE_ FUEL_ COST - BLAK
E3_ WORD_ FUEL_ COST - BLOOM_
BITS_ PER_ ITEM - Number of bits to set per input in Ethereum bloom filter.
- BLOOM_
SIZE_ BITS - Size of the bloom filter in bits
- BLOOM_
SIZE_ BYTES - Size of the bloom filter in bytes.
- BLS12381_
FP2_ SIZE - BLS12381_
FP_ SIZE - BLS12381
- BLS12381_
G1_ COMPRESSED_ SIZE - BLS12381_
G1_ RAW_ AFFINE_ SIZE - BLS12381_
G2_ COMPRESSED_ SIZE - BLS12381_
G2_ RAW_ AFFINE_ SIZE - BLS_
G1_ ADD_ COST - BLS_
G1_ DECOMPRESS_ COST - BLS_
G1_ DOUBLE_ COST - BLS_
G2_ ADD_ COST - BLS_
MAP_ G1_ COST - BLS_
MAP_ G2_ COST - BLS_
PAIRING_ COST - BN254_
ADD_ COST - BN254_
DOUBLE_ COST - BN254_
FP2_ SIZE - BN254_
FP_ SIZE - BN254
- BN254_
G1_ COMPRESSED_ SIZE - BN254_
G1_ COMPRESS_ COST - BN254_
G1_ DECOMPRESS_ COST - BN254_
G1_ RAW_ AFFINE_ SIZE - BN254_
G2_ COMPRESSED_ SIZE - BN254_
G2_ COMPRESS_ COST - BN254_
G2_ DECOMPRESS_ COST - BN254_
G2_ RAW_ AFFINE_ SIZE - BN254_
MUL_ COST - BN254_
PAIRING_ COST - CALLDATA_
QUADRATIC_ DIVISOR - Divisor in
surcharge = 3*words + words²/DIVISOR. Chosen so that 14 × 128 KB exceeds 100M gas (max block gas):DIVISOR < words²(53,248) / (100M - 7.4M linear) ≈ 30.6 - CALLDATA_
QUADRATIC_ THRESHOLD - Calldata surcharge threshold (128 KB).
- CALL_
DEPTH_ ROOT - CALL_
STACK_ LIMIT - A max rWasm call stack limit
- CHARGE_
FUEL_ BASE_ COST - COPY_
BASE_ FUEL_ COST - COPY_
WORD_ FUEL_ COST - DEBUG_
LOG_ BASE_ FUEL_ COST - DEBUG_
LOG_ WORD_ FUEL_ COST - DEFAULT_
FEE_ MANAGER_ AUTH - Default fee manager, should be changed after a chain is live
- DEFAULT_
UPDATE_ GENESIS_ AUTH - Authority address that is allowed to update the code of arbitrary accounts.
- ED25519_
ADD_ COST - ED25519_
DECOMPRESS_ COST - ED25519_
POINT_ COMPRESSED_ SIZE - ED25519
- ED25519_
POINT_ DECOMPRESSED_ SIZE - EIP2935_
BLOCKHASH_ SERVE_ WINDOW - In the EVM implementation (EIP-2935)
- EIP2935_
HISTORY_ SERVE_ WINDOW - In the EVM implementation (EIP-2935)
- EIP7702_
SIG - rWASM binary format signature:
- EIP7702_
SIG_ LEN - ENGINE_
METERED_ PRECOMPILES - Addresses whose execution should be charged by the runtime.
- EVM_
MAX_ CODE_ SIZE - EIP-170: Contract code size limit
- EVM_
MAX_ INITCODE_ SIZE - EIP-3860: Limit and meter initcode
- EXECUTE_
USING_ SYSTEM_ RUNTIME_ ADDRESSES - Addresses whose execution is delegated to the system runtime implementation.
- EXT_
CODE_ COPY_ MAX_ COPY_ SIZE - A maximum allowed bytes to be copied using EXT_CODE_COPY instruction
- FP1_
ADD_ COST - FP1_
BLS_ ADD_ COST - FP1_
BLS_ MUL_ COST - FP1_
MUL_ COST - FP2_
ADD_ COST - FP2_
BLS_ ADD_ COST - FP2_
BLS_ MUL_ COST - FP2_
MUL_ COST - FUEL_
DENOM_ RATE - A relation between fuel and gas, according to our benchmarks, average WebAssembly instruction is ~20 times faster than average EVM instruction.
- FUEL_
MAX_ LINEAR_ X - The maximum allowed value for the
xparameter used in linear gas cost calculation of builtins. This limit ensures: - FUEL_
MAX_ QUADRATIC_ X - The maximum allowed value for the
xparameter used in quadratic gas cost calculation of builtins. This limit ensures: - KECCA
K256_ EMPTY - The Keccak-256 hash of the empty string
"". - KECCAK_
BASE_ FUEL_ COST - KECCAK_
EMPTY - KECCAK_
WORD_ FUEL_ COST - NATIVE_
TRANSFER_ ADDRESS - NATIVE_
TRANSFER_ KECCAK - keccak256 of “Transfer(address,address,uint256)” that notifies about native transfer of eth
- POSEIDON_
EMPTY - PRECOMPILE_
BIG_ MODEXP - Big modular exponentiation precompile (EVM address 0x05).
- PRECOMPILE_
BLAK E2F - BLAKE2 compression function precompile (EVM address 0x09).
- PRECOMPILE_
BLS12_ 381_ G1_ ADD - BLS12-381 G1 add precompile (EVM address 0x0b).
- PRECOMPILE_
BLS12_ 381_ G1_ MSM - BLS12-381 G1 MSM (multi-scalar multiplication) precompile (EVM address 0x0c).
- PRECOMPILE_
BLS12_ 381_ G2_ ADD - BLS12-381 G2 add precompile (EVM address 0x0d).
- PRECOMPILE_
BLS12_ 381_ G2_ MSM - BLS12-381 G2 MSM (multi-scalar multiplication) precompile (EVM address 0x0e).
- PRECOMPILE_
BLS12_ 381_ MAP_ G1 - BLS12-381 map-to-G1 precompile (EVM address 0x10).
- PRECOMPILE_
BLS12_ 381_ MAP_ G2 - BLS12-381 map-to-G2 precompile (EVM address 0x11).
- PRECOMPILE_
BLS12_ 381_ PAIRING - BLS12-381 pairing check precompile (EVM address 0x0f).
- PRECOMPILE_
BN256_ ADD - BN254 (a.k.a. alt_bn128) addition precompile (EVM address 0x06).
- PRECOMPILE_
BN256_ MUL - BN254 (a.k.a. alt_bn128) multiplication precompile (EVM address 0x07).
- PRECOMPILE_
BN256_ PAIR - BN254 (a.k.a. alt_bn128) pairing check precompile (EVM address 0x08).
- PRECOMPILE_
CREAT E2_ FACTORY - A precompile smart contract that can deploy child contracts using CREATE/CREATE2.
- PRECOMPILE_
CREAT E2_ FACTORY_ DEPLOYER - PRECOMPILE_
EIP2935 - EIP-2935 system contract / precompile address (as specified by the EIP).
- PRECOMPILE_
EIP7951 - EIP-7951 system contract / precompile address (as specified by the EIP).
- PRECOMPILE_
EVM_ RUNTIME - Address of the delegated EVM runtime.
- PRECOMPILE_
FEE_ MANAGER - A precompile smart contract that handles fee management.
- PRECOMPILE_
IDENTITY - Identity precompile (copies input to output) (EVM address 0x04).
- PRECOMPILE_
KZG_ POINT_ EVALUATION - KZG point evaluation precompile (EVM address 0x0a).
- PRECOMPILE_
NITRO_ VERIFIER - Address of the Nitro verifier runtime.
- PRECOMPILE_
OAUT H2_ VERIFIER - Address of the OAuth2 verifier runtime.
- PRECOMPILE_
RIPEM D160 ripemd160precompile (EVM address 0x03).- PRECOMPILE_
ROLLUP_ BRIDGE - A precompile smart contract that handles the bridge.
- PRECOMPILE_
ROLLUP_ BRIDGE_ DEPLOYER - PRECOMPILE_
RUNTIME_ UPGRADE - A precompile smart contract that handles runtime upgrades.
- PRECOMPILE_
SECP256 K1_ RECOVER ecrecoverprecompile (EVM address 0x01).- PRECOMPILE_
SHA256 sha256precompile (EVM address 0x02).- PRECOMPILE_
SVM_ RUNTIME - Address of the delegated SVM runtime (Solana VM).
- PRECOMPILE_
UNIVERSAL_ TOKEN_ RUNTIME - Address of the delegated Universal Token runtime.
- PRECOMPILE_
UNUSED_ 4 - Address of the Wrapped ETH contract (ERC-20 compatible representation of native ETH).
- PRECOMPILE_
WASM_ RUNTIME - Address of the delegated Wasm runtime.
- PRECOMPILE_
WEBAUTHN_ VERIFIER - Address of the WebAuthn verifier runtime.
- QUADRATIC_
DIVISOR - QUADRATIC_
WORD_ FUEL_ COST - RWASM_
MAX_ CODE_ SIZE - rWasm max code size
- RWASM_
SIG - rWASM binary format signature:
- RWASM_
SIG_ LEN - SECP256
K1_ ADD_ COST - SECP256
K1_ DECOMPRESS_ COST - SECP256
K1_ DOUBLE_ COST - SECP256
K1_ FP_ SIZE - SECP256K1
- SECP256
K1_ G1_ COMPRESSED_ SIZE - SECP256
K1_ G1_ RAW_ AFFINE_ SIZE - SECP256
K1_ G1_ SEC1_ SIZE - SECP256
R1_ ADD_ COST - SECP256
R1_ DECOMPRESS_ COST - SECP256
R1_ DOUBLE_ COST - SECP256
R1_ FP_ SIZE - SECP256R1
- SECP256
R1_ G1_ COMPRESSED_ SIZE - SECP256
R1_ G1_ RAW_ AFFINE_ SIZE - SECP256
R1_ G1_ SEC1_ SIZE - SHA256_
BASE_ FUEL_ COST - SHA256_
WORD_ FUEL_ COST - STATE_
DEPLOY - STATE_
FUEL_ COST - STATE_
MAIN - SYSTEM_
ADDRESS - TESTNET_
LEGACY_ PRECOMPILE_ ADDRESSES - The full set of addresses treated as “system precompiles” by the executor.
- UINT256_
MUL_ MOD_ COST - UINT256_
X2048_ MUL_ COST - UNIVERSAL_
TOKEN_ MAGIC_ BYTES - ERC20 magic bytes: as char codes for “ERC” and the number 0x20
- UPDATE_
GENESIS_ PREFIX - Transaction calldata prefix for genesis update. Versioning allows introducing new update semantics without ambiguity.
- WASM_
MAGIC_ BYTES - WebAssembly magic bytes
- WASM_
MAX_ CODE_ SIZE - WASM max code size
- WASM_
SIG - WebAssembly signature (\00ASM)
- WASM_
SIG_ LEN
Traits§
- CryptoAPI
- A low-level API for cryptographic primitives used across the runtime.
- Fixed
Bytes Slice Ext - Extension trait for flattening a slice of
FixedBytesto a byte slice. - Fixed
Bytes VecExt - Extension trait for flattening a
VecofFixedBytesto aVec<u8>. - Into
LogData - Trait for an object that can be converted into a log data object.
- NativeAPI
- A trait for providing shared API functionality.
- Sealable
- Sealeable objects.
- Unwrap
Exit Code
Functions§
- calldata_
quadratic_ surcharge - Returns quadratic surcharge for
input_lenbytes aboveCALLDATA_QUADRATIC_THRESHOLD. - eip191_
hash_ message - Hash a message according to EIP-191 (version
0x01). - import_
linker_ v1_ preview - is_
delegated_ runtime_ address - Returns
trueifaddresscorresponds to a delegated runtime dispatcher. - is_
engine_ metered_ precompile - Returns
trueif the contract ataddressshould be charged fuel by the runtime. - is_
execute_ using_ system_ runtime - Returns
trueifaddressshould be executed by the system runtime. - keccak256
- Simple interface to the
Keccak-256hash function. - keccak256_
uncached - Simple interface to the
Keccak-256hash function. - logs_
bloom - Compute the logs bloom filter for the given logs.
- normalize_
v - Attempts to normalize the v value to a boolean parity value.
- resolve_
precompiled_ runtime_ from_ input - Resolves and returns the account owner
Addressbased on the provided input byte slice. - to_
eip155_ v - Applies EIP-155.
Type Aliases§
- B64
- 8-byte fixed byte-array type.
- B128
- 16-byte fixed byte-array type.
- B256
- 32-byte fixed byte-array type.
- B512
- 64-byte fixed byte-array type.
- Block
Hash - A block hash.
- Block
Number - A block number.
- Block
Timestamp - A block timestamp.
- ChainId
- Chain identifier type (introduced in EIP-155).
- EvmExit
Code - I8
- 8-bit signed integer type, consisting of 1, 64-bit limbs.
- I16
- 16-bit signed integer type, consisting of 1, 64-bit limbs.
- I32
- 32-bit signed integer type, consisting of 1, 64-bit limbs.
- I64
- 64-bit signed integer type, consisting of 1, 64-bit limbs.
- I128
- 128-bit signed integer type, consisting of 2, 64-bit limbs.
- I160
- 160-bit signed integer type, consisting of 3, 64-bit limbs.
- I256
- 256-bit signed integer type, consisting of 4, 64-bit limbs.
- Selector
- Solidity contract functions are addressed using the first four bytes of the Keccak-256 hash of their signature.
- Storage
Key - An account storage key.
- Storage
Value - An account storage value.
- TxHash
- A transaction hash is a keccak hash of an RLP encoded signed transaction.
- TxIndex
- The index of transaction in a block.
- TxNonce
- The nonce of a transaction.
- TxNumber
- The sequence number of all existing transactions.
- U8
- 8-bit unsigned integer type, consisting of 1, 64-bit limbs.
- U16
- 16-bit unsigned integer type, consisting of 1, 64-bit limbs.
- U32
- 32-bit unsigned integer type, consisting of 1, 64-bit limbs.
- U64
- 64-bit unsigned integer type, consisting of 1, 64-bit limbs.
- U128
- 128-bit unsigned integer type, consisting of 2, 64-bit limbs.
- U160
- 160-bit unsigned integer type, consisting of 3, 64-bit limbs.
- U256
- 256-bit unsigned integer type, consisting of 4, 64-bit limbs.
- U512
- 512-bit unsigned integer type, consisting of 8, 64-bit limbs.