Skip to main content

Crate example_erc20_gas

Crate example_erc20_gas 

Source
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ยง

AlloyCacheDB ๐Ÿ”’