archethic-foundation / archethic-foundation/archethic-dapp-framework-flutter
Bridge / DEX config onchain
- Dominant language
- Dart
- Stars
- 1
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
### 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_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading /lib/src/domain/repositories/tokens/ucids_tokens.json and locating the CryptoPrice class. Inspect the linked verified-token transaction chains to understand the proposed onchain data format and network separation. Done means token mappings can be updated onchain without recompiling and the coin name is removed from CryptoPrice.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100