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_hashfield which is absent inL1BatchHeader. - 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
transactionsis module that holds the essential information for every transaction.- url
- utils
- vm_
trace - vm_
version - web3
- Selected Web3 types copied from the
web3crate. - zk_
evm_ types
Structs§
- Account
Tree Id - 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.
- Eip712
Domain - Encoded
Structure Member - 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.
- Input
Data - 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,hashis not equal to the hash of thedata, but rather calculated by special formula. - K256
Private Key - secp256k1 private key wrapper.
- L1Batch
Number - ZKsync L1 batch sequential index.
- L1Block
Number - Ethereum network block sequential index.
- L1Chain
Id - ChainId in the Ethereum network.
- L2Block
Number - ZKsync network block sequential index.
- L2Chain
Id - ChainId in the ZKsync network.
- Nonce
- ZKsync account nonce.
- Packed
EthSignature - Struct used for working with Ethereum signatures created using eth_sign (using geth, ethers.js, etc)
message is serialized as 65 bytes long
0xprefixed string. - Priority
OpId - 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§
- Deserialize
Error - Execute
Transaction Common - Protocol
Version Id ProtocolVersionIdis a unique identifier of the protocol version. Note, that it is an identifier of theminorsemver version of the protocol, with themajorversion being0. 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-1559transaction. - EIP_
2930_ TX_ TYPE - Denotes the first byte of the
EIP-2930transaction. - EIP_
4844_ TX_ TYPE - Denotes the first byte of the
EIP-4844transaction. - 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§
- EIP712
Typed Structure - Interface for defining the structure for the EIP712 signature.
- Struct
Builder - Interface that collects members of the structure into the structure of the EIP-712 standard.
- Struct
Member