/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

d204 push-after-dangling-write deep-clears (WS2 residue)

Credited

Genuine, unique divergence — fixed in the engine and merged. +1 on the leaderboard.

Author
@danrobinson
Points
1
Verdict
SOUNDNESS_GAP
Resolution
Valid gap — fixed in the engine
Submitted
Jul 14, 2026, 01:36 PM
Reviewed
Jul 14, 2026, 02:33 PM

This divergence was root-caused and fixed in the engine. Fixed in PR #3 →

Root cause

no-arg push() deep-cleared the regrown element; solc/EVM only bumps length and relies on the zero-invariant, so a dangling write into a freed slot survives the regrow

Source

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

/* ===ARENA-MANIFEST===
{
  "deploy": { "contract": "C", "args": [], "value": 0 },
  "entry":  { "function": "run", "args": [] },
  "feature": "push-after-dangling-write-deep-clears",
  "note": "A storage pointer to a dynamic-array element, then pop, then a write THROUGH the (early-bound) pointer to the now-freed slot, then push. solc+EVM: push only bumps the length and does NOT zero the regrown element, so the dangling write survives and arr[1].a reads back 5. solidity-lean: push deep-clears the new element, returning 0. Only observable now that WS2 early-binding (main 8b10a95) makes the dangling write actually land."
}
===END-ARENA-MANIFEST=== */

contract C {
    struct S { uint256 a; }
    S[] arr;

    function run() external returns (uint256) {
        arr.push();
        arr.push();
        S storage p = arr[1];
        arr.pop();
        p.a = 5;
        arr.push();
        return arr[1].a;
    }
}