-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWeddingAPI.sol
52 lines (39 loc) · 1.71 KB
/
WeddingAPI.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
pragma experimental ABIEncoderV2;
pragma solidity >=0.4.0 <0.7.0;
contract Wedding{
enum ObjectionStatus {
None,
Pending,
Completed,
Rejected // We may need this someday!?
}
enum WeddingStatus {
Pending,
Completed,
Terminated,
PendingWithObjection
}
struct Guest{
string name;
string email;
uint256 couponCode;
uint256 ticket;
bool decision;
address etherumAddress;
}
function login(string memory guestname, int256 guestticket) view public returns (string memory);
function acceptTheWedding(string memory name) public;
function getWeddingInfo(string memory name) view public returns(string memory, string memory, //Name of the couple
string memory, string memory, // Location
string memory, string memory, // Date
string memory, uint, // Num of paticipant
string memory, string memory);
function getGuestList() view public returns(Guest[] memory);
function getGuestTicket(string memory name) view public returns (uint256);
function opposeTheWedding(string memory reason, string memory name) public;
function getObjectionStatus(string memory name) public view returns (string memory, string memory, uint256, uint256, uint8);
function getCurrentVote(string memory name) view public returns(int8, uint256);
function voteForObjection(string memory name, bool wannaStop) public;
function completeTheWedding() public;
function terminateTheWedding() public;
}