Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: medium
Invalid

Ignores return value after token approvals

Summary

In the contracts mentioned below, after approving a token, the return value `bool` is ignored. If the approval fails but the error is not checked, any subsequent transfers relying on that approval will also fail. This is an issue because, the contract assumes the token is approved for transfers but cannot verify it.

Vulnerability Details

```javascript
function _increaseAllowance(address spender, uint256 amount) internal {
=> feeToken.approve(spender, feeToken.allowance(address(this), spender) + amount);
}
```
found in
1.`LLMOracleCoordinator.sol::_increaseAllowance()`
2. `LLMOracleRegistry.sol::unregister()`
3. in the constructor of `BuyerAgent.sol`

Impact

if funds are held but cannot be transferred as intended, users might lose trust on the protocol and repeated unexpected reverts or failed transactions can impact the smooth operation of the protocol.

Tools Used

slither , manual review

Recommendations

1.use `SafeERC20` library from openzeppelin.(reccomended)
2.manually handle the return values.
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.