code-423n4 / 2022-03-lifinance-findings

6 stars 4 forks source link

Gas Optimizations #151

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Using String Bigger Than bytes32

Description

EVM is a stack machine with 256 bits (32 bytes) for each stack. Using unnecessary information that has size more than 32 bytes requires more than one stacks for storing, therefore using more gas unnecessarily.

Permalinks

Mitigation

Use a string that not bigger than 32 bytes or consider using custom errors instead if the contract uses solidity version 0.8.4 or above.

H3xept commented 2 years ago

Requires have been changed to custom errors in lifinance/lifi-contracts@f35ed79a266a69b363d72332b7861d15d18b98cb

H3xept commented 2 years ago

Duplicate of #100

gzeoneth commented 2 years ago

Warden submitted multiple QA report #149