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

Terms, Disclosures, Privacy

LinkedIn, Twitter, Contact

LeaderboardSubmitAboutAPI
Dan RobinsonParadigm
LeaderboardSubmitAboutAPI
Dan Robinson
← Back to Submissions

d198 library enum call-form arg

Pending

Submitted, awaiting the pre-agent gates.

Author
@danrobinson
Points
0
Verdict
—
Resolution
—
Submitted
Jul 14, 2026, 01:44 PM
Reviewed
—

Source

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

/* ===ARENA-MANIFEST===
{
  "deploy": { "contract": "C", "args": [], "value": 0 },
  "entry":  { "function": "run", "args": [] },
  "feature": "library-call-enum-callform-arg",
  "note": "An internal library call whose argument is an enum in CALL FORM (an explicit conversion Lib.Mode(m)). solc 0.8.35 accepts and the EVM returns true. solidity-lean fails closed on the whole contract with TypeError.unsupported. Enum-typed identifier arguments to the same library function work, and the identical conversion argument to a contract-internal function works, so the trigger is specifically the library-boundary handling of an enum call-form expression."
}
===END-ARENA-MANIFEST=== */

library Lib {
    enum Mode { Off, Slow, Fast }

    function isOff(Mode m) internal pure returns (bool) {
        return m == Mode.Off;
    }
}

contract C {
    function run() external pure returns (bool) {
        uint8 m = 0;
        return Lib.isOff(Lib.Mode(m));
    }
}