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

0 stars 0 forks source link

Gas: `unstreamed` not needed #216

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

cmichel

Vulnerability details

The unstreamed storage variable is redundant and the system can already track everything without this storage variable. Note that this variable is never read and only written to. (The system essentially tracks deposit_balance * deposit_duration for each user and pays out the fair share compared to the total cumulative balance times duration once at the end.)

Removing this variable saves a lot of gas as every updateStreamInternal call has to do fewer computations.