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

Conversion amount is reported incorrectly with exchange subcommand #462

Open
1 task done
rkachowski opened this issue Nov 26, 2024 · 1 comment
Open
1 task done
Assignees
Labels

Comments

@rkachowski
Copy link
Contributor

rkachowski commented Nov 26, 2024

Package

@celo/celocli

Have you ensured that all of these are up to date?

  • the package you are using

What version of the package are you on?

@celo/celocli/5.2.3 darwin-x64 node-v16.20.0

What command or function is the bug in?

celocli exchange:dollars

Operating System

macOS (Apple Silicon)

Describe the bug

Description

When running the exchange command, the value is incorrectly presented as if it's in full units / ETH, when the underlying transaction is run with wei. This results in an unexpected value being shown and misleading info displayed.

Actual

celocli exchange:dollars -n https://baklava-forno.celo-testnet.org --from 0xEF0186B8eDA17BE7D1230eeB8389fA85e157E1fb --value 100 --privateKey pkey
Running Checks:
   ✔  Account has at least 0.0000000000000001 cUSD
   ✔  Compliant Address
All checks passed
Fetching Quote... done
Quoted Price: 2.2 per token
Warning cUSD price here (i.e. on-chain) would be depegged by 44.669251186600555% from the oracle prices 1.21727647389478782421 (i.e. swap prices). Are you sure you want to continue? [y/yes, n/no (default)]: y
SendTransaction: increaseAllowance
txHash: 0xb2f073655e2f4226d0dbe5a1411a7412125b0a1cf2d45053e9ec57871ae69523
Sending Transaction: increaseAllowance... done
Swapping 100 cUSD for estimated 220 CELO
SendTransaction: exchange
txHash: 0xb4d964ac9d81d4dac78d6768925cf6cb1e2193d4c6205853c9583991c7700055
Sending Transaction: exchange... done

Thanks for using the celocli! We are interested in your feedback.
Let us know at github.com/celo-org/developer-tooling/discussions/92

Note the line Swapping 100 cUSD for estimated 220 CELO

Expected

  • Output contains the following line
    • Swapping 0.0000000000000001 cUSD for estimated 0.000000000000000223 CELO
  • or the value field is unambiguous about which units are expected
@aaronmgdr
Copy link
Member

ok fair point

@aaronmgdr aaronmgdr added this to the 5 - Celo MVP Mainnet milestone Nov 26, 2024
@aaronmgdr aaronmgdr self-assigned this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants