-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdex-contracts-object-diagram.drawio
More file actions
205 lines (205 loc) · 29.8 KB
/
Copy pathdex-contracts-object-diagram.drawio
File metadata and controls
205 lines (205 loc) · 29.8 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<mxfile host="app.diagrams.net" agent="Codex">
<diagram id="dex-contracts-object-diagram" name="DEX Contracts">
<mxGraphModel dx="1737" dy="758" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="3400" pageHeight="4300" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="2" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="RootPN
- _privateNoteCode / _pmpCode / _nullifierCode
- _oracleCode / _oracleEventListCode / _orderBookCode
- _ownerPubkey
- _deployedValues[tokenType]" vertex="1">
<mxGeometry x="40" y="40" width="340" height="150" as="geometry" />
</mxCell>
<mxCell id="3" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="PrivateNote
- static _depositIdentifierHash
- _stakes[stakeHash] : StakeInfo
- _balance[tokenType]
- _busy : optional(address)
- _hasWithdrawn
- _lockedInOrders[tokenType]
- _pendingTransferAmount / _pendingTransferTokenType
- _pendingPlaceBuyLock / _pendingPlaceBuyTokenType
- _orderFeeReserves[orderBook][orderId]
- _orderLocks[orderBook][orderId]
- _pendingBatchActive / _pendingBatchBuyLock / _pendingBatchTokenType
- _pendingBatchStakeHash / _pendingBatchSells[]
- _pmpCode / _privateNoteCode / _orderBookCode
- _oracleCodeHash / _oracleCodeDepth
- _oracleEventListCodeHash / _oracleEventListCodeDepth" vertex="1">
<mxGeometry x="410" y="220" width="430" height="350" as="geometry" />
</mxCell>
<mxCell id="4" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="Nullifier
- static _nullifierHash
- ctor(address to)" vertex="1">
<mxGeometry x="40" y="260" width="290" height="90" as="geometry" />
</mxCell>
<mxCell id="5" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="RootOracle
- _privateNoteCode / _pmpCode
- _oracleCode / _oracleEventListCode
- _ownerPubkey" vertex="1">
<mxGeometry x="1100" y="40" width="340" height="130" as="geometry" />
</mxCell>
<mxCell id="6" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="Oracle
- static _name
- _oraclePubkey
- _oracleEventListCode
- _pmpSaltedCodeHash
- _pmpSaltedCodeDepth" vertex="1">
<mxGeometry x="1100" y="230" width="340" height="160" as="geometry" />
</mxCell>
<mxCell id="7" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="OracleEventList
- static _oracle
- static _index
- _oraclePubkey
- _events[eventId] : EventInfo
- _pmpSaltedCodeHash
- _pmpSaltedCodeDepth" vertex="1">
<mxGeometry x="1480" y="220" width="360" height="190" as="geometry" />
</mxCell>
<mxCell id="8" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="PMP
- static _eventId / _oracleListHash / _tokenType
- _deployer
- _privateNoteCode / _orderBookCode
- _typedOutcomePools[outcomeId][betType]
- _outcomeNames[outcomeId]
- _oracleEventsConfirmed[oracleEventList.value]
- _oracleEventsPubkeys[oraclePubkey]
- _oracleEventsAddress[trustAddr] = oraclePubkey
- _timingsOracleHash[oraclePubkey] / _resolveOracleHash[oraclePubkey]" vertex="1">
<mxGeometry x="950" y="540" width="470" height="250" as="geometry" />
</mxCell>
<mxCell id="9" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="OrderBook
- static _eventId / _oracleListHash / _tokenType
- _privateNoteCode
- _pmpAddress
- _resultStart / _shuttingDown
- _orders[orderId] : Order
- _clientOrderIds[depositHash][clientOrderId] -> orderId
- _levels[outcomeId][isBuy][epochId][price] : PriceLevel
- _ownerHead[depositHash], _ownerTail[depositHash]
- _queue[slot] : QueueEntry
- _queueHead / _queueTail / _nextQueueId / _shutdownCursor" vertex="1">
<mxGeometry x="950" y="960" width="470" height="290" as="geometry" />
</mxCell>
<mxCell id="10" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="StakeInfo
key: stakeHash = hash(eventId, oracleListHash, tokenType)
- amount[outcomeId]
- debtAmount[outcomeId]
- couponsAmount[outcomeId]
- candidateAmount
- candidateOutcome
- candidateBetType
- tokenType
- oracleListHash" vertex="1">
<mxGeometry x="410" y="580" width="410" height="220" as="geometry" />
</mxCell>
<mxCell id="11" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="EventInfo
key: eventId
- eventName
- oracleFee
- deadline
- describe
- outcomeNames[outcomeId]
- count
- trustAddr" vertex="1">
<mxGeometry x="1480" y="530" width="360" height="180" as="geometry" />
</mxCell>
<mxCell id="12" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="Order
key: orderId
- depositHash
- price
- amount / minAmount / initialAmount
- filledAccum
- clientOrderId
- epochId / outcomeId / flags / isBuy
- nextAtPrice / prevAtPrice
- nextInOwner / prevInOwner" vertex="1">
<mxGeometry x="410" y="960" width="410" height="230" as="geometry" />
</mxCell>
<mxCell id="13" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="PriceLevel
key: (outcomeId, isBuy, epochId, price)
- firstOrderId
- lastOrderId
- totalAmount" vertex="1">
<mxGeometry x="410" y="1250" width="340" height="120" as="geometry" />
</mxCell>
<mxCell id="14" parent="1" style="shape=note;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="DexLib
used by RootPN, RootOracle, PrivateNote, Oracle, OracleEventList, PMP, OrderBook
deterministic keys:
- PrivateNote <- (_depositIdentifierHash)
- PMP <- (_eventId, _oracleListHash, _tokenType)
- OrderBook <- (_eventId, _oracleListHash, _tokenType)
- Oracle <- (_name)
- OracleEventList <- (_oracle, _index)" vertex="1">
<mxGeometry x="760" y="40" width="300" height="190" as="geometry" />
</mxCell>
<mxCell id="15" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="QueueEntry
key: slot
- entryType / queueId / cancelled
- depositHash
- outcomeId / isBuy / flags
- price / amount / minAmount
- epochId / clientOrderId
- targetOrderId / filledAccum
- precheckDone / precheckAccum / precheckLastPrice" vertex="1">
<mxGeometry x="790" y="1250" width="370" height="220" as="geometry" />
</mxCell>
<mxCell id="16" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="PrivateNote (peer)
- same contract type
- remote sender / recipient
- static _depositIdentifierHash
- _balance[tokenType]" vertex="1">
<mxGeometry x="40" y="580" width="300" height="140" as="geometry" />
</mxCell>
<mxCell id="17" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="ReplayProtection mixin
- messages[expireAt][messageHash]
- lastMessage(messageHash, expireAt)" vertex="1">
<mxGeometry x="40" y="760" width="300" height="110" as="geometry" />
</mxCell>
<mxCell id="20" edge="1" parent="1" source="2" target="3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="deploy / register / withdraw
key: _depositIdentifierHash">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="21" edge="1" parent="1" source="2" target="4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="deploy by _nullifierHash">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="22" edge="1" parent="1" source="4" target="3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="ctor arg: to = noteAddress
noteAddress derived from _depositIdentifierHash">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="23" edge="1" parent="1" source="5" target="6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="deployOracle()
keys: Oracle._name, oraclePubkey">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="24" edge="1" parent="1" source="6" target="7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="new OracleEventList
keys: _oracle = address(this), _index">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="25" edge="1" parent="1" source="7" target="11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="_events[eventId]">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="26" edge="1" parent="1" source="3" target="8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="market relation
marketKey: (eventId, oracleListHash, tokenType)
sender note derived from _depositIdentifierHash">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="27" edge="1" parent="1" source="8" target="7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="confirm / cancel relation
ctor: oracleEventLists[]
keys: (eventId, oracleListHash, tokenType)
PMP stores _oracleEventsConfirmed[oracleEventList.value]">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="28" edge="1" parent="1" source="3" target="10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="_stakes[stakeHash]
stakeHash = hash(eventId, oracleListHash, tokenType)">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="29" edge="1" parent="1" source="8" target="9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="deploy when pools freeze
marketKey: (_eventId, _oracleListHash, _tokenType)
OrderBook ctor sender = _pmpAddress">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="30" edge="1" parent="1" source="3" target="9" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="order relation
marketKey: (eventId, oracleListHash, tokenType)
owner key: depositHash -> PrivateNote
fee lock keys: _orderFeeReserves[ob][orderId], _orderLocks[ob][orderId]
client key: _clientOrderIds[depositHash][clientOrderId]">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="31" edge="1" parent="1" source="9" target="12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="_orders[orderId]">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="32" edge="1" parent="1" source="9" target="13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="_levels[outcomeId][isBuy][epochId][price]">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="33" edge="1" parent="1" source="12" target="13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="bucket key: (outcomeId, isBuy, epochId, price)">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="34" edge="1" parent="1" source="3" target="16" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="transfer
keys: destDepositHash / senderDepositHash">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="35" edge="1" parent="1" source="9" target="15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="_queue[slot]">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="36" edge="1" parent="1" source="3" target="17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeColor=#666666;fontSize=11;labelBackgroundColor=#ffffff;" value="inherits
saveMsg uses messages[expireAt][messageHash]">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="40" parent="1" style="shape=note;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="Declared Event Types
all event declarations from contracts/" vertex="1">
<mxGeometry x="40" y="1520" width="280" height="70" as="geometry" />
</mxCell>
<mxCell id="41" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="RootPN events
- VoucherGenerated(skUCommit, voucherNominal, tokenType)
- PrivateNoteDeployed(depositIdentifierHash, noteAddress, initialBalance)
- NullifierDeployed(nullifierAddress, value)" vertex="1">
<mxGeometry x="40" y="1620" width="520" height="130" as="geometry" />
</mxCell>
<mxCell id="42" edge="1" parent="1" source="2" target="41" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#9673a6;fontSize=11;labelBackgroundColor=#ffffff;" value="declares">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="43" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="Nullifier events
- none declared" vertex="1">
<mxGeometry x="40" y="1770" width="280" height="70" as="geometry" />
</mxCell>
<mxCell id="44" edge="1" parent="1" source="4" target="43" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#9673a6;fontSize=11;labelBackgroundColor=#ffffff;" value="declares">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="45" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="PrivateNote events
- OwnerChanged(oldPubkey, newPubkey)
- StakeConfirmed(stakeController, outcome, amount, betType)
- StakeCancelled(stakeController, value)
- FullSetStakeConfirmed(stakeController, amount[])
- FullSetStakeCancelled(stakeController, value)
- ClaimAccepted(stakeController, outcome?, payout)
- PMPDeployed(eventId, tokenType, pmpAddress, oracleEventLists[], oracleFee[])
- OrderSubmitted(clientOrderId, outcomeId, isBuy, price, amount, flags, eventId, tokenType)
- OrderPlacedConfirmed(orderBook, orderId)
- OrderFilledConfirmed(orderBook, orderId, outcomeId, filledAmount, clearingPrice, isBuy, feeAmount, isFinal)
- OrderCancelledConfirmed(orderBook, orderId, outcomeId, isBuy, returnAmount)
- TransferInitiated(dest, tokenType, amount)
- TransferReceived(from, tokenType, amount)" vertex="1">
<mxGeometry x="590" y="1620" width="880" height="320" as="geometry" />
</mxCell>
<mxCell id="46" edge="1" parent="1" source="3" target="45" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#9673a6;fontSize=11;labelBackgroundColor=#ffffff;" value="declares">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="47" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="RootOracle events
- OracleDeployed(oracle, pubkey, name)" vertex="1">
<mxGeometry x="1500" y="1620" width="390" height="80" as="geometry" />
</mxCell>
<mxCell id="48" edge="1" parent="1" source="5" target="47" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#9673a6;fontSize=11;labelBackgroundColor=#ffffff;" value="declares">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="49" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="Oracle events
- OracleEventListDeployed(eventListAddress, index)
- EventPublished(eventId, eventName)" vertex="1">
<mxGeometry x="1910" y="1620" width="430" height="100" as="geometry" />
</mxCell>
<mxCell id="50" edge="1" parent="1" source="6" target="49" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#9673a6;fontSize=11;labelBackgroundColor=#ffffff;" value="declares">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="51" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="OracleEventList events
- EventAdded(eventId, eventName, oracleFee, deadline)
- EventConfirmed(eventId, pmpAddress)" vertex="1">
<mxGeometry x="2360" y="1620" width="470" height="100" as="geometry" />
</mxCell>
<mxCell id="52" edge="1" parent="1" source="7" target="51" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#9673a6;fontSize=11;labelBackgroundColor=#ffffff;" value="declares">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="53" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="PMP events
- StakeAccepted(note, outcomeId, amount, betType)
- ApprovedByOracle(oracleEventList, oraclePubkey)
- Resolved(outcomeId)
- ClaimProcessed(note, payout, win)
- NetworkFeeBurned(amount)
- TimingsSet(stakeStart, stakeEnd, resultStart, resultEnd)
- NumOutcomesSet(numOutcomes)
- EventCancelled()
- PMPRejected()
- CreatorFeeCollected(fee)
- PoolsFrozen(baseTotalPool)
- SplitProcessed(note, collateral)
- MergeProcessed(note, collateral)" vertex="1">
<mxGeometry x="1500" y="1770" width="660" height="280" as="geometry" />
</mxCell>
<mxCell id="54" edge="1" parent="1" source="8" target="53" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#9673a6;fontSize=11;labelBackgroundColor=#ffffff;" value="declares">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="55" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="OrderBook events
- OrderPlaced(orderId, outcomeId, isBuy, flags, price, amount, clientOrderId)
- OrderCancelled(orderId, clientOrderId)
- OrderFilled(orderId, filledAmount, clearingPrice, feeAmount, isTaker)
- PartialFill(orderId, clientOrderId, filledAmount, remainingAmount)
- FullyFilled(orderId, clientOrderId, filledAmount)
- Queued(slot, queueId, entryType)
- Rejected(entryType, depositHash)
- CallbackBounced(dest, lt)" vertex="1">
<mxGeometry x="2190" y="1770" width="640" height="240" as="geometry" />
</mxCell>
<mxCell id="56" edge="1" parent="1" source="9" target="55" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#9673a6;fontSize=11;labelBackgroundColor=#ffffff;" value="declares">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="60" parent="1" style="shape=note;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;align=left;spacingLeft=8;spacingTop=6;fontSize=12;" value="Emitted External Event Objects
only emit Event{dest: ...}(...) creates an event object with dst
Declared event types above do not have dst as a field" vertex="1">
<mxGeometry x="40" y="2120" width="420" height="100" as="geometry" />
</mxCell>
<mxCell id="61" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4e1f5;strokeColor=#6c8ebf;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="RootPN emitted external event objects
- VoucherGenerated(dst, skUCommit, voucherNominal, tokenType)
- PrivateNoteDeployed(dst, depositIdentifierHash, noteAddress, initialBalance)
- NullifierDeployed(dst, nullifierAddress, value)" vertex="1">
<mxGeometry x="40" y="2240" width="520" height="130" as="geometry" />
</mxCell>
<mxCell id="62" edge="1" parent="1" source="2" target="61" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;fontSize=11;labelBackgroundColor=#ffffff;" value="emits external">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="63" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4e1f5;strokeColor=#6c8ebf;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="PrivateNote emitted external event objects
- OwnerChanged(dst, oldPubkey, newPubkey)
- PMPDeployed(dst, eventId, tokenType, pmpAddress, oracleEventLists[], oracleFee[])
- StakeCancelled(dst, stakeController, value)
- FullSetStakeConfirmed(dst, stakeController, amount[])
- FullSetStakeCancelled(dst, stakeController, value)
- StakeConfirmed(dst, stakeController, outcome, amount, betType)
- ClaimAccepted(dst, stakeController, outcome?, payout)
- TransferInitiated(dst, dest, tokenType, amount)
- TransferReceived(dst, from, tokenType, amount)
- OrderSubmitted(dst, clientOrderId, outcomeId, isBuy, price, amount, flags, eventId, tokenType)
- OrderPlacedConfirmed(dst, orderBook, orderId)
- OrderCancelledConfirmed(dst, orderBook, orderId, outcomeId, isBuy, returnAmount)
- OrderFilledConfirmed(dst, orderBook, orderId, outcomeId, filledAmount, clearingPrice, isBuy, feeAmount, isFinal)" vertex="1">
<mxGeometry x="590" y="2240" width="900" height="350" as="geometry" />
</mxCell>
<mxCell id="64" edge="1" parent="1" source="3" target="63" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;fontSize=11;labelBackgroundColor=#ffffff;" value="emits external">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="65" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4e1f5;strokeColor=#6c8ebf;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="RootOracle emitted external event objects
- OracleDeployed(dst, oracle, pubkey, name)" vertex="1">
<mxGeometry x="1520" y="2240" width="410" height="80" as="geometry" />
</mxCell>
<mxCell id="66" edge="1" parent="1" source="5" target="65" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;fontSize=11;labelBackgroundColor=#ffffff;" value="emits external">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="67" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4e1f5;strokeColor=#6c8ebf;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="Oracle emitted external event objects
- OracleEventListDeployed(dst, eventListAddress, index)" vertex="1">
<mxGeometry x="1950" y="2240" width="420" height="80" as="geometry" />
</mxCell>
<mxCell id="68" edge="1" parent="1" source="6" target="67" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;fontSize=11;labelBackgroundColor=#ffffff;" value="emits external">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="69" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4e1f5;strokeColor=#6c8ebf;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="OracleEventList emitted external event objects
- EventAdded(dst, eventId, eventName, oracleFee, deadline)
- EventConfirmed(dst, eventId, pmpAddress)" vertex="1">
<mxGeometry x="2390" y="2240" width="470" height="100" as="geometry" />
</mxCell>
<mxCell id="70" edge="1" parent="1" source="7" target="69" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;fontSize=11;labelBackgroundColor=#ffffff;" value="emits external">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="71" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4e1f5;strokeColor=#6c8ebf;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="PMP emitted external event objects
- PMPRejected(dst)
- ApprovedByOracle(dst, oracleEventList, oraclePubkey)
- TimingsSet(dst, stakeStart, stakeEnd, resultStart, resultEnd)
- EventCancelled(dst)
- StakeAccepted(dst, note, outcomeId, amount, betType)
- PoolsFrozen(dst, baseTotalPool)
- SplitProcessed(dst, note, collateral)
- MergeProcessed(dst, note, collateral)
- CreatorFeeCollected(dst, fee)
- Resolved(dst, outcomeId)
- ClaimProcessed(dst, note, payout, win)" vertex="1">
<mxGeometry x="1520" y="2360" width="700" height="250" as="geometry" />
</mxCell>
<mxCell id="72" edge="1" parent="1" source="8" target="71" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;fontSize=11;labelBackgroundColor=#ffffff;" value="emits external">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="73" parent="1" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d4e1f5;strokeColor=#6c8ebf;align=left;spacingLeft=8;spacingTop=6;fontSize=11;" value="OrderBook emitted external event objects
- Rejected(dst, entryType, depositHash)
- Queued(dst, slot, queueId, entryType)
- OrderPlaced(dst, orderId, outcomeId, isBuy, flags, price, amount, clientOrderId)
- OrderCancelled(dst, orderId, clientOrderId)
- PartialFill(dst, orderId, clientOrderId, filledAmount, remainingAmount)
- FullyFilled(dst, orderId, clientOrderId, filledAmount)
- OrderFilled(dst, orderId, filledAmount, clearingPrice, feeAmount, isTaker)
- CallbackBounced(dst, dest, lt)" vertex="1">
<mxGeometry x="2250" y="2360" width="610" height="250" as="geometry" />
</mxCell>
<mxCell id="74" edge="1" parent="1" source="9" target="73" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;fontSize=11;labelBackgroundColor=#ffffff;" value="emits external">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>