To migrate the draggable(old) contract, the successor(new) contract needs to implement a migration function which can be called when the it holds sufficient draggable token.
the successor needs to let the user wrap the draggable and mint equivalent amount of tokens.
migrate flow:
mint new token (old.totalSupply() )
call old.migrate() (which calls old.replaceWrap() moves base token to new and sets new as old.wrapped)
call old.unwrap(old.balanceof(new) to reduce supply of old
burn the unwrapped tokens to reduce supply => now the supply should be again the same as old.totalSupply() was before
To migrate the draggable(old) contract, the successor(new) contract needs to implement a migration function which can be called when the it holds sufficient draggable token.
migrate flow: