FlashRolloverLoan_G5 cannot work well with some LenderCommitForwarders including the SmartCommitmentForwarder contract.
Summary
The SmartCommitmentForwarder contract doesn't have the acceptSmartCommitmentWithRecipient() and getCommitmentMarketId() functions. However, FlashRolloverLoan_G5 calles the functions. So, FlashRolloverLoan_G5 cannot work with the SmartCommitmentForwarder contract.
Vulnerability Detail
FlashRolloverLoan_G5 calles the acceptSmartCommitmentWithRecipient() and getCommitmentMarketId() functions of LenderCommitForwarder.
However, some LenderCommitForwarders don't have these functions. As a result, FlashRolloverLoan_G5 cannot work well with some LenderCommitForwarders including the SmartCommitmentForwarder contract.
Impact
FlashRolloverLoan_G5 cannot work with some LenderCommitForwarders including the SmartCommitmentForwarder contract.
KupiaSec
medium
FlashRolloverLoan_G5
cannot work well with some LenderCommitForwarders including theSmartCommitmentForwarder
contract.Summary
The
SmartCommitmentForwarder
contract doesn't have theacceptSmartCommitmentWithRecipient()
andgetCommitmentMarketId()
functions. However,FlashRolloverLoan_G5
calles the functions. So,FlashRolloverLoan_G5
cannot work with theSmartCommitmentForwarder
contract.Vulnerability Detail
FlashRolloverLoan_G5
calles theacceptSmartCommitmentWithRecipient()
andgetCommitmentMarketId()
functions ofLenderCommitForwarder
.https://github.com/sherlock-audit/2024-04-teller-finance/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/FlashRolloverLoan_G5.sol#L270-L368
https://github.com/sherlock-audit/2024-04-teller-finance/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/FlashRolloverLoan_G5.sol#L433-L439
However, some LenderCommitForwarders don't have these functions. As a result,
FlashRolloverLoan_G5
cannot work well with some LenderCommitForwarders including theSmartCommitmentForwarder
contract.Impact
FlashRolloverLoan_G5
cannot work with some LenderCommitForwarders including theSmartCommitmentForwarder
contract.Code Snippet
https://github.com/sherlock-audit/2024-04-teller-finance/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/FlashRolloverLoan_G5.sol#L270-L368
https://github.com/sherlock-audit/2024-04-teller-finance/blob/main/teller-protocol-v2-audit-2024/packages/contracts/contracts/LenderCommitmentForwarder/extensions/FlashRolloverLoan_G5.sol#L433-L439
Tool used
Manual Review
Recommendation
The
getCommitmentMarketId
function should be added into theSmartCommitmentForwarder
contract.And the function selector should be corrected as follows.
Duplicate of #135