Skip to main content

Simulating Transactions

As explained in Pool Unlock, Angstrom pools are locked at the start of the block to prevent anyone from bypassing the auction. The unlock state is determined by _isUnlocked() : it returns true only when lastBlockUpdated == block.number, which gets updated by the auction-settlement tx each block. The beforeSwap enforces this: if the pool is locked and no valid attestation is provided, the swap reverts.

To simulate successfully, first put the pool into its unlocked state via one of:

  1. Simulate the Angstrom bundle we provide before simulating your swap tx.
  2. Supply a signed unlock attestation for the block in the hook data of your Uniswap V4 swap call. The attestation unlocks the pool with no additional simulation steps.
  3. Override the _lastBlockUpdated storage slot before simulating your tx to mark the pool as unlocked.

With Bundle or Unlock Attestation

  • Bundle: run the provided Angstrom bundle before your transaction in the same simulated block.
  • Unlock Attestation: include the attestation bytes in the hook data of the swap; the pool stays unlocked for that call. See Unlock Attestations for attestation sourcing and validation.

Without Bundle or Unlock Attestation

Override the _lastBlockUpdated storage parameters so the pool is unlocked in the simulator:

  • contract: Angstrom (0x0000000AA8c2Fb9b232F78D2B286dC2aE53BfAD4)
  • storage slot: 3
  • offset: 0
  • bytes: 8