-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTracks.sol
52 lines (42 loc) · 1.12 KB
/
Tracks.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 solidity ^0.4.4;
contract Tracks {
struct Strack{
uint trackId;
bytes32 trackName;
mapping (uint => Owner) ownersDetails;
}
struct Owner {
bytes32 name;
bytes32 mail;
bytes32 isni;
bytes32 percentage;
}
Owner thisOwner;
Strack[] public Stracks;
function saveTrackDetails(
uint _trackId,
bytes32 _trackName,
bytes32[] _ownersName,
bytes32[] _ownersMail,
bytes32[] _ownersIsni,
bytes32[] _ownersPercentage){
mapping (uint => Owner) ownersDetails;
for(uint i = 0; i < _ownersName.length; i++) {
Owner memory _ownersDetails;
_ownersDetails.name = "tees";
_ownersDetails.mail = "tees";
_ownersDetails.isni = "tees";
_ownersDetails.percentage = "tees";
ownersDetails[i] = _ownersDetails;
}
Stracks.push(Strack({
trackId: _trackId,
trackName: _trackName
}));
}
function getTrackDetails(uint _trackId) constant returns (uint trackId, bytes32 trackName){
Strack trackDetails = Stracks[_trackId];
trackName = trackDetails.trackName;
trackId = trackDetails.trackId;
}
}