Footguns, measured
Twelve ways a HyperEVM contract loses money or silently does nothing when it touches HyperCore, each with the on-chain evidence and the fix.
Almost every footgun here comes from two properties. CoreWriter reports nothing back, and one token lives on two scales (HyperCore wei, EVM decimals), with a third, 1e8 fixed point, in some action fields.
Unless marked as documented, each item was observed on chain: while building a tokenised lending vault, a rate index and a deployer-collateral facility, or in mainnet traffic scanned for them.
The numbers
Section titled “The numbers”| # | Footgun | What you see | Fix |
|---|---|---|---|
| 1 | CoreWriter never reverts | EVM status 1, nothing happened | reconcile from HyperCore state |
| 2 | Non-round HyperCore to HyperEVM amounts | “Invalid number of decimals” | floor to 10^abs(offset) |
| 3 | Bridge gas comes out of HyperCore | full-balance send refused | keep a HyperCore reserve |
| 4 | Bad precompile input | whole gas allowance burned | cap gas per call |
| 5 | 0x811 with no record |
PrecompileError |
non-reverting read, treat as zero |
| 6 | Scale traps | 100x errors | one conversion function, 1e8 for actions 1, 15, 17 |
| 7 | Silent drops | action vanishes, no error | zero unused fields; verify spot orders |
| 8 | Mode gates | action refused by account mode | set abstraction first |
| 9 | Testnet is not mainnet | code passes on testnet, fails on mainnet | per-network constants, mainnet clocks |
| 10 | Docs contradicted by chain | design built on a wrong sentence | prefer measurement |
| 11 | Sources disagree on action 15 ops 2 and 3 | unknown behaviour | use ops 0 and 1 only |
| 12 | No sender on a HyperCore spot send | deposit cannot be attributed | take deposits on the HyperEVM side |
Check these before you ship
Section titled “Check these before you ship”For a contract that uses CoreWriter or the precompiles:
- Every write: a later-block check against HyperCore state, and a failure path.
- Every precompile call: an explicit gas cap and an output-length check.
- Every HyperCore to HyperEVM amount: floored, with a fee reserve left on HyperCore.
- Every amount: converted by one tested function, never inline.
- Every network-specific id (token index, template name, contract address): looked up per network.
The evidence, item by item
Section titled “The evidence, item by item”Each row of the table, with the page that owns it linked.
1. Actions fail silently
Section titled “1. Actions fail silently”sendRawAction only emits a log, so the EVM transaction succeeds whatever HyperCore does. On testnet, supplying 100 USDC against under 1 USDC of spot returned status 1 while the explorer showed “Borrow/Lend error: Insufficient spot balance for operation”; on mainnet, a portfolio margin refusal of action 15 used 47,889 gas and returned status 1 (patterns).
2. Non-round amounts are rejected, not burned
Section titled “2. Non-round amounts are rejected, not burned”With a negative offset (USDC: -2), HyperCore to HyperEVM amounts that are not a multiple of 10^abs(offset) fail with “Invalid number of decimals”; the docs’ burn rule covers only the other direction. The five observed sends are on moving assets.
3. Bridge gas comes out of the HyperCore balance
Section titled “3. Bridge gas comes out of the HyperCore balance”A full 100 USDC testnet send was refused for want of the 200k-gas fee, charged on HyperCore, while 99 went through for 0.000588 USDC (the crossing fee).
4. Bad precompile input burns all the gas
Section titled “4. Bad precompile input burns all the gas”An unsupported input burned the entire 50M allowance (PrecompileOutOfGas(50000000)); narrowed argument widths truncate outcome asset ids (gas, where reads fail).
5. 0x811 reverts when there is no record
Section titled “5. 0x811 reverts when there is no record”The revert, the 31,989 USDC case and the first-deposit trap are on precompiles. Beyond that: after a first supply of 500 USDC on testnet, the read returned a basis of 500 and a value already above it.
6. Scale traps
Section titled “6. Scale traps”USDC is 8 decimals on HyperCore and 6 on the HyperEVM, and EVM decimals are weiDecimals + evmExtraWeiDecimals, not szDecimals (moving assets). Actions 1 (limitPx, sz), 15 (wei) and 17 (wei) use 1e8.
One project brief assumed 6 decimals on HyperCore where spotMeta shows weiDecimals 8: a 100x error, caught before any capital moved. An earlier reference note gave action 17’s wei as 1e6; a testnet split with wei = 100,000,000 minted exactly 1 Long and 1 Short and moved 1 USDC.
7. Silent drops
Section titled “7. Silent drops”Action 17 payloads with a non-zero unused field are dropped (per the docs), and so were spot orders on one testnet account (CoreWriter). Verify every order by its cloid in userFills.
8. Account mode gates
Section titled “8. Account mode gates”No precompile exposes the abstraction mode, yet portfolio margin refuses action 15 and a unified account with open positions cannot be switched off (CoreWriter). Set the mode with action 16 (1 is Standard) before the contract holds anything, and check it with the userAbstraction info request (account modes).
9. Testnet is not mainnet
Section titled “9. Testnet is not mainnet”- The testnet USDC link is dead: every view and
transferreverts. - The unstaking queue drained in about 5 minutes on testnet against 7 days on mainnet.
- HYPE is token 150 on mainnet and 1105 on testnet.
- Mainnet had 18 outcome templates including
scalarPrice; testnet had 66 and noscalarPrice.
Test duration logic against mainnet observations or a clock you control.
10. The docs are wrong in places
Section titled “10. The docs are wrong in places”- Orders: documented as delayed from CoreWriter, yet on mainnet they land 0.35 to 0.51 s after the block (n=52); only vault transfers are delayed (execution order).
- The portfolio margin page says CoreWriter supply comes “in a future upgrade”; action 15 is live.
- The action table has no 14, yet action 14 appeared 25 times in 3,000,001 mainnet blocks.
- The mirrored HIP-4 deployer page says “Testnet-only”; mainnet carried 228 active outcomes when checked.
More in where the chain and the docs disagree.
11. Action 15 operations 2 and 3
Section titled “11. Action 15 operations 2 and 3”One production client routes 2 as borrow and 3 as repay; a later investigation says action 15 exposes only supply and withdraw. Neither record was settled (CoreWriter).
12. A HyperCore spot send has no EVM-visible sender
Section titled “12. A HyperCore spot send has no EVM-visible sender”A contract sees its balance rise through 0x801 but cannot tell who paid. Take deposits on the HyperEVM side, where msg.sender is known, then bridge; the operator workaround and its limits are on patterns.
For the designs that absorb these failures, see patterns. For how to see what HyperCore actually did, see CoreWriter.