This guide outlines two methods for migrating your XDEFI tokens to CTRL:
- Method 1: Using a Gnosis Safe or other multi-signature wallet for a manual batch transaction.
- Method 2: An easier alternative that involves sending tokens to a personal wallet and using the migration app.
In Method 1, you will manually create a batched transaction using a safe (such as Gnosis Safe) to approve and then migrate XDEFI tokens to CTRL.
The first step is to approve the migration contract to spend your XDEFI tokens. This is necessary because the migration contract will transfer your XDEFI tokens and issue CTRL tokens in return.
approve(address spender, uint256 amount)
- XDEFI Token Contract:
0x72b886d09c117654ab7da13a14d603001de0b777
- spender: The migration contract address (
0x7c2230a01df134a632afddcec962bf1e9eb659ff
). - amount: The number of XDEFI tokens you wish to migrate. This should be specified with 18 decimal places. For example, to approve 1000 XDEFI tokens, pass
1000000000000000000000
(since XDEFI has 18 decimal places).
approve(0x7c2230a01df134a632afddcec962bf1e9eb659ff, 1000000000000000000000);
This transaction grants the migration contract permission to transfer 1000 XDEFI tokens from your safe.
When using your safe, ensure that this approval transaction is the first part of a batch that will include the migration call next.
Once the approval transaction is prepared, the next step is to call the migrate(...)
function to trigger the migration.
migrate(uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
- Migration Contract:
0x7c2230a01df134a632afddcec962bf1e9eb659ff
- amount: The same amount you approved (e.g.,
1000000000000000000000
). - deadline: A Unix timestamp in the future (e.g.,
1700000000
for a safe future time). - v, r, s: These are components of the EIP-2612 permit signature. Since you've already pre-approved the tokens using the
approve
function, you can use dummy values:- v:
0
- r:
0x0000000000000000000000000000000000000000000000000000000000000000
- s:
0x0000000000000000000000000000000000000000000000000000000000000000
- v:
migrate(1000000000000000000000, 1700000000, 0, 0x0000000000000000000000000000000000000000000000000000000000000000, 0x0000000000000000000000000000000000000000000000000000000000000000);
This transaction migrates 1000 XDEFI tokens from your safe to the migration contract, and the CTRL tokens are automatically sent back to your safe address.
Now that both the approval and migration transactions are prepared, batch them together in your safe. The approval transaction must happen first, followed by the migration transaction.
Once batched and signed by the necessary safe signers, submit the transaction.
Once the batched transaction has been confirmed:
- Check Etherscan: Verify the transactions on Etherscan by reviewing the approval and migration calls.
- Check Your CTRL Balance: After the migration transaction is complete, your safe should receive the corresponding amount of CTRL tokens.
If you run a simulation using a tool like Tenderly, you may encounter partial errors related to the signature components (v, r, s) during the migrate
function call. This is normal because you are using dummy values. The migration will still work correctly on-chain due to the earlier approval.
If you'd like an easier and more user-friendly method for migrating your tokens, you can use a personal hardware wallet or hot wallet to interact with the migration app.
To avoid the complexity of batching transactions, you can simply send your XDEFI tokens from your safe to a personal wallet (e.g., a hardware wallet like Ledger or a hot wallet like MetaMask).
- From your Safe, send your XDEFI tokens to your personal wallet.
- Ensure the wallet has enough ETH for gas fees during the migration process.
Once your XDEFI tokens are in your personal wallet:
- Go to the Migration App: Visit CTRL’s Migration App.
- Connect Your Wallet: Connect your hardware or hot wallet containing the XDEFI tokens.
- Migrate: Follow the on-screen instructions to migrate your XDEFI to CTRL. The migration app will guide you through the process, including any necessary approvals and migration steps.
After the migration is complete and your wallet has received the CTRL tokens, you can send them back to your safe:
- Send CTRL Tokens: Use your hardware or hot wallet to send the newly received CTRL tokens back to your safe address.
- Verify on Etherscan: Once the transaction is confirmed, you can verify that your safe now holds the CTRL tokens.
- Method 1 involves manually handling the migration process by creating a batched transaction from your safe, which includes the approval and migration steps. This method keeps everything within the safe environment.
- Method 2 is an easier, user-friendly alternative where you move your XDEFI tokens to a personal wallet, use the migration app, and then transfer the CTRL tokens back to your safe.
Both methods are valid, and you can choose the one that best suits your comfort level with handling multi-signature wallets and smart contract interactions.