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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ERC712, ERC2330, ERC3156x, Ownable & Ownable2Step #114

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Rubilmax
Copy link
Contributor

@Rubilmax Rubilmax commented Jun 20, 2023

ERC712: Gas-optimized alternative to OZ's. Solmate does not have an equivalent.
Ownable*: Gas-optimized equivalent to OZ's. Solmate only has Owned equivalent to Ownable.
ERC3156x: No equivalent in OZ's or Solmate's.
ERC2330: No equivalent in OZ's or Solmate's.

@Rubilmax Rubilmax changed the title Add EIP712, Ownable & Ownable2Step Add ERC712, ERC3156x, Ownable & Ownable2Step Jun 20, 2023
@github-actions
Copy link

github-actions bot commented Jun 20, 2023

Changes to gas cost

Generated at commit: 80cbc52df3ddcd31fa2406ee521b0dd5ccfa871e, compared to commit: d50e424540893c496f5c2522d7899a539ff625db

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
MathRef contract log2Dichotomy
log2Naive
-2 ✅
+1,029 ❌
-0.04%
+1.22%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
MathRef contract 238,081 (0) log2Dichotomy
log2Naive
4,735 (-2)
85,307 (+1,029)
-0.04%
+1.22%
4,735 (-2)
85,307 (+1,029)
-0.04%
+1.22%
4,735 (-2)
85,307 (+1,029)
-0.04%
+1.22%
4,735 (-2)
85,307 (+1,029)
-0.04%
+1.22%
1 (0)
1 (0)

@Rubilmax Rubilmax marked this pull request as ready for review June 20, 2023 14:55
@Rubilmax Rubilmax changed the title Add ERC712, ERC3156x, Ownable & Ownable2Step Add ERC712, ERC2330, ERC3156x, Ownable & Ownable2Step Jun 20, 2023
@Rubilmax Rubilmax marked this pull request as draft June 20, 2023 17:16

/// @dev Gas-optimized extsload getters to allow anyone to read storage from this contract.
/// Enables the benefit of https://eips.ethereum.org/EIPS/eip-2330 without requiring changes to the execution layer.
contract ERC2330 is IERC2330 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be appropriate to set these contracts as abstract?


/// @inheritdoc IOwnable2Step
function acceptOwnership() public virtual {
address sender = msg.sender;
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to cache the sender because msg.sender is actually cheaper than using memory.

@Rubilmax Rubilmax force-pushed the feat/eip712-ownable branch 2 times, most recently from 54116fe to 4b11ba6 Compare June 21, 2023 14:46
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.

2 participants