Skip to content

Support TX_TYPE.FUNDS_AND_PAYLOADS for CEA to UEA #72

@zaryab2000

Description

@zaryab2000

Feature: Ability for CEA to move FUNDS_and_PAYLOAD from CEA to UEA

Main Feature

As per v1 of CEA, it was decided that CEA will only [withdraw funds back to UEA.](https://www.notion.so/CEA-Preliminary-R-D-Doc-2b5188aea7f480a0bba3fbf1d326d52d?pvs=21)

As per new feature request:

  • CEA should be able to move FUNDS and PAYLOAD to UEA as well.
  • The flow would be:
    • Bob Request: Move 100 USDT from CEA balance to UEA on PC → Then execute payload 0xABC on UEA
    • The request goes from UGPC as is. NO CHANGES
    • TSS calls VAULT.
    • Vault calls CEA.executeUniversalTx()
    • CEA and CEAFactory Flow:
      • If payload empty ? tx type is FUNDS
        • pass empty payload and no sigData
        • recipient is UEA of the CEA
        • call gateway.sendUniversalTx() - already existing funds
      • If payload is non-empty ? tx typs is FUNDS_AND_PAYLOAD
        • call CEAFactory.sendUniversalTxViaCEA()
        • Factory checks caller is CEA , via CEA_TO_UEA mapping. valid CEA = has a UEA.
        • Factory sets recipient of the tx as recipient == CEA_TO_UEA[CEA]
        • factory calls gateway.sendUniversalTxViaCEA() → new function
    • On Gateway.sendUniversalTxViaCEA()
      • the function does exactly same as already existing function
      • only diff: adds viaCEA as true param in UniversalTx() event.

Contract Modifications for this feat

  1. UEA:
    1. bring back UniversalPayload ( no more rawPayload )
  2. CEA Changes
    1. signatureData removal
    2. payload check → empty then call normal gateway function else call special
    3. Invoke CEAFactory of that respective chain
  3. CEAFactory
    1. sendUniversalViaCEA()
      1. check its from valid CEA
      2. then put the recipient of this tx as the UEA of the CEA.
      3. call sendUnievrsalTxVIACEA()
      4. flow → [CEA and CEAFactory Flow:](https://www.notion.so/CEA-and-CEAFactory-Flow-308188aea7f480b49d26ef6a5b0575e3?pvs=21)
    2. Gateway:
      1. new function sendUniversalTxViaCEA()
      2. emits bool _ceaCall as true
      3. for all normal tx the _ceaCall is false.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions