Loading player…

GasSwap: Paying ETH to Smart Contracts without Passing ETH by Sorawit Suriyakarn (Devcon5)

DevconYouTube

Fri, Oct 2, 2020, 12:00 AM

One of the hassles when it comes to developing smart contracts and try to make them interoperable is how to pass ETH around. If one contract in a dependency requires a payment in ETH, every contract in the call-chain between the payer (either the transaction originator or a smart contract) and the receiver must pass along the ETH. This makes developer experience and contract interface design unnecessarily hard. At Band Protocol, we plan to release GasSwap, an on-chain simple library that allows a contract to directly get ETH from transaction sender via Gas. By combining [Uniswap](https://uniswap.io), a decentralized on-chain liquidity pool, and [GasToken](https://gastoken.io), a trustless Gas-ETH token conversion system, a contract can mint Gas token, at the cost of tx originator and use Uniswap to trade for ETH, simplifying the process. With GasSwap there are three benefits: 1. No need to decorate `payable` everywhere. Contracts can just mint ETH with GasSwap. It can also work with other tokens too. 2. User does not necessarily feel like they are paying for anything; it's just a seamless, more expensive gas cost experience. 3. ETH gas price will be more stable as there will be a liquid place to hedge/bet against gas price movement. While it's true that Ethereum community is trying to move away from the current storage model, making GasToken's life harder. We believe GasSwap is a breakthrough in smart contract design that's worth exploring.