Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 537 Bytes

get-nonce.md

File metadata and controls

30 lines (22 loc) · 537 Bytes

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