-
Notifications
You must be signed in to change notification settings - Fork 2
/
dual-integrator.sol
55 lines (46 loc) · 1.94 KB
/
dual-integrator.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
contract DualIntegrator {
uint months;
address partyAAddress;
address partyBAddress;
string contractHash;
string partyAName;
string partyBName;
function DualIntegrator(uint _months, address _partyAAddress, address _partyBAddress, string _partyAName, string _partyBName) {
partyAAddress = _partyAAddress;
partyBAddress = _partyBAddress;
partyAName = _partyAName;
partyBName = _partyBName;
months = _months;
}
function setHash(string _hash) {
contractHash = _hash; // we do not include permission checking here, but in a real application you would restrict this
}
function getParams() constant returns (uint _months, address _partyAAddress, address _partyBAddress) {
return (months, partyAAddress, partyBAddress);
}
function getNames() constant returns (string _hash) {
//, string _partyAName, string _partyBName) {
return (contractHash); //, partyAName, partyBName);
}
}
contract IntegratorFactory {
address[] addresses;
function createInstrument(uint _months, address _partyAAddress, address _partyBAddress, string _partyAName, string _partyBName) returns (address IntegratorAddr) {
address mostRecentIntegrationContract;
mostRecentIntegrationContract = new DualIntegrator(_months, _partyAAddress, _partyBAddress, _partyAName, _partyBName);
// NOTE: we do not set the hash in the contract on instantiation because the address of the code
// needs to be added to the prose document before it is signed with Docusign API and finalized
// with the hash of the document.
// return the contract address for consumption
addAddress(mostRecentIntegrationContract);
return mostRecentIntegrationContract;
}
function addAddress(address newAddress) {
addresses.push(newAddress);
}
function getAddresses() constant returns (address[] _addresses) {
return addresses;
}
}
Contact GitHub API Training Shop Blog About
© 2016 GitHub, Inc. Terms Privacy Security Status Help