Skip to content

Commit

Permalink
additional router graphics
Browse files Browse the repository at this point in the history
  • Loading branch information
lawsonkight committed Sep 26, 2024
1 parent 4c09296 commit 4ebe307
Show file tree
Hide file tree
Showing 10 changed files with 223 additions and 91 deletions.
2 changes: 1 addition & 1 deletion docs/bridge/docs/02-Bridge/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The [Synapse Bridge](https://synapseprotocol.com) and [Solana Bridge](https://so

<figure>
<BridgeFlow />
<caption>User assets are sent to a bridge contract, moved to the destination chain, and returned to the user.</caption>
<figcaption>User assets are sent to a bridge contract, moved to the `destChain`, and returned to the user.</figcaption>
</figure>

## Developers
Expand Down
2 changes: 1 addition & 1 deletion docs/bridge/docs/04-Routers/01-Synapse-Router/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The Synapse Router overhauls current Synapse Bridge contracts to abstract much o

<figure>
<BridgeFlow />
<caption>User assets are sent to a bridge contract, moved to the destination chain, and returned to the user.</caption>
<figcaption>User assets are sent to a Bridge contract, moved to the `destChain`, and returned to the user.</figcaption>
</figure>

## Queries
Expand Down
7 changes: 7 additions & 0 deletions docs/bridge/docs/04-Routers/CCTP/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
sidebar_label: CCTP
---

import { CCTPFlow } from '@site/src/components/CCTPFlow'

# CCTP Router

A [Synapse Router](../Synapse-Router) bridge module which uses Circle's [Cross-Chain Transfer Protocol](https://www.circle.com/en/cross-chain-transfer-protocol) to natively mint & burn USDC.

<figure>
<CCTPFlow />
<figcaption>User assets are sent to a Circle contract, moved to the `destChain`, and returned to the user.</figcaption>
</figure>

## Architecture

### Contracts
Expand Down
8 changes: 1 addition & 7 deletions docs/bridge/docs/04-Routers/RFQ/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
sidebar_label: RFQ
---

import { BridgeFlow } from '@site/src/components/BridgeFlow'
import { RFQFlow } from '@site/src/components/RFQFlow'

# RFQ Router
Expand All @@ -11,12 +10,7 @@ A [Synapse Router](../Synapse-Router) bridge module which matches on-chain user

<figure>
<RFQFlow />
<caption>User assets are sent to a bridge contract, moved to the destination chain, and returned to the user.</caption>
</figure>

<figure>
<BridgeFlow />
<caption>User assets are sent to a bridge contract, and held until a Solver completes their quote on the destination chain.</caption>
<figcaption>User assets are sent to a Bridge contract, and held until a Solver executes their quote on the `destChain`.</figcaption>
</figure>

## Architecture
Expand Down
3 changes: 2 additions & 1 deletion docs/bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"docusaurus-theme-openapi-docs": "^4.0.1",
"prism-react-renderer": "^2.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"synapse-constants": "^1.3.24"
},
"devDependencies": {
"typescript": "~5.2.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/bridge/src/components/BridgeFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const BridgeFlow = () => {
attributeName="cx"
to="-24.5%"
dur=".5s"
begin="bridgeFlowSend.begin + .5s"
begin="bridgeFlowSend.begin + .4s"
calcMode="spline"
keyTimes="0; 1"
keySplines=".5 0 .2 1"
Expand Down
181 changes: 181 additions & 0 deletions docs/bridge/src/components/CCTPFlow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
export const CCTPFlow = () => {
return (
<svg
width="100%"
viewBox="-240 0 480 164"
xmlns="http://www.w3.org/2000/svg"
>
<set
id="bridgeFlowTimer"
attributeName="x"
begin="0s; bridgeFlowTimerOut.end + 2s"
/>
<g fill="currentcolor" fillOpacity=".05">
<rect x="-50%" rx="4" y="0" width="100%" height="48" />
<rect x="-50%" rx="4" y="56" width="100%" height="48" />
<rect x="-50%" rx="4" y="112" width="100%" height="48" />
<rect x="-50%" rx="4" y="0%" width="33.3%" height="100%" />
<rect x="16.7%" rx="4" y="0%" width="33.3%" height="100%" />
</g>
<line
x1="-50%"
y1="100%"
x2="-50%"
y2="100%"
stroke="currentcolor"
strokeWidth="4"
strokeOpacity=".25"
>
<set attributeName="x1" to="-50%" begin="bridgeFlowTimer.begin" />
<set attributeName="x2" to="-50%" begin="bridgeFlowTimer.begin" />
<animate
attributeName="x2"
values="-50%; 50%"
begin="bridgeFlowSend.begin"
dur="4s"
calcMode="linear"
keyTimes="0; 1"
keySplines=".5 0 1 1"
fill="freeze"
/>
<animate
id="bridgeFlowTimerOut"
attributeName="x1"
values="-50%; 50%"
begin="bridgeFlowReceive.end + 1s"
dur=".75s"
calcMode="spline"
keyTimes="0; 1"
keySplines=".5 0 .2 1"
fill="freeze"
/>
</line>
<g fill="currentcolor" textAnchor="middle" dominantBaseline="middle">
<text x="-33%" y="24">
originChain
</text>
<text x="33%" y="24">
destChain
</text>
<text y="24">App / SDK</text>
<text y="80">Wallet</text>
<text y="136">Circle</text>
</g>
<circle
cx="-33%"
cy="80"
r="12"
fill="hsl(211deg 67% 50%)"
stroke="hsl(211deg 67% 50%)"
>
<set attributeName="opacity" to="1" begin="bridgeFlowTimer.begin" />
<set attributeName="cy" to="80" begin="bridgeFlowTimer.begin" />
<set attributeName="cx" to="-33%" begin="bridgeFlowTimer.begin" />
<animate
id="bridgeFlowSign"
attributeName="opacity"
values=".5; 1"
dur=".1s"
repeatCount="3"
begin="bridgeFlowTimer.begin + 1s"
fill="freeze"
/>
<animate
id="bridgeFlowSend"
attributeName="cy"
to="136"
dur=".5s"
begin="bridgeFlowSign.end + 2s"
calcMode="spline"
keyTimes="0; 1"
keySplines=".5 0 .2 1"
fill="freeze"
/>
<animate
id="bridgeFlowBurn"
attributeName="cx"
to="-31.5%"
dur=".5s"
begin="bridgeFlowSend.begin + 2s"
calcMode="spline"
keyTimes="0; 1"
keySplines=".5 0 .2 1"
fill="freeze"
/>
<animate
attributeName="opacity"
values="1; 0"
dur=".1s"
begin="bridgeFlowBurn.begin"
repeatCount="3"
fill="freeze"
/>
</circle>
<circle
r="12"
cx="31.5%"
cy="136"
fill="hsl(211deg 67% 50%)"
stroke="hsl(211deg 67% 50%)"
>
<set attributeName="cy" to="136" begin="bridgeFlowTimer.begin" />
<set attributeName="cx" to="31.5%" begin="bridgeFlowTimer.begin" />
<animate
id="bridgeFlowMint"
attributeName="cx"
to="33%"
dur=".5s"
begin="bridgeFlowBurn.begin + .1s"
calcMode="spline"
keyTimes="0; 1"
keySplines=".5 0 .2 1"
fill="freeze"
/>
<set attributeName="opacity" to="0" begin="bridgeFlowTimer.begin" />
<animate
attributeName="opacity"
values="0; 1"
begin="bridgeFlowMint.begin"
dur=".1s"
repeatCount="5"
fill="freeze"
/>
<animate
id="bridgeFlowReceive"
attributeName="cy"
to="80"
dur=".5s"
begin="bridgeFlowMint.end + 1s"
calcMode="spline"
keyTimes="0; 1"
keySplines=".5 0 .2 1"
fill="freeze"
/>
</circle>
<circle
r="11"
cx="33%"
cy="80"
stroke="hsl(211deg 67% 50%)"
fill="none"
opacity="0"
strokeDasharray="2.5"
>
<set attributeName="opacity" to="0" begin="bridgeFlowTimer.begin" />
<animate
attributeName="opacity"
values="0; .3; 0; .5; 0; .7; 0; 1"
dur=".4s"
begin="bridgeFlowSign.begin"
fill="freeze"
/>
<animate
attributeName="stroke-dashoffset"
by="5"
dur="1s"
repeatCount="indefinite"
/>
</circle>
</svg>
)
}
Loading

0 comments on commit 4ebe307

Please sign in to comment.