Skip to content

@receipts:block.timestamp

Timestamp of a sealed block, addressed by number or tag (default: latest).

On-chain (@receipts:block.timestamp!): Reads the block being written, and takes no arguments.

⚗️ Experimental — available at next.evmcrispr.com.

Returns: number

@receipts:block.timestamp(block? chain?)
NameTypeDescription
[block]number | stringBlock number or tag (default: latest)
[chain]chainChain to look on (default: current chain)
# Read the timestamp a sealed block was mined at
set $when @receipts:block.timestamp(19426587 mainnet)

With ! and no arguments the read happens on-chain at assertion time: the timestamp of the block being written.

load receipts
set $vesting 0x0102030405060708090a0b0c0d0e0f1011121314
# Seconds until unlock, computed at assertion time
assert @num!($vesting::{unlockTime()(uint256)} - @block.timestamp!) > 86400