huff-language / huffmate

A library of modern, hyper-optimized, and extensible Huff contracts with extensive testing and documentation built by Huff maintainers.
https://github.com/pentagonxyz/huffmate
MIT License
430 stars 55 forks source link

fix: hashmap.huff hashing pattern changed to solidity pattern #106

Closed AmadiMichael closed 1 year ago

AmadiMichael commented 1 year ago

This changes the pattern of hashing for slots in Hashmap.huff to match that of how solidity lang handles mappings.

GET_SLOT_FROM_KEYS() function uses sha3(slot . key) against sha3(key . slot) used in solidity, GET_SLOT_FROM_KEYS_2D() function uses sha3(sha3(slot . key1) . key2) against sha3(key2 . sha3(key1 . slot) used in solidity and GET_SLOT_FROM_KEYS_3D() function uses sha3(key3 . sha3(key2 . sha3(slot . key1))) against sha3(key3 . sha3(key2 . sha3(key1 . slot))) used in solidity.

devtooligan commented 1 year ago

lgtm. would be nice to get a second set of eyes on this one since i was involved in the creation of this fix @cheethas @clabby @refcell @MathisGD

AmadiMichael commented 1 year ago

Minor issues with comments, otherwise LGTM

Ah, missed them, thanks. Committed.