cometh-hq / alembic-rental-contracts

2 stars 1 forks source link

In Rent, process the cost and fee should be done after the NFTs have been processed #5

Closed Mikerah closed 2 years ago

Mikerah commented 2 years ago

Severity: Low

In RentalProtocol.sol, the rent method currently processes the cost and fee before going onto processing each NFT. As this process handles users funds, it is best to apply the checks-effects-interaction pattern throughout the method even though the nonReentrant modifier is applied. As such, we recommend that the processing of the NFTs within the rental offer is performed first before then processing the costs and fees.

jeje commented 2 years ago

Proposal implemented with commit https://github.com/cometh-game/cometh-rental-contracts/commit/05f960ba7960a4ccd150c78bf717364dbe624aaf

Mikerah commented 2 years ago

LGTM