Skip to content

Commit c1a2738

Browse files
committed
feat: add missing supplyAmount check
Signed-off-by: GopherJ <[email protected]>
1 parent e68ccf1 commit c1a2738

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

contracts/protocol/libraries/logic/MarketplaceLogic.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,12 @@ library MarketplaceLogic {
635635
);
636636
DataTypes.ReserveData storage reserve = ps._reserves[vars.creditToken];
637637
vars.creditXTokenAddress = reserve.xTokenAddress;
638-
// either the buyer decided to not use any credit
638+
// either the seller & buyer decided to not use any credit
639639
// OR
640640
// the creditToken must be listed since otherwise cannot borrow from the pool
641641
require(
642-
vars.creditAmount == 0 || vars.creditXTokenAddress != address(0),
642+
(vars.creditAmount == 0 && vars.supplyAmount == 0) ||
643+
vars.creditXTokenAddress != address(0),
643644
Errors.ASSET_NOT_LISTED
644645
);
645646
}

0 commit comments

Comments
 (0)