Created
February 21, 2019 18:19
-
-
Save ankitbrahmbhatt1997/59c0f0bd23f5b0a119fd95576247166f to your computer and use it in GitHub Desktop.
making a payment to the third party
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
function makePayment(uint index) public onlyAdmin goalReached{ | |
// Directly referencing the specific spending request inside the requests dynamic array | |
Request storage thisRequest = requests[index]; | |
// Checking the necessary conditions | |
require(thisRequest.completed == false); | |
require(thisRequest.numberOfVoters > totalContributors / 2);//more than 50% voted | |
// Performing the operations | |
thisRequest.recipient.transfer(thisRequest.value); | |
thisRequest.completed = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment