Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ERC20 token weird pack of behaviours #1932

Open
DanielAtKrypton opened this issue Oct 15, 2020 · 2 comments
Open

Added ERC20 token weird pack of behaviours #1932

DanielAtKrypton opened this issue Oct 15, 2020 · 2 comments
Assignees
Labels
bug Something isn't working connext P1 top priority user request Requested by end-user
Projects
Milestone

Comments

@DanielAtKrypton
Copy link

Added ERC20 token weird pack of behaviours

Versions

With:

OS Name Microsoft Windows 10 Pro
Version 10.0.19041 Build 19041

WSL2 - Debian
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster

Docker Desktop 2.4.0.0

mainnet > xucli --version
1.1.0

Docker images:

Imgur

Description

After strictly following this, I entered the following command to add the SER token:

xucli addcurrency SER Connext --decimal_places 7 --token_address 0xB561fEF0d624C0826ff869946f6076B7c4f2ba42

The result returned:

success

Happy with the success I made the following sequence:

mainnet > getbalance

Balance:
┌──────────┬───────────────┬────────────────────────────┬───────────────────────────────┐
│ Currency │ Total Balance │ Channel Balance (Tradable) │ Wallet Balance (Not Tradable) │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ BTC      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ DAI      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ ETH      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ LTC      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ USDT     │ 0             │ 0                          │ 0                             │
└──────────┴───────────────┴────────────────────────────┴───────────────────────────────┘
mainnet > getbalance SER
Error: 9 FAILED_PRECONDITION: swapClient for currency SER not found
mainnet > xucli addcurrency SER Lnd --decimal_places 7 --token_address 0xB561fEF0d624C0826ff869946f6076B7c4f2ba42
Error: 6 ALREADY_EXISTS: currency SER already exists
mainnet > xucli removecurrency SER
Error: 3 INVALID_ARGUMENT: currency must consist of 2 to 5 upper case English letters or numbers
mainnet > xucli listcurrencies

Currencies:
┌────────┬────────┬────────────────────────────────────────────┬─────────────┐
│ Ticker │ Digits │ Token Address                              │ Swap Client │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ BTC    │ 8      │                                            │ Lnd         │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ LTC    │ 8      │                                            │ Lnd         │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ ETH    │ 18     │ 0x0000000000000000000000000000000000000000 │ Connext     │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ USDT   │ 6      │ 0xdAC17F958D2ee523a2206206994597C13D831ec7 │ Connext     │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ DAI    │ 18     │ 0x6B175474E89094C44Da98b954EedeAC495271d0F │ Connext     │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ SER    │ 7      │ 0xB561fEF0d624C0826ff869946f6076B7c4f2ba42 │ Connext     │
└────────┴────────┴────────────────────────────────────────────┴─────────────┘
mainnet > getbalance

Balance:
┌──────────┬───────────────┬────────────────────────────┬───────────────────────────────┐
│ Currency │ Total Balance │ Channel Balance (Tradable) │ Wallet Balance (Not Tradable) │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ BTC      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ DAI      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ ETH      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ LTC      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ USDT     │ 0             │ 0                          │ 0                             │
└──────────┴───────────────┴────────────────────────────┴───────────────────────────────┘

mainnet > exit

So I decided to exit and enter again:

❯ bash xud.sh
1) Simnet
2) Testnet
3) Mainnet
Please choose the network: 3
🚀 Launching mainnet environment
🌍 Checking for updates...
- Container mainnet_lndbtc_1: recreate
- Container mainnet_lndltc_1: recreate
- Container mainnet_connext_1: recreate
- Container mainnet_arby_1: recreate
- Container mainnet_boltz_1: recreate
- Container mainnet_xud_1: recreate
A new version is available. Would you like to upgrade (Warning: this may restart your environment and cancel all open orders)? [Y/n] y
Recreating mainnet_lndbtc_1...
Recreating mainnet_lndltc_1...
Recreating mainnet_connext_1...
Recreating mainnet_arby_1...
Recreating mainnet_boltz_1...
Recreating mainnet_xud_1...

🏃 Warming up...


