Skip to content

Commit

Permalink
fix: validating if the rental expiration date is lte offer in _cancel…
Browse files Browse the repository at this point in the history
…RentalOffer
  • Loading branch information
EDUARDO MELO DE SIQUEIRA authored and EDUARDO MELO DE SIQUEIRA committed Jun 17, 2024
1 parent e7eb859 commit 1d4ad34
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contracts/NftRentalMarketplace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ contract NftRentalMarketplace is Initializable, OwnableUpgradeable, PausableUpgr

nonceDeadline[msg.sender][_offer.nonce] = uint64(block.timestamp);
for (uint256 i = 0; i < _offer.roles.length; i++) {
roleDeadline[_offer.roles[i]][_offer.tokenAddress][_offer.tokenId] = uint64(block.timestamp);

if(rentals[_offerHash].expirationDate <= roleDeadline[_offer.roles[i]][_offer.tokenAddress][_offer.tokenId]) {
roleDeadline[_offer.roles[i]][_offer.tokenAddress][_offer.tokenId] = rentals[_offerHash].expirationDate;
} else {
roleDeadline[_offer.roles[i]][_offer.tokenAddress][_offer.tokenId] = uint64(block.timestamp);
}
}
emit RentalOfferCancelled(_offer.lender, _offer.nonce);
}
Expand Down

0 comments on commit 1d4ad34

Please sign in to comment.