Skip to content

Instantly share code, notes, and snippets.

@bartubozkurt
Created February 2, 2023 11:46
Show Gist options
  • Save bartubozkurt/96feff94bc024fbe463646e88b3b22b8 to your computer and use it in GitHub Desktop.
Save bartubozkurt/96feff94bc024fbe463646e88b3b22b8 to your computer and use it in GitHub Desktop.
/* Bad */
contract BadVault{
function receive() payable public{
}
}
/* Better */
contract GoodVault{
// add withdraw function.
function withdraw() public onlyOwner {
owner.transfer(this.balance)
}
function receive() payable public{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment