0

I have created ETH HD wallet and want to send all coins received on those HD wallet address to an admit ETH wallet , this is easy but problem stands as I want to send the ether without any gas fees. I was said it could be achieved , but after multiple google I was clueless on how I could achieve it ,I landed here for help !

| improve this question | | | | |
  • 1
    Transferring ether costs 21000 gas units per transaction. No way around it. – goodvibration Feb 10 at 12:06
  • the sender has to pay the extra amount for the gas fee for transferring to Admin wallet. But I don't know how could we do that ? and if it can be done in contract , is the contract written for individual wallet address or how such address is generated ? heres' alot of question ,but to answer you It can be achieved by making the sender pay the gas instead we pay for it. – ishab acharya Feb 10 at 12:09
  • Your bunch of questions here is totally unclear, let alone the fact that you are not describing your system in a sensible manner. Please spend some time to formulate a plain and clear description of what components your system consists of, how they interact with each other and what is the overall purpose. – goodvibration Feb 10 at 12:30
1

Address of your HD wallet is most probably so called “Externally Owned Address” (EOA), so it does not have any byte code associated and thus all the ether sent to it just settle on its balance without triggering any logic.

However, you may create another address, that will automatically forward incoming ether transfers to admin wallet, and this address will be under control of your HD wallet, so the owner of HD wallet will be able to set what address incoming ether transfers are forwarded to.

In order to create such address you need to deploy smart contract looking like this:

pragma solidity ^0.6.0;

contract Forwarder {
  address private owner;
  address payable private destination;

  constructor () public {
    owner = msg.sender;
    destination = msg.sender;
  }

  fallback () external payable {
    require (destination.send (address (this).balance));
  }

  function setDestination (address payable _destination) public {
    require (msg.sender == owner);
    destination = _destination;
  }
}
| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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