I'm developing ETH and ERC20 tokens deposit service. for every user I need unique wallet address,

  1. Can I develop a smart contract to generate unique wallet address for every user?
  2. Can I transfer deposited ERC20 tokens from user wallets to another wallet and pay fee for transactions with smart contract main account?

1 Answer 1

  1. Yes, you can generate one Wallet contract per every EOA of your user, and this contract may act on behalf of the user, being the user who controls it with its signature. To see an example, check Augur's Wallet contracts here: https://github.com/AugurProject/augur/blob/0a12a20a3ab0f4a822ec2c5070136e3e4a8180c4/packages/augur-core/src/contracts/AugurWalletRegistry.sol#L180

  2. You can't pay transaction fees with ERC20 tokens, unless you swap them for ETH on Uniswap just before executing the corresponding function but that must be before the User calls the contract, which is not the case we are talking about. The user (EOA owner) is the one who pays the transaction fee. You can restore the amount of fees spent back to the User from the contract though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.