Enter master xud password:
xud was unlocked succesfully
The following wallets were unlocked: LTC, BTC

                           .___           __  .__
          ___  _____ __  __| _/     _____/  |_|  |
          \  \/  /  |  \/ __ |    _/ ___\   __\  |
           >    <|  |  / /_/ |    \  \___|  | |  |__
          /__/\_ \____/\____ |     \___  >__| |____/
                \/          \/         \/
--------------------------------------------------------------

mainnet > getbalance

Balance:
┌──────────┬───────────────┬────────────────────────────┬───────────────────────────────┐
│ Currency │ Total Balance │ Channel Balance (Tradable) │ Wallet Balance (Not Tradable) │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ BTC      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ DAI      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ ETH      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ LTC      │ 0             │ 0                          │ 0                             │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ USDT     │ 0             │ 0                          │ 0                             │
└──────────┴───────────────┴────────────────────────────┴───────────────────────────────┘
mainnet > getbalance SER
Error: 2 UNKNOWN: cannot convert SER units of 0 to amount because units per currency was not found in the database
mainnet > xucli listcurrencies

Currencies:
┌────────┬────────┬────────────────────────────────────────────┬─────────────┐
│ Ticker │ Digits │ Token Address                              │ Swap Client │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ BTC    │ 8      │                                            │ Lnd         │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ LTC    │ 8      │                                            │ Lnd         │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ ETH    │ 18     │ 0x0000000000000000000000000000000000000000 │ Connext     │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ USDT   │ 6      │ 0xdAC17F958D2ee523a2206206994597C13D831ec7 │ Connext     │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ DAI    │ 18     │ 0x6B175474E89094C44Da98b954EedeAC495271d0F │ Connext     │
├────────┼────────┼────────────────────────────────────────────┼─────────────┤
│ SER    │ 7      │ 0xB561fEF0d624C0826ff869946f6076B7c4f2ba42 │ Connext     │
└────────┴────────┴────────────────────────────────────────────┴─────────────┘
mainnet > getbalance DAI

Balance:
┌──────────┬───────────────┬────────────────────────────┬───────────────────────────────┐
│ Currency │ Total Balance │ Channel Balance (Tradable) │ Wallet Balance (Not Tradable) │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ DAI      │ 0             │ 0                          │ 0                             │
└──────────┴───────────────┴────────────────────────────┴───────────────────────────────┘
mainnet > listpairs
Trading Pairs:
┌──────────────┐
│ Trading pair │
├──────────────┤
│ BTC / USDT   │
├──────────────┤
│ ETH / BTC    │
├──────────────┤
│ LTC / BTC    │
├──────────────┤
│ USDT / DAI   │
└──────────────┘
mainnet > xucli walletdeposit SER
{
  "address": "0x9B6eE9076f5972999C28F79Ed0144e9eaBf0A087"
}
mainnet > xucli walletdeposit ETH
{
  "address": "0x9B6eE9076f5972999C28F79Ed0144e9eaBf0A087"
}

Potential problems found

Weirdness no 1:

mainnet > getbalance SER
Error: 9 FAILED_PRECONDITION: swapClient for currency SER not found

Weirdness no 2:

mainnet > xucli removecurrency SER
Error: 3 INVALID_ARGUMENT: currency must consist of 2 to 5 upper case English letters or numbers

Weirdness no 3:

mainnet > getbalance

Balance:
┌──────────┬───────────────┬────────────────────────────┬───────────────────────────────┐
│ Currency │ Total Balance │ Channel Balance (Tradable) │ Wallet Balance (Not Tradable) │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ BTC │ 0 │ 0 │ 0 │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ DAI │ 0 │ 0 │ 0 │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ ETH │ 0 │ 0 │ 0 │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ LTC │ 0 │ 0 │ 0 │
├──────────┼───────────────┼────────────────────────────┼───────────────────────────────┤
│ USDT │ 0 │ 0 │ 0 │
└──────────┴───────────────┴────────────────────────────┴───────────────────────────────┘

getbalance command above doesn't show SER balance.

Weirdness no 4:

