I want a function to only be able to be called after a certain specific period of time has passed from the contract's inception. Generally, I was using block.number for that. As in:
require(block.number >= 8000000);
However, if I want to use block.timestamp, could I do as below:
contract Time is owned {
uint today;
constructor() public {
today = block.timestamp;
}
Declare 'today', and then set a requirement:
require (block.timestamp >= today + 365 days);
Will that work in preventing that the function gets called before 365 days pass from the publishing of the contract?