github OffchainLabs/stylus-sdk-rs v0.2.2
Stylus SDK 0.2.2

latest releases: v0.6.0, v0.4.3, v0.4.2...
13 months ago

This backwards-compatible patch release makes documentation improvements, along with one minor feature addition.

StorageKey

You can now implement custom keys for mappings.

impl StorageKey for Key {
    fn to_slot(&self, root: B256) -> U256 {
        // return a slot
    }
}

The above then enables

sol_storage! {
    mapping(Key => Value) map;    // in solidity
}

#[solidity_storage]
pub struct Contract {
    map: StorageMap<Key, Value>,  // or in Rust
}

Don't miss a new stylus-sdk-rs release

NewReleases is sending notifications on new releases.