Skip to content

Commit

Permalink
Remove ERC165Storage (#3880)
Browse files Browse the repository at this point in the history
Co-authored-by: Francisco <frangio.1@gmail.com>
  • Loading branch information
JulissaDantes and frangio authored Dec 19, 2022
1 parent 6ffa9a5 commit f0cecf7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 83 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* `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))
* `ProxyAdmin`: Removed `getProxyAdmin` and `getProxyImplementation` getters. ([#3820](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3820))
* `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))
* `ERC165Storage`: Removed this contract in favor of inheritance based approach. ([#3880](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3880))

### How to upgrade from 4.x

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

#### ERC165Storage

Users that were registering EIP-165 interfaces with `_registerInterface` from `ERC165Storage` should instead do so so by overriding the `supportsInterface` function as seen below:

```solidity
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
}
```

## Unreleased

* `ReentrancyGuard`: Add a `_reentrancyGuardEntered` function to expose the guard status. ([#3714](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3714))
Expand Down
11 changes: 0 additions & 11 deletions contracts/mocks/ERC165StorageMock.sol

This file was deleted.

2 changes: 1 addition & 1 deletion contracts/token/ERC721/extensions/ERC721Consecutive.sol
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@ abstract contract ERC721Consecutive is IERC2309, ERC721 {
(bool exists, uint96 latestId, ) = _sequentialOwnership.latestCheckpoint();
return exists ? latestId + 1 : 0;
}
}
}
2 changes: 0 additions & 2 deletions contracts/utils/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ Note that, in all cases, accounts simply _declare_ their interfaces, but they ar

{{ERC165}}

{{ERC165Storage}}

{{ERC165Checker}}

{{IERC1820Registry}}
Expand Down
2 changes: 0 additions & 2 deletions contracts/utils/introspection/ERC165.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import "./IERC165.sol";
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
Expand Down
42 changes: 0 additions & 42 deletions contracts/utils/introspection/ERC165Storage.sol

This file was deleted.

25 changes: 0 additions & 25 deletions test/utils/introspection/ERC165Storage.test.js

This file was deleted.

0 comments on commit f0cecf7

Please sign in to comment.