Optimism
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Optimism
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Block timestamps are the on-chain clock that vesting schedules, auctions, time-locks, and reward accrual read from block.timestamp, and off-chain indexers use to place OP Mainnet events in real time. On OP Mainnet (chain ID 10), with a new block roughly every two seconds, that clock ticks fast and smoothly — but it is set by the sequencer, not measured by a global consensus of validators, which changes how much you can trust it for fine-grained logic. This guide is for smart contract and backend developers who need to use OP Mainnet timestamps safely: it covers how they are assigned, what accuracy you can and cannot assume, the bounds on manipulation, network time drift, and the patterns that keep time-based logic robust.
block.timestamp as a randomness source.block.timestamp alone.