-
Notifications
You must be signed in to change notification settings - Fork 2
/
marriage.sol
66 lines (55 loc) · 1.66 KB
/
marriage.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Hudson Jameson (Souptacular) Created December 2015
contract owned
{
function owned()
{
owner = msg.sender;
}
modifier onlyowner()
{
if (msg.sender == owner)
_
}
address owner;
}
contract Marriage is owned
{
// Store marriage data
bytes32 public partner1;
bytes32 public partner2;
uint256 public marriageDate;
bytes32 public marriageStatus;
bytes public marriageProofDoc;
// Create initial marriage contract
function createMarriage(bytes32 partner1Entry, bytes32 partner2Entry, uint256 marriageDateEntry, bytes32 status, bytes description)
{
partner1 = partner1Entry;
partner2 = partner2Entry;
marriageDate = marriageDateEntry;
setStatus(marriageStatus);
bytes28 name = "Marriage Contract Creation";
MajorEvent(block.timestamp, marriageDate, name, description);
}
// Set the marriage status if it changes
function setStatus(bytes32 status)
{
marriageStatus = status;
}
// Upload documentation for proof of marrage like a marriage certificate
function marriageProof(bytes IPFSHash)
{
marriageProofDoc = IPFSHash;
}
// Log major life events
function majorEvent(bytes32 name, bytes description, uint256 eventTimeStamp)
{
MajorEvent(block.timestamp, eventTimeStamp, name, description);
}
// Withdraw my vacation fund
function returnFunds()
{
uint256 balance = address(this).balance;
address(owner).send(balance);
}
event MajorEvent(uint256 logTimeStamp, uint256 eventTimeStamp, bytes32 indexed name, bytes indexed description);
}