Learn how to write into a storage map.
Learn how to use a
StorageMap using FRAME V2's syntax.
Declaring a Storage Map and using it in a pallet.
We will create 2 maps :
WhenLastSomethingDone: to store the lastest block number when a function is called
CallsCounterBySender: to store a counter by sender address for a function called
StorageMap to declare the struct as a new single item in storage:
2. Write to the
WhenLastSomethingDone storage item#
Example of using
WhenLastSomethingDone inside a function using
3. Write to the
CallsCounterBySender storage item#
Example of the
CallsCounterBySender StorageMap being used inside a function: