contract ExampleContract { uint256 public lastCall; function hasCooldown() public { uint256 day = 60 * 60 * 24; require(block.timestamp > lastCall + day, "hasn't been a day"); lastCall = block.timestamp; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter