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
/
ORentable.sol
56 lines (46 loc) · 1.65 KB
/
ORentable.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
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7;
// Inheritance
import {BaseTokenInitializable} from "./BaseTokenInitializable.sol";
// References
import {IORentableHooks} from "../interfaces/IORentableHooks.sol";
import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
/// @title OToken
/// @author Rentable Team <[email protected]>
/// @custom:security Rentable Security Team <[email protected]>
/// @notice Represents a transferrable tokenized deposit and mimics the wrapped token
contract ORentable is BaseTokenInitializable {
/* ========== CONSTRUCTOR ========== */
/// @notice Instantiate a token
/// @param wrapped wrapped token address
/// @param owner admin for the contract
/// @param rentable rentable address
constructor(
address wrapped,
address owner,
address rentable
) BaseTokenInitializable(wrapped, owner, rentable) {}
/* ========== VIEWS ========== */
/* ---------- Internal ---------- */
/// @inheritdoc BaseTokenInitializable
function _getPrefix() internal virtual override returns (string memory) {
return "o";
}
/* ========== MUTATIVE FUNCTIONS ========== */
/* ---------- Internal ---------- */
/// @inheritdoc ERC721Upgradeable
function _transfer(
address from,
address to,
uint256 tokenId
) internal override {
// Notify Rentable after successful transfer
super._transfer(from, to, tokenId);
IORentableHooks(getRentable()).afterOTokenTransfer(
getWrapped(),
from,
to,
tokenId
);
}
}