You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many functions take parameters in memory instead of in calldata. If the parameters don't need to be modified, it is more efficient not to copy them to memory unless absolutely necessary. In general, copying of entire structs should be avoided when possible.
This improvement can be made in the following places: #. All of the Space contract's setter functions, its initialize function and _getCumulativePower. (Note that the latter would also require an assertNoDuplicateIndices implementation with a calldata list). #. The _assertProposalExists takes a Proposal memory as a parameter. However, in the execute and cancel functions it is passed a Proposal storage variable. Thus, the entire struct will be copied into memory only to check a single field's value. #. The bytesToAddress function in the CompVotingStrategy and OZVotingStrategy could take a bytes calldata parameter instead of a bytes memory. #. The various _verify functions in the SignatureVerifier could take bytes calldata as a parameter.
The text was updated successfully, but these errors were encountered:
Many functions take parameters in memory instead of in calldata. If the parameters don't need to be modified, it is more efficient not to copy them to memory unless absolutely necessary. In general, copying of entire structs should be avoided when possible.
This improvement can be made in the following places: #. All of the Space contract's setter functions, its initialize function and _getCumulativePower. (Note that the latter would also require an assertNoDuplicateIndices implementation with a calldata list). #. The _assertProposalExists takes a Proposal memory as a parameter. However, in the execute and cancel functions it is passed a Proposal storage variable. Thus, the entire struct will be copied into memory only to check a single field's value. #. The bytesToAddress function in the CompVotingStrategy and OZVotingStrategy could take a bytes calldata parameter instead of a bytes memory. #. The various _verify functions in the SignatureVerifier could take bytes calldata as a parameter.
The text was updated successfully, but these errors were encountered: