Skip to content

Improve the type safety of contract storage #1762

Description

@leighmcculloch

For sometime folks have asked for ways to improve the type safety of working with contract storage, with the main complaint being that one can mix up the key type, storage type, and the value type, writing with one type at one location and reading at another.

This issue is a starting point to start collecting storage patterns and solutions that folks are using. Post other solutions and patterns as comments. I will keep the issue description updated with a summary of all.

This issue may not result in a change to the soroban-sdk, but it may if an approach proves to meaningfully improve contract safety and the developer experience. Anything the sdk adopts should be composable and general enough to lean into the 'library' lane rather than lean into the 'framework' lane. That distinction will not always be clear.

Solutions seen in the wild:

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