Skip to content

Support for handling reverts in view function calls #438

@Wollac

Description

@Wollac

Background

Currently, Steel requires view functions to return a value and panics when a call reverts. This creates limitations for contracts that rely on revert behavior for validation logic.

Current limitations

  1. The called function must return a value
  2. When a call reverts, the guest panics by default
  3. Only a debug string is available for reverts, which is not suitable for production use.

Suggested features

Add proper support for handling reverts in Steel with the following features:

  1. Allow view functions without return values
  2. Implement proper Rust error handling for failed executions
  3. Return properly typed Rust errors that allow
    • Access the error data
    • Decode ABI error information
    • Support error matching/handling similar to Solidity's try-catch

Current workarounds

  1. Provide a wrapper contract that translates revert/success to boolean/enum returns.
  2. Modify existing contracts to return values instead of revertin

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