Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eee50df8f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const addressProvider = await ethers.getContractAt("PoolAddressesProvider", providerDeployment.address, signer); | ||
| const [poolAddress, poolConfiguratorAddress] = await Promise.all([addressProvider.getPool(), addressProvider.getPoolConfigurator()]); |
There was a problem hiding this comment.
Gate the recovery rollout on Safe admin access
This preflight only verifies addresses, but the batch it green-lights queues PoolConfigurator calls such as setReservePause, setReserveBorrowing, setReserveFlashLoaning, setReserveFreeze, and configureReserveAsCollateral. In contracts/dlend/core/protocol/pool/PoolConfigurator.sol, those entrypoints are protected by onlyEmergencyOrPoolAdmin and onlyRiskOrPoolAdmins, and this repo’s other mainnet rollouts already have explicit ACL role checks/grant steps for the same reason. If the governance Safe can grant these roles but does not already hold them, recovery:safe:preflight still passes and the generated batch reverts when the Safe executes it.
Useful? React with 👍 / 👎.
| ```bash | ||
| export RPC_URL='https://ethereum-rpc.publicnode.com' | ||
| export ATTACKER='0xbA5E1E36b0305772D35509c694782fB9118D4ecc' | ||
| export RESERVES_JSON='["0x07fFf99e1664d9B116fbC158c0E99785F81cA236","0x8236a87084f8B84306f72007F36F2618A5634494","0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599","0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf","0x45804880De22913dAFE09f4980848ECE6EcbAf78","0xac3E018457B222d93114458476f3E3416Abbe38F","0xcf62F905562626CfcDD2261162a51fd02Fc9c5b6"]' |
There was a problem hiding this comment.
Snapshot the full reserve set in Phase 0
This recommended RESERVES_JSON narrows preflight-checks.ts to seven assets, but the rest of the playbook depends on Phase 0 discovering every unpaused low-supply flash-loan reserve before the operator derives RECOVERY_RESERVES_JSON. The addresses called out later in the same document (dETH, WETH, wstETH, rETH, sUSDe, sUSDS, syrupUSDC, syrupUSDT) are not in this list, so an operator who copies the snippet will never see them in the preflight output and can prepare an incomplete recovery batch.
Useful? React with 👍 / 👎.
…xport for common.ts
- Add AtomicMarketListingHelper contract (stage/enable reserves with min supply) - Deploy helper in pool configurator; wire preflight and new-listings deploy scripts - Add viaIR override and stack-depth refactor for AtomicMarketListingHelper - Skip setDebtCeiling when unchanged to avoid RESERVE_LIQUIDITY_NOT_ZERO on enable - Add no-op default export to deploy/30_dlend_new_listings/common.ts for hardhat-deploy - Update collateral rollout and recovery playbook docs; add AtomicMarketListingHelper tests Made-with: Cursor
Patch flash-loan premium routing to remove the near-empty reserve index inflation path and add operator tooling to sanitize and permanently remove the quarantined cbBTC market safely. Made-with: Cursor
Summary
Validation
yarn hardhat compilenpx tsc --noEmit --target ES2020 --module commonjs --moduleResolution node --esModuleInterop --skipLibCheck scripts/recovery/common.ts scripts/recovery/preflight-checks.ts scripts/recovery/repay-attacker-variable-debt.ts scripts/recovery/assert-post-repay.tsyarn eslint deploy/32_dlend_recovery_mainnet/*.tsyarn tsx scripts/recovery/preflight-checks.tsRECOVERY_RESERVES_JSON='["0x07fFf99e1664d9B116fbC158c0E99785F81cA236","0xb419EcDd222981E7E54cEc316797eCb799c6AFdC","0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2","0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0","0xae78736Cd615f374D3085123A210448E74Fc6393","0x9D39A5DE30e57443BfF2A8307A4256c8797A3497","0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD","0x80ac24aa929eaf5013f6436cda2a7ba190f5cc0b","0x356B8d89c1e1239Cbbb9dE4815c39A1474d5BA7D"]' PK_MAINNET_DEPLOYER='0x1111111111111111111111111111111111111111111111111111111111111111' USE_SAFE=true yarn hardhat deploy --network ethereum_mainnet --tags setup-ethereum-mainnet-dlend-recovery-preflightRECOVERY_RESERVES_JSON='["0x07fFf99e1664d9B116fbC158c0E99785F81cA236","0xb419EcDd222981E7E54cEc316797eCb799c6AFdC","0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2","0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0","0xae78736Cd615f374D3085123A210448E74Fc6393","0x9D39A5DE30e57443BfF2A8307A4256c8797A3497","0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD","0x80ac24aa929eaf5013f6436cda2a7ba190f5cc0b","0x356B8d89c1e1239Cbbb9dE4815c39A1474d5BA7D"]' yarn tsx scripts/recovery/assert-post-repay.ts(expected to fail against current live state until the admin batch and repay are executed)Notes
dETH,WETH,wstETH,rETH,sUSDe,sUSDS,syrupUSDC, andsyrupUSDTas unpaused low-supply reserves with flash loans enabled, so the recovery docs and batch inputs were widened to account for those markets rather than only the originally paused set