planetarium / NineChronicles.Bridge

A bridge implementation for the NineChronicles planets
3 stars 3 forks source link

Observe transferred events instead of burn, for downstream too #5

Closed longfin closed 11 months ago

longfin commented 11 months ago

Currently, this bridge acts against downstream to upstream bridging

sequenceDiagram
    actor u as user
    participant d as downstream
    actor b as bridge
    participant us as upstream

    u ->> d: send tx to burn asset
    b -->> d: observe burnt events
    b ->> us: send tx to release asset
    us -->> u: release assets to user

This implementation is quite simple, but we need to have different frontend for downstream→upstream(burn asset) than upstream→downstream(transfer asset),

To unify them, bridge needs to observe transferring events like upstream, for downstream too.

sequenceDiagram
    actor u as user
    participant d as downstream
    actor b as bridge
    participant us as upstream

    u ->> d: send tx to transfer
    b -->> d: observe burnt events
    b ->> d: send tx to burn asset
    b ->> us: send tx to release asset
    us -->> u: release assets to user
moreal commented 11 months ago

It seems resolved by #8, #10