Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deposits don't work with fee-on transfer tokens #152

Open
code423n4 opened this issue Jun 16, 2021 · 4 comments
Open

Deposits don't work with fee-on transfer tokens #152

code423n4 opened this issue Jun 16, 2021 · 4 comments
Labels

Comments

@code423n4
Copy link
Contributor

Handle

cmichel

Vulnerability details

Vulnerability Details

There are ERC20 tokens that may make certain customizations to their ERC20 contracts.
One type of these tokens is deflationary tokens that charge a certain fee for every transfer() or transferFrom().

Impact

The deposit() function will introduce unexpected balance inconsistencies when comparing internal asset records with external ERC20 token contracts.

Recommended Mitigation Steps

One possible mitigation is to measure the asset change right before and after the asset-transferring routines

@code423n4 code423n4 added 2 (Med Risk) bug Something isn't working labels Jun 16, 2021
code423n4 added a commit that referenced this issue Jun 16, 2021
@mcplums
Copy link
Collaborator

mcplums commented Jun 17, 2021

I think balancedBooks modifier should handle this?

Of course it means we are unable to use such tokens, but that is ok

@Splidge
Copy link
Collaborator

Splidge commented Jun 17, 2021

oh, trying the same one again..? 😁
code-423n4/2021-05-88mph-findings#16

I'll fight this one though, I'd argue that we are using ERC20 tokens and according to the ERC20 spec for transferFrom:

Transfers _value amount of tokens from address _from to address _to

A deflationary token therefore isn't compliant to ERC20 as it doesn't transfer the full _value and so it isn't what we are planning to use and not relevant here.

@dmvt
Copy link
Collaborator

dmvt commented Jul 10, 2021

If you plan not to support these tokens it should be very clearly documented. Keep in mind that "we don't support that" still has massive impact on the users involved. See: imBTC / ERC777 on Uniswap v1. The issue is valid and should stand in the audit report, in part so that future users see it.

@Steiner-254
Copy link

Interesting ...haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants