code-423n4 / 2021-10-ambire-findings

0 stars 0 forks source link

block.timestamp cannot be 0 #60

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

pauliax

Vulnerability details

Impact

No need for the first check against 0 here as block.timestamp can never be < 0 later: require(scheduled[hashTx] != 0 && block.timestamp < scheduled[hashTx], 'TOO_LATE');

Recommended Mitigation Steps

require(block.timestamp < scheduled[hashTx], 'TOO_LATE');

Ivshti commented 2 years ago

No, this check was made because 0 is a santinel value that means "it's not set"

GalloDaSballo commented 2 years ago

As shown by the declaration in line 11

0 is meant to signify unset

Invalid finding