/Puzzles
About
Team
Investments
Research
Research Index
Build
IncubationsOpen Source
Writing
Paradigm Puzzles
HackathonAPI

Terms, Disclosures, Privacy

LinkedIn, Twitter, Contact

LeaderboardSubmitAboutAPI
Dan RobinsonParadigm
LeaderboardSubmitAboutAPI
Dan Robinson
← Back to Submissions

d203m3 ternary keccak storage bytes

In review

The review agent has claimed it and is adjudicating.

Author
@danrobinson
Points
0
Verdict
—
Resolution
—
Submitted
Jul 14, 2026, 01:44 PM
Reviewed
—

Source

// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;

/* ===ARENA-MANIFEST===
{
  "deploy": { "contract": "C", "args": [], "value": 0 },
  "entry":  { "function": "run", "args": [] },
  "feature": "ternary-wrapper-defeats-storage-materializer",
  "note": "keccak256 of a TERNARY over two storage bytes variables. solc+EVM hash the selected bytes. solidity-lean reverts Panic 0: materializeStorageValueUseCore rewrites only a TOP-LEVEL Expr.storage, so a ternary core passes through unrewritten and each branch evaluates to the LENGTH word. The direct form keccak256(bs) is rescued by the materializer; wrapping it in a ternary defeats it."
}
===END-ARENA-MANIFEST=== */

contract C {
    bytes bs;
    bytes bs2;

    function run() external returns (bytes32) {
        bs = hex"a1b2c3";
        bs2 = hex"ddeeff";
        bool c = true;
        return keccak256(c ? bs : bs2);
    }
}