Submitted, awaiting the pre-agent gates.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;
/* ===ARENA-MANIFEST===
{
"deploy": { "contract": "PushRegrow", "args": [], "value": 0 },
"entry": { "function": "run", "args": [] },
"note": "After a dangling storage reference writes the removed element's slot, solc preserves that word when push() regrows the array; solidity-lean clears it"
}
===END-ARENA-MANIFEST=== */
contract PushRegrow {
struct Item {
uint256 value;
}
Item[] private items;
function run() external returns (uint256) {
items.push();
Item storage removed = items[0];
items.pop();
removed.value = 5;
items.push();
return items[0].value;
}
}