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
payable
keywordfunction withdraw() external payable onlyOwner