It's a best practice to use abi.encode
instead of abi.encodePacked
when hashing parameters, because of hashing collisions.
In Listing.sol
and Order.sol
contracts, abi.encodePacked
method is used for hashing, which can lead to hashing collisions:
This is because abi.encodePacked
concatenates all the strings. This can result in same pod order id or listing used for exchanges. Here is a brief example using Foundry:
Manual Review
Use abi.encode()
instead of abi.encodePacked()
for hashing
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.