How can we convert, for instance, the Address type from Alloy Primitives into the StorageAddress type from the Stylus crate?
1 Answer
You would use from()
or into()
. The SDK uses Alloy's primitives behind the scenes.
That being said, it's rare that you have to do this conversion yourself, because the Stylus team has made sure that API boundaries use Alloy primitives, that is, you declare your Solidity struct inside sol_storage!
and forget that the backing types are Storage*
.