0

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;
    }
    // uint256[] public anArray;
    Person[] public listOfPeople;

In stylus, how would I setup the sol_storage! macro for this?

sol_storage! {
    #[entrypoint]
    pub struct SimpleStorage {
        // What goes in here?
    }
}

Bonus

What would go in the impl to make a getter for this array?

0

Your Answer

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

Browse other questions tagged or ask your own question.