Bsc

是否可以辨識在 BSCScan API 中部署新令牌的事務?

  • July 9, 2021

我可以通過呼叫最後一個塊來訪問 BSCScan API 以獲取最後一筆交易:

https://api.bscscan.com/api?module=proxy&action=eth_blockNumber

結果:

{
"jsonrpc": "2.0",
"id": 83,
"result": "0x6d7138"
}

所以我再次呼叫 API 來查看最後一個塊交易(我認為它們是最後一個交易):

https://api.bscscan.com/api?module=proxy&action=eth_getBlockByNumber&tag=0x6d7138&boolean=true&apikey=<MY_API_KEY>

結果(部分):

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"difficulty": "0x2",
"extraData": "0xd883010006846765746888676f312e31352e35856c696e7578000000fc3ca6b721df73705c7a4c0c4c69bb9d443a2d9431d6af69efd3e88f707830c919b9d48c7ef50acea5401d3c4691d4f0dc04d49190ffdad766715e9197fcce8d5725adaa00",
"gasLimit": "0x2a9d887",
"gasUsed": "0x13577e6",
"hash": "0x814280a50dd15e2d7c577443755d8c4d04e06404bd34758457b491734ff6f5d6",
"logsBloom": "0x9e3723488f257d7cf2b31166985e0eefe9a672e0df0de2e62475a13080ba1744138376156a4c18487b0cf0ec60414533381f1504b32622054490f0c4f02713ec59c67c667ca8025283024c8c17770a24fb938f3c17c66a5eb236f6538ec7354c76e979bdb3cb1f49c70e0541c2674c914b1fb167ecbe97f08ff5035b1ca5636872e088a5c3060d0879d55c230102bcc44e2654870551c65e0d4b34644b877ef6f68c104c16c0c8ed6cc8a3e79bb89413099809daf3b41ae0c533c62829c9d0d4631d0ea3da800d136648b9d6629fd0bcee713850200001348814f95a31a1f88024d24c9304d5d80b09260e2616973af33ebe7f3acdd3567d224aa1de7ae784a8",
"miner": "0x70f657164e5b75689b64b7fd1fa275f334f28e18",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x6d6faa",
"parentHash": "0x145593cb7c173573753ecbf4edba0bb94e8c439c9a341a6f3ac8cd5a23dcd591",
"receiptsRoot": "0x19cfdd8c4e818197bd6d3fbee1b934628bf902c7979b03f6bec4ca83b4a185c5",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x12f01",
"stateRoot": "0x7ae1ef174f6c9333de03759f4384fdc36cf6cabc956727046c1279fc2576559d",
"timestamp": "0x60933ac2",
"totalDifficulty": "0xda5787",
"transactions": [
{
"blockHash": "0x814280a50dd15e2d7c577443755d8c4d04e06404bd34758457b491734ff6f5d6",
"blockNumber": "0x6d6faa",
"from": "0x000000a0c521dd28025b937b1f15141d61969959",
"gas": "0x493e0",
"gasPrice": "0x5d21dba00",
"hash": "0x5fdf16feb5d044603c821312e38b1db95a9f6bee35a012d08476d17a2a2ce538",
"input": "0x38ed17390000000000000000000000000000000000000000000000006c53ced68a312000000000000000000000000000000000000000000000000006abbea5d4c723400000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000a0c521dd28025b937b1f15141d619699590000000000000000000000000000000000000000000000000000000060933ac60000000000000000000000000000000000000000000000000000000000000002000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000007083609fce4d1d8dc0c979aab8c869ea2c873402",
"nonce": "0x3abdc",
"to": "0xc0788a3ad43d79aa53b09c2eacc313a787d1d607",
"transactionIndex": "0x0",
"value": "0x0",
"v": "0x93",
"r": "0x6912203611a43fb110b8b1f8057c8cd92fb893db706342bf380670fa9370700e",
"s": "0x1a90b45b8c0d602253281d32e512a594ec05697a4cf1ef6e227d0b5db9edc97c"
},

所以…可以檢查 TX 並告訴它是令牌部署嗎?我的目標是知道新令牌何時到達鏈上。

我找到了這種地址“契約創建”,但不知道它是什麼。

在此處輸入圖像描述

編輯

好吧..似乎我無法通過查看創建交易來弄清楚如何找到代幣合約地址。

在此處輸入圖像描述

在這裡,我可以看到 TX0xa675342c579fe2424be52b861bb9acd9acb6f98ff79eb99177000a2438b28487已創建契約0x0ff5c3bffea73b562a9ec897e78b6a650fafd104,但沒有引用塊中的此雜湊,7173853您可以在此處查看:https ://api.bscscan.com/api?module=proxy&action=eth_getBlockByNumber&tag=0x6D76DD&boolean=true

這裡查看並檢查此日誌此交易後,我很想得出結論,我只需要檢查交易數據。我總結我發現的所有合約部署數據都以“ 0x60806040527f76”開頭。

實際上……這是合約程式碼的開始……最像“pragma solidity bla bla bla”所以這必須是Solidity版本。

我發現契約部署的“TO”屬性為空……

您可以通過to欄位找到合約創建交易:這始終null用於合約創建。

完成此步驟後,您應該獲得包含合約地址的合約創建交易的交易收據:https ://api.bscscan.com/api?module=proxy&action=eth_getTransactionReceipt&txhash=0xa675342c579fe2424be52b861bb9acd9acb6f98ff79eb99177000a2438b28487

引用自:https://ethereum.stackexchange.com/questions/98401