I need to define a specific time phase. Therefore, I wanted to use opening timestamp and closing timestamp using block.timestamp. I get the following warning:

Linter: security/no-block-members: Avoid using 'block.timestamp'.

with the explanation that block.timestamp can be manipulated by miners.

Is there another solution working with timestamp or defining a time phase resp.?

1 Answer 1


This linter advice is incorrect and in practice block.timestamp is safe. The risks of using block numbers are higher because the block production rate is not deterministic. The linter advice is based on non-realistic security assumptions that are not a concern under any kind of real scenario.

More information on this answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.