Skip to main content

Lazy storage on delegate

What it does

Checks for non-lazy storage when using delegate calls.

Why is this bad?

ink! has a bug that prevents delegate calls from modifying the storage of the caller.

More info

Example

    #[ink(storage)]
pub struct Contract {
admin: AccountId,
}

Use instead:

    #[ink(storage)]
pub struct Contract {
admin: Lazy<AccountId, ManualKey<12345>>,
}

Implementation

The detector's implementation can be found at this link.