Created
February 2, 2023 11:46
-
-
Save bartubozkurt/96feff94bc024fbe463646e88b3b22b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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