Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃帹 Style nits #51

Merged
merged 3 commits into from Oct 24, 2022
Merged

馃帹 Style nits #51

merged 3 commits into from Oct 24, 2022

Conversation

transmissions11
Copy link
Collaborator

No description provided.

Comment on lines 22 to 28
/// @notice Returns the domain separator for the current chain.
/// @dev Uses cached version if chainid and address are unchanged from construction.
function DOMAIN_SEPARATOR() public view returns (bytes32) {
if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
return _CACHED_DOMAIN_SEPARATOR;
} else {
return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME);
}
return
block.chainid == _CACHED_CHAIN_ID
? _CACHED_DOMAIN_SEPARATOR
: _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed the this address(this) stuff isnt rly needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and removing it should give us a lil gas savings

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, @marktoda and I discussed this a bit more on Friday and think we should actually keep it. OZ decided to add this check (see convo here )so that delegatecalling would be supported safely and its minor gas overhead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should we care about supporting delegatecalls at our own expense? this case is unique from OZ's convo because it is logical that tokens could want to delegatecall ERC20 impls with EIP712 mixed in, but no one should be delegatecaling permit2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fair - happy to leave it out then

Copy link
Member

@snreynolds snreynolds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry some conflicts from today but feel free to merge !

@snreynolds snreynolds merged commit e8334bd into main Oct 24, 2022
@snreynolds snreynolds deleted the style branch October 24, 2022 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants