-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathExampleERC721A.sol
More file actions
32 lines (28 loc) · 1.01 KB
/
ExampleERC721A.sol
File metadata and controls
32 lines (28 loc) · 1.01 KB
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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "erc721a/ERC721A.sol";
import "../PreApproveChecker.sol";
/**
* @title ExampleERC721A
* @notice This example contract is a demonstration of how to override the
* `isApprovedForAll` function to query the pre-approve registry.
*/
contract ExampleERC721A is ERC721A {
/**
* @dev For best gas performance, this should be a hardcoded constant.
* You can either set it to the EOA you use to list/remove operators,
* or an proxy that allows the owner to list/remove operators.
*/
address public constant PRE_APPROVE_LISTER = 0x0123456789012345678901234567890123456789;
constructor() ERC721A("Example", "EXAMPLE") {}
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
return ERC721A.isApprovedForAll(owner, operator)
|| PreApproveChecker.isPreApproved(operator, owner, PRE_APPROVE_LISTER);
}
}