Avoiding Costly Mistakes: How SafeTransfer Ensures Accurate Token Transfers
Over the past few months, there have been several incidents where tokens have been sent to incorrect addresses. Notable examples include the Optimism Foundation accidentally sending 20 million $OP tokens to an undeployed Wintermute multisig and a Juno whale mistakenly transferring $36 million worth of Juno tokens due to a typo. Numerous similar cases can be discovered by examining token contracts on Etherscan, such as 411K USDT sent to the USDT contract by mistake.
The immutability of transactions on most blockchains makes this a significant issue.
In the majority of situations, there is no method to retrieve the misplaced tokens, leaving no solution for erroneously sent tokens. However, there is a way to prevent such mistakes.
What if, instead of transferring tokens directly, a specific amount is designated for the recipient to “claim” using their wallet? This approach allows for easy rectification of errors by merely revoking the approval.
There are two methods to achieve this: a manual process utilising a block explorer or and a free, open-source tool called SafeTransfer.
Introducing SafeTransfer
SafeTransfer serves as a free and open-source tool that accomplishes all the steps mentioned above on your behalf. This guide will illustrate how to use GnosisScan to securely transfer your tokens.
If you prefer a visual guide, a step-by-step video tutorial is available that explains the entire process:
Approving tokens to send
To begin, visit safetransfer.cash. Connect your wallet, choose the network, enter the recipient’s address, select the token, and designate the amount you wish to transfer.
Finally, click “Approve” and finalize the approval in your wallet. This process will generate a link that can be forwarded to your recipient. The resulting screen will resemble the screenshot below.
If you open the link yourself, you should also be able to cancel the approval.
Receiving the tokens
For the recipient to receive the tokens, forward the link generated by SafeTransfer. The recipient only needs to connect their wallet, click the “Receive” button, and complete the transaction within their wallet. The receive page should look similar to the screenshot below.
And just like that, it’s done — it’s truly as simple as that.
Using a blockchain explorer:
This guide will demonstrate how to safely transfer tokens using GnosisScan.
Approving Tokens for Sending:
To utilize the previously mentioned method for sending tokens, you must first approve the desired amount and designate a recipient.
1. Begin by visiting either CoinGecko or CoinMarketCap to locate the token you wish to transfer:
In our case we will use GnosisChain hence we’ll be copying the XDAI contract address.
2. Go to GnosisScan blockchain explorer.
Put the contract address of the token of your choice and access the contract. Navigate to the “Contract” tab, select “Write As Proxy”, and connect your wallet by clicking “Connect to Web3”. This action should bring up a page similar to the one shown in the screenshot below:
Upon successful connection, seek out the “approve” function and extend it. This action will reveal two fields: one for entering the spender’s address and another for defining the amount you intend to approve. Being used to multiplying each amount I wished to transfer by 10**18, I initially overlooked the fact that this process differs for the USDT contract because the USDT token only has 6 decimal points.
( note: In the amount field, multiply the amount you want to transfer by 10**6 with 6 being the decimal places of the USDT ERC-20 token that you’re transferring.
By default, ERC20 uses a value of 18 for decimals. Always check in the token page on your EVM blockchain explorer.)
As demonstrated in the following screenshot, I am approving 40 USDT to be spent by the address 0x9d….7A6D. Following this, simply click on “Write” and finalize the approval.
Receive the tokens
In order for the recipient to receive the tokens, share the token contract page with them.
The recipient will need to connect their wallet to GnosisScan and navigate to the “Write as Proxy” just as the sender did. However, in this instance, the recipient needs to locate the “transferFrom” function.
Upon filling in the necessary fields, the recipient should see a screen similar to the screenshot below.
The last step is to click on “Write” and complete the transaction in his Metamask. If there is any mistake, you can still revoke the approval using RevokeCash.
And there you have it! The recipient can now “claim” tokens directly from your wallet using this method. This approach eliminates the possibility of sending tokens to the wrong address. The most significant drawback, however, is the time-consuming nature of the process. It also necessitates familiarity with interacting with contracts on GnosisScan.
Using SafeTransfer follows a similar pattern, while simplifying this entire process.
Both methods work in a similar manner. We suggest you use the method that resonates with you the most and experience a safer way of transferring crypto like never before.
— —
About Gnosis Builders:
Gnosis Builders is a pioneering team focused on driving the adoption and development of the Gnosis ecosystem. With a mission to make blockchain technology more accessible and user-friendly, they actively contribute to the growth of decentralized applications, tools, and infrastructure.
About Gnosis Chain:
Gnosis Chain is an EVM compatible, community owned network that prioritizes credible neutrality and resiliency, open to everyone without privilege or prejudice. Gnosis Chain is secured by over 100k validators around the world.
— -
Other ways to get involved
Participate in our community: t.me/GnosisBuildersCommunity
Reach out for support & resources: gnosis.builders/contact-us
Use Gnosis Chain apps: gnosis.builders/users
Find the right wallet for you: gnosiswallets.com
Get free xDai: gnosisfaucet.com
Build on Gnosis Chain: gnosis.builders/developers
Become a validator: validategnosis.com
Monitor validators: gnosispools.info
Gnosis Chain Stats: gnosismetrics.com
Follow us on social media to be updated on our upcoming projects and progress:
Originally published at https://www.gnosis.builders.