feat(defi): add evm_tx_handler PR1 (quote, preview, transfer)#150
feat(defi): add evm_tx_handler PR1 (quote, preview, transfer)#150Hendobox wants to merge 4 commits into
Conversation
Introduce defi/evm_tx_handler for a dedicated EVM agent wallet on Ethereum and Base. First PR ships resolve, quote, preview, transfer, balances, wallet_info, and update_preferences with YAML registries and mocked Web3 tests. Swap execute is stubbed for a follow-up PR.
|
Thanks for the thorough work on this new skill @Hendobox, this is a strong first pr and clearly tracks #142. The architecture matches what we asked for: structured intent only in the skill, agent handles NL, YAML registries, confirmation gates, and mocked Web3 tests. Security choices (gitignored config, fail-closed RPC, key redaction, placeholder addressbook) look thoughtful. Good call splitting swap Before merge we could build the full MVP from #142 in place, so we plan to wait for pr2 rather than merge pr1 alone. The main gap is swap Small asks for this PR or the next commit:
Tips for next wave: reuse the quote payload (path, min_out, deadline) in execute so quote and broadcast stay consistent; mock approve + swap in tests the same way you mocked transfer. Happy to keep reviewing on the same branch or a stacked pr2, 100% up to you. Nice work on a fairly complex skill. Did you checked ARPAHLS/OPSIE's web3 handler or built this from scratch? |
|
Thanks for the detailed review — agreed on waiting for the full MVP before merging. Plan: I’ll stack PR2 on this same branch (feat/evm-tx-handler-pr1) as a separate commit (no squash), so you get PR1 + execute in one merge for auditability. I’ll update the description to Part of #142 now and switch to Fixes #142 once execute lands. This commit / next push: CI: install web3>=6.0.0 and run pytest skills/defi/evm_tx_handler/test_skill.py execute: approve + Uni V2 router swap, reusing the quote payload (path, min_out_wei, deadline) so quote and broadcast stay aligned |
Install web3 in the CI matrix and pytest the defi/evm_tx_handler bundle. Add an [Unreleased] CHANGELOG entry for the new skill (Part of ARPAHLS#142).
|
Thanks for the quick follow-up and for stacking next steps on the same branch, this will be smoother i think. On the latest commit: please drop the CI changes for now (revert Keep building PR2 on the same branch (execute, caps, USD preview, tests). We will review together the full series once swap Appreciate the OPSIE note, yes it was nice to view but it is from 2022-23, so clean Skillware implementation is exactly what we wanted. <3 |
This reverts commit 0ff55fe.
Add Uni V2 swap execution with ERC20 approve handling, max_trade_usd fail-closed enforcement, and optional USD preview output. Reuse quote payload fields for broadcast consistency and expand mocked tests for approve/swap and cap edge cases. Part of ARPAHLS#142
|
Thanks again @Hendobox, the new commit lands the full #142 MVP. CI revert was the right call, we’ll handle CI in #151. We’re ready to merge once the items below are in. Please add on this branch (one final polish commit is fine):
You do not need to change Optional, not blocking: After that we’ll merge (merge commit, not squash), cut the release manually, and update the site. Solid work on a high-risk skill done cleanly. <3 |
|
Thanks for the detailed review and for confirming this lands the full #142 MVP. I’ll add the updates and keep everything on this branch so you can merge the full series with a merge commit. |
Part of #142 (edited by rosspeili)
Summary
Adds
defi/evm_tx_handler- a Skillware skill for a dedicated EVM agent wallet on Ethereum and Base, driven by structured JSON intent (no slash commands; no NLP insideskill.py).PR1 (this PR):
resolvemissing_fields/suggested_defaultsquote/previewgetAmountsIn/getAmountsOut, slippage, gas estimate)transferconfirmedgatebalances/wallet_info/update_preferencesexecutenot_available); honorsneeds_confirmationwhen enabledPR2 (follow-up): swap
execute(approve + router),max_trade_usd, optional USD preview.Boundaries
intent, previews, user approval,confirmed: trueSecurity / ops
AGENT_WALLET_PRIVATE_KEYin.envonly — never tool args or YAMLconfig.yamlgitignored; example committeddata/addressbook.yamlplaceholders before mainnet useDependencies
web3>=6.0.0,pyyaml(viamanifest.yaml/SkillLoader).Test plan
pytest skills/defi/evm_tx_handler/test_skill.py tests/test_skill_issuer.py -q(mocked Web3, no live keys)SkillLoader.load_skill("defi/evm_tx_handler")withweb3installedresolve→quoteon Base with test RPCReviewer focus
data/chains.yamlrouter / WETH addressesdata/tokens.yaml(Basedegen)manifest.yamlconstitutionexecuteuntil PR2?Follow-up
PR2:
execute, receipt handling,max_trade_usd, optional CoinGecko USD in preview.