WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Sunny Coral Monkey - Fee-on-Transfer Token Accounting Failure #736

@sherlock-admin4

Description

@sherlock-admin4

Sunny Coral Monkey

Medium

Fee-on-Transfer Token Accounting Failure

Summary

The contracts transfer tokens and assume the received amount is exactly the transferred amount, which fails for fee-on-transfer tokens.

Root Cause

In DexSwap.sol and Router.sol, tokens are transferred from the user to the contract (Spender or Executor) and then the contract uses the entire fromTokenAmount for swapping. However, for fee-on-transfer tokens, the actual amount received by the contract is less than fromTokenAmount.

Then, in the executor, the entire fromTokenAmount is used for swapping.
The contracts do not account for the actual balance received, which can be less than fromTokenAmount for fee-on-transfer tokens.

Internal Pre-conditions

N/A

External Pre-conditions

N/A

Attack Path

The contracts do not account for the actual balance received, which can be less than fromTokenAmount for fee-on-transfer tokens.

Impact

Fee-on-Transfer Token Accounting Failure

PoC

No response

Mitigation

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Won't FixThe sponsor confirmed this issue will not be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions