archethic-foundation / archethic-dapp-framework-flutter

GNU Affero General Public License v3.0
0 stars 1 forks source link

Bridge / DEX config onchain #19

Open redDwarf03 opened 4 months ago

redDwarf03 commented 4 months ago

Is your feature request related to a problem?

No response

Describe the solution you'd like

The relation between UCIds and token addresses for each environment is configured in a json file in the project. When we want to add new tokens, we need to recompile the project and update dependencies. The goal of this issue is to move onchain the configuration /lib/src/domain/repositories/tokens/ucids_tokens.json

No need to define all networks in the same config Distinct config for each network.

So, instead of

{
    "mainnet": {
        "0000457EACA7FBAA96DB4A8D506A0B69684F546166FBF3C55391B1461907EFA58EAF": 1027,
        "00005751A05BA007E7E2518DEA171DBBD67B0527C637232F923830C39BFF9E8F159A": 20920
    },
    "testnet": {
        "00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1": 3890,
        "00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4": 1027,
        "0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827": 1839,
        "00001ED63AC2850CEA282D3D0CA5047418BC2720CB49D15B611D2845611F605716A1": 20920
    },
    "devnet": {
        "00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1": 3890,
        "00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4": 1027,
        "0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827": 1839,
        "0000353AF3AF4BC3CB70E16A5DA4F5A842140C8FE63314E9B7336089C973821B544F": 1027
    }
}

Create in each network a transaction chain with data txn

{
  "ucids": {
        "00001A4AB7AD0CE2B494C965C66FF2962692A5FE5ECB71B345ABB53BAD88A83A01F1": 3890,
        "00003DF600E329199BF3EE8FBE2B8223413D70BCDD97E15089E6A74D94DE3F1173B4": 1027,
        "0000288BF6F0E12457B125DC54D2DFA4EB010BE3073CF02E10FB79B696180F55B827": 1839,
        "0000353AF3AF4BC3CB70E16A5DA4F5A842140C8FE63314E9B7336089C973821B544F": 1027
    }
}

We can follow the example of verified tokens available in these tx chains https://testnet.archethic.net/explorer/chain?address=0000b01e7a497f0576a004c5957d14956e165a6f301d76cda35ba49be4444dac00eb https://mainnet.archethic.net/explorer/chain?address=000030ed4ed79a05cfaa90b803c0ba933307de9923064651975b59047df3aaf223bb

Additional context

Remove coin's name from CryptoPrice class

Epic

No response

redDwarf03 commented 4 months ago

finish before https://github.com/archethic-foundation/archethic-dapp-framework-flutter/pull/13