Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Rentals are ended where there could be fees to be claimed #1

Open
gioenn opened this issue Nov 4, 2021 · 0 comments
Open

Rentals are ended where there could be fees to be claimed #1

gioenn opened this issue Nov 4, 2021 · 0 comments

Comments

@gioenn
Copy link
Contributor

gioenn commented Nov 4, 2021

When a rental is terminated, function createLease allows to opportunistically create a new rental (for the same listing) and an event RentEnds is emitted which so far indicates also fees are completely claimed which could not be the case.

https://github.com/rentable-world/rentable-protocol/blob/694d4b1f3546d8b0a80904bcaedeca2d64eeac62/contracts/Rentable.sol#L211-L230

Possible solutions

  1. At protocol level automatically send the remaining fees to the owner of the yToken and then propagate the event
  2. At subgraph level avoid setting availableToClaim to 0 in handleRentEnds (see: https://github.com/rentable-world/rentable-subgraph/blob/e47633efa4dda86a70b972b5e3ae2790f9e4a4ae/src/mappings.ts#L136-L145)

Impact on users

Rentals with available fees to be claimed are not shown in the rentals list if a new rental for the same listing is created. This prevents user to claim these fees through the frontend (they should make a direct call to the smart contract).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant