-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathERC721Recover.sol
38 lines (33 loc) · 1.33 KB
/
ERC721Recover.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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {RecoverERC721} from "./recover/RecoverERC721.sol";
/**
* @title ERC721Recover
* @dev Allows the contract owner to recover any ERC-721 token sent into the contract and sends them to a receiver.
*/
abstract contract ERC721Recover is Ownable, RecoverERC721 {
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) Ownable(initialOwner) {}
/**
* @dev Recovers the `tokenId` of the ERC-721 `tokenAddress` locked into this contract
* and sends it to the `tokenReceiver` address.
*
* NOTE: restricting access to owner only. See `RecoverERC721::_recoverERC721`.
*
* @param tokenAddress The contract address of the token to recover.
* @param tokenReceiver The address that will receive the recovered token.
* @param tokenId The identifier for the NFT to be recovered.
* @param data Additional data with no specified format.
*/
function recoverERC721(
address tokenAddress,
address tokenReceiver,
uint256 tokenId,
bytes memory data
) public virtual onlyOwner {
_recoverERC721(tokenAddress, tokenReceiver, tokenId, data);
}
}