code-423n4 / 2022-07-swivel-findings

0 stars 1 forks source link

Gas Optimizations #69

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Calldata should be used instead of Memory to save some Gas

Line 495 swivel.sol: function is external and i and d are not changed within function scope function setFee(uint16[] memory i, uint16[] memory d) external authorized(admin) returns (bool)

Hardcode feedenominators array size to save some Gas

Line 496 swivel.sol: feeDenominator array is hardcoded to 4, using a constant would save some gas uint256 len = i.length;

JeeberC4 commented 2 years ago

Warden submitted multiple Gas Optimizations. Will not be judged.