Rescue the residual AAVE held by the legacy LendToAaveMigrator proxy and permanently close the LEND → AAVE migration via an Aave Governance V3 proposal.
The original LendToAaveMigrator proxy at 0x317625234562B1526Ea2FaC4030Ea499C5291de4 still holds AAVE tokens that were never migrated. The LEND → AAVE migration is no longer needed: this repo upgrades the proxy to a new implementation that sweeps the residual AAVE to the Aave Collector and disables the migration entry point.
Two contracts in src/:
New REVISION = 3 implementation of the migrator.
initialize()— one-shot, gated byVersionedInitializable. Transfers the proxy's full AAVE balance toCOLLECTORand emitsAaveTokensRescued.migrateFromLEND(uint256)— always reverts withMigrationClosed(). The migration is permanently shut.migrationEnded()— returnstrue.- Constructor wires the immutables (
AAVE,LEND,LEND_AAVE_RATIO,COLLECTOR) and disables initializers on the implementation itself by settinglastInitializedRevision = REVISION.
Aave Governance V3 payload (IProposalGenericExecutor).
execute() calls ProxyAdmin.upgradeAndCall on the migrator proxy with the new implementation and abi.encodeWithSignature('initialize()'), so the upgrade and the rescue happen atomically in the same transaction.
- Deploy the new
LendToAaveMigratorimplementation (seescripts/DeployLendToAaveMigrator.s.sol). - Deploy
ProposalPayloadwith the new implementation address. - Aave Governance V3 executes the payload →
ProxyAdmin.upgradeAndCallupgrades the migrator proxy and callsinitialize()in the same transaction. initialize()sweeps the proxy's AAVE balance to the Aave Collector.- From this point on,
migrateFromLENDreverts and the migration is closed.
Requires Foundry (forge, cast) and Node + Yarn (only for the prettier/lint scripts).
git submodule update --init --recursive
forge install
yarn installforge test -vvv
# or
make testTest files live in tests/: LendToAaveMigrator.t.sol and ProposalPayload.t.sol.
To verify upgrade safety against the currently deployed implementation:
make download # fetches the current on-chain implementation from Etherscan
make storage-diff # generates storage-layout and source diffs under reports/ and diffs/