uniswap_v2.token_tax

Documentation for eth_defi.uniswap_v2.token_tax module.

Querying the buy tax, transfer tax & sell tax of an ERC20 token

Read also unit test suite tests/test_token_tax.py to see the retrieval of token taxes for ELEPHANT token on BSC

Functions

estimate_token_taxes(uniswap, base_token, ...)

Estimates different token taxes for a token by running Ganache simulations for it.

Classes

TokenTaxInfo

Different token taxes we figured out.

Exceptions

ApprovalFailure

Yet another random Ganache failure.

OutOfGasDuringSell

The token is likely some sort of ponzi with restricted transfer.

OutOfGasDuringTransfer

The token is likely some sort of ponzi with restricted transfer.

SellFailed

Could not sell the token.

SwapError

The swap method reverted due to low liquidity of either the base or quote token

TransferFailure

The token transfer failed for some random reason.

TransferFromError

The token is likely broken.