Reducing the Transaction fee for ERC20 Token Transfers

Reducing the Transaction fee for ERC20 Token Transfers

A Next Generation Wallet for Your Social Life

A very secure social group wallet that offers transparency and trust within groups, built on blockchain. With this users can easily create accounts and track activities by their groups, managing money, time, items with commerce, and ticketing features.

Challenge:

A typical ERC20 transfer on the Ethereum mainnet takes $1. Making a transfer of a token whose value is in cents and paying $1 as transaction fess is not at all economical. Therefore, we needed to find a way to pay minimal transaction fees to provide value in our reward for community input, or let me put this way:

Total value of tokens transferred in a single transaction > Transaction Fee.

The Challenge

  • Implementation of wallet accounts based on hierarchy mapping and configuration choices
  • Adding events to contracts like expenses, given/received discounts, sponsorships (match% in $s, items, hours), coupons, points, revenue from other individuals/groups
  • One main challenge was to show the visual map of disbursements for all funds came from inside activity and left an activity wallet. Solved this problem using the D3.js library.
  • To create robust APIs to be integrated with any mobile app

Theory:

After going through the above problem statement and a series of discussions with the internal blockchain team at V2Soft and the client, we decided that an approach of Bulk Transfer would maintain the value of the reward.

Solution:

While creating a solution for one of our clients (OpenTherapoid), wherein we (V2Soft) were responsible for creating an ERC20 contract and enable token transfers from the contract to different user addresses.

The user was being rewarded with ScienceCoins for different activities that they perform on the OpenTherapoid platform.

First, what is Bulk Transfer?

Bulk Transfer is a mechanism or a function that has been coded in the smart contract which takes in an array of accounts (multiple accounts), along with an array of amounts (amount for each account), and an array of activities (activity for each account), which internally loops through these arrays and transfers the amount from the amounts array to the account from the accounts array and logs the activity from the activities array.

We were surprised by the reduction in the amount of gas that was consumed for each transfer.

We have analyzed the gas used by Single Transfer Vs BulkTransfer

 

Type Gas Price Tx Fee Rinkeby Tx URL
Single Transfer 0.000000002 0.000070802 Single Transfer
Bulk Transfer 0.000000002 0.000205656 Bulk Transfer

 

Points worth noting are as follows:

  1. Gas used by Single Transfer 35401
    1. In terms of dollar amounts, the Tx price for Single Transfer (as per our observation on Testnet) is $0.14, thus six individual transfers would have costed 0.14 * 6 = $0.84
    2. In terms of gas used by Single Transfer (as per our observation on Testnet) is 35401, thus six individual transfers would have used 35401 * 6 = 212406
  2. Gas used by Bulk Transfer 102828 (6 Token Transfers were done inside one transaction)
    1. In terms of dollar amount, the Tx price for BulkTransfer (as per our observation on Testnet) is $0.41
    2. In terms of gas used by Single Transfer (as per our observation on Testnet) is 102828
  3. Summary:
Type Tx Fee In $ Gas Used
Single Transfer 0.14 35401
Bulk Transfer 0.41 102828

 

It is evident that processing token transfers individually is not economical in the long run whereas processing token transfers using a bulk approach is economical and these are supported by the above findings.

Technologies we used

Request A Call Back.

If you would like to find out more about what V2Soft did during this case study, or more about our Blockchain technology, please provide us with your info and one of our team members will reach out to you.

Back
Copyright 2024 © V2Soft. All rights reserved

There was an error submitting your request !
Please contact support@v2hash.com

Thank you for your request,
we will get in touch with you soon