Skip to content

Instantly share code, notes, and snippets.

@ankitbrahmbhatt1997
Created February 21, 2019 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitbrahmbhatt1997/d6f4e2c34c63481c70d84cbd696f975f to your computer and use it in GitHub Desktop.
Save ankitbrahmbhatt1997/d6f4e2c34c63481c70d84cbd696f975f to your computer and use it in GitHub Desktop.
getting a refund
function getRefund() public {
// REQUIRED CONDITIONS FOR GETTING A REFUND
require(block.number > deadline);
require(raisedAmount < goal);
require(contributions[msg.sender] > 0);
msg.sender.transfer(contributions[msg.sender]);
contributions[msg.sender] = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment