I am wondering if anyone is aware of the structure that is used by centralized exchanges like Binance, Coinbase, KuCoin, etc. to handle their ETH/ERC20 Tokens deposits.
I started to handle this by providing the users an EOA address and having an EOA master account and transfer all the deposits to it.
But when I encountered to the lack of ETH for ERC20 transfer(from user's account to the master account) fee problem, I decided to implement a modified version of this contract address approach by providing each user a contract address rather than an EOA. I handled the auto transfer of ETH with zero fee to the master and the support for all the ERC20s issues that this article did not proposed.
But the problem of high fee for deploying smart contracts (after a lot of modifications, I had to pay 100 bucks for each deployment, which means creating a contract address for each user cost me $100) and still having to pay fee for ERC20 token transfer to the master account, which is not affordable economically, made me to explore more.
I am currently working on @mikko-ohtamaa's suggestion to use some alternative EVM compatible chains to lower the costs.
Now, the question is, when I see big centralized exchanges' structures at first glance, I see that they provide their users EOAs and not contract addresses (so they don't have to pay for the address creation) and I see that each deposit to the user's address will end up with a transfer to their master account, but am unable to track down the rest of the flow. I appreciate it if anyone share their knowledge on how they handle the aforementioned deposits issue or any suggestions to handle this side of transaction flows with the minimum possible charges.
Thanks in Advance, R.
- Geth version: 1.10.12-stable
- Geth's web3 api version: 0.20.1
- OS: Windows
- web3.py version: 5.25.0
- python version: 3.10.1
- I started my geth using the following command:
geth console --goerli --syncmode "light" --http --http.port 20000 --http.api personal,eth,net,web3 --allow-insecure-unlock