Can I declare a `Vec` in a `storage` block?

No, this is not possible. Instead, the standard library provides a special vector type called StorageVec which behaves very much like a Vec in the sense that the API is quite similar. However, StorageVec holds its data in storage and not on the heap.

4 Likes