function testDate(uint date1,uint date2)
public
returns (bool)
{
require(date1 == date2,'not same date')
return date1 == date2;
}让res =等待TestSol.testDate.call(‘1630972800’,‘1631145600’);

为什么这些都是真的?
发布于 2021-09-16 07:21:36
您的代码有几个问题。
‘1630972800’是一个字符串,而不是数字。我的猜测是,它被解释为完全不同的东西(可能是0),这两个数字在EVM中是相同的。如果您在Remix中尝试了这个函数,那么这个函数工作得很好,只是缺少了一个;。
https://ethereum.stackexchange.com/questions/110017
复制相似问题