Last active
February 21, 2019 18:57
-
-
Save ankitbrahmbhatt1997/a1001d712fb60fc01e7932bc9300b965 to your computer and use it in GitHub Desktop.
spending request
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 createSpendingRequest(string _description, address _recipient, uint _value) public onlyAdmin goalReached{ | |
// INSTANTIATING A Request STRUCT IN THE MEMORY | |
Request memory newRequest = Request( | |
{ | |
description:_description, | |
value:_value, | |
recipient:_recipient, | |
numberOfVoters:0, | |
completed:false | |
} | |
); | |
// AN EXAMPLE OF A SPENDING REQUEST WOULD BE SOMETHING LIKE | |
// { | |
// description:"For Buying microchips for the product(A description would generally describe more than this :) )", | |
// value: 2000000000000000000 (2 ether converted to wei), | |
// recipient:0x12gfsk34j43....., | |
// numberOfVoters:0, | |
// completed:false | |
// } | |
// STORING THE SPENDING REQUEST STRUCT VARIABLE INTO THE requests DYNAMIC ARRAY | |
requests.push(newRequest); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment