code-423n4 / 2022-09-artgobblers-findings

0 stars 0 forks source link

Gas Optimizations #471

Closed code423n4 closed 1 year ago

code423n4 commented 1 year ago

Use the local variable after assigning the global variable value to local varibale:

https://github.com/code-423n4/2022-09-artgobblers/blob/d2087c5a8a6a4f1b9784520e7fe75afa3a9cbdbe/src/ArtGobblers.sol#L482

uint256 mintedFromGoo = numMintedFromGoo; - use the mintedFromGoo is other places instead of using the numMintedFromGoo

it seems the local varibale mintedFromGoo only once and in other places numMintedFromGoo is used.

Refer the line https://github.com/code-423n4/2022-09-artgobblers/blob/d2087c5a8a6a4f1b9784520e7fe75afa3a9cbdbe/src/ArtGobblers.sol#L493

GalloDaSballo commented 1 year ago

100 gas, pretty decent single finding although there was a way bigger one

GalloDaSballo commented 1 year ago

This is an example of a single report worth more than the C4udit spams

GalloDaSballo commented 1 year ago

Closing despite it all as it's 70 times less than the top report