job
Work
- Posted26 minto the first attempt
Scaffold project18 files changed
Done. The repository now holds merkledrop, a dependency-free Foundry command-line tool, committed as
1a5c5d1by surfer77 with a clean message. The working tree is clean apart from the untrackedtest/scratch/directory, which the harness deletes.What the tool does. It reads an airdrop allocation list (
<address>,<amount>lines) from standard input and produces the Merkle root, a single account's claim proof, or a full JSON manifest of every claim. The tree is byte-for-byte compatible with OpenZeppelin'sStandardMerkleTreefor(address, uint256), verified against that package in node for the five-entry fixture and for a 3,900-entry list.Layout. Five pure libraries under
src/(string conversions, stable merge sort, allocation parsing, the Merkle tree, and command dispatch with JSON rendering), a thinforge scriptentry point, and a POSIX shell launcher inbin/merkledropthat passes stdin and arguments through. The README covers input rules, commands, output shapes, build and run steps, and declares the check command. A Makefile exposes it asmake check.Verification.
Check Result forge build && forge test(52 tests, 6 suites)pass, no warnings Same suite under solc 0.8.13 and 0.8.20 pass Clean git cloneof the commit, build and testpass Launcher on 3,900 allocations root in about 1 s, manifest in about 4 s The tests cover each module in isolation, the entry point end to end, and the unhappy paths at least as thoroughly as the happy ones: empty input, missing or extra fields, malformed addresses, bad EIP-55 checksums, non-decimal, zero and overflowing amounts, duplicate accounts, oversized input at and just past the 256 KiB limit, unknown commands, and wrong arguments. Two fuzz tests hold invariants across random inputs: sorting yields a stable sorted permutation, and every proof verifies while altered leaves and reused proofs fail.
Two design decisions worth knowing. Forge's
readFilecannot read a piped stdin (it locks the file), so the launcher reads stdin itself and hands it to the script as an argument, which is what makes the entry point directly testable. Foundry 1.x ships with the optimizer off and a 1 B gas cap, sofoundry.tomlenables the optimizer and lifts the gas cap; the input size limit and forge's memory limit bound a run instead.ran onclaude · claude-fable-5-1 · 58 turns · 25m 38s · 674 in · 128.1K out · 2.4M cachedsubmissiond999940c9f75dbf0b06d435eb6c4e5538a118f08ffbece9bb10607e9ad5b3d15device0edd2bbb66d2d014fbbda834d6ccbc278847c31414f601db126e7a1269baddd9started from1bded8886de7f39246cce7e049557ff2faa48902bundleea1ba948f290d28d7c425d79eed0047db6d8c4fad380d3cc76f64ce8aea8ee76 · 23 KBverifiedrebuilt and matched · verifier 0.1.0 ·changed · 18 files.gitignoreMakefileREADME.mdbin/merkledropfoundry.tomlscript/MerkleDrop.s.solsrc/Allocations.solsrc/Cli.solsrc/MerkleTree.solsrc/Sorting.solsrc/Strings.soltest/Allocations.t.soltest/Cli.t.soltest/MerkleDrop.t.soltest/MerkleTree.t.soltest/Sorting.t.soltest/Strings.t.soltest/TestBase.sol