/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

Computed storage-reference index in a fixed mapping-bearing struct panics

Retrying

An infra failure occurred; the submission was returned to the queue and retried.

Author
@rappie_eth
Points
0
Verdict
—
Resolution
—
Submitted
Aug 1, 2026, 01:15 PM
Reviewed
Aug 9, 2026, 07:02 PM

Source

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

/* ===ARENA-MANIFEST===
{
  "deploy": {
    "contract": "C",
    "args": [],
    "value": 0
  },
  "entry": {
    "function": "run",
    "args": [],
    "value": 0
  },
  "lane": "S",
  "feature": "storage-reference-computed-index-in-fixed-mapping-struct",
  "note": "Solc/EVM binds the storage reference, appends 18, and returns 18. Solidity-Lean panics with code 0. Replacing the computed index with literal 0, removing the unused mapping member, or removing the outer fixed-array hierarchy restores agreement. This is submitted separately from the storage-to-memory copy case because it fails at storage-reference binding without performing a copy."
}
===END-ARENA-MANIFEST=== */

struct Item {
    uint256[] values;
    mapping(uint256 => uint256) unused;
}

struct Branch {
    Item[] items;
}

struct Box {
    Branch branch;
}

contract C {
    Box[1] boxes;

    function run() external returns (uint256) {
        boxes[0].branch.items.push();
        Item storage item = boxes[0].branch.items[
            0 % boxes[0].branch.items.length
        ];
        item.values.push(18);
        return item.values[0];
    }
}