feat: add EVM payment method (e.g. Base) - #243
Open
vivbhandari wants to merge 1 commit into
Open
Conversation
Adds mpp.methods.evm, ported from the ../mpp/evm.py prototype: a Method/Intent pair for standard EVM chains that settles charges with a plain ERC-20 transfer instead of Tempo's native account-abstraction transaction. Client-side builds and signs an EIP-1559 transaction; server-side broadcasts it and confirms the mined receipt contains a matching Transfer log, with optional Store-backed replay protection. Ships behind a new "evm" extra (eth-account, eth-hash) and follows the tempo method's package layout and lazy-export conventions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012oZVh6chEXJMiVkQ2Qsjej
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mpp.methods.evm, ported from the../mpp/evm.pyprototype: aMethod/Intentpair for standard EVM chains (Base by default) that settles charges with a plain ERC-20transferinstead of Tempo's native account-abstraction transaction.transfer(address,uint256); server side broadcasts it and confirms the mined receipt contains a matchingTransferlog, with optionalStore-backed replay protection.evmextra (eth-account,eth-hash[pycryptodome]) and followsmpp.methods.tempo's package layout and lazy-export conventions (account.py,client.py,intents.py,_defaults.py,_rpc.py, lazy__init__.py/__init__.pyi).Test plan
tests/test_evm.py(51 tests): account key handling,evm()factory defaults/overrides, client-side transaction building (incl. chain-id mismatch, gas-estimate fallback), server-sideChargeIntentverification (decode failures, revert/missing-log handling, receipt polling, replay protection, "already known" tx tolerance), and an end-to-end client→server flow.tests/test_optional_deps.py/tests/test_import_isolation.pyextended with evm-extra coverage mirroring the existing tempo-extra tests.ruff check ./ruff format --check .cleanpyrightclean (0 errors)🤖 Generated with Claude Code