getNonce

Signature

function getNonce(address account) external returns (uint64);
function getNonce(Wallet memory wallet) external returns (uint64);

Description

Gets the nonce of the given account or Wallet.

Examples

address

uint256 nonce = vm.getNonce(address(100));
emit log_uint(nonce); // 0

Wallet

Wallet memory alice = vm.createWallet("alice");
uint256 nonce = vm.getNonce(nonce);
emit log_uint(nonce); // 0