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

The RGB++ lock's balance of RUSD is incorrect #812

Open
duanyytop opened this issue Jan 15, 2025 · 3 comments
Open

The RGB++ lock's balance of RUSD is incorrect #812

duanyytop opened this issue Jan 15, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@duanyytop
Copy link

duanyytop commented Jan 15, 2025

The RUSD balance of tb1qvt7p9g6mw70sealdewtfp0sekquxuru6j3gwmt is incorrect.

The result of btc-asset-api

{
    "address": "tb1qvt7p9g6mw70sealdewtfp0sekquxuru6j3gwmt",
    "xudt": [
        {
            "symbol": "RUSD",
            "name": "RUSD",
            "decimal": 8,
            "type_hash": "0x45b32a2bc4285d0a09678eb11960ddc8707bc2779887a09d482e9bfe9a2cdf52",
            "type_script": {
                "codeHash": "0x1142755a044bf2ee358cba9f2da187ce928c91cd4dc8692ded0337efa677d21a",
                "args": "0x878fcc6f1f08d48e87bb1c3b3d5083f23f8a39c5d5c764f253b55b998526439b",
                "hashType": "type"
            },
            // 0.09 RUSD
            "total_amount": "0x895440",
            "available_amount": "0x895440",
            "pending_amount": "0x0"
        }
    ]
}

The result of CKB Explorer

image

Analysis

The 0.2RUSD is from https://testnet.explorer.nervos.org/transaction/0xf6ecdb4471769de317791782c7dfd0cc5f69ced93f33035a662e893b840f509b#0, but the corresponding BTC UTXO is spent.

So the correct balance of RUSD is 0.09RUSD.

@duanyytop duanyytop added the bug Something isn't working label Jan 15, 2025
@poor-defined poor-defined moved this to 📌CurrentWeek in CKB Explorer Jan 17, 2025
@poor-defined
Copy link
Contributor

Got it , will check it soon.
Its status should not be "Live Cell"

Image

@rabbitz Please check.

@rabbitz
Copy link

rabbitz commented Jan 17, 2025

ckt1qpsu57j8j6jwkxw2fuxsvh9ekyxaeuqz7y8hewupp3cxed4mtseysqgpqqqqpmedfcp8070wvqp4vv285nd00pphtjldwra2ayhx5hd0jh4f7wdspyrdkm get_cells

{
    "jsonrpc": "2.0",
    "result": {
        "last_cursor": "0x4061ca7a4796a4eb19ca4f0d065cb9b10ddcf002f10f7cbb810c706cb6bb5c32480101000000ef2d4e0277f9ee6003563147a4daf784375cbed70faae92e6a5daf95ea9f39b00000000000f0769a0000000400000000",
        "objects": [{
            "block_number": "0xf0769a",
            "out_point": {
                "index": "0x0",
                "tx_hash": "0xf6ecdb4471769de317791782c7dfd0cc5f69ced93f33035a662e893b840f509b"
            },
            "output": {
                "capacity": "0x5e3ff5d00",
                "lock": {
                    "args": "0x01000000ef2d4e0277f9ee6003563147a4daf784375cbed70faae92e6a5daf95ea9f39b0",
                    "code_hash": "0x61ca7a4796a4eb19ca4f0d065cb9b10ddcf002f10f7cbb810c706cb6bb5c3248",
                    "hash_type": "type"
                },
                "type": {
                    "args": "0x878fcc6f1f08d48e87bb1c3b3d5083f23f8a39c5d5c764f253b55b998526439b",
                    "code_hash": "0x1142755a044bf2ee358cba9f2da187ce928c91cd4dc8692ded0337efa677d21a",
                    "hash_type": "type"
                }
            },
            "output_data": "0x002d3101000000000000000000000000",
            "tx_index": "0x4"
        }]
    },
    "id": 2
}

0xf6ecdb4471769de317791782c7dfd0cc5f69ced93f33035a662e893b840f509b:0 should be a live cell

@poor-defined
Copy link
Contributor

There're two issues here:

  1. The BTC push service is unresponsive;
  2. The RGB++ tab in the frontend has an issue with RUSD statistics calculation. The original issue is likely caused by this.
    所以这里有两个问题:
  3. BTC 的推送服务没有响应;
  4. 前端的 RGB++ tab 的 RUSD 统计计算。本 issue 原来应该就是这个造成的。

FYI, @FrederLu reproduced it:
Manually executing it updates the data.
FYI, @FrederLu 这边复现了一下:
手动执行后数据会更新数据

curl --location 'https://testnet-api.explorer.nervos.org/api/v2/bitcoin_vouts/verify' \
--header 'Content-Type: application/json' \
--data '{
    "outpoint": {
        "tx_hash": "0xcb98094a7b04039ce9f0407e320092093d14cc3d7a643eb835673938ff279a54",
        "index": 0
    },
    "consumed_by": {
        "txid": "3dba769f99e612a805eacbe98710ef32bed3fe8f7976566911327532792ea861",
        "vin": {
            "txid": "ae06fd82c3ca780cb2fe85a371fb5a3ff847875dd27f6f97e08201b115601de3",
            "index": 0
        }
    }
}'
https://testnet.explorer.nervos.org/address/tb1qy69508yfgydz27q2vg9dml9xtsxva2v85n9k6y

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📌CurrentWeek
Development

No branches or pull requests

4 participants