Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Due to Arbitrum Sequencer, horses can be happy 0 or 2 days

Description

On Arbitrum, a sequencer is used for block.timestamp, and it can deviate by up to 24 hours earlier or 1 hour in the future compared to real-time (See Arbitrum docs for more information).

A horse is supposed to be happy for 24 hours after a meal. However, if block.timestamp is 24 hours earlier (due to Arbitrum sequencer) during a call to isHappyHorse, a horse can be happy for 2 days. Conversely, if block.timestamp is 24 hours earlier during a call to feedHorse, a horse can be happy for 0 days if the sequencer corrects the timestamp just after the call.

Impact

Invariant breaking :

  • A horse can be happy for 2 days with just one meal.

  • A horse can be happy for 0 days after a meal.

Recommended Mitigation

Arbitrum is not recommended for this type of contract due to the deviation in block.timestamp caused by the Arbitrum sequencer. Consider using other Ethereum Layer 2 solutions or the Ethereum mainnet to avoid issues related to time deviation.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Arbitrum timestamps can be inaccurate.

Block timestamps can vary between Arbitrum and Ethereum in case sequencer fails to post batches on the parent chain within a [24 hours earlier than the current time or 1 hour in the future] boundary. This can lead to inconsistencies for Horses minted on Arb.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.