Skip to content

IRentingHookMechanics

IRentingHookMechanics

RentingHookError

error RentingHookError(string reason)

Thrown when the renting hook execution failed due to the `reason`.

__onRent

function __onRent(uint256 rentalId, struct Rentings.Agreement rentalAgreement, struct Accounts.RentalEarnings rentalEarnings) external returns (bool success, string errorMessage)

Executes arbitrary logic after successful renting. NOTE: This function should not revert directly and must set correct `success` value instead.

Name Type Description
rentalId uint256 Rental agreement ID.
rentalAgreement struct Rentings.Agreement Newly registered rental agreement details.
rentalEarnings struct Accounts.RentalEarnings The rental earnings breakdown.
Name Type Description
success bool True if hook was executed successfully.
errorMessage string The reason of the hook execution failure.