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

0 stars 0 forks source link

Gas Optimizations #107

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

1-In below code line we can use uint96 instead of uint256 in function returning parameter . Because balance never exeed 2^96. So uint96 is enough

https://github.com/code-423n4/2022-03-volt/blob/f1210bf3151095e4d371c9e9d7682d9031860bbd/contracts/vcon/Vcon.sol#L253


2- In below codeline we can use a much smaller variable (for emaple uint8) for function returning parameter. Because chainID are limeted .

https://github.com/code-423n4/2022-03-volt/blob/f1210bf3151095e4d371c9e9d7682d9031860bbd/contracts/vcon/Vcon.sol#L536

ElliotFriedman commented 2 years ago

VCON is out of scope for the contest