Skip to main content
2 votes

block.timestamp: will my function possibly fail?

Will my function possibly fail if last block mined is closer than 24hrs? Or does block.timestamp get updated with actual current block timestamp before executing my function, even if still not mined ...
Mila A's user avatar
  • 1,254
2 votes

How can I check if the day is Valentine’s Day every year?

I know about this library here: https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary There are instructions in the README. In any case it's very simple, you can just copy the library into your ...
0xSanson's user avatar
  • 3,294
1 vote

Solidity Add Timer So It Would Get Executed By Itself

You can use Chainlink Automation to achieve that functionality. It provides three kinds of triggers depending on the use-case: Time-Based - calling function in a regular interval like cron jobs. ...
SYED ASAD KAZMI's user avatar
1 vote

block.timestamp: will my function possibly fail?

Due to the network distributed nature and transactions propagation time. It could be possible that block producers clock aren't synchronized with the frontend clock. It is feasible that the ...
Ismael's user avatar
  • 30.5k
1 vote
Accepted

Can Arbitrum's block timestamp be trusted to the same degree as the L1 time?

The block timestamp cannot be trusted to the same degree on a L2 like Arbitrum, but it is not fully gameable. Whenever a batch settles on the L1, it sends the latest timestamp to the L2. From the ...
Paul Razvan Berg's user avatar
1 vote

Are block.timestamp and block.number still problematic under Proof of Stake?

Yes, generally using block values as a proxy for time is not a good idea. The main reason is that while slots are currently every 12 seconds, it is not guaranteed that it won't decrease or change in ...
eth's user avatar
  • 86k
1 vote

Is it possible to set a custom start time and block number for a local Hardhat node?

Yes, Hardhat allows you to set a specific block number for your local node. To add a block number, you just need to include it in your hardhat.config.js file: networks: { hardhat: { ...
Rohan Nero's user avatar
  • 1,607
1 vote
Accepted

How to send signed data to backed and verify it?

As an example, your data structure could be: let user = { data: { name: 'name1', age: 367, height: 188, timestamp: 1236366, }, address: '0x<UserAddress&...
tenbits's user avatar
  • 2,428
1 vote

How to get the block number which is the closest to a given timestamp?

Old question, new answer: findblock API provides you with two endpoints that can do just that
Ján Jakub Naništa's user avatar
1 vote

How to get the block number which is the closest to a given timestamp?

Moralis have an API endpoint just for that, so if you already happen to use their API, there's no need to add another dependency. https://docs.moralis.io/web3-data-api/evm/reference/get-date-to-block?...
rioted's user avatar
  • 111

Only top scored, non community-wiki answers of a minimum length are eligible