-
Notifications
You must be signed in to change notification settings - Fork 0
/
design.drawio
206 lines (206 loc) · 18.9 KB
/
design.drawio
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
206
<mxfile host="app.diagrams.net" modified="2024-07-14T02:21:22.481Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:127.0) Gecko/20100101 Firefox/127.0" etag="-EGuGdCKTm2bv-yotYYG" version="24.6.5" type="device">
<diagram name="Page-1" id="t6AoFiBrVVnzdo2l2Gcy">
<mxGraphModel dx="1194" dy="556" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="7IAWQ3vHg3S8ieReHD5M-1" value="<div>Alice</div>" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="165" y="200" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-2" value="<font face="Courier New"><code>Settlement Contract A<br></code></font>" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="625" y="180" width="95" height="100" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-1" target="7IAWQ3vHg3S8ieReHD5M-2">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-22" value="<font face="Helvetica">Create Order A<br>(initiate)<br></font>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-5">
<mxGeometry x="-0.093" y="1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-9" value="<font face="Helvetica"><code>Settlement Contract</code> B</font>" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="625" y="440" width="95" height="100" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-10" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="805" y="360" as="sourcePoint" />
<mxPoint x="805" y="360" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.4;entryY=-0.03;entryDx=0;entryDy=0;entryPerimeter=0;exitX=0.4;exitY=1.04;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-2" target="7IAWQ3vHg3S8ieReHD5M-9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-13" value="Bob" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="165" y="460" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-14" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-13" target="7IAWQ3vHg3S8ieReHD5M-9">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-16" value="<font face="Helvetica">Create Order B<br>(initiate)</font>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-14">
<mxGeometry x="-0.0837" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.642;exitY=-0.03;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.642;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-9" target="7IAWQ3vHg3S8ieReHD5M-2">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-26" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="45" y="360" as="sourcePoint" />
<mxPoint x="805" y="360" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-28" value="Broadcast<br>Orders" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxGeometry x="642.5" y="340" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-29" value="<h1 style="margin-top: 0px;">Create Order<br></h1>Alice and Bob creates matchable orders at different chains. The settlement contract broadcasts the orders to the target chain." style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
<mxGeometry x="40" y="30" width="200" height="120" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-60" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-31" target="7IAWQ3vHg3S8ieReHD5M-58">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-61" value="Matched for <br>Order B" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-60">
<mxGeometry x="0.25" y="-3" relative="1" as="geometry">
<mxPoint x="-3" y="-7" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-31" value="<font face="Courier New"><code>Settlement Contract A</code></font>" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="185" y="920" width="95" height="100" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-32" value="<font face="Helvetica"><code>Settlement Contract</code> B</font>" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="599.5" y="920" width="95" height="100" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-37" value="<div>Tarik</div>" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="419" y="1140" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-38" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.3333333333333333;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-37" target="7IAWQ3vHg3S8ieReHD5M-31">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-39" value="Tells Order A<br>matches with Order B<br>(match)" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-38">
<mxGeometry x="-0.3051" y="4" relative="1" as="geometry">
<mxPoint x="17" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-57" value="<h1 style="margin-top: 0px;">Matching Orders<br></h1><p>Tarik sends match transaction to both settlement contract. The settlement contract validates the match and connects those two orders to each other for resolving.<br></p>" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
<mxGeometry x="40" y="630" width="260" height="120" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-58" value="Order A" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="60" y="770" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-62" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0;exitDx=0;exitDy=32.5;exitPerimeter=0;entryX=0;entryY=0;entryDx=0;entryDy=32.5;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="280" y="948.5" as="sourcePoint" />
<mxPoint x="599.5" y="948.5" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-63" value="Tells that Order A is matched with B<br>(broadcast match)" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-62">
<mxGeometry x="-0.1689" y="2" relative="1" as="geometry">
<mxPoint x="14" y="1" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-66" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0;exitDx=0;exitDy=67.5;exitPerimeter=0;entryX=1;entryY=0;entryDx=0;entryDy=67.5;entryPerimeter=0;" edge="1" parent="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="599.5" y="989.5" as="sourcePoint" />
<mxPoint x="280" y="989.5" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-67" value="Tells that Order B is matched with A<br>(broadcast match)" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-66">
<mxGeometry x="0.1922" relative="1" as="geometry">
<mxPoint x="18" y="3" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-68" value="Order B" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="694.5" y="766" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-69" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.55;entryY=0.95;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-32" target="7IAWQ3vHg3S8ieReHD5M-68">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-70" value="Matched for<br>Order A" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-69">
<mxGeometry x="0.3647" y="-2" relative="1" as="geometry">
<mxPoint x="1" y="8" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-80" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-71" target="7IAWQ3vHg3S8ieReHD5M-79">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-81" value="Transfers Order A<br>inputs to Bob" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-80">
<mxGeometry x="-0.1385" y="-1" relative="1" as="geometry">
<mxPoint x="1" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-71" value="<font face="Courier New"><code>Settlement Contract A</code></font>" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="225" y="1639" width="95" height="100" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-72" value="<div>Tarik</div>" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="400" y="1819" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-73" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-72" target="7IAWQ3vHg3S8ieReHD5M-71">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-74" value="Starts Trade<br>(resolve)" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-73">
<mxGeometry x="-0.3638" y="2" relative="1" as="geometry">
<mxPoint x="2" y="-30" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-92" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-76" target="7IAWQ3vHg3S8ieReHD5M-87">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-93" value="<div>Transfers Order B</div><div>inputs to Alice<br></div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-92">
<mxGeometry y="1" relative="1" as="geometry">
<mxPoint x="1" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-76" value="<font face="Courier New"><code>Settlement Contract B<br></code></font>" style="shape=cylinder3;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;size=15;" vertex="1" parent="1">
<mxGeometry x="529.5" y="1639" width="95" height="100" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-77" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0;exitDx=0;exitDy=32.5;exitPerimeter=0;entryX=0;entryY=0;entryDx=0;entryDy=32.5;entryPerimeter=0;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-71" target="7IAWQ3vHg3S8ieReHD5M-76">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-78" value="Tells that inputs<br>are transferred to Bob<br>(broadcast resolve)" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-77">
<mxGeometry x="-0.28" y="-3" relative="1" as="geometry">
<mxPoint x="18" y="1" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-79" value="Bob" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="257.5" y="1439" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-87" value="Alice" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="562" y="1439" width="30" height="60" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-94" value="<div>Resolve</div><div>Event</div>" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="20" y="1649" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-95" value="Emits" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.875;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-71">
<mxGeometry relative="1" as="geometry">
<mxPoint x="130" y="1689" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-96" value="Resolve Event" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="705" y="1649" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-98" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.067;entryY=0.5;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="1" source="7IAWQ3vHg3S8ieReHD5M-76" target="7IAWQ3vHg3S8ieReHD5M-96">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-99" value="Emits" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-98">
<mxGeometry x="-0.0626" relative="1" as="geometry">
<mxPoint x="1" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-100" value="<h1 style="margin-top: 0px;">Resolving Orders<br></h1><p>Tarik starts the transfers by sending resolve transaction to one of the settlement contracts.<br>The settlement contract transfers their side of input tokens then orders the other settlement contract to do the transfers as well. Each contract emits the resolve event and deletes orders after that.<br></p>" style="text;html=1;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
<mxGeometry x="41" y="1264" width="285" height="140" as="geometry" />
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-102" value="" style="endArrow=classic;startArrow=classic;html=1;rounded=0;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="200" y="810" as="sourcePoint" />
<mxPoint x="680" y="810" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="7IAWQ3vHg3S8ieReHD5M-104" value="Matched" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="7IAWQ3vHg3S8ieReHD5M-102">
<mxGeometry x="-0.0042" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>