forked from gahu/infocryptology
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontract.sol
More file actions
48 lines (41 loc) · 1.74 KB
/
contract.sol
File metadata and controls
48 lines (41 loc) · 1.74 KB
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
pragma solidity ^0.4.24;
contract HouseContract{
address Creator;
struct Content{
string LessorName;
string HirerName;
string BrokerName;
string Address;
string ContractDate;
string ExpireDate;
string payment;
}
uint256 ContractNumber = 1;
mapping(uint256 => Content) Contracts;
function addContract(string _lessor, string _hirer, string _broker, string _address,
string _ContractDate, string _ExpireDate, string _payment)
public {
Contracts[ContractNumber].LessorName = _lessor;
Contracts[ContractNumber].HirerName = _hirer;
Contracts[ContractNumber].BrokerName = _broker;
Contracts[ContractNumber].Address = _address;
Contracts[ContractNumber].ContractDate = _ContractDate;
Contracts[ContractNumber].ExpireDate = _ExpireDate;
Contracts[ContractNumber].payment = _payment;
ContractNumber++;
}
function getContracts(uint256 _ContractNumber) public view
returns(string, string, string, string, string, string, string){
return(
Contracts[_ContractNumber].LessorName,
Contracts[_ContractNumber].HirerName,
Contracts[_ContractNumber].BrokerName,
Contracts[_ContractNumber].Address,
Contracts[_ContractNumber].ContractDate,
Contracts[_ContractNumber].ExpireDate,
Contracts[_ContractNumber].payment);
}
function getContractNumber() public view returns (uint){
return ContractNumber;
}
}