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

Remove double sload when doing math checks in tokens #2506

Merged
merged 5 commits into from Feb 9, 2021

Conversation

Amxx
Copy link
Collaborator

@Amxx Amxx commented Feb 3, 2021

The addition of revert messages back into the 0.8 branch (#2491) generated double reading of some storage slot. This PR remove the double sload, which reduces gas costs of running the affected function.

PR Checklist

  • Tests
  • Changelog entry

Copy link
Contributor

@frangio frangio left a comment

Choose a reason for hiding this comment

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

I want us to avoid using underscore suffix as much as possible, so I've proposed a few alternative variable names. Similar names can be used throughout the PR.

Otherwise this is good!

contracts/token/ERC1155/ERC1155.sol Outdated Show resolved Hide resolved
contracts/token/ERC20/ERC20.sol Outdated Show resolved Hide resolved
@frangio frangio enabled auto-merge (squash) February 9, 2021 15:03
@frangio frangio disabled auto-merge February 9, 2021 15:58
@frangio frangio merged commit a44303c into OpenZeppelin:master Feb 9, 2021
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