Is it possible to initialize a StorageMap with data?

Is it possible to initialize a StorageMap with data?

2 Likes

Storage slots in Fuel either have been initialized or they are unused. You could make a custom StorageMap which would return a “default” value incase of an unused storageslot being accessed.

2 Likes

And if the question is whether you can declare a StorageMap with some default data in it, then no. All StorageMaps start off empty and the only way to insert data into them is via the insert() method which has to be called in the body of a contract method.

2 Likes

Ues it is lets goo… And there si more