Browsing the crypto Twitter/X, I found a service smolrefuel.com, (tweet), which solves the problem of obtaining a gas token on Ethereum networks if you don’t have one, for example when you withdraw a stablecoin from an exchange. I did a little research on how it works. A high-level overview: ERC-2612 The foundation of this is […]
After previous article about Uniswap’s SwapRouter bug that permits unspent ETH to be left in SwapRouter and then picked up by a MEV bot, I got replies on Twitter that there is also a possibility to left funds in SwapRouter when swapping ERC-20 tokens. To sweep ERC20 tokens that may have left in SwapRouter after […]
Inspired by the post of Jeiwan about Uniswap’s SwapRouter bug (or feature?), I became curious to calculate how much MEV bots have earned so far exploiting this behaviour. A short recap, the bug/feature is that some unfortunate user can construct such a call to SwapRouter so that some ETH will be left in the SwapRouter […]
Error I was getting a floating error “read tcp [::1]:60674->[::1]:8090: read: connection reset by peer” in my Go code when making a HTTP POST request to another service at localhost:8090 with pretty standard http.Post method: Fix turned out to be tricky and a simple one at the same time. Reproducing error Let’s try to reproduce […]
Here are the tools for Ethereum development I created: ABI Encoding and decoding online for Solidity smart contracts
This is the part 5 of Uniswap V3 SDK Swap Tutorial, full source code. In this part of the tutorial we will make actual swap having a route we obtained from Uniswap in previous part. Approving token for Uniswap to spend There is a important nuance we need to handle. While Uniswap (and more precisely, Uniswap […]
This is the part 4 of Uniswap V3 SDK Swap Tutorial, full source code. A crucial part of making a swap is creating a swap route. This is the optimal path with swap parameters which Uniswap constructs to make the desired swap. How to conduct token swap in Uniswap Swap is conducted in the following […]
This is the part 3 of Uniswap V3 SDK Swap Tutorial, full source code. In this part we’ll call Quoter interface with ethers.js to get quote for a swap. First we format inAmountStr according to decimals of this token. ethers.js has very handy functions for it. Always use the number of decimals after the decimal point you […]
This is the second part of Uniswap V3 SDK Swap Tutorial, full source code. In this part we’ll download and print out pool information. Pool is just a smart contract, responsible for swapping one token for another, for example, WETH-USDT pool (more about pools). Get Uniswap pool smart contract address To get pool smart contract […]
This is the first part of Uniswap V3 SDK Swap Tutorial, full source code In this part of tutorial we’ll create TypeScript application and connect to Ethereum-compatible blockchain to load token balances. For the sake of simplicity, we’ll omit “import” statements, parametrising the program by command line arguments and environment variables (you can find full […]