Skip to content

Commit 4c5d4be

Browse files
committed
fix ERC721 visibility layers and move custom errors to base interface
1 parent a97dd2f commit 4c5d4be

File tree

12 files changed

+195
-96
lines changed

12 files changed

+195
-96
lines changed

abi/ERC721BaseInternal.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@
3939
"name": "ERC721BaseInternal__TransferToZeroAddress",
4040
"type": "error"
4141
},
42+
{
43+
"inputs": [],
44+
"name": "ERC721Base__NotOwnerOrApproved",
45+
"type": "error"
46+
},
47+
{
48+
"inputs": [],
49+
"name": "ERC721Base__SelfApproval",
50+
"type": "error"
51+
},
4252
{
4353
"anonymous": false,
4454
"inputs": [

abi/ERC721Metadata.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@
3939
"name": "ERC721BaseInternal__TransferToZeroAddress",
4040
"type": "error"
4141
},
42+
{
43+
"inputs": [],
44+
"name": "ERC721Base__NotOwnerOrApproved",
45+
"type": "error"
46+
},
47+
{
48+
"inputs": [],
49+
"name": "ERC721Base__SelfApproval",
50+
"type": "error"
51+
},
4252
{
4353
"inputs": [],
4454
"name": "ERC721Metadata__NonExistentToken",

abi/ERC721MetadataInternal.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@
3939
"name": "ERC721BaseInternal__TransferToZeroAddress",
4040
"type": "error"
4141
},
42+
{
43+
"inputs": [],
44+
"name": "ERC721Base__NotOwnerOrApproved",
45+
"type": "error"
46+
},
47+
{
48+
"inputs": [],
49+
"name": "ERC721Base__SelfApproval",
50+
"type": "error"
51+
},
4252
{
4353
"anonymous": false,
4454
"inputs": [

abi/IERC721.json

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,4 @@
11
[
2-
{
3-
"inputs": [],
4-
"name": "ERC721BaseInternal__BalanceQueryZeroAddress",
5-
"type": "error"
6-
},
7-
{
8-
"inputs": [],
9-
"name": "ERC721BaseInternal__ERC721ReceiverNotImplemented",
10-
"type": "error"
11-
},
12-
{
13-
"inputs": [],
14-
"name": "ERC721BaseInternal__InvalidOwner",
15-
"type": "error"
16-
},
17-
{
18-
"inputs": [],
19-
"name": "ERC721BaseInternal__MintToZeroAddress",
20-
"type": "error"
21-
},
22-
{
23-
"inputs": [],
24-
"name": "ERC721BaseInternal__NonExistentToken",
25-
"type": "error"
26-
},
27-
{
28-
"inputs": [],
29-
"name": "ERC721BaseInternal__NotTokenOwner",
30-
"type": "error"
31-
},
32-
{
33-
"inputs": [],
34-
"name": "ERC721BaseInternal__TokenAlreadyMinted",
35-
"type": "error"
36-
},
37-
{
38-
"inputs": [],
39-
"name": "ERC721BaseInternal__TransferToZeroAddress",
40-
"type": "error"
41-
},
422
{
433
"anonymous": false,
444
"inputs": [

abi/IERC721BaseInternal.json

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
[
2+
{
3+
"inputs": [],
4+
"name": "ERC721BaseInternal__BalanceQueryZeroAddress",
5+
"type": "error"
6+
},
7+
{
8+
"inputs": [],
9+
"name": "ERC721BaseInternal__ERC721ReceiverNotImplemented",
10+
"type": "error"
11+
},
12+
{
13+
"inputs": [],
14+
"name": "ERC721BaseInternal__InvalidOwner",
15+
"type": "error"
16+
},
17+
{
18+
"inputs": [],
19+
"name": "ERC721BaseInternal__MintToZeroAddress",
20+
"type": "error"
21+
},
22+
{
23+
"inputs": [],
24+
"name": "ERC721BaseInternal__NonExistentToken",
25+
"type": "error"
26+
},
27+
{
28+
"inputs": [],
29+
"name": "ERC721BaseInternal__NotTokenOwner",
30+
"type": "error"
31+
},
32+
{
33+
"inputs": [],
34+
"name": "ERC721BaseInternal__TokenAlreadyMinted",
35+
"type": "error"
36+
},
37+
{
38+
"inputs": [],
39+
"name": "ERC721BaseInternal__TransferToZeroAddress",
40+
"type": "error"
41+
},
42+
{
43+
"inputs": [],
44+
"name": "ERC721Base__NotOwnerOrApproved",
45+
"type": "error"
46+
},
47+
{
48+
"inputs": [],
49+
"name": "ERC721Base__SelfApproval",
50+
"type": "error"
51+
},
52+
{
53+
"anonymous": false,
54+
"inputs": [
55+
{
56+
"indexed": true,
57+
"internalType": "address",
58+
"name": "owner",
59+
"type": "address"
60+
},
61+
{
62+
"indexed": true,
63+
"internalType": "address",
64+
"name": "operator",
65+
"type": "address"
66+
},
67+
{
68+
"indexed": true,
69+
"internalType": "uint256",
70+
"name": "tokenId",
71+
"type": "uint256"
72+
}
73+
],
74+
"name": "Approval",
75+
"type": "event"
76+
},
77+
{
78+
"anonymous": false,
79+
"inputs": [
80+
{
81+
"indexed": true,
82+
"internalType": "address",
83+
"name": "owner",
84+
"type": "address"
85+
},
86+
{
87+
"indexed": true,
88+
"internalType": "address",
89+
"name": "operator",
90+
"type": "address"
91+
},
92+
{
93+
"indexed": false,
94+
"internalType": "bool",
95+
"name": "approved",
96+
"type": "bool"
97+
}
98+
],
99+
"name": "ApprovalForAll",
100+
"type": "event"
101+
},
102+
{
103+
"anonymous": false,
104+
"inputs": [
105+
{
106+
"indexed": true,
107+
"internalType": "address",
108+
"name": "from",
109+
"type": "address"
110+
},
111+
{
112+
"indexed": true,
113+
"internalType": "address",
114+
"name": "to",
115+
"type": "address"
116+
},
117+
{
118+
"indexed": true,
119+
"internalType": "uint256",
120+
"name": "tokenId",
121+
"type": "uint256"
122+
}
123+
],
124+
"name": "Transfer",
125+
"type": "event"
126+
}
127+
]

abi/IERC721Internal.json

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,4 @@
11
[
2-
{
3-
"inputs": [],
4-
"name": "ERC721BaseInternal__BalanceQueryZeroAddress",
5-
"type": "error"
6-
},
7-
{
8-
"inputs": [],
9-
"name": "ERC721BaseInternal__ERC721ReceiverNotImplemented",
10-
"type": "error"
11-
},
12-
{
13-
"inputs": [],
14-
"name": "ERC721BaseInternal__InvalidOwner",
15-
"type": "error"
16-
},
17-
{
18-
"inputs": [],
19-
"name": "ERC721BaseInternal__MintToZeroAddress",
20-
"type": "error"
21-
},
22-
{
23-
"inputs": [],
24-
"name": "ERC721BaseInternal__NonExistentToken",
25-
"type": "error"
26-
},
27-
{
28-
"inputs": [],
29-
"name": "ERC721BaseInternal__NotTokenOwner",
30-
"type": "error"
31-
},
32-
{
33-
"inputs": [],
34-
"name": "ERC721BaseInternal__TokenAlreadyMinted",
35-
"type": "error"
36-
},
37-
{
38-
"inputs": [],
39-
"name": "ERC721BaseInternal__TransferToZeroAddress",
40-
"type": "error"
41-
},
422
{
433
"anonymous": false,
444
"inputs": [

abi/IERC721Metadata.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@
3939
"name": "ERC721BaseInternal__TransferToZeroAddress",
4040
"type": "error"
4141
},
42+
{
43+
"inputs": [],
44+
"name": "ERC721Base__NotOwnerOrApproved",
45+
"type": "error"
46+
},
47+
{
48+
"inputs": [],
49+
"name": "ERC721Base__SelfApproval",
50+
"type": "error"
51+
},
4252
{
4353
"inputs": [],
4454
"name": "ERC721Metadata__NonExistentToken",

contracts/interfaces/IERC721Internal.sol

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ pragma solidity ^0.8.8;
66
* @title Partial ERC721 interface needed by internal functions
77
*/
88
interface IERC721Internal {
9-
error ERC721BaseInternal__BalanceQueryZeroAddress();
10-
error ERC721BaseInternal__ERC721ReceiverNotImplemented();
11-
error ERC721BaseInternal__InvalidOwner();
12-
error ERC721BaseInternal__MintToZeroAddress();
13-
error ERC721BaseInternal__NonExistentToken();
14-
error ERC721BaseInternal__NotTokenOwner();
15-
error ERC721BaseInternal__TokenAlreadyMinted();
16-
error ERC721BaseInternal__TransferToZeroAddress();
17-
189
event Transfer(
1910
address indexed from,
2011
address indexed to,

contracts/token/ERC721/base/ERC721BaseInternal.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
pragma solidity ^0.8.8;
44

5-
import { IERC721Internal } from '../../../interfaces/IERC721Internal.sol';
65
import { IERC721Receiver } from '../../../interfaces/IERC721Receiver.sol';
76
import { AddressUtils } from '../../../utils/AddressUtils.sol';
87
import { EnumerableMap } from '../../../utils/EnumerableMap.sol';
98
import { EnumerableSet } from '../../../utils/EnumerableSet.sol';
9+
import { IERC721BaseInternal } from './IERC721BaseInternal.sol';
1010
import { ERC721BaseStorage } from './ERC721BaseStorage.sol';
1111

1212
/**
1313
* @title Base ERC721 internal functions
1414
*/
15-
abstract contract ERC721BaseInternal is IERC721Internal {
15+
abstract contract ERC721BaseInternal is IERC721BaseInternal {
1616
using ERC721BaseStorage for ERC721BaseStorage.Layout;
1717
using AddressUtils for address;
1818
using EnumerableMap for EnumerableMap.UintToAddressMap;

contracts/token/ERC721/base/IERC721Base.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
pragma solidity ^0.8.8;
44

55
import { IERC721 } from '../../../interfaces/IERC721.sol';
6+
import { IERC721BaseInternal } from './IERC721BaseInternal.sol';
67

78
/**
89
* @title ERC721 base interface
910
*/
10-
interface IERC721Base is IERC721 {
11-
error ERC721Base__NotOwnerOrApproved();
12-
error ERC721Base__SelfApproval();
11+
interface IERC721Base is IERC721BaseInternal, IERC721 {
12+
1313
}

0 commit comments

Comments
 (0)