Skip to content

Using SafeCast can result in reverts in Safe functions #829

@jalextowle

Description

@jalextowle

Several of the core Hyperdrive flows rely on Safe functions that will proactively catch arithmetic failures and return failure flags instead of reverting. After addressing Spearbit issue #55 in #812, it is now possible for arithmetic failures while casting to result in reversions in flows that we expect to always succeed.

Several changes need to be made to address this:

  1. Add a powSafe variant that returns a failure flag instead of reverting when arithmetic issues occur.
  2. Add to<X>Safe variants to the SafeCast functions that are currently being used with Safe functions.
  3. Ensure that these safe variants are being used within the Safe functions used within Hyperdrive.

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