The claimAndSwap
function currently uses balanceOf
to calculate the received amount after a swap. This approach can lead to inaccurate calculations if there are external factors affecting the contract’s token balance, such as dust, manual transfers, or additional swaps. Instead, the function should rely on the actual amount returned by the exchange
function to ensure accurate accounting.
Lack of Reliance on Actual Swap Output:
The router.exchange
function likely provides a return value indicating the exact amount swapped. Ignoring this and relying on balanceOf
is less reliable and unnecessarily risky.
The reliance on balanceOf can lead to inaccuracies in calculating the true output of the swap, which might cascade into errors in profit/loss reporting.
Use Actual Swap Output:
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.