code-423n4 / 2022-05-bunker-findings

1 stars 0 forks source link

Gas Optimizations #122

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

G01 No need to explicitly initialize variables with default values

If a variable is not initialized it is automatically set to the default value (0 for uint, false for bool, address(0) for address...). Explicitly initializing it with its default value is an anti-pattern and wastes gas.

Example:

uint256 totalAmount = 0; -> uint256 totalAmount;

CNft.sol#L49-L49