1

What I have currently -

  1. Master wallet : Contains ETH balance
    • Deploys ERC20 contracts to mint custom tokens.
  2. User wallets : NO ETH balance
    • owns tokens of the deployed contract.
  3. Contract : Custom deployed ERC20 contract to mint tokens

What I expect -

  • I would like the users to be able to transact the tokens amongst them
  • The transaction gas fee be deducted from the master/company wallet.
  • Transferring ether to the user wallets is not a viable option for us.
  • The token ownership must be verifiable on the blockchain.

Things I've looked into -

  • approve allows another wallet to transfer on behalf of it.
    • The user wallet would need some ETH balance to perform the approve transaction.
    • The user wallet would need to do this for each token type ?
  • HD wallets
    • There's no parent/child relationship and hence the child would have to pay the gas fee for transactions.

Blockchain concepts are still new to me. Any guidance or help is greatly appreciated.

Thanks in advance!

2 Answers 2

0

if you're willing to add some function to the extension from openzeppelin (ERC20.sol), this might work.

what I'm thinking is you can add let's say in ERC20.sol extension

function increaseAllowanceInit(address owner, address spender, uint256 addedValue) internal virtual returns(bool) 
{
    _approve(owner, spender, allowance(owner, spender) + addedValue);
    return true;
}

and call it in the constructor of your main ERC20 token contract.

If you're not willing to add some function, this will never work since there's an assigner of owner in approve function preventing it to happen

function approve(address spender, uint256 amount) public virtual override returns (bool) {
    address owner = _msgSender(); // this one you need to bypass
    _approve(owner, spender, amount);
    return true;
}
0

You can uses meta-transactions to achieve the result you wanted.

Meta-transactions enable us to perform gasless transaction.

One famous gasless transaction provider is biconomy.

You can check their docs to understand more.

You can also check openzeppelin docs for gasless transactions.

Tell me if it helps you!

Your Answer

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

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