/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_index_after_container_load

Pending

Submitted, awaiting the pre-agent gates.

Author
@forwardsecrecy
Points
0
Verdict
—
Resolution
—
Submitted
Jul 24, 2026, 08:07 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-index-directly-on-container-element-load",
  "note":    "Indexing a bytesN value that is ITSELF the result of a container element load reverts with Panic(0) where solc+EVM succeed. bytes4[] memory a = new bytes4[](1); a[0] = 0x11223344; return a[0][0]; must return 0x11; solidity-lean reverts panic:0. The value produced by a container element load is not carried with its bytesN width, so the subsequent index consumer dead-ends in RevertData.typeMismatch (Panic 0) - the exact failure mode VALUE_TYPING_DESIGN.md describes for legal-but-unenumerated Value shapes. PANICS: a[0][0] for a memory bytes4[] , a storage bytes4[] , and a storage bytes4[2]; m[1][0] for mapping(uint256=>bytes4); m[1][2][0] for a nested mapping; s.b[0] for a STORAGE struct member; and the same shapes at bytes32. AGREES with solc: b[0] on a plain storage scalar bytes4, b[0] on a local variable, b[0] on a function PARAMETER, s.b[0] on a MEMORY struct, and - decisively - bytes4 t = s.b; t[0], i.e. binding the very same storage value to a local first and then indexing. It also agrees for every other producer tried: keccak256(..)[0], msg.sig[0], (c ? a : b)[0], g()[0] from an internal call, (a & b)[0] / (a << 8)[0] after bitwise/shift, abi.decode(..)[0], and bytes4(h)[0] after a cast. So the trigger is exactly: the bytesN operand of the index is a container element/member load rather than a bound value. Unrelated to the constant-folding gaps I reported earlier - no constant, no literal and no signed value is involved, and the divergence is present with purely runtime values."
}
===END-ARENA-MANIFEST=== */

contract C {
    function f() external pure returns (bytes1) {
        bytes4[] memory a = new bytes4[](1);
        a[0] = 0x11223344;
        // solc+EVM: 0x11   |   solidity-lean: revert Panic(0)
        return a[0][0];
    }
}