0

How to achieve the functionality of Solidity's mapping in Solana? What I need is a map with an arbitrary number of entries (it'll be evergrowing).

So how to calculate the rent exemption and how to actually do this? Is it even possible?

I just need 1 account, so 1 global hashmap in a program.

I would be storing keys as integers and values as strings.

wohlstad
  • 12,661
  • 10
  • 26
  • 39
6b86b273ff
  • 11
  • 2

1 Answers1

3

in solana it's more common to use PDAs for this purpose, encode the key inside the seed and use the account data for storing the value.