Expand description
Example of a custom handler for ERC20 gas calculation.
Gas is going to be deducted from ERC20 token.
Re-exportsยง
pub(crate) use exec::transact_erc20evm_commit;๐pub(crate) use network::Ethereum;๐pub(crate) use DynProvider;๐pub(crate) use Provider;๐pub(crate) use ProviderBuilder;๐pub(crate) use alloy_sol_types::SolValue;๐pub(crate) use anyhow::Result;๐pub(crate) use CfgEnv;๐pub(crate) use TxEnv;๐pub(crate) use AlloyDB;๐pub(crate) use BlockId;๐pub(crate) use CacheDB;๐pub(crate) use database_interface::WrapDatabaseAsync;๐pub(crate) use address;๐pub(crate) use hardfork::SpecId;๐pub(crate) use keccak256;๐pub(crate) use Address;๐pub(crate) use StorageValue;๐pub(crate) use TxKind;๐pub(crate) use U256;๐pub(crate) use state::AccountInfo;๐pub(crate) use Context;๐pub(crate) use Database;๐pub(crate) use MainBuilder;๐pub(crate) use MainContext;๐
Modulesยง
- exec
- Execution utilities for ERC20 gas payment transactions
- handler
- Custom handler implementation for ERC20 gas payment
Constantsยง
- TOKEN
- USDC token address on Ethereum mainnet
- TREASURY
- Treasury address that receives ERC20 gas payments
Functionsยง
- balance_
of ๐ - erc_
address_ storage - Calculates the storage slot for an ERC20 balance mapping. This implements the standard Solidity mapping storage layout where slot = keccak256(abi.encode(address, slot_number))
- main ๐
- transfer ๐
Type Aliasesยง
- Alloy
CacheDB ๐