时间生成规则

Posted 月夜魂归

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了时间生成规则相关的知识,希望对你有一定的参考价值。

笔记软件在2023/3/29 20:57:08推送该笔记

初始化

constructor()
    _contractCreateTime = block.timestamp;

function seconds10CanDo() external
    if(block.timestamp>_contractCreateTime+10 seconds)
        student.id = 8000;
    

//e.g:after 10 seconds
modifier only(uint time)
    require(block.timestamp>_contractCreateTime+time);
    _;

以上是关于时间生成规则的主要内容,如果未能解决你的问题,请参考以下文章