Right now Sushiswap is acting up, and doesn't allow all interactions with their smart contracts. So for example you are not able to directly claim your staking rewards. There are some workarounds, but I wanted to use this opportunity to show you how to interact with a smart contract directly, even if a website is down. This is not only working for Sushi, but basically any smart contact. Step 1: Find the contract address and interaction inputsIn the best case you have interacted with a contract before and can look up your own transactions. Also browse down to "Input Data" and see what parameters are required. In this case we have just an pid value, which was always "2" in the past and the address. We also find out the method is called "harvest" with the MethodID "0x18fccc76". Last \"harvest\" interaction with MiniChefV2 Input Data viewed as \"Original\" (important for later) Step 2: Locate the method on the contractFirst view the contract address on the block explorer, click on "Contract" and on "Write Contract", you will see a list of the available methods. Make sure the method has the same ID as we looked up earlier. Step 3: Make your transactionThe harvest function doesn't require any transaction specific values, which makes it pretty easy to write to it. I just entered the value 0x2 and my address as shown here: Note that "0x" is just the prefix for a hexadecimal number and not actual values, it will also be missing from the raw hex data later. The input fields didn't accept the numbers exactly as displayed in the explorer earlier (with the dozens of zeros in front. If you don't feel comfortable changing these numbers, don't worry, there is one final step. Step 4: Double check the inputIn crypto we always double check we made everything correct, right? When I entered the hexadecimal notation I was also unsure if it was the correct way to input it or if I would fuck something up. Connect the wallet to the explorer website and hit "Write". A Metamask window pops up. Before confirming the transaction, click on the "Hex" tab and view the "Hex Data" Now we compare this with the Data Input from earlier and can confirm it's indeed exactly what we wanted. You can copy paste it into a text editor in two lines to easily compare it character by character. So confident that everything was right, we hit confirm and Small note: I also ramped up the gas limit a little because I knew the contract estimated it wrong before in the past. I don't know if this is neccersery right now. After my next refresh the transaction is confirmed and the rewards in my wallet. Congratulation, you claimed your Sushi rewards without needing their centralized website! ConclusionBlockchain is decentralized - even if websites go down, the contracts are still working and available - you just have to know how to use them. I know many people won't be comfortable doing something like that, but this being an option is already amazing enough. If SushiSwap ran away from one day to the other, anyone could make a website allowing interactions with their contracts again - convenient for everyone. This is not possible in the traditional financial word and one of the reasons I love blockchain so much. tl;drIf a DeFi website is down, you can still interact with most contracts via the block explorer directly:
[link] [comments] |
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments