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

⚡ SSTORE2 Gas Optimizations #270

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Saw-mon-and-Natalie
Copy link

Description

This PR rewrites most of the write functionality for SSTORE2 contract in assembly. Besides the shorter creation code for the storage contract, these changes also avoid the memory expansion costs that came with using abi.encodePacked saving a few hundred gas.

Also, custom errors are used instead of the previously used require patterns.

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Ran forge snapshot
  • Ran npm run lint
  • Ran forge test

Pull requests with an incomplete checklist will be thrown out.

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