abi

package
v0.16.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package abi decodes the non-indexed data section of specific Ethereum event logs the juno node consumes.

Index

Constants

View Source
const WordSize = 32

WordSize is the size of a single ABI-encoded word: a uint256.

Variables

This section is empty.

Functions

func UnpackLogMessageToL2

func UnpackLogMessageToL2(data []byte) (payload []Word, nonce, fee Word, err error)

UnpackLogMessageToL2 decodes the data section of the Starknet core contract's LogMessageToL2 event into its three non-indexed fields.

Event ABI:

LogMessageToL2(address indexed fromAddress,
               uint256 indexed toAddress,
               uint256 indexed selector,
               uint256[] payload,
               uint256 nonce,
               uint256 fee)

The indexed fields are carried in log topics, not the data buffer, and are extracted by the caller. The data section encodes the remaining (uint256[], uint256, uint256) tuple per the Solidity ABI:

head[0] (32 bytes): offset to payload tail
head[1] (32 bytes): nonce
head[2] (32 bytes): fee
tail at head[0]:    length (32 bytes), then length × 32 bytes of elements

Types

type Word

type Word [WordSize]byte

Word is one ABI-encoded uint256: 32 big-endian bytes. The decoder returns words verbatim — interpretation (numeric, address, hash) is the caller's job.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL