Bonding doesn't work with fee-on transfer tokens #251
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
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
cmichel
Vulnerability details
Certain ERC20 tokens make modifications to their ERC20's
transfer
orbalanceOf
functions.One type of these tokens is deflationary tokens that charge a certain fee for every
transfer()
ortransferFrom()
.Impact
The
Bonding._bond()
function will revert in the_balanceCheck
when transferring a fee-on-transfer token as it assumes the entireamount
was received.Recommended Mitigation Steps
To support fee-on-transfer tokens, measure the asset change right before and after the asset-transferring calls and use the difference as the actual bonded amount.
The text was updated successfully, but these errors were encountered: