This repository has been archived by the owner on Oct 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ICollectionLibrary.sol
92 lines (84 loc) · 2.82 KB
/
ICollectionLibrary.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7;
/// @title Collection library interface
/// @author Rentable Team <[email protected]>
/// @custom:security Rentable Security Team <[email protected]>
/// @notice Implementer can realize custom logic for specific collections attaching to these hooks
interface ICollectionLibrary {
/* ========== MUTATIVE FUNCTIONS ========== */
/// @notice Called after a deposit
/// @param tokenAddress wrapped token address
/// @param tokenId wrapped token id
/// @param user depositor
function postDeposit(
address tokenAddress,
uint256 tokenId,
address user
) external;
/// @notice Called after a listing
/// @param tokenAddress wrapped token address
/// @param tokenId wrapped token id
/// @param user lister
/// @param maxTimeDuration max duration allowed for the rental
/// @param pricePerSecond price per second in payment token units
function postList(
address tokenAddress,
uint256 tokenId,
address user,
uint256 minTimeDuration,
uint256 maxTimeDuration,
uint256 pricePerSecond
) external;
/// @notice Called after a rent
/// @param tokenAddress wrapped token address
/// @param tokenId wrapped token id
/// @param duration rental duration
/// @param from rentee
/// @param to renter
/// @param toWallet renter wallet
function postRent(
address tokenAddress,
uint256 tokenId,
uint256 duration,
address from,
address to,
address payable toWallet
) external payable;
/// @notice Called after expiration settlement on-chain
/// @param tokenAddress wrapped token address
/// @param tokenId wrapped token id
/// @param from rentee
function postExpireRental(
address tokenAddress,
uint256 tokenId,
address from
) external payable;
/// @notice Called after WToken transfer
/// @param tokenAddress wrapped token address
/// @param tokenId wrapped token id
/// @param from sender
/// @param to receiver
/// @param toWallet receiver wallet
function postWTokenTransfer(
address tokenAddress,
uint256 tokenId,
address from,
address to,
address payable toWallet
) external;
/// @notice Called after OToken transfer
/// @param tokenAddress wrapped token address
/// @param tokenId wrapped token id
/// @param from sender
/// @param to receiver
/// @param currentRenterWallet current renter wallet
/// @param rented true when a rental is in place, false otw
function postOTokenTransfer(
address tokenAddress,
uint256 tokenId,
address from,
address to,
address payable currentRenterWallet,
bool rented
) external;
}