tact-lang / tact-docs

Tact main documentation
https://docs.tact-lang.org
55 stars 41 forks source link

Nested maps using hashing of keys #398

Open anton-trunov opened 1 month ago

anton-trunov commented 1 month ago

We should provide an example of how to emulated binary maps of pseudo-type map<(K1, K2), V> using hashes and a map of type map<Int, V>

novusnota commented 1 month ago

SomeStruct.toCell().hash() for the hashing?

anton-trunov commented 1 month ago

I think this is going to be expensive because the cell-creating operation (ENDC) costs 518 gas units. We should use hashing of the keys directly.