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:
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.
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.