The FeeDistributionBranch
contract relies on external calls, such as token transfers using the ERC-20 transfer
function. This dependence introduces risks of reentrancy, unexpected failures, and gas consumption issues.
The claimFees
function interacts directly with external contracts via the IERC20.transfer
call:
if an external token’s transfer
function is overridden to include malicious logic, it could reenter the contract before state changes (e.g., updating feeBalances
) are finalized.
Unexpected Failures: External calls may fail for various reasons, such as insufficient gas or non-standard token implementations.
Gas Wastage: A loop making multiple external calls (e.g., one per asset) can result in high gas consumption, especially with maliciously large input arrays.
An attacker could exploit the claimFees
function by reentering the contract, causing inconsistent state updates or draining funds.
Manual review
Adopt the Checks-Effects-Interactions Pattern:
Update the contract state before making any external calls to prevent reentrancy.
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.