I’m trying to make a transfer function require X or Y dependent on time relative to the contract creation.
So far this is what I have:
uint256 public createTime;
function Time() public {
createTime = block.timestamp;
}
function _transfer(blabla)
if(createTime < 7 days * 1 days)
{
require(this and that);
}
if(createTime > 7 days * 1 days)
{
require(this and that);
}
The first function Time shows as 0 in the testnet. I’m not sure if this is correct? I was under the impression that function would display the timestamp the contract was transacted (deployed), so that I could calculate certain time requirements relative to that starting time.
Is this in any way correct or am I off the ballpark here?
Thanks!