-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[Bug]: Wrong token amount for vUSDC minting and withdrawing on Venus #26521
Comments
After debugging I found that issue in this case is simulation api returning erroneous data. |
When querying token balances via RPC calls (e.g., Affected Chains (so far):
Example from BNB Chain: curl 'https://bsc-dataseed1.binance.org/' \
// headers removed for brevity
--data-raw '{"jsonrpc":"2.0","id":169618779484965,"method":"eth_call","params":[{"from":"0x0000000000000000000000000000000000000000","data":"0x70a082310000000000000000000000003424b949dbc5d2d2654cb6fc622c4d723b2e8fb4","to":"0xeca88125a5adbe82614ffc12d0db554e2e2867c8"},"latest"]}' Response: {"jsonrpc":"2.0","id":169618779484965,"result":"0x000000000000000000000000000000000000000000000000000000134c31d25200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}
Verification of contract code: The smart contract implementation of The balance reported by block explorers (e.g., BscScan) matches the decoded value from the first 32 bytes of the RPC response AnalysisThe issue likely stems from the RPC node implementation or configuration, not from the client, simulations api, or smart contracts themselves The problem affecting multiple chains suggests it might be related to common infrastructure or software these chains are using. Next steps
|
Nick Hewitt noticed that if you go to the debugger it shows the raw output which matches geth:
|
… changes (#4775) ## Explanation * Use contract abi's to decode the amounts of token balance changes – instead of the raw output from a balanceOf call. ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> * Fixes: MetaMask/metamask-extension#26521 ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/transaction-controller` - **FIXED**: Use contract abi's to decode the amounts of token balance changes – instead of the raw output from a balanceOf call. ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
Describe the bug
Wrong token amount and fiat price displayed for minting and withdrawing vUSDC on Venus
Expected behavior
Display accurate token amount and fiat price for vUSDC - currently 1 USDC = 41.131844 vUSDC
Screenshots/Recordings
Steps to reproduce
Error messages or log output
No response
Detection stage
In production (default)
Version
12.0.0
Build type
None
Browser
Brave
Operating system
MacOS
Hardware wallet
No response
Additional context
No response
Severity
No response
The text was updated successfully, but these errors were encountered: