WINGS:XFI Swap Instructions

WINGS:XFI Swap Instructions

Important: US persons/citizens are not allowed to participate in the swap.

Relevant Contracts:

Please note that all transactions before 07/Sept/2020, 14:00 UTC will be rejected.

Using the access-portal

To swap WINGS to XFI using the access-portal, you will need to use Metamask. Make sure you also have sufficient ETH in the wallet for gas costs.

If your WINGS are on a wings.ai wallet, you need to first import that wallet into Metamask using your private key. If needed, you can find instructions on how to extract the private key here. NEVER share your private keys with anyone!

By swapping your WINGS to XFI you will lose access to your WINGS forever.

1. The access-portal is available at swap.dfinance.co. Please make sure you verify that you are using the correct web address! Never use unofficial links!

2. Fully read and understand the swap terms. If you agree to the terms and if you are not a US person, tick the checkboxes and click continue.

3. Connect Metamask by clicking the "Metamask" button. (You may need to enter your Metamask password [in Metamask!] to unlock your wallet).

4. Select the address you have your WINGS tokens on and click "Next"

5. Allow swap.dfinance.co to VIEW the addresses and click "Connect"

6. Approve "WINGS" - In the "Swap" tab, click "MAX" on the right side and make sure the "From" input field has the total number of WINGS you wish to swap - then click "Approve WINGS" - this will initiate a PERMISSION transaction (no swap yet)

Note: If you have your WINGS spread over a number of addresses, you will need to "Approve WINGS" for every address.

7. Submit the permission transaction - Metamask will now popup and ask you to confirm the transaction. By default, the permission is set to "Unlimited". If you wish to limit how much to swap, you can do so under "Edit Permission" > "Custom Spend Limit".

You can set the gas price based on Metamask recommendation or use ethgasstation.info or etherscan.io/gastracker for gas price recommendation. For faster processing, in the Metamask popup, to the right of "Transaction Fee" you can select "Edit" then select the "Fast" option. Note, however, that this will increase the gas price and thus make the transaction a bit more expensive. Once done with the gas, click "Confirm".

If you use a hardware wallet, make sure it is connected and unlocked so you may sign the transaction (with the hardware wallet) so Metamask can submit the transaction to the network.

8. Wait for the permission transaction to be confirmed by the network.

9. Once the permission transaction has been confirmed, under the "Swap" tab, enter the amount of WINGS you wish to swap. If you wish to swap all, you can use the "MAX" button on the right. Now click the "Swap Tokens" button and approve the Metamask transaction (remember to set gas price preferences).

10. Once the swap transaction has been approved, you are done. The swap has been initiated. Welcome to Dfinance


Interacting with the swap contract directly

By using the swap smart contract you agree to the swap terms.


Below you will find the WINGS and SWAP contracts ABIs, which will be needed for interacting with the smart contracts directly. Note that both XFI and WINGS contracts support the standard ERC20 ABI interface.

WINGS ERC20 ABI:

[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}]
WINGS ABI

SWAP CONTRACT ABI:

[{"inputs":[],"name":"wingsToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":"true"},{"inputs":[],"name":"xfiToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function","constant":"true"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"estimateSwapWINGSForXFI","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function","constant":"true"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"name":"swapWINGSForXFI","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function","constant":false}]
SWAP CONTRACT ABI

Using MyCrypto

1. Approve WINGS tokens

First, you will need to approve the swap contract to spend your WINGS tokens. This is required because the swap contract will need to transfer WINGS.

Go MyCrypto. Double-check that you are using the correct web address or use the local version. Then go to Tools → Interact With Contracts (link).

Enter the following data into their respective fields:

  • From the Select Existing Contract dropdown, select CUSTOM
  • In the Contract Address field, use the WINGS contract address: 0x667088b212ce3d06a1b553a7221E1fD19000d9aF
  • In the ABI / JSON Interface, copy & paste the WINGS ERC20 ABI (above). It is important to make sure you don't have any unwanted space (usually at the end)

Click the "Access" button. From the "Read / Write Contract" dropdown list, choose the "approve" function.

Enter the following data into their respective fields:

  • _spender address = 0xd8339fc272B9956f48bD0465856481B128Dbf171
  • _value uint256 = the amount of WINGS you want to swap, in WEI. For example, if you want to swap 1000 WINGS, you will need to enter 1000000000000000000000 (1 WINGS is 1000000000000000000 wei). You can also use this converter.

