|
Ran
|
Jobs
1
|
Files
24
|
Run time
1min
|
Badge
README BADGES
|
push
github
v2: Bind clone salts to the caller (#218) ## Motivation `ERC1155SeaDropCloneFactory.createClone` derived the clone salt as `keccak256(abi.encodePacked(salt, blockhash(block.number)))`. The blockhash of the current block is always 0, so a clone's address depends only on the salt the caller passes, and the comment's "pseudo-random" claim is wrong. Anyone who copies the salt from a pending `createClone` transaction gets a clone at that address, owned by them, and the original call reverts. os2-core picks random salts and credits a clone to the transaction's sender, so the impact is griefing. The same change landed on `main` in #217. ## Solution `createClone` now uses `keccak256(abi.encode(msg.sender, salt))`. Nothing in os2-core or os2-web predicts clone addresses. os2-core only encodes the `createClone` call, in `CreatorStudioDeployContractHelper.kt`. ## Deployment impact - Deployed factories and clones don't change. - The clone implementation is unchanged, and its runtime code hash stays `0x24ae192620cbc4d6636733ca858c25aba` (Foundry 1.9.0). The factory's init code changes, so mine its CREATE2 salt against the new init code hash. The init code is now 47,719 bytes, 1,433 under EIP-3860's limit. ## Testing - `testCreateCloneSaltIsBoundToCaller`: two callers using the same salt get different clones, and one caller can't reuse a salt. It fails against the previous factory. - `forge test`: 318 passed, 0 failed. `forge fmt --check` and `forge lint --deny warnings` pass with Foundry 1.9.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
344 of 384 branches covered (89.58%)
Branch coverage included in aggregate %.
1 of 1 new or added line in 1 file covered. (100.0%)
1528 of 1725 relevant lines covered (88.58%)
6552.46 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | foundry - 42531539295.1 | 24 |
88.76
|
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|