Brisk Sapphire Chipmunk - ERC20.approve Used Instead of Safe Approvals, Causing Pool Failures with Some ERC20s #29
Labels
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
Brisk Sapphire Chipmunk
Medium
ERC20.approve Used Instead of Safe Approvals, Causing Pool Failures with Some ERC20s
Summary
The function acceptFundsForAcceptBid handles accepting a loan bid, transferring funds to the borrower, and securing collateral. It approves the TELLER_V2 contract to transfer the loan's principal amount using "ERC20.approve".
However, some ERC20s on some chains don't return a value.
The most popular example is USDT and USDC on the main net, and as the docs mention it should be compatible on any EVM chain and will support USDT:
Despite this claim, the current implementation of the approve function does not account for tokens like USDT, contradicting the protocol's intentions.
Therefore acceptFundsForAcceptBid will never work on the EVM Chain or other related chain and tokens.
Root Cause
In LenderCommitmentGroup_Smart.soL: 556, approve function is used instead of safeApprove. USDT on the main net doesn't return a value, https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7#code. This includes USDC which should work in the protocol.
This behavior causes the approve function to revert when interacting with these tokens.
The specific part of the function is highlighted her;
https://github.com/sherlock-audit/2024-11-teller-finance-update/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol#L556
Internal pre-conditions
External pre-conditions
Attack Path
Impact
PoC
No response
Mitigation
Use
safeApprove
instead ofapprove
The text was updated successfully, but these errors were encountered: