protocolFee can be updated at any time by protocol
Summary
protocolFee can be updated at any time by protocol. But it should settle the product first in order to make product coordinator receive fair payment for previous period.
This fee can be changed at any time. But the problem is that settle is not called for each product before the change. As result this change has impact on previous earning of product.
Impact
Part of product earning can be stolen by protocol.
rvierdiiev
medium
protocolFee can be updated at any time by protocol
Summary
protocolFee
can be updated at any time by protocol. But it should settle the product first in order to make product coordinator receive fair payment for previous period.Vulnerability Detail
Perennial protocol has a fee that is taken from each product earnings. https://github.com/sherlock-audit/2023-05-perennial/blob/main/perennial-mono/packages/perennial/contracts/collateral/Collateral.sol#L161-L175
This fee collecting is done inside
settle
function.This fee can be changed at any time. But the problem is that
settle
is not called for each product before the change. As result this change has impact on previous earning of product.Impact
Part of product earning can be stolen by protocol.
Code Snippet
Provided above
Tool used
Manual Review
Recommendation
Call
settle
for each product.