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

0 stars 0 forks source link

Gas Optimizations #20

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

https://github.com/code-423n4/2022-03-volt/blob/main/contracts/volt/Volt.sol#L53 If not called inside the contract, function should be declared external. This avoid storing parmeters in memory, saving gas fees.

https://github.com/code-423n4/2022-03-volt/blob/main/contracts/volt/Volt.sol#L63 Consider addin zero check for value

https://github.com/code-423n4/2022-03-volt/blob/main/contracts/utils/Timed.sol#L71 Check if oldDuration and newDuration is different before raising event. This will save some as fee.

https://github.com/code-423n4/2022-03-volt/blob/main/contracts/utils/RateLimited.sol#L141 Check if oldBufferCap and newBufferCap is different before raising event. This will save some as fee.

https://github.com/code-423n4/2022-03-volt/blob/main/contracts/utils/RateLimited.sol#L132 Check if oldRateLimitPerSecond and newRateLimitPerSecond is different before raising event. This will save some as fee.

https://github.com/code-423n4/2022-03-volt/blob/main/contracts/vcon/Vcon.sol#L124 Add zero check for rawAmount. there is no reason to mind 0 tokens

https://github.com/code-423n4/2022-03-volt/blob/main/contracts/vcon/Vcon.sol#L174 Add zero check for rawAmount. there is no reason to mind 0 tokens