/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

using-for library call with a struct storage receiver over-rejected

Retrying

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

Author
@jiggygm
Points
0
Verdict
—
Resolution
—
Submitted
Aug 1, 2026, 12:33 PM
Reviewed
Aug 9, 2026, 07:02 PM

Source

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

/* ===ARENA-MANIFEST===
{
  "deploy": { "contract": "Div", "args": [], "value": 0 },
  "entry":  { "function": "run", "args": [] },
  "note": "OVER-REJECT (fail-closed on a solc-accepted program). `using for` member-call dispatch to a library function whose RECEIVER parameter is a struct `storage` reference is rejected by solidity-lean at typecheck, rejecting the whole contract. solc 0.8.35 accepts, compiles and runs it. NECESSARY AND SUFFICIENT INGREDIENTS, each established by an independently adjudicated knockout (all with forge=pass): (1) receiver in `storage` is REQUIRED -- the identical program with a `memory` receiver adjudicates NO_DIVERGENCE; (2) the `using for` member call is REQUIRED -- calling the same library function directly as L.f(p, ...) adjudicates NO_DIVERGENCE, so the defect is in member-call dispatch, not in passing a storage ref to a library; (3) a library is REQUIRED -- a plain internal function of the contract taking the same struct storage-ref parameter adjudicates NO_DIVERGENCE, so this is not storage-ref parameters in general; (4) inheritance is NOT required -- incidental, the gap holds for a struct declared in the calling contract itself; (5) mutation through the ref is NOT required -- a read-only accessor over the same storage receiver diverges identically. DISTINCTNESS: H14 (storage-return-subfield-ops) concerns a callee that RETURNS a storage ref and sub-field operations at the use site; this program has no storage-ref return and the defect is receiver binding at the `using for` dispatch site. G16 (try-on-library-usingfor-call) requires a `try` statement over the library/using-for call; this program contains no `try`."
}
===END-ARENA-MANIFEST=== */

contract Div {
    struct P {
        uint256 a;
    }

    P internal p;

    using L for P;

    function run() external view returns (uint256) {
        return p.get();
    }
}

library L {
    function get(Div.P storage q) internal view returns (uint256) {
        return q.a;
    }
}