On BSC chain, this transaction is minting an NFT(MstToken). The evm trace shows it called MstToken.transferFrom(fromUser, ..., 0x30927f74c9de0000)
to send out 0x30927f74c9de0000 token and it succeeded, the return value is 1:
{
"type": "CALL",
...
"calls": [
{
"type": "DELEGATECALL",
...
"calls": [
{
"type": "CALL", // <-- `transferFrom(user, ..., 0x30927f74c9de0000)`, returns true
...
"input": "0x23b872dd0000000000000000000000009b57b60f14fea2b9889f203ed29db879060147dc000000000000000000000000edc7fd964385ee96b8e2447e2d0e9fd8decad30000000000000000000000000000000000000000000000000030927f74c9de0000",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
{
"type": "CALL",
But when I query the balance of that block from archive node, it shows only 0x13d7adaac0a4940f, less than 0x30927f74c9de0000. My code in Golang:
client, _ := ethclient.Dial("wss://archive_node_url")
// token address
MstAddress := common.HexToAddress("0xe7af3fcc9cb79243f76947402117d98918bd88ea")
blockNum := big.NewInt(17453505)
userAddress := common.HexToAddress("0x9b57b60f14fea2b9889f203ed29db879060147dc")
mst, _ := erc20.NewErc20(MstAddress, client)
balance, _ := mst.BalanceOf(&bind.CallOpts{
BlockNumber: blockNum,
}, userAddress)
fmt.Println(balance)
I thought maybe the user send two transactions at same block, first sending some token to it and then mints. But I check on that block number, there seems only one tx from the user.
What do I miss?