Skip to content

Commit 81dbe64

Browse files
Remove ERC165Storage (#3880)
Co-authored-by: Francisco <[email protected]>
1 parent 9cbe8b3 commit 81dbe64

File tree

6 files changed

+11
-82
lines changed

6 files changed

+11
-82
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* `TransparentUpgradeableProxy`: Removed `admin` and `implementation` getters, which were only callable by the proxy owner and thus not very useful. ([#3820](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3820))
1010
* `ProxyAdmin`: Removed `getProxyAdmin` and `getProxyImplementation` getters. ([#3820](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3820))
1111
* `ERC20`: Deleted `_beforeTokenTransfer` and `_afterTokenTransfer` hooks, added a new internal `_update` function for customizations, and refactored all extensions using those hooks to use `_update` instead. ([#3838](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3838))
12+
* `ERC165Storage`: Removed this contract in favor of inheritance based approach. ([#3880](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3880))
1213

1314
### How to upgrade from 4.x
1415

@@ -33,6 +34,16 @@ For example, a contract using `ERC20`'s `_beforeTokenTransfer` hook would have t
3334
}
3435
```
3536

37+
#### ERC165Storage
38+
39+
Users that were registering EIP-165 interfaces with `_registerInterface` from `ERC165Storage` should instead do so so by overriding the `supportsInterface` function as seen below:
40+
41+
```solidity
42+
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
43+
return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
44+
}
45+
```
46+
3647
## Unreleased
3748

3849
* `ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714))

contracts/mocks/ERC165StorageMock.sol

Lines changed: 0 additions & 11 deletions
This file was deleted.

contracts/utils/README.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ Note that, in all cases, accounts simply _declare_ their interfaces, but they ar
7070

7171
{{ERC165}}
7272

73-
{{ERC165Storage}}
74-
7573
{{ERC165Checker}}
7674

7775
{{IERC1820Registry}}

contracts/utils/introspection/ERC165.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import "./IERC165.sol";
1616
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
1717
* }
1818
* ```
19-
*
20-
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
2119
*/
2220
abstract contract ERC165 is IERC165 {
2321
/**

contracts/utils/introspection/ERC165Storage.sol

Lines changed: 0 additions & 42 deletions
This file was deleted.

test/utils/introspection/ERC165Storage.test.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)