0

Suppose I control wallet A. I would like to create a smart contract that withdraws funds from wallet A using its private key. Suppose further that the smart contract will be created by wallet B. Wallet B calls the contract function to withdraw these funds from my wallet A.

I need suggestions and clarification to develop this.

1 Answer 1

1

Im not a expert at all but to do this your private key would need to be in the smart contract and the smart contract is public on the blockchain so it is basically not going to work without leaking your wallet to the world.

The only other thing i can think of is implementing approval and transfer from functions just like in the ERC20 standard but i myself have not got an answer on how you can do that. If you can find out how to set a approval function up then from there it would be fairly simple

1
  • Thanks for your response. The contract is for personal use and will not be verified on block explorers. Also, I will use selfDestruct after its use. The contract is for carrying out trades and certain operations. Approve and transferFrom don't work for me, unfortunately. However, I verified that if wallet A sends a signature in metatransaction, it already solves my problem. Not exactly what I wanted, but it helps.
    – Gamer Noob
    Apr 14 at 2:09

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.