docs: add decimal footgun section to use-arc skill#36
Open
erhnysr wants to merge 1 commit into
Open
Conversation
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
Small, focused addition to the existing
use-arcskill: a new Common Pitfalls → The Decimal Footgun section that reinforces the existing decimal guidance with a concrete, real-world example.Motivation
Arc uses USDC as its native gas token, which makes it easy to assume every amount uses 18 decimals like a typical EVM chain — when in fact ERC-20 USDC uses 6 decimals and only native gas (
msg.value) uses 18. This is a real trap: we hit exactly this decimal mismatch in one of our own projects (a USDC payment flow), whereparseEtherwas used instead ofparseUnits(amount, 6), producing an amount 10^12 times too large. We wrote it up in a Paragraph article (https://paragraph.com/@coliseum/the-18-vs-6-decimal-footgun-on-arc-what-nearly-killed-coliseum) as a lesson learned, and this PR distills that experience into the skill so other builders (and agents) avoid the same mistake.What's added
parseEther('10')→ 10^18 vsparseUnits('10', 6)→ 10^6, a 1,000,000,000,000x error)Consistency
This complements — and does not duplicate — the existing "Dual decimals" Core Concept and the Best Practices decimal rule. It follows the same markdown style, code-block conventions, and tone as the rest of the file.