-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: use directly IERC165
in inheritance instead of ERC165
#238
Conversation
5ca5fa0
to
7112a50
Compare
7112a50
to
dcfbba4
Compare
dcfbba4
to
8c0ebb6
Compare
a0c1c1a
to
b0acce2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to keep super.supportsInterface
, otherwise we will stop the inheritance chain in supportsInterface
of child contracts such as LSP9, and LSP0 for example.
Tested and this actually will break the inheritance call via |
…ders2 refactor: prepare wrapper utils for provider merge
What does this PR introduce?
♻️ Refactor
Remove
IERC165
from the inheritance list ofIERC725X
andIERC725Y
.⚡️ Performance
Reduce deployment cost by an extra -45.814 gas compared to #236 by using directly
IERC165
in the inheritance instead ofERC165
and callingsuper.supportsInterface
.The checks for interface ID ERC165 are directly inlined as a result inside the
supportsInterface(bytes4)
function ofERC725XCore
,ERC725YCore
andERC725
contracts.PR Checklist
npm run lint
&&npm run lint:solidity
npm run format
(prettier)npm run build
npm run test
Previous gas cost (
develop
branch)New Gas costs (this branch)