Crate zksync_types

Source
Expand description

ZKsync types: essential type definitions for ZKsync network.

zksync_types is a crate containing essential ZKsync network types, such as transactions, operations and blockchain primitives.

Re-exports§

pub use event::VmEvent;
pub use event::VmEventGroupKey;
pub use l1::L1TxCommonData;
pub use l2::L2TxCommonData;
pub use protocol_upgrade::ProtocolUpgrade;
pub use protocol_upgrade::ProtocolVersion;
pub use tx::Execute;
pub use storage::*;

Modules§

abi
aggregated_operations
api
base_token_ratio
basic_fri_types
Basic types for FRI prover.
blob
block
circuit
commitment
Data structures that have more metadata than their primary versions declared in this crate. For example, L1 batch defined here has the root_hash field which is absent in L1BatchHeader.
contract_verification_api
debug_flat_call
eip712_signature
This is implementation of a standard for hashing typed structured data for EIP-712 signing standard.
eth_sender
ethabi
Ethereum ABI encoding decoding library.
event
fee
fee_model
hasher
helpers
l1
Definition of ZKsync network priority operations: operations initiated from the L1.
l2
l2_to_l1_log
network
The network where the ZKsync resides.
packed_eth_signature
priority_op_onchain_data
proto
protocol_upgrade
protocol_version
prover_dal
Types exposed by the prover DAL for general-purpose use.
pubdata_da
snapshots
storage
storage_writes_deduplicator
system_contracts
tee_types
tokens
transaction_request
tx
transactions is module that holds the essential information for every transaction.
url
utils
vm_trace
vm_version
web3
Selected Web3 types copied from the web3 crate.
zk_evm_types

Structs§

AccountTreeId
Account place in the global state tree is uniquely identified by its address. Binary this type is represented by 160 bit big-endian representation of account address.
Eip712Domain
EncodedStructureMember
H64
H128
Fixed-size uninterpreted hash type with 16 bytes (128 bits) size.
H160
Fixed-size uninterpreted hash type with 20 bytes (160 bits) size.
H256
Fixed-size uninterpreted hash type with 32 bytes (256 bits) size.
H512
Fixed-size uninterpreted hash type with 64 bytes (512 bits) size.
H520
H2048
Bloom hash type with 256 bytes (2048 bits) size.
InputData
Optional input Ethereum-like encoded transaction if submitted via Web3 API. If exists, its hash will be used to identify transaction. Note, that for EIP712-type transactions, hash is not equal to the hash of the data, but rather calculated by special formula.
K256PrivateKey
secp256k1 private key wrapper.
L1BatchNumber
ZKsync L1 batch sequential index.
L1BlockNumber
Ethereum network block sequential index.
L1ChainId
ChainId in the Ethereum network.
L2BlockNumber
ZKsync network block sequential index.
L2ChainId
ChainId in the ZKsync network.
Nonce
ZKsync account nonce.
PackedEthSignature
Struct used for working with Ethereum signatures created using eth_sign (using geth, ethers.js, etc) message is serialized as 65 bytes long 0x prefixed string.
PriorityOpId
Unique identifier of the priority operation in the ZKsync network.
Transaction
U64
Little-endian large integer type Unsigned 64-bit integer.
U128
Little-endian large integer type 128-bit unsigned integer.
U256
Little-endian large integer type 256-bit unsigned integer.

Enums§

DeserializeError
ExecuteTransactionCommon
ProtocolVersionId
ProtocolVersionId is a unique identifier of the protocol version. Note, that it is an identifier of the minor semver version of the protocol, with the major version being 0. Also, the protocol version on the contracts may contain potential minor versions, that may have different contract behavior (e.g. Verifier), but it should not impact the users.
VmVersion

Constants§

EIP_712_TX_TYPE
Denotes the first byte of the special ZKsync’s EIP-712-signed transaction.
EIP_1559_TX_TYPE
Denotes the first byte of the EIP-1559 transaction.
EIP_2930_TX_TYPE
Denotes the first byte of the EIP-2930 transaction.
EIP_4844_TX_TYPE
Denotes the first byte of the EIP-4844 transaction.
LEGACY_TX_TYPE
Denotes the first byte of some legacy transaction, which type is unknown to the server.
PRIORITY_OPERATION_L2_TX_TYPE
Denotes the first byte of the priority transaction.
PROTOCOL_UPGRADE_TX_TYPE
Denotes the first byte of the protocol upgrade transaction.

Traits§

EIP712TypedStructure
Interface for defining the structure for the EIP712 signature.
StructBuilder
Interface that collects members of the structure into the structure of the EIP-712 standard.
StructMember

Type Aliases§

Address
SerialId