I need to use height() and timestamp() in my contract.
There are two methods for doing that.
- Import the two functions using
use std::block::(height, timestamp};. You can then use
timestamp()in your code as needed.
- Use call paths in your code when using those function. E.g.
let h = std::block::height();.