Example: Simulate new transaction

Let’s walk through an example of simulating an arbitrary transaction in Walnut.

Suppose we want to simulate a transaction that calls the increase_balance method on the following contract deployed on the Sepolia network: 0x03f09656761d212cdcc05f1479c914491f6096a9396fe8a6acfb6bb2351b845c.

The entrypoint we intend to call:

    fn increase_balance(amount: felt252)

Step 1: Navigate to the Simulation Page

Go to Walnut and click on "Simulate Transaction".

Step 2: Fill in the Form Fields

  • Network: Choose SN_SEPOLIA, since the contract is deployed on Sepolia.
  • Sender Address: Enter your account address or any valid account address.
  • Number of contract calls: Set to 1, as we are invoking a single contract.
    • Contract address: Paste 0x03f09656761d212cdcc05f1479c914491f6096a9396fe8a6acfb6bb2351b845c. This will auto-load the list of available entrypoints.
    • Entrypoint: Select increase_balance from the list of available functions.
    • Entrypoint signature: Displays the function signature, showing the expected input arguments. This is a read-only field to help you with the next calldata field.
    • Calldata: The increase_balance function takes one argument named amount of type felt252. You can input a value like 3, encoded as 0x3.
  • Block Number: Optionally specify a block number. If left blank, Walnut will use the latest block.
  • Transaction Version: Set to Version 3.

Step 3: Run the Simulation

Click "Run Simulation" and wait for the results.