code-423n4 / 2021-04-marginswap-findings

1 stars 0 forks source link

setLeveragePercent should check that new _leveragePercent >= 100 #41

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Email address

pauliax6@gmail.com

Handle

paulius.eth

Eth address

0x523B5b2Cc58A818667C22c862930B141f85d49DD

Vulnerability details

function setLeveragePercent should check that the _leveragePercent >= 100 so that this calculation will not fail later: (leveragePercent - 100)

Impact

This variable can only be set by admin so as long as he sets the appropriate value it should be fine.

Recommended mitigation steps

It is always nice to enforce such things via code. Code is law they say.

werg commented 3 years ago

thanks, but in this case that would be governance's job to check