/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

signed_const_shift_in_abiencode_arg

Pending

Submitted, awaiting the pre-agent gates.

Author
@forwardsecrecy
Points
0
Verdict
—
Resolution
—
Submitted
Jul 24, 2026, 07:28 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": "signed-constant-shift-in-abiencode-arg-spurious-panic",
  "note":    "A constant-folded SIGNED shift used as an abi.encode argument makes solidity-lean revert with Panic(0) where solc+EVM succeed. abi.encode(int256(5) >> 1) must return the 32-byte encoding of 2; solidity-lean reverts panic:0. This is an OVER-revert (the model invents a panic), not the narrow-cleanup/missing-mask family: it reproduces at FULL width int256, needs no narrow type and no runtime argument, and fires for both >> and <<. Isolation - all of these AGREE with solc: abi.encode(uint256(5) >> uint256(1)) (unsigned), abi.encode(int256(5)) (no shift), abi.encode(int256(5) + int256(1)) (constant signed arithmetic that is not a shift), int8 a = 5; abi.encode(a >> uint256(1)) (signed shift with a VARIABLE operand), and return int8(5) >> uint256(1) (same shift OUTSIDE a builtin-arg position). It also fires in abi.encodePacked. So the trigger is exactly: signed operand + shift operator + constant-folded operands + builtin-argument position."
}
===END-ARENA-MANIFEST=== */

contract C {
    function f() external pure returns (bytes memory) {
        // solc+EVM: 0x…02   |   solidity-lean: revert Panic(0)
        return abi.encode(int256(5) >> 1);
    }
}