code-423n4 / 2021-09-sushitrident-findings

0 stars 0 forks source link

Unused state variable `barFee` and `_barFeeTo` in IndexPool #117

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

hrkrshnn

Vulnerability details

Unused state variable barFee and _barFeeTo in IndexPool

The public state variable https://github.com/sushiswap/trident/blob/9130b10efaf9c653d74dc7a65bde788ec4b354b5/contracts/pool/IndexPool.sol#L43 and https://github.com/sushiswap/trident/blob/9130b10efaf9c653d74dc7a65bde788ec4b354b5/contracts/pool/IndexPool.sol#L20 seems to be never used anywhere in the contract. Removing them will save gas for (almost) all external calls because of their presence in function dispatch.

sarangparikh22 commented 2 years ago

Yes, however, this will be used in future for fee calculation for the bar.