The following wallets were unlocked: LTC, BTC

Why aren't ETH and ETH(ERC20) in the unlocked list as well?

Weirdness no 5:
Even after restart, getbalance command still doesn't show SER balance.

Weirdness no 6:

mainnet > getbalance SER
Error: 2 UNKNOWN: cannot convert SER units of 0 to amount because units per currency was not found in the database

Summarizing

These were the I believe problems I could find when adding an ERC20 token to XUD. Maybe there is something I am missing to make all these points work correctly, any ideas?

@michael1011 michael1011 added bug Something isn't working connext labels Oct 15, 2020
@kilrau
Copy link
Contributor

kilrau commented Oct 15, 2020

Thanks for opening this issue!

@kilrau kilrau added this to To do in UX + Feedback via automation Oct 15, 2020
@kilrau kilrau added user request Requested by end-user P1 top priority labels Oct 15, 2020
@kilrau
Copy link
Contributor

kilrau commented Oct 27, 2020

Quick update here:

* Weirdness no 1-3 is a known issue and should be solved by #1746, please run above steps to confirm @LePremierHomme

#1746 should be merged soon, just one small fix left. @raladev will make sure this fixes 1-3.

* Weirdness 5 & 6

These are far more complex than initially thought. In order to list add any ERC20 and start trading it, the connext node has to support this token and has to be funded with it. @jgarzik came up with a "wild" idea how to do that: #1956

* Weirdness no 4

The following wallets were unlocked: LTC, BTC

This is what should be fixed in this issue @sangaman

sangaman added a commit that referenced this issue Oct 28, 2020
This adds a flag to the `UnlockNode` response to indicate whether
a Connext client is connected and ready to accept calls. In the cli,
`ETH` gets added to the list of wallets that are unlocked and ready when
this new flag is true.

Closes #1932.
sangaman added a commit that referenced this issue Nov 1, 2020
This adds a flag to the `UnlockNode` response to indicate whether
a Connext client is connected and ready to accept calls. In the cli,
`ETH` gets added to the list of wallets that are unlocked and ready when
this new flag is true.

Closes #1932.
@kilrau kilrau removed this from To do in UX + Feedback Nov 6, 2020
@kilrau kilrau added this to To do in November via automation Nov 6, 2020
@kilrau kilrau moved this from To do to In progress in November Nov 6, 2020
@kilrau kilrau added this to the 1.3.1 milestone Nov 6, 2020
sangaman added a commit that referenced this issue Nov 10, 2020
This adds a flag to the `UnlockNode` response to indicate whether
a Connext client is connected and ready to accept calls. In the cli,
`ETH` gets added to the list of wallets that are unlocked and ready when
this new flag is true.

Closes #1932.
sangaman added a commit that referenced this issue Nov 10, 2020
This adds a flag to the `UnlockNode` response to indicate whether
a Connext client is connected and ready to accept calls. In the cli,
`ETH` gets added to the list of wallets that are unlocked and ready when
this new flag is true.

Closes #1932.
sangaman added a commit that referenced this issue Nov 10, 2020
This adds a flag to the `UnlockNode` response to indicate whether
a Connext client is connected and ready to accept calls. In the cli,
`ETH` gets added to the list of wallets that are unlocked and ready when
this new flag is true.

Closes #1932.
sangaman added a commit that referenced this issue Nov 10, 2020
This adds a flag to the `UnlockNode` response to indicate whether
a Connext client is connected and ready to accept calls. In the cli,
`ETH` gets added to the list of wallets that are unlocked and ready when
this new flag is true.

Closes #1932.
@kilrau kilrau removed this from In progress in November Nov 30, 2020
@kilrau kilrau added this to To do in December via automation Nov 30, 2020
@kilrau kilrau moved this from To do to In progress in December Nov 30, 2020
@kilrau kilrau removed this from In progress in December Jan 4, 2021
@kilrau kilrau added this to To do in January via automation Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working connext P1 top priority user request Requested by end-user
Projects
No open projects
January
  
To do
Development

Successfully merging a pull request may close this issue.

3 participants