Skip to content

Fix: Proposal: add quote display sanity checks for Base MCP agent#142

Open
joebkarwalo wants to merge 1 commit into
base:masterfrom
joebkarwalo:bounty-fix/bounty-85bcbf50
Open

Fix: Proposal: add quote display sanity checks for Base MCP agent#142
joebkarwalo wants to merge 1 commit into
base:masterfrom
joebkarwalo:bounty-fix/bounty-85bcbf50

Conversation

@joebkarwalo

Copy link
Copy Markdown

What

Adds a new skill reference file (skills/base-mcp/references/quote-sanity.md) that gives agents an explicit function/formula for converting a raw token amount (wei / smallest unit) into a human-readable value using the token's decimals, plus a checklist to sanity-check that conversion before showing a quote or requesting approval. Cross-references this new file from approval-mode.md's "Common mistakes" section so agents load it as part of the approval flow.

Why

As reported in the issue, an agent displayed 50,355,726,366,371 wei as 0.050356 ETH instead of the correct 0.000050355726366371 ETH in a pre-approval chat summary. Even though the Base Account approval screen itself was correct, an incorrect human-readable summary before approval undermines user trust and could cause a user to misunderstand what they're about to approve. This adds an explicit, reusable conversion function and verification checklist so agents compute (and can self-check) the human-readable amount correctly instead of eyeballing/misformatting it.

Testing

Manually verified the worked example in the new reference file matches the issue's numbers exactly:

  • Raw: 50355726366371 wei, decimals: 18 (ETH)
  • 50355726366371 / 10^18 = 0.000050355726366371 ETH — matches the issue's stated "correct human-readable value".
  • Confirmed no existing files/functions were removed; only additive documentation and a small cross-reference addition to approval-mode.md.

Closes #68

@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

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.

Proposal: add quote display sanity checks for Base MCP agent approval flows

2 participants