Skip to content

Commit

Permalink
feat: crete when rentalProject not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
CanvasL committed Jul 23, 2024
1 parent 2b32097 commit 99a643a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Marketplace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ contract Marketplace is Ownable {
address rentalProduct = RENTAL_PRODUCT_FACTORY.getRentalProduct(
args.product
);
require(address(rentalProduct) != address(0), "unsupported nft");
if(rentalProduct == address(0)) {
rentalProduct = RENTAL_PRODUCT_FACTORY.createRentalProduct(args.product);
}
require(
listings[rentalProduct][args.tokenId].status ==
ListingStatus.WithdrawnOrNotExist, // Never listed or withdrawn
Expand Down

0 comments on commit 99a643a

Please sign in to comment.