Skip to content

docs: add decimal footgun section to use-arc skill#36

Open
erhnysr wants to merge 1 commit into
circlefin:masterfrom
erhnysr:add/use-arc-decimal-footgun
Open

docs: add decimal footgun section to use-arc skill#36
erhnysr wants to merge 1 commit into
circlefin:masterfrom
erhnysr:add/use-arc-decimal-footgun

Conversation

@erhnysr

@erhnysr erhnysr commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Small, focused addition to the existing use-arc skill: 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), where parseEther was used instead of parseUnits(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

  • A concrete failure scenario with real numbers (parseEther('10') → 10^18 vs parseUnits('10', 6) → 10^6, a 1,000,000,000,000x error)
  • A ❌ WRONG / ✅ CORRECT TypeScript/viem code comparison
  • A one-line rule to remember
  • A note on why it's dangerous: can revert on insufficient balance, or worse, silently succeed with a wildly wrong amount

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.

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.

1 participant