The "sellProfits"
function in the "Fees"
smart contract lacks token allowance checks before performing token swaps using the Uniswap V3 router. This vulnerability can lead to potential security risks and unauthorized token spending.
The "sellProfits"
function directly swaps tokens without verifying whether the contract has been granted sufficient token allowance by the token owner. This means that the contract assumes it has complete control over the loan tokens (profits) and can spend them without any restrictions.
Unauthorized Token Spending: If the "Fees" contract receives loan tokens from external accounts or contracts, it can perform swaps without the proper approvals. This allows the contract to spend tokens that it does not actually own, leading to potential misuse of tokens.
Contract Inconsistency: The lack of token allowance checks makes the contract inflexible when interacting with external contracts. Changes in the external contract's address or requirements may result in the Fees contract becoming non-functional.
Manual code review
Use the IERC20.allowance()
function to ensure that the contract has the required allowance from the token owner or invoke the IERC20.approve()
function to set the appropriate allowance for the contract.
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.