Skip to main content
For certain types of tests it’s useful to skip through time. This is possible from the dashboard with Configure next block, or over RPC with 2 Admin RPC methods available on Virtual Environments: evm_increaseTime and evm_setNextBlockTimestamp.

Getting the correct time

During execution of a transaction or eth_call accesses block.timestamp within a contract, the value will depend on whether the target block (latest or pending) block:
  • For pending block: block.timestamp == time.now() + adjustment_offset. This represents the current time adjusted by the time-adjustment methods.
  • For latest block: block.timestamp == latest_block.timestamp. This is the timestamp of the most recently mined block.
The adjustment_offset comes from time-adjustment methods:
  1. evm_setNextBlockTimestamp: Skips time to the timestamp for the next block: adjustment_offset = timestamp - time.now().
  2. evm_increaseTime: Advances time by a relative amount. adjustment_offset += increase_value

Examples

Increase time by an offset

showLineNumbers

Set timestamp for pending block

showLineNumbers

Configure the next block from the dashboard

In the Virtual Environment header, open the menu next to Mine and select Configure next block.
Configure next block dialog with an Add blocks field set to 1, Time configuration options Increase time and Set UNIX timestamp, a 10 seconds value, a preview table showing Mainnet block 25265709 changing to 25265710, and Fetch latest, Mine with next transaction, and Mine now buttons

Configure next block dialog, opened from the menu next to Mine.