4

I'm trying to do some modification to a test contract and i want to do it valid until a period of time like defining

startingTime= 25/08/2017;
endingTime= 27/08/2017;

is this possible in some way and what type should i use? i already checked the block.timestamp thing and don't like much that function because of the miners influence on that.

1 Answers1

5

If you're looking at something happening days in advance you should probably stop worrying and just use block.timestamp. See this discussion on how much you should worry about miner manipulation: Solidity: Timestamp dependency, is it possible to do safely?

If you're looking at an outcome within a few minutes, you should probably also require a minimum block.number, as block.timestamp is easily manipulated between blocks or over small numbers of blocks.

If you really need more confidence and/or precision than that, an alternative is to use some external timestamping service, but obviously that brings its own trust and security issues.

Edmund Edgar
  • 16,897
  • 1
  • 29
  • 58
  • Thank you for your time and answer, i know what you are saying, only want to know if is there some other way to control this type of cases – Erley Calle Aug 28 '17 at 13:41