code-423n4 / 2021-12-perennial-findings

0 stars 0 forks source link

At `Product.sol#closeAll`, cache `_position[account]` #65

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

0x0x0x

Vulnerability details

At Product.sol#closeAll cache _position[account] to save gas.

In the first line of the function _position[account] is used twice and gas can be saved by caching it.

GalloDaSballo commented 2 years ago

Agree with the finding