The RockPaperScissors contract relies on block.timestamp to enforce timeouts and deadlines for game actions, which could potentially be manipulated by miners (albeit within a limited timeframe). This dependency appears in game creation, join deadlines, and the reveal phase timing mechanisms.
Timestamp Dependence: The contract uses block.timestamp for timeout calculations:
Scale of Manipulation: Miners can only adjust timestamps by seconds, while the contract's timeouts are generally much longer:
joinTimeout defaults to 24 hours
_timeoutInterval must be at least 5 minutes
Potential Scenarios:
A miner could delay the inclusion of a move reveal to make it appear to have missed the deadline
A player who is also a miner could gain a slight advantage in timing their actions
In close timeout situations, a miner could intentionally trigger or prevent a timeout
Slither, Cursor, Remix, Foundry
Use Block Numbers Instead of Timestamps:
Add Buffer Periods:
Code suggestions or observations that do not pose a direct security risk.
Code suggestions or observations that do not pose a direct security risk.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.