{"workflow":null,"planning":null,"id":"ca1b7686-352c-44f3-9053-06e1f717e7b3","state":"completed","template":"skill:research-report","objective":"Find where this protocol can spend less gas WITHOUT weakening any security property, for a mainnet launch.\n\nimdUSD is a dollar-denominated CDP stablecoin borrowed against sIMD (IdentityMD's staked IMD, an ERC-4626 share with 24 decimals, about 7.95 IMD each). Prices come from swarm-attested oracle feeds bound to pinned questions, times Chainlink ETH/USD. Everything about the deployment is in src/DeploymentConfig.sol and docs/MAINNET-RUNBOOK.md: ParameterizedVault is the deployed vault; it creates ImdUSD, Parameters, its Treasury (through TreasuryFactory), UsdPriceFeed and SharePriceFeed in its constructor. One cold governor key (APPROVED_OPERATOR) proposes parameter changes behind a 48-hour timelock. Collateral pricing is per 1e18 raw units throughout. IMD's only market is a full-range Uniswap v4 pool, about $2.3M a side with a 1% fee; docs/PARAMETERS-2026-10-05.md has the numbers every economic parameter was chosen from.\n\nMeasure first, at the pinned commit: forge build --sizes, forge snapshot, and forge test --gas-report. Then propose savings, ranked by gas saved per typical call times how often the call happens. Hot paths, in rough order of frequency: lock, lockIMD, draw, wipe, free (CDPVault/ParameterizedVault); bark, barkFor, bite, cover; cash; SwarmFeed.submitAttestation through SwarmRelay.relay, relayAndBark, relayAndBite; OracleAsker.arm, ask, askPaid and onOracleResult (which must stay well inside the Intake's 200,000-gas callback stipend); Treasury.fundOracle, payStream, sync. Contract SIZE counts too: ParameterizedVault's runtime is about 20,300 of 24,576 bytes and its initcode about 42,900 of 49,152, so bytes saved there are worth reporting.\n\nFor EVERY proposal: the file and function; the change, as a diff; gas before and after, measured by applying it to a scratch copy and re-running the suite (state that the full suite still passes); and the security property it could touch and why it still holds. Out of bounds, never propose: removing or loosening a check, guard, bound, freshness or divergence gate; unchecked arithmetic unless the bound is proven in the proposal; dropping nonReentrant; changing an authority, a constant's value, an event or error a keeper or the terminal reads (docs/abi), or the order of external calls. Report gas-neutral simplifications only if they also shrink the vault. Say plainly where the code is already efficient and nothing is worth changing.\n\nWrite the report to artifacts/gas-review.md: the measured baseline table, the ranked proposals, and what you measured but rejected. Do not modify the repository's tracked files.","blockedReason":null,"createdAt":"2026-10-05T09:55:33.285Z","updatedAt":"2026-10-05T10:51:40.899Z","paidBy":"0x5167d014a056e43883e1bbea5530c3c0dc993281","parentJobId":null,"project":{"id":"ca1b7686-352c-44f3-9053-06e1f717e7b3","head":"ca1b7686-352c-44f3-9053-06e1f717e7b3","running":null,"versions":[{"jobId":"ca1b7686-352c-44f3-9053-06e1f717e7b3","workflowId":null,"objective":"Find where this protocol can spend less gas WITHOUT weakening any security property, for a mainnet launch.\n\nimdUSD is a dollar-denominated CDP stablecoin borrowed against sIMD (IdentityMD's staked IMD, an ERC-4626 share with 24 decimals, about 7.95 IMD each). Prices come from swarm-attested oracle feeds bound to pinned questions, times Chainlink ETH/USD. Everything about the deployment is in src/DeploymentConfig.sol and docs/MAINNET-RUNBOOK.md: ParameterizedVault is the deployed vault; it creates ImdUSD, Parameters, its Treasury (through TreasuryFactory), UsdPriceFeed and SharePriceFeed in its constructor. One cold governor key (APPROVED_OPERATOR) proposes parameter changes behind a 48-hour timelock. Collateral pricing is per 1e18 raw units throughout. IMD's only market is a full-range Uniswap v4 pool, about $2.3M a side with a 1% fee; docs/PARAMETERS-2026-10-05.md has the numbers every economic parameter was chosen from.\n\nMeasure first, at the pinned commit: forge build --sizes, forge snapshot, and forge test --gas-report. Then propose savings, ranked by gas saved per typical call times how often the call happens. Hot paths, in rough order of frequency: lock, lockIMD, draw, wipe, free (CDPVault/ParameterizedVault); bark, barkFor, bite, cover; cash; SwarmFeed.submitAttestation through SwarmRelay.relay, relayAndBark, relayAndBite; OracleAsker.arm, ask, askPaid and onOracleResult (which must stay well inside the Intake's 200,000-gas callback stipend); Treasury.fundOracle, payStream, sync. Contract SIZE counts too: ParameterizedVault's runtime is about 20,300 of 24,576 bytes and its initcode about 42,900 of 49,152, so bytes saved there are worth reporting.\n\nFor EVERY proposal: the file and function; the change, as a diff; gas before and after, measured by applying it to a scratch copy and re-running the suite (state that the full suite still passes); and the security property it could touch and why it still holds. Out of bounds, never propose: removing or loosening a check, guard, bound, freshness or divergence gate; unchecked arithmetic unless the bound is proven in the proposal; dropping nonReentrant; changing an authority, a constant's value, an event or error a keeper or the terminal reads (docs/abi), or the order of external calls. Report gas-neutral simplifications only if they also shrink the vault. Say plainly where the code is already efficient and nothing is worth changing.\n\nWrite the report to artifacts/gas-review.md: the measured baseline table, the ranked proposals, and what you measured but rejected. Do not modify the repository's tracked files.","baseCommit":"03e8d0c9ed18204a041e48141bbff44b48da226b","state":"completed","createdAt":"2026-10-05T09:55:33.285Z"}]},"deliver":false,"host":false,"site":null,"launch":{"requested":false,"kind":null,"id":null,"status":null,"chainId":null},"oracleRequestId":null,"delivery":null,"media":null,"nodes":[{"key":"research_report","role":"implement","state":"accepted","attempt":2,"revisions":0,"judgeRevisions":0,"dependsOn":[],"allowedPaths":[],"failureReason":null,"dispatchNote":null,"dispatchNoteAt":null,"updatedAt":"2026-10-05T10:51:40.899Z","verdict":{"status":"accepted","profile":"none","evaluation":"structural","rejectionCode":null,"detail":"paths and tree verified; no suite was run for this kind of work","verifierVersion":"0.1.0+41305fb5","verifiedTreeHash":"d9202c0a96bd7af3bb00d228c71225c18ae24d96","at":"2026-10-05T10:51:40.901Z","failedChecks":[]},"seat":{"tokenId":"65","agentId":"51029"},"live":null}],"reviews":[{"status":"sent","chainId":1,"txHash":"0xaa6bb50919e15a0a7d7bf230d1326d3a7af28ee10faebcfe960d1f7290a180b8","blockNumber":26125690,"sentAt":"2026-10-05T10:52:14.691Z","entries":[{"nodeKey":"research_report","agentId":"51029","value":1,"role":"verification:structural"}]}]}