To measure whether the time limit has been exceeded
(uint deadline) ⇒ true or false
deadline = 946684800
block.timestamp = 1656477111
block.timestamp
(uint
): current block timestamp in seconds since Unix epoch
⇒ reverted false
modifier ensure(uint deadline) {
require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED');
_; // execute function
}
https://github.com/Uniswap/v2-periphery/blob/master/contracts/UniswapV2Router02.sol#L18
https://solidity-by-example.org/function-modifier