Normal behavior:
This script prepares Merkle tree input data using address/amount pairs. The intent is for off-chain tools or test helpers to use the JSON output to build a Merkle tree that matches the Merkle root deployed on-chain.
Issue:
The script manually serializes JSON by string-concatenating object keys "0"
, "1"
, "2"
, ......, using dynamic formatting. This leads to a non-deterministic data layout, since JSON itself does not guarantee object key order.
If a Merkle tree is regenerated using the same data but a different key order (as is common in real-world JSON parsers), the final root hash will change, breaking all Merkle proofs and preventing legitimate airdrop claims.
Likelihood: Medium
Occurs when Merkle roots are rebuilt off-chain using tools that parse the generated JSON without preserving key order.
Common in multi-platform environments or team handoffs where JSON is used as a shared data layer.
Impact: Medium
Causes Merkle root mismatch and invalidates airdrop proofs.
Users will be unable to claim Snowman NFTs even with valid data.
Leads to user frustration, broken airdrop launches, and trust issues in the protocol's fairness.
This PoC simulates how changing the order of input entries ,as would happen if JSON keys are reordered during parsing results in a different Merkle root, even if the values are the same.
leaves1
: original order (alice
, then bob
)
leaves2
: reordered (bob
, then alice
)
Different leaf order → different Merkle root → broken airdrop proof
Do not manually serialize JSON with numeric keys using string.concat
. Instead:
Use a structured encoding format ( ABI or RLP) where order is enforced.
Or, sort values explicitly before building the Merkle tree, and use arrays rather than object keys for ordered data.
Why it works
Switching from object-style keys ("0": {...}
) to array-style entries enforces consistent order.
Prevents unintended key reordering during parsing.
Maintains deterministic Merkle tree generation across systems.
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.
The contest is complete and the rewards are being distributed.