{"data":{"kind":"file","path":"README.md","version_id":"rrz11z1xr8rtpjv484w85wit","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":2096,"modified_at":"2026-11-27T10:23:27.074000","content_hash":"622c9875e2b332d4d3a48d58abe2731e8cdb8ef4f6ca6f4706d9940e2760bf83"},"entries":[],"content":"# `solidity-patch-swe-env` (`verifiers v1`)\n\nExecutable **Solidity Smart-Contract Vulnerability Repair (SWE)** RL environment for the Prime Intellect Environments Hub.\n\n## Overview\nUnlike classification-only audit benchmarks, this environment requires the model to output a **complete, compilable, patched Solidity `^0.8.24` contract** inside `<patch>...</patch>` that fixes a concrete DeFi vulnerability while preserving the contract's exact public ABI and functional invariants.\n\n### 5 Parameterized DeFi Bug-Repair Classes (40 Deterministic Tasks)\n1. **`ERC4626_INFLATION`**: Add virtual share/asset offset (`VIRTUAL_SHARES` / `VIRTUAL_ASSETS`) into share conversion math to block first-depositor donation inflation.\n2. **`ROUNDING_DIRECTION`**: Fix Morpho-style borrow share truncation by rounding UP against the borrower (`mulDivUp` / `(a * b + c - 1) / c`).\n3. **`READ_ONLY_REENTRANCY`**: Enforce Checks-Effects-Interactions (decrement `totalSupply` and `poolEth` strictly before external ETH `.call{value: ...}`) plus a reentrancy lock protecting both `withdraw` and view pricing (`getVirtualPrice`).\n4. **`SPOT_ORACLE_MANIPULATION`**: Replace flash-loan-manipulable AMM spot reserve ratio (`getReserves()`) with a manipulation-resistant TWAP / Chainlink oracle interface.\n5. **`ORACLE_DECIMAL_MISMATCH`**: Normalize 6- or 8-decimal Chainlink price feeds to 18 decimals (`10 ** (18 - decimals)`) and enforce positive price validation (`price > 0`).\n\n### Anti-Reward-Hacking Verifier Gates\n- **Hard Compile Gate**: Real `solc` compilation when available (`solc` / `~/.svm/*/solc-*`), with strict structural Solidity verification fallback — syntax errors or non-compiling patches score **`0.0`**.\n- **ABI Preservation Gate**: Deleting or renaming the contract or target function scores **`0.0`**.\n- **Unpatched / Comment-Hack Gate**: Copying the buggy code or inserting comments without fixing the actual expression scores **`0.0`**.\n- **Clean Separation**: Verified reference patch policy scores **`1.0000`** vs naive copy / comment-hack baselines at **`0.0000`** (`+1.0000` separation).\n","encoding":"utf-8","truncated":false,"total_bytes":2096},"status":null}