Open
Description
Issue
In the contract we have multiple require checks to validate contract calls before execution. One of those is checking whether the Commitment that is created does not have a startTime
that is in the past
Example
line 180 SinglePlayerCommit.sol
require(_startTime > block.timestamp, "SPC::makeCommitment - commitment cannot start in the past");
line 145..149 SinglePlayerCommit.user.sol (test)
_startTime = new Date('1 Jan 2016 12:34:56 GMT').valueOf();
// await expect(
// contractWithUser.makeCommitment(_activity, _measureIndex, _goal, _startTime, _amountToStake, _overrides),
// ).to.be.revertedWith("SPC::makeCommitment - commitment cannot start in the past");
Reference
https://solidity.readthedocs.io/en/v0.6.10/units-and-global-variables.html?highlight=time#time-units
Expected outcome
- When making a contract call with a
startTime
in the past, the call is reverted with the error message declared in the contract. - there might be some delay, so maybe for now starttime can always be current blocktime?
- test uncommented and passes
Metadata
Metadata
Assignees
Labels
No labels