Gas Optimizations #60
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
G (Gas Optimization)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Unnecessary Initialisation of variables.
Description:
All data types in solidity have default values and hence they need not be initialized. e.g. uint256 is by default 0. Initializing it in the code unless the logic requires, costs gas fees. This can be avoided easily.
All such variables are listed in a single report for simplicity.
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L35
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L38
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L39
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AutoLocker.sol#L72
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AutoLocker.sol#L381
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AutoLocker.sol#L485
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AutoLocker.sol#L540
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AutoLocker.sol#L630
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraMerkleDrop.sol#L29
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L99
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/ExtraRewardsDistributor.sol#L231
Mitigation:
Do not initialize variables unless needed.
The text was updated successfully, but these errors were encountered: