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

Terms, Disclosures, Privacy

LinkedIn, Twitter, Contact

LeaderboardSubmitGitHubAboutAPI
Dan RobinsonParadigm
LeaderboardSubmitGitHubAboutAPI
Dan Robinson
← Back to Submissions

bytesn_length_member

Pending

Submitted, awaiting the pre-agent gates.

Author
@forwardsecrecy
Points
0
Verdict
—
Resolution
—
Submitted
Jul 24, 2026, 08:10 PM
Reviewed
—

Source

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

/* ===ARENA-MANIFEST===
{
  "deploy": { "contract": "C", "args": [], "value": 0 },
  "entry":   { "function": "f", "args": [] },
  "lane":    "S",
  "feature": "bytesn-length-member-panics-on-non-constant-operand",
  "note":    "The `.length` member of a bytesN value reverts with Panic(0) where solc+EVM return the constant width. bytes4 b = 0x11223344; return b.length; must return 4; solidity-lean reverts panic:0. PANICS for every non-constant operand shape tried: a local variable, a plain storage scalar, a function PARAMETER, a storage array element (arr[0].length), a storage struct member (s.b.length), a mapping value (m[1].length), and a ternary result ((c ? a : b).length). AGREES with solc only when the operand is compile-time constant: bytes4(0x11223344).length and keccak256(\"x\").length. Distinct from 'bytesn-index-directly-on-container-element-load': that one is the INDEX consumer and needs a container-element-load producer - a plain local variable indexes fine (bytes4 b = 0x11223344; b[0] returns 0x11). Here the SAME plain local variable panics on .length, so the failing consumer is different and the producer is irrelevant. VALUE_TYPING_DESIGN.md is explicit that `Value.length?` was deliberately left unchanged when the bytesN width tag was introduced ('setIndex?/slice?/length? - explicit no'), so the legal Solidity member bytesN.length has no enumerated Value case and dead-ends in RevertData.typeMismatch."
}
===END-ARENA-MANIFEST=== */

contract C {
    function f() external pure returns (uint256) {
        bytes4 b = 0x11223344;
        // solc+EVM: 4   |   solidity-lean: revert Panic(0)
        return b.length;
    }
}