-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfleet.pum
48 lines (41 loc) · 1.13 KB
/
fleet.pum
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
@startuml
Owned <|-- Mortal
Mortal <|-- SimpleSmartAsset
Mortal <|-- SimpleSmartAssetManager
SimpleSmartAsset *-- SimpleSmartAssetManager
class Beneficiary << struct >> {
uint weight
address address
}
hide Beneficiary circle
class Owned {
owner
modifier onlyOwner
}
class Mortal {
remove()
}
class SimpleSmartAsset {
uint usagePrice;
Beneficiary[] beneficiaries;
uint totalWeight; // to calculate percentage the beneficiaries receive
constructor(uint usagePrice, address[] addresses, uint weights)
addBeneficiary(address addr, uint weight)
uint constant getUsagePrice()
pay() payable
-- events --
event BeneficiaryPaid(address addr, uint amount)
event AssetCreated(uint usagePrice, address[] addresses, uint weights[]
}
class SimpleSmartAssetManager {
mapping(string => address) smartAssets;
createSmartAsset(string name, uint usagePrice, address[] addresses, uint[] weights)
useAsset(address assetAddress)
getUsagePrice(string assetName)
getUsagePrice(address assetAddress)
useAsset(string name) payable
removeAsset(string name)
-- events --
event AssetUsed(string name, uint usagePrice)
}
@enduml