Add a Timelock and an Event to ClearingHouse.sol:setParams()
#77
Labels
bug
Something isn't working
duplicate
This issue or pull request already exists
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/ClearingHouse.sol#L344-L354
Vulnerability details
Impact
It is a good practice to give time for users to react and adjust to critical changes. A timelock provides more guarantees and reduces the level of trust required, thus decreasing risk for users. It also indicates that the project is legitimate.
Here, no timelock capabilities nor events are implemented on
ClearingHouse.sol:setParams()
, which I believe is a function that can impact some users enough to make them want to react / be notified ahead of time, as it changes these 4 parameters:tradeFee
,liquidationPenalty
,maintenanceMargin
andminAllowableMargin
Proof of Concept
https://github.com/code-423n4/2022-02-hubble/blob/main/contracts/ClearingHouse.sol#L344-L354
Recommended Mitigation Steps
Consider adding a timelock and an event to
ClearingHouse.sol:setParams()
Additionally, I suggest adding an upperbound on
tradeFee
andliquidationPenalty
, as too big of a possible value for those isn't good for trust.The text was updated successfully, but these errors were encountered: