plasma-contracts icon indicating copy to clipboard operation
plasma-contracts copied to clipboard

support for tokens contracts taking fee on `transferFrom`

Open paulperegud opened this issue 7 years ago • 2 comments

Issue Type

[ ] bug report
[x] feature request

Current Behavior

Depositing DGX into the chain credits user with amount on plasma chain, while root contract balance is increased only by amount - fee. This causes chain to be insolvent for DGX token.

Expected Behavior

Account for the fact that token may extract such a fee and rely not on declared amount, but on actual change of balance of root chain contract.

paulperegud avatar Sep 21 '18 12:09 paulperegud

Apparently, this behavior might be against ERC20 standard (or at least against its idea). It would be nice if we could ignore the misbehaving token.

paulperegud avatar Sep 23 '18 16:09 paulperegud

Attempting to confirm whether or not this is against spec. Either way, we would still need to execute a balance check before and after the transfer to watch for this behavior. We could ignore this entirely, but that seems like it could lead to poor UX.

smartcontracts avatar Sep 28 '18 19:09 smartcontracts