0

I recently implemented a withdraw function from my smart contract to a Gnosis Safe address, and I ran into many problems because the Tx was failing due to out of gas.

After many research I finally found out why.

But even with this solution, it was still a challenge to get the funds out of my contract.

So my question is, what is the recommended way to implement withdraw to a Gnosis Safe address? Is there a way to bypass this problem or is it uncircumventable?

UPDATE 1

This was my "faulty" implementation:

  function withdraw() external onlyOwner {
    payable(vault).transfer(address(this).balance);
  }

UPDATE 2

Very good information here.

Thanks @mikheevm

3
  • You should have the payable keyword function withdraw() external payable onlyOwner Commented Apr 7, 2022 at 7:28
  • 2
    consensys.net/diligence/blog/2019/09/…
    – mikheevm
    Commented Apr 7, 2022 at 8:53
  • @mikheevm if you post an answer I'll accept it. Everything I needed to know is inside that article. Thanks !
    – eightyfive
    Commented Apr 8, 2022 at 11:03

0

Browse other questions tagged or ask your own question.