The contract calls tokenManager.tillIn()
without validating the result of this external call. If the call fails, the function proceeds without interruption, potentially leading to inconsistencies in the contract's state.
If the tillIn function fails (e.g., because of insufficient funds or if the contract is paused), the contract will behave as if the transfer was successful, even though it wasn’t. This could result in a mismatch between the expected and actual token balances, potentially allowing users to receive tokens or benefits incorrectly.
Example
In the settleAskMaker
function:
If tokenManager.tillIn()
fails silently (e.g., due to insufficient funds), the function continues, leading to:
No actual token transfer occurs.
The offer is still marked as settled using perMarkets.settledAskOffer()
.
An event is emitted, indicating a successful settlement, even though no tokens were transferred.
This can cause the contract to believe a settlement has occurred when, in fact, it hasn’t.
Manual Review
Verify the return value of tillIn
and ensure the transaction reverts if it fails.
If tillIn
doesn't return a value, consider modifying it or use a try/catch block to handle potential failures.
Log events for any failed transfers to facilitate off-chain monitoring.
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.