Skip to content

Conversation

@anylots
Copy link
Contributor

@anylots anylots commented Jan 16, 2026

This PR introduces several improvements and refactorings to the alternative fee (alt fee) mechanism, focusing on token-based gas payments.

Key changes include:

  • Token Fee Reimbursement: The reimburse_caller logic in the EVM handler has been updated to correctly handle fee reimbursement for AltFeeTx transactions. A new reimburse_caller_token_fee function calculates the appropriate token amount to return to the caller.
  • ERC20 Transfer with EVM: A new transfer_erc20_with_evm function has been added to facilitate ERC20 token transfers during the fee payment process, using a dedicated EVM call. This provides a more robust way to handle token transfers.
  • Improved Validation: The validate_and_deduct_token_fee function now includes a check to prevent the use of token ID 0 for gas payments.
  • Fee Limit Extraction: The MorphTxEnv now correctly extracts the fee_limit from AltFeeTx transactions.
  • EIP-7702 Support: Added handling for the authorization_list field for EIP-7702 transactions.
  • General Refactoring: Various other refactorings and improvements have been made to the alt fee logic for clarity and correctness, including rounding up in token amount calculations and improving the ERC20 balance retrieval with an EVM fallback.

These changes enhance the reliability and functionality of the alt fee system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants