Units
Common units
weiis the smallest subdenomination of Ether (1wei== 1)gweiis the commonly used subdenomination to describe gas price (1gwei== 1e9)etherunit (1ether== 1e18)
Note
In Solidity, we will use integers for calculations and the language does not support the float type. The float representation issue causes rounding errors (rounding) that create logical holes for attack.
Time units
1 == 1
seconds1
minutes== 60seconds1
hours== 60minutes1
days== 24hours1
weeks== 7days
Example
function f(uint start, uint daysAfter) public {
if (block.timestamp >= start + daysAfter * 1 days) {
// ...
}
}Last updated