Option buyer receives no refunds if he sends too much ETH #66
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
Cally.sol#L224-L226
Vulnerability details
Impact
If option buyer sends an amount bigger than
premium
the difference is not refunded to buyer.This could lead to a big loss for the buyer who could have made a mistake like for example typing an extra zero.
Proof of Concept
Recommended Mitigation Steps
Consider refunding the difference to the buyer (more gas expensive) or implementing a check with strict equality:
msg.value == premium
(less gas expensive).The text was updated successfully, but these errors were encountered: