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

fix: [N03]: Removal of Duplicate computations #4082

Merged
merged 2 commits into from
Aug 9, 2022

Conversation

chrismaree
Copy link
Member

Motivation

OZ Identified the following issue:

In the ProposerV2 contract, the function resolveProposal performs two subsequent
calls to AdminIdentifierLib._constructIdentifier(id) in line 91 and line 99
without storing the return value.
Consider performing only one call and capturing the return value to enhance the gas efficiency
of your code.

The solution in this PR:
Store the identifier and re-use it to avoid double computation.

Summary

Briefly summarize what changes were made to accomplish the motivation above.

Details

This may be unnecessary for some PRs. Catch-all for detailed explanations about the implementation decisions and implications of the change.

Testing

Check a box to describe how you tested these changes and list the steps for reviewers to test.

  • Ran end-to-end test, running the code as in production
  • New unit tests created
  • Existing tests adequate, no new tests required
  • All existing tests pass
  • Untested

Issue(s)

Fixes #XXXX

Signed-off-by: chrismaree <christopher.maree@gmail.com>
@chrismaree chrismaree added the audit-dvm-2-0 Fixes for the DVM 2.0 Audit label Aug 5, 2022
Copy link
Member

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: chrismaree <christopher.maree@gmail.com>
@chrismaree chrismaree merged commit b78bd44 into master Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit-dvm-2-0 Fixes for the DVM 2.0 Audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants