Possibility of having an Array without a fixed size in Sway

Hi guys,

I was trying to build a contract where I need an array to store addresses of the users [add: Address]. However I want that array not be fixed in size since I want to add more addresses to the array with contract calls.

Based on the documentation, in Sway, Arrays are fixed in size.

I’m wondering is there any ways to achieve what i have mentioned above?

Hi @mrlily call you try using a Storage Vector:
Sway | Fuel Docs

2 Likes