Closed
Description
Line 9 in b3d9889
In the provided example, the desired algorithm for getting leaves is:
bytes32 leaf = keccak256(bytes.concat(keccak256(abi.encode(addr, amount))));
And this works perfectly fine when there is more than 1 value inside the leaf.
However, when the value inside the leaf is singular, then there is no need for extra concat and keccak256, it only makes gas overhead. And the preferred algorithm is:
bytes32 leaf = keccak256(abi.encodePacked(addr));
This makes make a big difference because there is no possibility to change the leaf algorithm that this library uses, hence all trees and proofs for them can't be synced with the contract's behavior.
Metadata
Metadata
Assignees
Labels
No labels