The _stake
and _withdraw
functions in the Distribution
contract transfer tokens before updating user balances, potentially exposing the contract to reentrancy attacks.
The _stake
and _withdraw
functions perform token transfers before updating user balances. This design can expose the contract to reentrancy attacks, where a malicious external contract may call back into the Distribution
contract during the token transfer process.
The lack of updating user balances before transferring tokens may allow an attacker to exploit reentrancy, potentially leading to unexpected behavior or financial loss.
No specific tools were used to identify this issue; it was identified through manual code review.
Update User Balances Before Transferring Tokens:
Ensure that user balances are updated before any token transfers within the _stake
and _withdraw
functions. This helps prevent potential reentrancy attacks.
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.