tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
396 stars 112 forks source link

Nested maps using hashing of keys #1083

Open anton-trunov opened 2 months ago

anton-trunov commented 2 months 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 2 months ago

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

anton-trunov commented 2 months 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.