The one wallet to rule them all. Pay for gas using any token from any wallet, across all chains.
As web3 users navigate the diverse ecosystems across many chains, they will inevitably accumulate an abundance of disparate wallets, with many different tokens.
The goal of building Gastly is to unify all these wallets & tokens in a task that is ubiquitous across every chain: paying for gas.
Gastly is the glue that enables any of your wallets pay for a transaction, using any token, regardless of the chain.
The frontend demo app is a next.js app with ethersjs. The backend uses nodejs and Safe SDK to relay signed transactions to smart contract wallets. The contracts are written in Solidity. The architecture of the contracts are described below.
This project uses 5 core components: Liquidity pools, Wormhole, Safe accounts, 1Balance relayers, xERC20 LP tokens.
These pools exist as a hub-and-spoke model, which consists of a single Root Pool (deployed on Goerli), and multiple cross-chain Branch Pools (deployed on Polygon, Scroll, and others). The idea is that the Root Pool will contain the target gas token (we use gEth on goerli). This is supplied by liquidity providers (LPs) in exchange for fees (currently 0% for this project, but should scale according to utilization).
Wormhole is used as a message relayer to send the credit amount from the Branch pool to the Root Pool. Gastly decided to use messaging instead of a token bridge to save gas i.e., if a user needs to bridge tokens every time, they would incur massive gas overhead costs.
Accounts are used as a smart contract wallet to initiate transactions. For this project, it is a 1/1 Safe account. The Safe account uses 1Balance as the "paymaster".
The relayers that are sponsors of the Safe account's transactions. 1Balance accepts a specific token to meter gas use. For example, deposits are made in gEth on goerli testnet. In production, deposits are made in USDC on Polygon. Deposits are made on behalf of a single EOA account. In this case, it is the owner of the 1/1 Safe.
Since it is expected that Pools can get unbalanced, LPs can bridge their tokens to rebalance the pools. They can be incentivized to do so by getting a rebalancing bonus/fee. Gastly takes advantage of xERC20 implementation with xCall on Connext
When a user wants to pay with tokens on another chain, gastly will: