Some tokens will be locked in the LenderCommitmentGroup_Smart contract forever if used as principal token.
Vulnerability Detail
Some ERC20 tokens, such as BNB, do not revert but return a bool value if the transfer() and transferFrom() function calls fail. Therefore, the transaction may not be reverted and funds may be lost.
Even if token transmission fails in #L412, the burnSharesToWithdrawEarnings() function is not reverted. Therefore, users may lose their poolSharesToken.
Impact
If the token send fails, it will cause a lot of serious problems.
For example, if a token such as BNB is used as the principal token, the user may lose the poolShareToken.
blockchain555
high
Some collateral will be locked in the contract
Summary
Some tokens will be locked in the
LenderCommitmentGroup_Smart
contract forever if used as principal token.Vulnerability Detail
Some ERC20 tokens, such as BNB, do not revert but return a bool value if the
transfer()
andtransferFrom()
function calls fail. Therefore, the transaction may not be reverted and funds may be lost.Even if token transmission fails in #L412, the
burnSharesToWithdrawEarnings()
function is not reverted. Therefore, users may lose theirpoolSharesToken
.Impact
If the token send fails, it will cause a lot of serious problems. For example, if a token such as BNB is used as the principal token, the user may lose the
poolShareToken
.Code Snippet
https://github.com/sherlock-audit/2024-04-teller-finance/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol#L412 https://github.com/sherlock-audit/2024-04-teller-finance/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol#L313 https://github.com/sherlock-audit/2024-04-teller-finance/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol#L446 https://github.com/sherlock-audit/2024-04-teller-finance/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/LenderCommitmentGroup/LenderCommitmentGroup_Smart.sol#L459
Tool used
Manual Review
Recommendation
Use OpenZeppelin's
safeTransfer()
, which is able to handle the missing return valueDuplicate of #50