How can we convert, for instance, the Address type from Alloy Primitives into the StorageAddress type from the Stylus crate?

1 Answer 1


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*.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.