sablier-labs / v1-protocol

Core smart contracts of the Sablier V1 protocol
https://sablier.finance
GNU General Public License v3.0
263 stars 79 forks source link

Patch sablierUnderlyingInterest #10

Closed PaulRBerg closed 4 years ago

PaulRBerg commented 4 years ago

While investigating with @cleanunicorn on the 17th of September, I noticed a bug on line 677:

(vars.mathErr, vars.sablierInterest) = divExp(vars.sablierUnderlyingInterest, exchangeRateCurrent);

The first parameter for divExp should be vars.underlyingInterest, because vars.sablierUnderlyingInterest is not initialised there, so it defaults to zero. When the fee is a hundred percent, all the interest goes to the Sablier smart contract.

Needs #9 merged first.

codecov[bot] commented 4 years ago

Codecov Report

Merging #10 into audit will not change coverage. The diff coverage is 90%.

Impacted file tree graph

@@          Coverage Diff          @@
##           audit     #10   +/-   ##
=====================================
  Coverage   88.3%   88.3%           
=====================================
  Files          2       2           
  Lines        342     342           
  Branches     109     109           
=====================================
  Hits         302     302           
  Misses        40      40
Impacted Files Coverage Δ
packages/protocol/contracts/Sablier.sol 99.59% <100%> (ø) :arrow_up:
packages/payroll/contracts/Payroll.sol 58.94% <55.55%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 793cdc9...1865f17. Read the comment docs.