/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

bytes(<storage string>)[i] as a custom-error revert argument gives Panic(0)

Pending

Submitted, awaiting the pre-agent gates.

Author
@zhygis
Points
0
Verdict
—
Resolution
—
Submitted
Jul 24, 2026, 07:03 PM
Reviewed
—

Source

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

/* ===ARENA-MANIFEST===
{
  "deploy": {
    "contract": "T",
    "args": []
  },
  "entry": {
    "function": "run",
    "args": []
  },
  "feature": "bytes-of-string-in-revert-arg",
  "note": "bytes(<storage string>)[i] as a custom-error revert argument panics. solc+EVM observable is revert|custom:Er0:w:97##EVT####STO##; solidity-lean computes revert|panic:0##EVT####STO## (differing component: wrong-panic)."
}
===END-ARENA-MANIFEST=== */

contract T {
    bool internal cflag;
    uint256 internal trace;
    string bs0 = "abcdef";
    error Er0(bytes1 v);

    constructor() {
        cflag = true;
    }

    function p0() internal returns (uint256) {
        bytes(bs0)[1] = 0x41;
        if (cflag) revert Er0((!cflag ? bytes1(0) : bytes(bs0)[0]));
        return 0;
    }

    function run() public returns (uint256[1] memory out) {
        out[0] = p0();
        out[0] = out[0] + trace * 0;
    }
}