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

[MSW-02C] Inefficient Variable Packing #13

Closed
cozcan opened this issue Aug 15, 2023 · 1 comment
Closed

[MSW-02C] Inefficient Variable Packing #13

cozcan opened this issue Aug 15, 2023 · 1 comment

Comments

@cozcan
Copy link
Contributor

cozcan commented Aug 15, 2023

MSW-02C: Inefficient Variable Packing

Type Severity Location
Gas Optimization MultiSigWallet.sol:L49-L50, L55

Description:

The Transaction struct of the MultiSigWallet contract has a bool variable as well as address variables that are not grouped together.

Example:

struct Transaction {
  address payable destination;
  address token;
  TokenStandard ts;
  uint tokenId;
  uint value;
  bytes data;
  bool executed;
  uint confirmTimestamp;
  uint txTimestamp;
}

Recommendation:

We advise the bool variable to be relocated either after or before an address variable, ensuring that the Transaction struct is tight-packed and occupies one less storage slot than it presently does.

@cozcan
Copy link
Contributor Author

cozcan commented Aug 28, 2023

The executed boolean variable has been relocated before the destination address, optimizing the storage space of the Transaction struct.

Fixed by the Pull Request 21

@cozcan cozcan closed this as completed Aug 28, 2023
cozcan added a commit that referenced this issue Aug 28, 2023
This Pull Request is fixing 10 out of 16 issues detected by Omniscia auditor. We was commented separetly on the Issue section

[MSW-01S] Literal Equality of bool Variable #5 Closed
[MSW-01M] Potentially Incorrect Filters #6 Closed
[MSW-03M] Bypass of Signer / Owner Restriction #8 Closed
[MSW-05M] Incorrect Requirement Validation #10 Closed
[MSW-02C] Inefficient Variable Packing #13 Closed
[MSW-04C] Inexistent Error Messages #14 Closed
[MSW-06C] Redundant Multiplication of Time #17 Closed
[MSW-07C] Redundant Parenthesis Statements #18 Closed
[MSW-08C] Redundant Security Checks #19 Closed
[MSW-09C] Unclear Orders of Evaluation #20 Closed
[MSW-05C] Loop Iterator Optimizations #16 Closed
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

No branches or pull requests

1 participant