Skip to content

viaprotocol/gasless-transfer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EVM Gasless Transfers

This repository contains sample code for execution of "gasless" ERC-20 transfers. It makes use of Flashbots, sending bundles of two consecutive transactions: deposit transaction from special gas tank account to user account, and second transaction with actual ERC-20 transfer. Flashbots will ensure that both transaction are executed at the same time.

How to use

  1. Make sure that you have Node.js and Yarn installed.

  2. Install dependencies by running:

yarn
  1. Copy example.env and rename it to .env. Then fill variables with actual values:

ALCHEMY_API_KEY - your Alchemy.com API key GAS_TANK_PRIVATE_KEY - private key of gas tank account (should have ETH on balance) USER_PRIVATE_KEY - private key of user account TOKEN_ADDRESS - address of the ERC-20 token being transferred RECIPIENT - address of the transfer recipient TRANSFER_AMOUNT - amount of transfer in full units BASE_GAS_PRICE - current gas price in gwei

  1. Execute transfer by running:
npm run start
  1. Wait for a minute, then check user's account Etherscan page for transactions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published