docs(erc20): add output format, error states, and workflow context to action descriptions#1237
Open
0xAxiom wants to merge 1 commit into
Open
Conversation
… action descriptions Closes coinbase#1066 — audit flagged erc20 actions scoring C/C+ due to missing output documentation and error state coverage. Changes per action: - get_balance: add Returns section (success format + error case), note EVM-only constraint - transfer: add Returns section, document gas requirement for native token (agents need to know ERC20 transfers still cost ETH), list guardrail refusal conditions - approve: add workflow context (use BEFORE calling a protocol; flow is approve → protocol call; without allowance transferFrom reverts), add Returns section, document overwrite behaviour and malicious-spender risk - get_allowance: add workflow context (call before approve to avoid redundant tx; allowance of 0 blocks transferFrom), add Returns section, clarify owner is always the wallet address Applied to both TypeScript and Python implementations.
🟡 Heimdall Review Status
|
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
Closes #1066 — erc20 action descriptions were audited and scored C/C+ due to missing output documentation and error state coverage.
Changes per action (TypeScript + Python):
get_balance: AddReturnssection (success format + error case); note EVM-only constraint.transfer: AddReturnssection; document that ERC20 transfers still require native token (ETH) for gas — agents inferring from "transfer USDC" often don't realize they need ETH in the wallet; list the two guardrail refusal conditions.approve: Add workflow context explaining why approve exists (call before a DeFi protocol so itstransferFromdoesn't revert); typical flow isapprove → call protocol; addReturns; document overwrite behaviour and malicious-spender risk; cross-referenceget_allowance.get_allowance: Add workflow context (call this beforeapproveto skip a redundant tx when allowance already covers the amount; allowance of 0 meanstransferFromis blocked); addReturns; clarify the owner is always the wallet's own address.No logic changes — descriptions only.
Testing
Descriptions are string constants; no runtime tests required. The existing test suite validates action behaviour, which is unchanged.