livepeer / protocol

Livepeer protocol
MIT License
154 stars 45 forks source link

[delta-audit] bonding: Fix treasury cut precision on fee withdrawal #624

Closed victorges closed 12 months ago

victorges commented 1 year ago

What does this pull request do? Explain your changes. (required) This fixes the precision used when handleing the treasuryRewardCutRate variable in the updateTranscoderWithFees function.

The cut rate is saved in PreciseMathUtils precision (27-digit) and was being used as a MathUtils precision (6-digit).

Also added tests to exercise the specific code (I suspect there wasn't a test case for that specific branch).

Specific updates (required)

How did you test each of these updates (required) yarn test to be deployed to devnet

Does this pull request close any open issues? Fixes https://github.com/code-423n4/2023-08-livepeer-findings/issues/165

Checklist: