Skip to content

Contract: Develop Gas Estimation and Invocations Simulation Wrapper #420

Description

@EDOHWARES

Description

Build a helper contract that simulates events and calculates gas consumption for arbitrary invocations.

Current Problem

Complex multi-contract invocations frequently fail on-chain due to gas budget exhaustion, and developers lack tools to pre-calculate accurate resource fees.

Proposed Solution

Build a simulation runner contract that runs target methods in dry-run mode and calculates CPU, RAM, and storage fee footprints.

Technical Tasks

  • Implement read-only execution wrappers inside a simulation helper contract
  • Parse result buffers to extract gas and resource footprint metrics
  • Build estimation formulas accounting for Stellar ledger transaction fees
  • Write test cases asserting estimates against actual runtime executions

Acceptance Criteria

  • Invocations report resource footprints without performing actual state writes
  • Estimator reports match actual on-chain executions within a 5% margin
  • Simulation handles out-of-gas exceptions gracefully, returning details on where it failed

Testing Requirements

  • Benchmark gas estimates against real execution runs of several contracts

Metadata

  • Priority: Medium
  • Difficulty: Medium

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions