token

Documentation for eth_defi.token Python module.

ERC-20 token deployment and manipulation.

Deploy ERC-20 tokens to be used within your test suite.

Read also unit test suite for tokens to see how ERC-20 can be manipulated in pytest.

Module Attributes

WRAPPED_NATIVE_TOKEN

Addresses of wrapped native token (WETH9) of different chains

USDC_NATIVE_TOKEN

Addresses of wrapped native token (WETH9) of different chains

USDT_NATIVE_TOKEN

Addresses USDT Tether of different chains

Functions

create_token(web3, deployer, name, symbol, ...)

Deploys a new ERC-20 token on local dev, testnet or mainnet.

fetch_erc20_details(web3, token_address[, ...])

Read token details from on-chain data.

get_erc20_contract(web3, address[, ...])

Wrap address as ERC-20 standard interface.

get_wrapped_native_token_address(chain_id)

reset_default_token_cache()

Purge the cached token data.

Classes

TokenDetails

ERC-20 token Python presentation.

Exceptions

TokenDetailError

Cannot extract token details for an ERC-20 token for some reason.