2

I have access to the BSCScan API to take last transactions by calling for the last block:

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

Result:

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

So I call the API again to see last block transactions (I presume they are the last transactions at all):

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

Result (partial):

{
"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"
},

So ... is possible to check that TX and tell it is a token deploy? My goal is to know when a new token arrives on the chain.

I found this kind of address "Contract Creation" but don't know what is it.

enter image description here

EDIT

Well.. seems I can't figure out how to find the token contract address by looking the creation transaction.

enter image description here

Here I can see the TX 0xa675342c579fe2424be52b861bb9acd9acb6f98ff79eb99177000a2438b28487 was creted the contract 0x0ff5c3bffea73b562a9ec897e78b6a650fafd104 but there is no reference to this hash in block 7173853 as you can check here: https://api.bscscan.com/api?module=proxy&action=eth_getBlockByNumber&tag=0x6D76DD&boolean=true

2

After give a look here and check this log and this transaction I tempted to conclude I'm just need to check the data of transaction. I conclude all contract deployment data I found starts with "0x60806040527f76".

Actually.... this is the start of the contract code...most like "pragma solidity bla bla bla" so this must be the Solidity version.

I discovered the "TO" attribute is null for contract deployments ...

1
  • I'm stuck here. I have no way to link the transaction that created the token with the token contract address. – Magno C May 6 at 2:33
0

You can find contract creation transaction by the to field: this is always null for contract creation.

After this step you should get the transaction receipt of the contract creation transaction which contains the contract address: https://api.bscscan.com/api?module=proxy&action=eth_getTransactionReceipt&txhash=0xa675342c579fe2424be52b861bb9acd9acb6f98ff79eb99177000a2438b28487

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.