Open code423n4 opened 2 years ago
ye0lde
Gas savings and code clarity
The local variables on the lines below are declared to store the return values from requery yet some of these local variables are never used within the code.
requery
https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L112-L113 https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L115
Visual Studio Code, Remix
Change this: https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L112-L115 to
, // pcv value , // user fei int256 newProtocolEquity, // validity ) = oracle.pcvStats();
Valid optimization.
Handle
ye0lde
Vulnerability details
Impact
Gas savings and code clarity
Proof of Concept
The local variables on the lines below are declared to store the return values from
requery
yet some of these local variables are never used within the code.https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L112-L113 https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L115
Tools Used
Visual Studio Code, Remix
Recommended Mitigation Steps
Change this: https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L112-L115 to