Skip to content

Moderato: deployment gas underestimates Tempo contract creation costs in Foundry #3350

@okwme

Description

@okwme

Summary

On Moderato testnet, Tempo TIP-20 native USD precompiles are callable from deployed contracts, but contract deployment from Foundry against the public RPC shows two surprising behaviors:

  1. forge script calling TIP-20 precompiles inside the script VM hits OpcodeNotFound
  2. large contract creates on-chain can consume the full gas cap and fail even when local Foundry deployment gas is much lower

What I verified

TIP-20 precompiles are not wallet-only:

  • direct RPC cast call to pathUSD / AlphaUSD / BetaUSD / ThetaUSD works
  • a deployed Solidity probe contract can call balanceOf(...) on all four
  • a deployed Solidity probe contract can call approve(...) on pathUSD, and the allowance is stored on-chain

Example successful contract-originated approve:

  • token: 0x20c0000000000000000000000000000000000000
  • tx: 0x3458b929d74331dc1ffe99446cdd5c3505d93af017fb2f4355520844e130f9a7

Unexpected behavior

For PredictionMarket deployment on Moderato:

forge create src/PredictionMarket.sol:PredictionMarket \
  --broadcast \
  --gas-limit 20000000 \
  --rpc-url https://rpc.moderato.tempo.xyz \
  --private-key <funded-key>

Receipt:

  • tx: 0x5f38ff9fc3c2d29436d098c74aa5b040159da19a5c31b99bfd801dcb838ed314
  • status: 0
  • gasUsed: 20000000
  • feeToken: 0x20C0000000000000000000000000000000000000
  • reported contractAddress: 0x6b821802e2cB86d3082EA47342b6d49D3618D62d
  • cast code at that address returns 0x

Local Foundry gas report for the same contract says deployment cost is about 5,216,990 gas, so the live failure is unexpectedly far above local expectations.

Question

Is there any known Moderato behavior around:

  • contract creation gas accounting when fees are paid in TIP-20 stables
  • precompile behavior inside Foundry-style script/simulation paths
  • limits or caveats for deploying larger contracts through the public RPC

If there is a recommended deployment method for large contracts on Moderato, that would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions