The block.timestamp
on Arbitrum
can not represent right the current time.
The project will be deployed on Arbitrum
and Ethereum
. Also, the Streets::unstake
function relies on block.timestamp
to check the time for which the token is staked (stakedDuration
):
But the block.timestamp
on Arbitrum
works differently.
In the Arbitrum
documentation is said:
https://docs.arbitrum.io/for-devs/concepts/differences-between-arbitrum-ethereum/block-numbers-and-time#block-timestamps-arbitrum-vs-ethereum
Due to the way in which the block.timestamp
works on Arbitrum
it is possible the following scenario:
Bob stakes his token at 15:00 (3 PM) on February 27 and attempts to unstake at 17:00 (5 PM) on February 28, the real-world elapsed time is indeed 1 day and 2 hours. The contract is deployed on Arbitrum
and the block.timestamp
can return value that is 24 hours earlier than the current time. If the block.timestamp
on Arbitrum
is lagging by up to 24 hours due to the delay in rollup batch confirmations, the smart contract might see the current time as 17:00 on February 27, only 2 hours after the original stake.
As a result, when Bob tries to unstake, the contract calculates the staked duration based on the block.timestamp
, which it perceives to be only 2 hours past the staking time. This would lead to the contract not rewarding Bob any tokens, as it incorrectly assumes that the staking period was less than a day.
Also, it is possible the scenario when the block.timestamp
on Arbitrum
returns the time that is 1 hour in the future. In that case Bob will be able to unstake his token and receive his cred tokens 1 hour early.
Manual Review
Ensure that the return value of the stakedDuration
in Streets::unstake
function is calculated properly on every chain that the project is deployed.
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.