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

refactor: optimize modifiers #7

Closed
wants to merge 1 commit into from

Conversation

pegahcarter
Copy link

For each function a modifier is attached to, the bytecode of the full modifier is added (reference here). So, by adding a private/internal function call, the bytecode of the logic statements is only copied to the contract once and each modifier only references the function call.

I went ahead and turned the modifiers we've made into private func calls. I left onlyOwner as-is to maintain the Synthetix code. One thing I'm wondering- what are your thoughts of removing Owned.sol in favor of OZ's Ownable2Step?

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.

1 participant