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

Struct packing #159

Closed
code423n4 opened this issue Nov 30, 2021 · 2 comments
Closed

Struct packing #159

code423n4 opened this issue Nov 30, 2021 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists G (Gas Optimization)

Comments

@code423n4
Copy link
Contributor

Handle

robee

Vulnerability details

The following structs could change the order of their stored elements to decrease memory uses.
and number of occupied slots. Therefore will save gas at every store and load from memory.

    In Auction.sol, AuctionData{

is optimized to: 16 slots from: 17 slots.
The new order of types (you choose the actual variables):

  1. uint256
  2. uint256
  3. uint256
  4. uint256
  5. uint256
  6. uint256
  7. uint256
  8. uint256
  9. uint256
  10. uint256
  11. uint256
  12. uint256
  13. uint256
  14. uint256
  15. mapping
  16. bool
  17. bool
@code423n4 code423n4 added bug Something isn't working G (Gas Optimization) labels Nov 30, 2021
code423n4 added a commit that referenced this issue Nov 30, 2021
@0xScotch 0xScotch added the duplicate This issue or pull request already exists label Dec 9, 2021
@0xScotch
Copy link
Collaborator

0xScotch commented Dec 9, 2021

#38

@0xScotch 0xScotch closed this as completed Dec 9, 2021
@GalloDaSballo
Copy link
Collaborator

Duplicate of #38

@GalloDaSballo GalloDaSballo marked this as a duplicate of #38 Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists G (Gas Optimization)
Projects
None yet
Development

No branches or pull requests

3 participants