lunes, 12 de julio de 2021

TUTORIAL: How to avoid failed transactions with Ethereum when using Shiba Swap #SHIBARMY

By Victor Hernandez

This tutorial will show you how I avoided a failed Ethereum transaction using the MetaMask wallet.

I'm writing this tutorial because when ShibaSwap.com was released, many people who wanted to stake their Shiba Inu tokens, which are based on Ethereum, reported failed transactions even though they paid the highest gas fee possible. Unfortunately, failed transactions do not give the money back.

People who had failed transactions blamed it on ShibaSwap, when in reality the culprit was lack of experience using Ethereum and MetaMask for transactions.

But with this method I was able to minimize the risk of failed transcations.

WARNING: This is not financial advice. It is published simply for educational purposes. This tutorial cannot guarantee results on each individual case.

THE METHOD

How did I find out this method? Trial en error. I got 3 failed transactions the same day while trying to do a transaction on ShibaSwap and lost nearly $30 USD. I looked online for some tutorial about it but found nothing useful. So I decided to do some experimenting on my own to see if I could find a solution.

The solution is this: In order to minimize the risk of a failed transaction I increased the GAS LIMIT amount to 6 times what MetaMask was suggesting.

But let's start with some terminology so people who are new to Ethereum can understand it better.

ETHEREUM NETWORK: This is the network that handles all of the transactions of the Ethereum blockcahain.

TRANSACTION: When you send Ethereum or an Ethereum-based token (such as USDT, Shiba Inu, Bone, Leash, WETH, etc) from one address to another. This can happen when you swap tokens, when you buy something with Ethereum, or when you do anything with your tokens on ShibaSwap.

GAS: Gas is a fee all Ethereum transactions require to be processed. It's a "mining" fee, in other words. Gas fees can change a lot during the day. The gas fees are based on how complex the transaction is and how busy the Ethereum network is a the moment of the transaction. Gas fees are set by the network. Swaps like ShibaSwap can add transaction fees for using the Swap, but the actual gas fee is not set by ShibaSwap.

GWEI:  This is the fraction of Ethereum that is used as gas fees. The amount of GWEI is what determines the gas fee. This fee is set by the Ethereum network and it varies during the course of the day.

GAS LIMIT: This is how much GWEI you're willing to pay for gas. It's not how much you're actually going to pay, but how much you're willing to pay IF gas fees increase. If the gas limit is too low, and the gas fee increases during the transaction's confirmation, the transaction will fail. If the gas limit is sufficiently high, the transaction will be successful.

FAILED TRANSACTION:  A transaction that did not go through because the gas fee was either too low or it was changed by the network to a higher price during the confirmation process. Gas fees from failed transactions cannot be recovered. The Ethereum network does this as a way to punish people who want to spam the network with a bombardment of transactions using unsufficient gas fees. Failed transactions can occur even if you select the maximum suggested gas fee in MetaMask, as the fee can change without notice.

HOW TO AVOID FAILED TRANSACTIONS

Now let's talk about the actual procedure to avoid failed transactions. We will use MetaMask for this tutorial.

Let's say have $74 USD worth of Ethereum in your MetaMask wallet and you want to buy 2 Bone tokens at ShibaSwap.com using the SWAP function. You click on SWAP and then on CONFIRM SWAP. This will trigger your MetaMask wallet. MetaMask will show a screen similar to this one displaying the gas fee, the GWEI and the gas limit. We're indicating the gas limit field with red and an arrow.


What I did to avoid a failed transaction was to change the gas limit to 6 times what MetaMask was suggesting. In this case I would change the first 1 to a 6 or a 7.

By doing that, the "total" amount will say $45 USD instead of $15.

Setting up the gas limit to a higher number means that if the gas fee increases during the confirmation period, MetaMask will take the new amount from the wallet instead of the original quoted gas fee. It will NOT take the full $45 USD. Just the amount that's needed. Let's say the new gas fee is $12 USD. Only $12 will be spent. Not $45.

CAVEAT: The gas limit can only be increased to the maximum amount of Ethereum available in the wallet. Thus, if there are only $25 USD in the wallet, the most you can increase the gas limit is to $25. If a higher number is entered, the wallet won't allow the transaction. As a result, it is always a good idea to have more Ethereum in the wallet as a safety measure.

WHY TIMES SIX?

There is no real reason to multiply the gas limit by 6. I did it because the end result was about as big as the most expensive gas fee I've ever seen, which is about $25 USD.

This means the gas limit can be increased by any number. But the risk of a failed transaction diminishes if the gas limit makes the gas fee about $25 or more. Anything less than $25 can increase the risk of a failed transaction.

Again, increasing the gas limit does NOT mean the wallet will spend the full gas limit amount. It means that IF the transaction's gas fee increases, the transaction has a buffer of Ethereum to pay for the increase. But only the new gas fee will be spent, not the full gas limit.

FOUND THIS TUTORIAL USEFUL? Send us som Shiba Inu. Or Bone. Or Leash. or Ethereum. Here's our address:

0x7E28423dAC5C36E50757Eb8Fa6c00198DE80D22B

0x7E28423dAC5C36E50757Eb8Fa6c00198DE80D22B 0x7E28423dAC5C36E50757Eb8Fa6c00198DE80D22B

0x7E28423dAC5C36E50757Eb8Fa6c00198DE80D22B



No hay comentarios.:

Publicar un comentario