At the bottom, access your wallet.

Keep the "Value" input empty or zero.  Disable "Automatically Calculate Gas Limit" and configure the gas settings:

  • Gas price (gwei) - use the optimal gas settings for you or use Gas tracker for a recommendation.
  • Gas limit - 60000 gas units should be sufficient.

Send the transaction and wait for confirmation before continuing.

2. SWAP

Go MyCrypto. Double-check that you are using the correct web address or use the local version. Then go to Tools → Interact With Contracts (link).

Enter the following data into their respective fields:

From the Select Existing Contract dropdown, select CUSTOM

  • In the Contract Address field, enter the swap contract address: 0xd8339fc272B9956f48bD0465856481B128Dbf171
  • ABI / JSON Interface =  In the ABI / JSON Interface, copy & paste the SWAP ERC20 ABI (above). It is important to make sure you don't have any unwanted space (usually at the end).

Click on "Access" button and choose the "swapWingsForXFI" function in from "Read / Write Contract" dropdown list.

In the amountIn uint256 field, enter the amount WINGS you want to swap (IN WEI). This is the same amount as approved in the previous transaction (e.g 1000000000000000000000  for 1000 WINGS).

At the bottom, access your wallet.

Keep the "Value" input empty or zero.  Disable "Automatically Calculate Gas Limit" and configure the gas settings:

  • Gas price (gwei) - use the optimal gas for you or use Gas tracker for a recommendation.
  • Gas limit - 120000 gas units should be sufficient.

Send the transaction and wait for confirmation. Once the transaction is approved the smart contract will start allocating XFI to your address. You have now completed the swap, welcome to Dfinance.

Using MyEtherWallet

1. Approve WINGS tokens

First, you will need to approve the swap contract to spend your WINGS tokens. This is required because the swap contract will need to transfer WINGS.

Go MyEtherWallet. Make sure you double-check you are using the correct web address. Unlock your wallet, then on the left side, select Contract → Interact with Contract (link).

Enter the following data into their respective fields:

  • In the Contract Address field, use the WINGS contract address: 0x667088b212ce3d06a1b553a7221E1fD19000d9aF
  • In the ABI/JSON Interface, copy & paste the WINGS ERC20 ABI (above).

It is important to make sure you don't have any unwanted spaces (usually at the end of the ABI or the contract address)

Click "Continue". From the "Select an item" dropdown list, choose the "approve" function.

Enter the following data into their respective fields:

  • _spender address = 0xd8339fc272B9956f48bD0465856481B128Dbf171
  • _value (uint256) = the amount of WINGS you want to swap, in WEI. For example, if you want to swap 1000 WINGS, you will need to enter 1000000000000000000000 (1 WINGS is 1000000000000000000 wei). You can also use this converter.

"Value in ETH" - keep "0" or empty.

Click the "Write" button. If needed, configure your gas price preference. You can use Gas tracker for a recommendation. The gas limit required is 60000 units.

Send the transaction and wait for it to be confirmed.

2. Swap

Go MyEtherWallet. Make sure you double-check you are using the correct web address. Unlock your wallet, then on the left side, select Contract → Interact with Contract (link).

Enter the following data into their respective fields:

  • In the Contract Address field, use the SWAP contract address: 0xd8339fc272B9956f48bD0465856481B128Dbf171
  • In the ABI/JSON Interface, copy & paste the SWAP ERC20 ABI (above).

It is important to make sure you don't have any unwanted spaces (usually at the end of the ABI or the contract address)

Click "Continue". From the "Select an item" dropdown list, choose the "swapWingsForXFI" function.

Enter the following data into their respective fields:

  • AmountIn (uint256) - enter the amount WINGS you want to swap (IN WEI). This is the same amount as approved in the previous transaction (e.g 1000000000000000000000  for 1000 WINGS).

"Value in ETH" - keep "0" or empty.

Click the "Write" button. If needed, configure your gas price preference. You can use Gas tracker for a recommendation. The gas limit required is 120000 units.

Send the transaction and wait for confirmation. Once the transaction is approved the smart contract will start allocating XFI to your address. You have now completed the swap, welcome to Dfinance.

Contact us:Gubbelstasse 11, 6300 Zug, Switzerland

Please, fill all fields Success

Thank you for contacting

We will contact you