-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCarnetEntretien.sol
39 lines (27 loc) · 910 Bytes
/
CarnetEntretien.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
// SPDX-License-Identifier: GPL-3.
pragma solidity ^0.7.4;
contract CarnetEntretien {
Entretien[] listeEntretiens;
//address[] public listeEntretiens;
function creerEntretien(string memory _description) public {
Entretien nouveauEntretien = new Entretien(_description, address(this));
listeEntretiens.push(nouveauEntretien);
}
function voirLesEntretiens() public view returns(Entretien[] memory) {
return listeEntretiens;
}
}
contract Entretien {
string description;
address vehicule;
constructor (string memory _description, address _adressevehicule) {
description = _description;
vehicule = _adressevehicule;
}
function voirladesc() public view returns(string memory) {
return description;
}
function voirlevehicule() public view returns(address) {
return vehicule;
}
}