From a wallet holding ANTv1, you can upgrade all of its ANTv1 balance into ANTv2 by sending this
to: 0x960b236A07cf122663c4303350609A66A7B288C0 (this is ANTv1's contract address)
When a wallet upgrades its ANT balance through an on-chain interaction with this contract, the following happens:
ANTv2Migratorpulls the requested amount of ANTv1 from the wallet's balance into its own balance
- 3.From its own balance,
ANTv2Migratorsends the equivalent amount of ANTv2 back to the wallet's balance
The simplest approach to completing the migration is by sending a single transaction, calling
approveAndCall()allows you to create an allowance to a contract and spend it in the same transaction.
To create such a call, you may pull out your favourite tool and use the following ABI:
For the arguments, use:
0x078BEbC744B819657e1927bF41aB8C74cBBF912D(this is the migration contract's address)
_amount: amount of ANTv1 to upgrade, denominated in wei (i.e. multiply by 1e18 for "decimal-correct" amounts)
_extraData: can be left blank (not used)
Next, take the encoded data:
In the above screenshot, I've specified to only upgrade one (1) ANTv1.
You may now take this data and use it in a transaction where the
0x960b236A07cf122663c4303350609A66A7B288C0(this is ANTv1's address).
For example, to use the above data, you would send a transaction with the following data:
If you prefer to not use an
approveAndCall()transaction, you can upgrade in two steps by first creating an allowance (through
ANTv1.approve()) for at least the amount desired to the migration contract at
0x078BEbC744B819657e1927bF41aB8C74cBBF912D, and then calling one of:
migrate(uint256): Allows you to directly specify how much you'd like to upgrade
migrateAll(): Assumes you want to upgrade all of your balance (and that you've set an appropriate allowance)
On the migration contract.
In some situations, you may prefer to complete the upgrade without ever creating a token approval and only using vanilla
Once this contract is deployed, simply transfer ANTv1 into the contract as desired and then call
migrate()to complete the upgrade.
Do you have a question? Leave your comments here at our Discourse forum 👇