Call Trace Types

Walnut Call Trace supports three different types of calls: CALL, DELEGATE, and FUNCTION, each representing a specific type of contract interaction on Starknet. Here’s a breakdown of what each type entails.

    What are Frames: In a Call Trace component on Walnut, each call item is referred to as a “Frame.” Frames represent the sequence of calls within a transaction.

CALL

Link to an example transaction with Call Trace containing a CALL frame.

CALL represents a regular contract call, which is a direct interaction between two contracts.

For example, in the screenshot above, the function mint_and_deposit on the Ekubo:Positions contract calls the mint function on the Ekubo:PositionsNFT contract. This interaction delegates the process of minting a new NFT to the Ekubo:PositionsNFT contract, which creates the NFT, updates its own storage, and returns the newly minted token ID (type u64).

DELEGATE

Link to an example transaction with Call Trace containing a DELEGATE frame.

DELEGATE represents a call to a function in a library from another contract class, using the storage of the caller contract. Any state changes made during this call affect the caller’s storage, not the callee’s—in this case, the library.

For example, in the screenshot above, IExchange.multi_route_swap initiates a sequence of calls to the Realms:LORDS Token contract to query balances (balanceOf) and perform token transfers (transferFrom). A delegate call is then made to the ISwapAdapter class to execute the logic for the swap. Any state changes made during this swap execution affect the storage of the caller contract (IExchange), not the ISwapAdapter contract.

FUNCTION

Link to an example transaction with Call Trace containing a FUNCTION frame.

FUNCTION represents function calls that are internal to a given contract. These calls provide insights into the internal workings and computations within the contract, which are valuable for debugging, auditing, or gaining a deeper understanding of the transaction.

    Public explorers typically don’t display FUNCTION calls in their Call Trace components because blockchain nodes don’t provide this data. Walnut overcomes this limitation by resimulating each transaction using its own infrastructure. This enables Walnut to generate the full trace, including internal operations, and display the entire execution flow.