Solidity: Deprecate "now" and just rely on "block.timestamp"

Created on 30 Apr 2018  路  6Comments  路  Source: ethereum/solidity

My reasoning is that block.timestamp is way more explicit in showing the intention, while now requires explanation: yes, now relates to the timestamp of the block controlled by the miner.

Warning in 0.6.x, error in 0.7.0.

breaking change language design

Most helpful comment

Might want to consider something in the gasleft() vein - maybe timestamp(), or currentTime()

All 6 comments

Not sure about this one. If we start arguing about miners controlling blocks, we have to deprecate anything that has "transaction ordering dependence". now + 300 days is much easier to read than block.timestamp + 300 days and thus might be less confusing. We could do a survey here...

Might want to consider something in the gasleft() vein - maybe timestamp(), or currentTime()

I think I am still in favour of block.timestamp as that shows clearly where the data is coming from.

The twitter oracle preferred block.timestamp. I'd like to bring this up again and do it on 0.7.0.

Fine with removing now.

Was this page helpful?
0 / 5 - 0 ratings