code-423n4 / 2021-11-fei-findings

0 stars 0 forks source link

`requery()` has unused local variables #148

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

loop

Vulnerability details

When retrieving the pcv stats from the oracle only newProtocolEquity is used. The other return values of oracle.pcvStats() are also stored in a local variable, but not used within requery(). The call to oracle.pcvStats() can be made without creating unused local variables to save a small amount of gas:

(
       ,  ,  int256 newProtocolEquity,
 ) = oracle.pcvStats();

Proof of Concept

https://github.com/code-423n4/2021-11-fei/blob/main/contracts/TRIBERagequit.sol#L111-L116

Tools Used

Remix

elee1766 commented 2 years ago

159

pauliax commented 2 years ago

A duplicate of #159