Open code423n4 opened 2 years ago
Consider using optimized for-loop and apply the following optimizations:
Affected code:
Using x != 0 uses 6 less gas than x > 0. Consider changing all "greater than zero" comparisons to "not equal to zero".
Splitting && conditions into several require statements saves gas.
As per 0.8.4 solidity version it supports new custom errors. Custom errors are reducing 38 gas if condition is met and 22 gas otherwise. Also reduces contract size and deployment costs.
Usual suspect, also we are on 0.6.12 ser
Impact
Consider using optimized for-loop and apply the following optimizations:
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
Using x != 0 uses 6 less gas than x > 0. Consider changing all "greater than zero" comparisons to "not equal to zero".
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
Splitting && conditions into several require statements saves gas.
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps
Impact
As per 0.8.4 solidity version it supports new custom errors. Custom errors are reducing 38 gas if condition is met and 22 gas otherwise. Also reduces contract size and deployment costs.
Affected code:
Proof of Concept
Tools Used
Recommended Mitigation Steps