code-423n4 / 2023-01-drips-findings

0 stars 2 forks source link

Gas Optimizations #133

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

See the markdown file with the details of this report here.

GalloDaSballo commented 1 year ago

| [GAS-1] | Variables within Structs can be packed into fewer storage slots | 1 | Invalid

| [GAS-2] | Avoid compound assignment operator in state variables | 10 | | [GAS-3] | Usage of uint/int smaller than 32 bytes (256 bits) incurs overhead | 2 | | [GAS-4] | 10 ** X can be changed to 1eX and save some gas | 3 | | [GAS-5] | Using fixed bytes is cheaper than using string | 2 | | [GAS-6] | Public functions not called by the contract should be declared external instead| 10 | | [GAS-7] | Use Internal View Functions in Modifiers to save Bytecode| 1 | | [GAS-8] | ++i/i++ should be unchecked{++i}/unchecked{i++} when it is not possible for them to overflow |13 | | [GAS-9] | Using unchecked blocks to save gas | 1 |

Rest is minor, less than 300 gas

c4-judge commented 1 year ago

GalloDaSballo marked the issue as grade-c