MetaMorphoAdapterMigration
Inherits: IVersioned, ReentrancyGuard
Title: MetaMorphoAdapterMigration
Moves one configured adapter's principal and uncredited yield atomically.
Grant temporary manager roles on both adapters and governance on the paused vault, then revoke them in the same Safe transaction. No user tokens are minted or burned.
Constants
safe
address public immutable safe
vault
IMigrationVault public immutable vault
oldAdapter
IMigrationAdapter public immutable oldAdapter
newAdapter
IMigrationAdapter public immutable newAdapter
usdc
IERC20 public immutable usdc
vaultId
uint256 public immutable vaultId
State Variables
completed
bool public completed
Functions
constructor
Binds this one-use operation to a Safe, vault and adapter pair.
constructor(address safe_, address vault_, uint256 id_, address old_, address next_) ;
version
Identifies the immutable migration implementation.
function version() external pure override returns (string memory);
migrate
Migrates current balances without embedding an amount that can become stale.
Leaves yield uncredited as idle USDC at the replacement adapter. A legacy adapter can retain fractional shares worth zero USDC base units; no valued assets may remain. Any failure rolls back the withdrawals, deposits, registry change and completion flag.
function migrate() external nonReentrant;
Events
Migrated
event Migrated(
uint256 indexed vaultId,
address indexed oldAdapter,
address indexed newAdapter,
uint256 principal,
uint256 uncreditedYield
);
Errors
Unauthorized
error Unauthorized();
InvalidConfiguration
error InvalidConfiguration();
InvalidState
error InvalidState();
BalanceMismatch
error BalanceMismatch();