GP - Use Case and Functionalities
Gas Pump (GP) is a Smart Contract from Tatum that helps you manage Dust and Gas fees in a custodial application.
Introduction to Gas Pump Basics
1. The "Master Gas Pump Address"
- You select a blockchain address to work as your "Master Gas Pump Address". You must own the PrivateKey.
- The "Master GP Address" is the blockchain address that will own the precalculated "Slave GP Contract Addresses"
- The "Master GP Address" pays all the gas fees for operations made by "Slave GP Contract Addresses".
2. The "Slave GP Contract Address(es)"
- These are s "Smart Contract" based address(es)
- If just precalculated, the address can only be used to deposit assets.
- Transferring out requires activating the address - Thus paying for gas fees on-chain to activate each one individually.
Gas Pump is a Smart Contract Chain dependant. An activated "Slave GP Contract Address" in for example the ETH chain won't work to transfer out assets from another chain.
Address index:
- Each "Slave GP Contract Addresses" is associated with its own index.
- You can start with any number, but we recommend that you start from zero (0).
- If you precalculated three gas pump addresses with a range of index values from 3 to 5. The first address in the returned array is assigned the index value "3", the second one - "4", and the third one - "5".
- We strongly encourage users to track these addresses as well as their index.
[ "0x3cb76aed9c5e336ef961265c6079c14e9cd3d125", // index == 3 "0x2c6079c14e9cd3d2ea8cb76aed9c5e336ef96586", // index == 4 "0xf5e336ef9612614e9cd3d2ea8cb76aed95c6087c" // index == 5 ]
Precalculating limits:
- Up to 4,000 addresses for Harmony, in one call
- Up to 500 addresses for TRON, in one call
- Up to 5,000 addresses for the other supported blockchains, in one call
If you need more addresses than one API call can precalculate, make several API calls. For example, if you need 10,000 addresses on Ethereum, make an API call with an index range from 0 through 4,999 and then make another API call with an index range from 5,000 through 9,999.
Standard Custodial transfer
- You assign a standard blockchain address (EOA) to an End-user to act as a "Deposit address".
- End-user deposits on-chain assets (ERC-20 tokens) from outside your Exchange or Application to his "Deposit address".
- You have to calculate the fees to transfer out the assets from the "Deposit address".
- You send native assets from your "Master Exchange Address" to the "Deposit address" of the End-user.
- You send the End-user assets from the "Deposit address" to your "Master Exchange Address".
Observations
- Two transactions happened in this use case, where you had to pay gas fees for both.
- Dust is generated and lost in the deposit address of the End-user.
- If you have thousands or millions of addresses, this method creates an enormous amount of work and fees for you to pay.
Gas Pump Custodial transfer
- You select a blockchain address, you own the PrivateKey, to work as your "Master GP Address".
- This address will pay for all transfer fees from your "Slave GP Contract Addresses"
- You Precalculate a "Slave GP Contract Address".
- The address can be used to deposit assets only.
- To transfer out requires activating the address (Smart Contract).
- You assign said precalculated "Slave GP Contract Address" to an End-user to act as a "Deposit address"
- End-user deposits on-chain assets (ERC-20 tokens) from outside your Exchange or Application to his "Deposit address".
- You activate the "Slave GP Contract Address".
- You send the End-user assets to your Master Exchange Address
Observations
- You pay for the activation of the "Slave GP Contract Address".
- On-chain cost charged by the blockchain due to Smart Contract Activation.
- The transfer fees from the "Slave GP Contract Address" are paid by your "Master GP Address".
- You avoid Dust management.
- You may rotate and reassign an activated "Slave GP Contract Address", as needed, across your End-users.
Good to Know
- Gas Pump is only available on some EVM chains.
- You can review the smart contracts behind the Gas Pump implementation on our GitHub page:
- Smart contracts audited and certified by Certik:
- View the security assessment
- Tatum on the Certik website.
Updated 14 days ago