-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
422 lines (398 loc) · 19.1 KB
/
Copy pathdemo.html
File metadata and controls
422 lines (398 loc) · 19.1 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ethereum ↔ Osmosis Cross-Chain Bridge — Live Demo</title>
<meta name="description" content="Live proof-of-concept demo of a lock-and-mint token bridge between Ethereum Sepolia and Osmosis testnet." />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
<style>
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
--bg: #0a0e1a;
--surface: rgba(255, 255, 255, 0.04);
--surface-hover: rgba(255, 255, 255, 0.07);
--border: rgba(255, 255, 255, 0.08);
--text: #e2e8f0;
--text-dim: #8892a6;
--accent-eth: #627eea;
--accent-eth-glow: rgba(98, 126, 234, 0.25);
--accent-osmo: #a855f7;
--accent-osmo-glow: rgba(168, 85, 247, 0.25);
--accent-green: #22c55e;
--accent-green-glow: rgba(34, 197, 94, 0.15);
--radius: 16px;
--mono: 'JetBrains Mono', monospace;
--sans: 'Inter', system-ui, sans-serif;
}
html { scroll-behavior: smooth; }
body {
font-family: var(--sans);
background: var(--bg);
color: var(--text);
min-height: 100vh;
width: 100%;
overflow-x: hidden;
line-height: 1.6;
}
body::before {
content: '';
position: fixed;
top: -40%; left: -20%;
width: 80vw; height: 80vw;
background: radial-gradient(circle, var(--accent-eth-glow) 0%, transparent 60%);
pointer-events: none; z-index: 0;
}
body::after {
content: '';
position: fixed;
bottom: -40%; right: -20%;
width: 80vw; height: 80vw;
background: radial-gradient(circle, var(--accent-osmo-glow) 0%, transparent 60%);
pointer-events: none; z-index: 0;
}
.page {
position: relative; z-index: 1;
max-width: 1120px;
margin: 0 auto;
padding: 40px 24px 60px;
}
/* Header */
header { text-align: center; margin-bottom: 48px; }
header .badge {
display: inline-flex; align-items: center; gap: 6px;
background: var(--accent-green-glow);
border: 1px solid rgba(34, 197, 94, 0.3);
color: var(--accent-green);
font-size: 12px; font-weight: 600;
letter-spacing: 0.5px; text-transform: uppercase;
padding: 5px 14px; border-radius: 100px; margin-bottom: 20px;
}
header .badge .dot {
width: 7px; height: 7px; border-radius: 50%;
background: var(--accent-green);
animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.4; transform: scale(0.8); }
}
header h1 {
font-size: clamp(28px, 4.5vw, 44px); font-weight: 800; letter-spacing: -1px;
background: linear-gradient(135deg, var(--accent-eth) 0%, var(--accent-osmo) 100%);
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
background-clip: text; margin-bottom: 12px;
}
header p { color: var(--text-dim); font-size: 15px; max-width: 600px; margin: 0 auto; }
header .networks {
display: flex; justify-content: center; gap: 24px;
margin-top: 20px; font-size: 13px; font-weight: 500;
}
header .networks span { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
header .networks .chain-dot { width: 8px; height: 8px; border-radius: 50%; }
header .networks .chain-dot.eth { background: var(--accent-eth); }
header .networks .chain-dot.osmo { background: var(--accent-osmo); }
/* Cards */
.card {
background: var(--surface); backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid var(--border); border-radius: var(--radius);
padding: 28px; margin-bottom: 24px; transition: background 0.2s;
}
.card:hover { background: var(--surface-hover); }
.card-title {
font-size: 13px; font-weight: 600; text-transform: uppercase;
letter-spacing: 1.2px; color: var(--text-dim); margin-bottom: 18px;
}
/* Flow diagram */
.flow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; align-items: center; }
.flow-chain {
text-align: center; padding: 24px 16px; border-radius: 14px;
border: 1px solid var(--border); background: var(--surface);
}
.flow-chain .chain-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.flow-chain .chain-sub { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.flow-chain.eth { border-color: rgba(98, 126, 234, 0.25); }
.flow-chain.eth .chain-name { color: var(--accent-eth); }
.flow-chain.osmo { border-color: rgba(168, 85, 247, 0.25); }
.flow-chain.osmo .chain-name { color: var(--accent-osmo); }
.flow-arrows { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px; }
.flow-arrows .arrow {
display: flex; align-items: center; gap: 6px;
font-size: 11px; font-weight: 600; letter-spacing: 0.5px; white-space: nowrap;
}
.arrow-line { width: 48px; height: 2px; border-radius: 2px; }
.arrow.fwd .arrow-line { background: linear-gradient(90deg, var(--accent-eth), var(--accent-osmo)); }
.arrow.rev .arrow-line { background: linear-gradient(90deg, var(--accent-osmo), var(--accent-eth)); }
.arrow.fwd { color: var(--accent-osmo); }
.arrow.rev { color: var(--accent-eth); }
.flow-icon { font-size: 28px; line-height: 1; }
/* Contracts grid */
.contracts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.contract-item {
padding: 18px; border-radius: 12px;
border: 1px solid var(--border); background: var(--surface);
}
.contract-item .label {
font-size: 12px; font-weight: 600; text-transform: uppercase;
letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 8px;
}
.contract-item .addr { font-family: var(--mono); font-size: 12.5px; color: var(--text); word-break: break-all; }
.contract-item a { color: var(--accent-eth); text-decoration: none; transition: color 0.15s; }
.contract-item a:hover { color: #8fa4f0; text-decoration: underline; }
.contract-item a.osmo-link { color: var(--accent-osmo); }
.contract-item a.osmo-link:hover { color: #c084fc; }
.contract-item .verified {
display: inline-flex; align-items: center; gap: 4px;
font-size: 11px; font-weight: 600; color: var(--accent-green); margin-top: 6px;
}
/* TX steps */
.tx-section-title {
font-size: 15px; font-weight: 700; margin-bottom: 16px;
display: flex; align-items: center; gap: 8px;
}
.tx-section-title .tag {
font-size: 11px; font-weight: 600; text-transform: uppercase;
letter-spacing: 0.5px; padding: 3px 10px; border-radius: 6px;
}
.tag.fwd { background: rgba(168, 85, 247, 0.15); color: var(--accent-osmo); border: 1px solid rgba(168, 85, 247, 0.25); }
.tag.rev { background: rgba(98, 126, 234, 0.15); color: var(--accent-eth); border: 1px solid rgba(98, 126, 234, 0.25); }
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 14px; }
.step-indicator { display: flex; flex-direction: column; align-items: center; }
.step-num {
width: 28px; height: 28px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.step.eth-step .step-num { background: rgba(98, 126, 234, 0.2); color: var(--accent-eth); border: 1px solid rgba(98, 126, 234, 0.35); }
.step.osmo-step .step-num { background: rgba(168, 85, 247, 0.2); color: var(--accent-osmo); border: 1px solid rgba(168, 85, 247, 0.35); }
.step-line { width: 2px; flex: 1; background: var(--border); margin: 4px 0; }
.step:last-child .step-line { display: none; }
.step-body { padding-bottom: 20px; }
.step:last-child .step-body { padding-bottom: 0; }
.step-action { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.step-detail { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.step-tx {
display: inline-flex; align-items: center; gap: 5px;
font-family: var(--mono); font-size: 11.5px;
padding: 4px 10px; border-radius: 6px;
background: rgba(255,255,255,0.04); border: 1px solid var(--border);
text-decoration: none; color: var(--text); transition: all 0.15s;
}
.step-tx:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.step-tx .arrow-icon { font-size: 10px; color: var(--text-dim); }
/* Balance table */
.balance-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.balance-table th {
text-align: left; font-size: 11px; font-weight: 600;
text-transform: uppercase; letter-spacing: 0.8px;
color: var(--text-dim); padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.balance-table td {
padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.03);
font-family: var(--mono); font-size: 13px;
}
.balance-table tr:last-child td { border-bottom: none; }
.balance-table .stage { font-family: var(--sans); font-weight: 600; color: var(--text); }
.balance-table .num { text-align: right; }
.balance-table .match { color: var(--accent-green); font-weight: 500; }
.invariant {
display: flex; align-items: center; gap: 8px;
margin-top: 14px; padding: 12px 16px; border-radius: 10px;
background: var(--accent-green-glow); border: 1px solid rgba(34, 197, 94, 0.2);
font-size: 13px; font-weight: 600; color: var(--accent-green);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
footer {
text-align: center; padding-top: 24px;
font-size: 12px; color: var(--text-dim);
}
footer a { color: var(--accent-eth); text-decoration: none; }
footer a:hover { text-decoration: underline; }
@media (max-width: 768px) {
.flow { grid-template-columns: 1fr; gap: 12px; }
.flow-arrows { flex-direction: row; padding: 8px 0; }
.arrow-line { width: 24px; }
.two-col { grid-template-columns: 1fr; }
.contracts-grid { grid-template-columns: 1fr; }
.page { padding: 24px 16px 40px; }
}
</style>
</head>
<body>
<div class="page">
<header>
<div class="badge"><span class="dot"></span> Verified on live testnets</div>
<h1>Ethereum ↔ Osmosis<br/>Cross-Chain Token Bridge</h1>
<p>Lock-and-mint bridge POC — a full bidirectional round-trip executed on live testnets with source-verified contracts.</p>
<div class="networks">
<span><span class="chain-dot eth"></span> Ethereum Sepolia (11155111)</span>
<span><span class="chain-dot osmo"></span> Osmosis Testnet (osmo-test-5)</span>
</div>
</header>
<!-- Architecture -->
<div class="card">
<div class="card-title">Bridge Architecture</div>
<div class="flow">
<div class="flow-chain eth">
<div class="flow-icon">⟠</div>
<div class="chain-name">Ethereum Sepolia</div>
<div class="chain-sub">TestToken (ERC-20) + BridgeLock</div>
</div>
<div class="flow-arrows">
<div class="arrow fwd">lock → <span class="arrow-line"></span> → mint</div>
<div style="font-size:11px;color:var(--text-dim)">off-chain relayer</div>
<div class="arrow rev">unlock ← <span class="arrow-line"></span> ← burn</div>
</div>
<div class="flow-chain osmo">
<div class="flow-icon">⚛</div>
<div class="chain-name">Osmosis Testnet</div>
<div class="chain-sub">Token Factory — wbridge (wTT)</div>
</div>
</div>
</div>
<!-- Deployed Contracts -->
<div class="card">
<div class="card-title">Deployed Contracts & Assets</div>
<div class="contracts-grid">
<div class="contract-item">
<div class="label">TestToken (ERC-20)</div>
<div class="addr">
<a href="https://sepolia.etherscan.io/address/0x5d42ee571fdb4eaaf732118b6f137a457ad0674a#code" target="_blank" rel="noopener">0x5d42ee571fdb4eaaf732118b6f137a457ad0674a</a>
</div>
<div class="verified">✓ Source Verified on Etherscan</div>
</div>
<div class="contract-item">
<div class="label">BridgeLock (Escrow)</div>
<div class="addr">
<a href="https://sepolia.etherscan.io/address/0xaf50c0c0487456b108fbb5aba0f3a3b3cd165bde#code" target="_blank" rel="noopener">0xaf50c0c0487456b108fbb5aba0f3a3b3cd165bde</a>
</div>
<div class="verified">✓ Source Verified on Etherscan</div>
</div>
<div class="contract-item">
<div class="label">Wrapped Token (Osmosis Token Factory)</div>
<div class="addr" style="font-size:11.5px;">
<span style="color:var(--accent-osmo);">factory/</span>osmo1zccwu68e76tnsrn230lh0ghsx0qv2v8x2h95lc<span style="color:var(--accent-osmo);">/wbridge</span>
</div>
</div>
<div class="contract-item">
<div class="label">Authorized Relayer (unlock signer)</div>
<div class="addr">
<a href="https://sepolia.etherscan.io/address/0xD39d24Ce7aA839EB855d5219F28612D5Ac76D469" target="_blank" rel="noopener">0xD39d24Ce7aA839EB855d5219F28612D5Ac76D469</a>
</div>
</div>
</div>
</div>
<!-- Transaction Flow -->
<div class="two-col">
<div class="card">
<div class="tx-section-title">
<span class="tag fwd">Forward</span> Lock 25 TT → Mint 25 wTT
</div>
<div class="steps">
<div class="step eth-step">
<div class="step-indicator"><div class="step-num">1</div><div class="step-line"></div></div>
<div class="step-body">
<div class="step-action">approve(BridgeLock, 25)</div>
<div class="step-detail">User approves escrow contract to spend 25 TT</div>
<a class="step-tx" href="https://sepolia.etherscan.io/tx/0xc4367460cb836dd2ecd54a397a4c99954f12829aab357a7028711f456be28c34" target="_blank" rel="noopener">0xc436…8c34 <span class="arrow-icon">↗</span></a>
</div>
</div>
<div class="step eth-step">
<div class="step-indicator"><div class="step-num">2</div><div class="step-line"></div></div>
<div class="step-body">
<div class="step-action">lock(25, "osmo1zcc…95lc")</div>
<div class="step-detail">Tokens escrowed in BridgeLock. Emits Locked event (nonce 0).</div>
<a class="step-tx" href="https://sepolia.etherscan.io/tx/0xe1ae35aadb59f41a1468cf762bf201c9e4e3d7db652a999ea1c9f1e80d98d440" target="_blank" rel="noopener">0xe1ae…d440 <span class="arrow-icon">↗</span></a>
</div>
</div>
<div class="step osmo-step">
<div class="step-indicator"><div class="step-num">3</div></div>
<div class="step-body">
<div class="step-action">MsgMint 25 wTT → recipient</div>
<div class="step-detail">Relayer detects Locked event, mints wrapped tokens on Osmosis.</div>
<a class="step-tx" href="https://www.mintscan.io/osmosis-testnet/tx/FDEC749B7675715D04EE7D5C61F64B9A26216DD171E2B3A10DDCDC18B09867F8" target="_blank" rel="noopener">FDEC74…67F8 <span class="arrow-icon">↗</span></a>
</div>
</div>
</div>
</div>
<div class="card">
<div class="tx-section-title">
<span class="tag rev">Reverse</span> Return 10 wTT → Unlock 10 TT
</div>
<div class="steps">
<div class="step osmo-step">
<div class="step-indicator"><div class="step-num">4</div><div class="step-line"></div></div>
<div class="step-body">
<div class="step-action">MsgSend 10 wTT → relayer</div>
<div class="step-detail">User sends wrapped tokens to relayer. Memo = EVM recipient address.</div>
<a class="step-tx" href="https://www.mintscan.io/osmosis-testnet/tx/2A3980D7FF07C76B93C5D1E875D20224B1A923CEBF762F0134115349B1BF2EF0" target="_blank" rel="noopener">2A3980…2EF0 <span class="arrow-icon">↗</span></a>
</div>
</div>
<div class="step osmo-step">
<div class="step-indicator"><div class="step-num">5</div><div class="step-line"></div></div>
<div class="step-body">
<div class="step-action">MsgBurn 10 wTT</div>
<div class="step-detail">Relayer burns the received wrapped tokens, reducing supply.</div>
<a class="step-tx" href="https://www.mintscan.io/osmosis-testnet/tx/1EDA055AEB297282654483B2E9FDFE9DB20ACC9BC5FDCE68D8FC928014E72D34" target="_blank" rel="noopener">1EDA05…2D34 <span class="arrow-icon">↗</span></a>
</div>
</div>
<div class="step eth-step">
<div class="step-indicator"><div class="step-num">6</div></div>
<div class="step-body">
<div class="step-action">unlock(recipient, 10)</div>
<div class="step-detail">Relayer releases 10 TT from escrow on Sepolia.</div>
<a class="step-tx" href="https://sepolia.etherscan.io/tx/0xac58d451e9850e354ba1e220b2185c61ceab68b426da4c71e8597d7a4e197cdb" target="_blank" rel="noopener">0xac58…7cdb <span class="arrow-icon">↗</span></a>
</div>
</div>
</div>
</div>
</div>
<!-- Balance Reconciliation -->
<div class="card">
<div class="card-title">Balance Reconciliation</div>
<table class="balance-table">
<thead>
<tr>
<th>Stage</th>
<th class="num">User TT (Sepolia)</th>
<th class="num">BridgeLock Escrowed</th>
<th class="num">wTT Supply (Osmosis)</th>
<th class="num">Invariant</th>
</tr>
</thead>
<tbody>
<tr>
<td class="stage">Start</td>
<td class="num">1,000,000</td>
<td class="num">0</td>
<td class="num">0</td>
<td class="num match">0 = 0 ✓</td>
</tr>
<tr>
<td class="stage">After Forward (lock 25)</td>
<td class="num">999,975</td>
<td class="num">25</td>
<td class="num">25</td>
<td class="num match">25 = 25 ✓</td>
</tr>
<tr>
<td class="stage">After Reverse (return 10)</td>
<td class="num">999,985</td>
<td class="num">15</td>
<td class="num">15</td>
<td class="num match">15 = 15 ✓</td>
</tr>
</tbody>
</table>
<div class="invariant">✓ Invariant held throughout: escrowed TT == wTT supply</div>
</div>
<footer>
Testnet POC · Single trusted relayer · Not production / not audited ·
<a href="https://sepolia.etherscan.io/address/0x5d42ee571fdb4eaaf732118b6f137a457ad0674a#code" target="_blank" rel="noopener">Contracts verified on Etherscan</a>
</footer>
</div>
</body>
</html>