Last active
February 22, 2023 09:53
-
-
Save developeruche/8e4e10132b65825f2ed447729ffa7079 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
contract Campaign { | |
struct Request { | |
string description; | |
uint256 value; | |
address recipient; | |
bool complete; | |
uint256 approvalCount; | |
mapping(address => bool) approvals; | |
} | |
uint256 numRequests; | |
mapping (address => Request[]) requests; | |
function createRequest(string memory description, uint value, address recipient, uint256 _index) public { | |
Request[] storage r = requests[msg.sender]; | |
r[_index].description = description; | |
r[_index].value = value; | |
r[_index].recipient = recipient; | |
r[_index].complete = false; | |
r[_index].approvalCount = 0; | |
r[_index].approvals[msg.sender] = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment