Skip to content

Conversation

@salaheldinsoliman
Copy link
Contributor

Storage vectors here are not supported via keeping a VecObject in storage.
Instead, we follow an approach similar to how storage vectors in Solidity: The key is a hash function of (storage slot + index). This hash function in Soroban is simply a VecObject :)

contract storage_array {
            uint64[] mylist;
            uint64 normal = 20;

            function push_pop() public returns (uint64) {
                mylist.push(5);
                mylist[0] = 15;
                return mylist[0] ;
            }
  }

Here mylist[0] element is addressed as VecObject(main slot + index), which in this case is VecObject(0,0)

Signed-off-by: salaheldinsoliman <salaheldin_sameh@aucegypt.edu>
Signed-off-by: salaheldinsoliman <salaheldin_sameh@aucegypt.edu>
salaheldinsoliman and others added 2 commits November 15, 2025 11:48
Signed-off-by: salaheldinsoliman <salaheldin_sameh@aucegypt.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants