Skip to content

Detector ideas #7

@0xGeorgii

Description

@0xGeorgii

Function Contract can panic

Detect panic!, unwrap, and expect calls inside all contract functions (directly or indirectly). We need it to ensure a developer does not explicitly interrupt execution with panics => interrupts a caller call.
Inspired by: scout

Storage key is accepted as a function parameter

A user should not be able to set an arbitrary named storage slot location.
Inspired by: scout

Default struct is returned

If in a function, a default struct is created without mut and then returned from the function with unwrap_or or with return or without being changed.

https://docs.rs/soroban-sdk/latest/soroban_sdk/token/trait.TokenInterface.html#tymethod.transfer
We can check if someone calls a transfer with the unsigned amount or by using cast.

Extend ttl with max_ttl

A TTL extension should be calculated, but not just set as maximum.

See Soroban SDK docs:

Using temporary storage value as a condition

If there is a env::storage::temporary::has call used as a condition, it can be an error.


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