Questions tagged [stylus]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
23 views

Converting between Alloy Primitive and Storage Types

How can we convert, for instance, the Address type from Alloy Primitives into the StorageAddress type from the Stylus crate?
Dege's user avatar
  • 11
2 votes
0 answers
23 views

How to run a script in a stylus project

I have a smart contract written with the stylus SDK, and I have a rust script that I've written to interact with it. My file structure looks as such: . ├── Cargo.lock ├── Cargo.toml ├── Makefile ├── ...
Patrick Collins's user avatar
3 votes
0 answers
26 views

Run a local stylus node?

Is there a anvil equivalence for stylus? ie: I want to test my stylus smart contracts against a local stylus node, how would I do that?
Patrick Collins's user avatar
3 votes
1 answer
32 views

Where is the constructor of a stylus contract defined?

In solidity, I can pick the deployment parameters of my smart contract using the constructor keyword. constructor( /* params here */) {...} What is the rust/stylus equivalent of that?
Patrick Collins's user avatar
2 votes
0 answers
23 views

How to make a test in stylus?

Let's say I have the following stylus contract: #![cfg_attr(not(feature = "export-abi"), no_main)] extern crate alloc; use stylus_sdk::{ alloy_primitives::U256, prelude::{entrypoint, ...
Patrick Collins's user avatar
0 votes
1 answer
25 views

Add a key, value pair to a sol mapping in stylus?

In my stylus contract, I have the following sol_storage: sol_storage! { #[entrypoint] pub struct SimpleStorage { mapping(string => string) name_to_favorite_number; } } And, I ...
Patrick Collins's user avatar
0 votes
0 answers
31 views

How to make a struct in `sol_storage` layout in `stylus`?

I am attempting to replicate a solidity storage layout in stylus. It includes a struct, and a list of that struct object: struct Person { uint256 favoriteNumber; string name; } ...
Patrick Collins's user avatar
1 vote
2 answers
124 views

Why do I use extern crate for alloc instead of `use std::alloc`?

I'm making a simple storage contract in stylus, but I'm confused as to why I can't import alloc like I can other imports. I have two kinds of imports // the extern extern crate alloc; // The classic ...
Patrick Collins's user avatar
1 vote
1 answer
99 views

How to verify a stylus smart contract?

I have deployed the Counter contract to the Stylus testnet. However, looking at verification options, it looks like only Solidity & Vyper is supported. Is there a way to verify a Stylus (rust-...
Patrick Collins's user avatar