Gas Optimizations #128
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
<
is cheaper than<=
Proof of Concept:
https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L146-L148
https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L171-L172
Recommended Mitigation Steps:
Change from
<=
to<
========================================================================
!=0
is more gas efficient than< 0
Proof of Concept:
https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L198
https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L321
Recommended Mitigation Steps:
Change
> 0
or< 0
to!= 0
========================================================================
calldata
to store struct data type can save gasProof of Concept:
https://github.com/code-423n4/2022-04-backed/blob/main/contracts/NFTLoanFacilitator.sol#L332
Recommended Mitigation Steps:
Change to:
========================================================================
The text was updated successfully, but these errors were encountered: