// Log("----------------", decodedCalldata["funcName"], "----------------", "#FF0000")
arrLog.push("----------------" + decodedCalldata["funcName"] + "----------------" + "#FF0000")
for (var key in decodedCalldata["args"]) {
// Log(key, decodedCalldata["args"][key])
arrLog.push(key + ": " + JSON.stringify(decodedCalldata["args"][key]))
}
}
// Output logs
for (var logIdx = arrLog.length - 1; logIdx >= 0; logIdx--) {
Log(arrLog[logIdx])
}
}
getTransactionCounter++
}
recv = obj
} else if (data == null) {
msg = "The buffer queue is empty, time:" + _D()
}
LogStatus(_D(), ", msg:", msg, ", recv:", recv)
}
}
fonction onexit (() {
Log ((
fonction onerror (() {
Log ((
for (var logIdx = arrLog.length - 1; logIdx >= 0; logIdx--) {
Log(arrLog[logIdx])
}
}
Create a live trading to test:
```run
2023-06-20 17:01:00 Info ----------------0x5288a7bd6e0f57162ca763df722de73793e542734d7d2b7af5755664e2e67910/multicall----------------
2023-06-20 17:01:00 Info 0x851b594033d57c98af753bcb3a7d0237a615de32 -> 0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45
2023-06-20 17:01:00 Info ----------------exactInputSingle----------------
2023-06-20 17:01:00 Info params: {"tokenOut":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","fee":"10000","recipient":"0x0000000000000000000000000000000000000002","amountIn":"8952087000296027130940868","amountOutMinimum":"41638694112306829","sqrtPriceLimitX96":"0","tokenIn":"0xe1283567345349942acdfad3692924a1b16cf3cc"}
2023-06-20 17:01:00 Info ----------------unwrapWETH9----------------
2023-06-20 17:01:00 Info amountMinimum: "41638694112306829"
2023-06-20 17:01:00 Info recipient: "0x851b594033d57c98af753bcb3a7d0237a615de32"
2023-06-20 16:59:03 Info ----------------0x55e0c4a38a17d3aa6e8f558a66c77e9defa9f8f6e347536363ac1b921de9aaf3/multicall----------------
2023-06-20 16:59:03 Info 0x27457ada2dd725c7d0f28e1737bdd0bf583c0f0b -> 0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45
2023-06-20 16:59:03 Info ----------------swapExactTokensForTokens----------------
2023-06-20 16:59:03 Info amountIn: "816769666850161"
2023-06-20 16:59:03 Info amountOutMin: "40404501509302321"
2023-06-20 16:59:03 Info path: ["0x7863e06bca47ded821fcb53ab788eeb371243eda","0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"]
2023-06-20 16:59:03 Info to: "0x27457ada2dd725c7d0f28e1737bdd0bf583c0f0b"
2023-06-20 16:58:25 Info sigHash: 0x5ae401dc
Capture d'écran:
Vous pouvez voir que le Hash de transaction est0x5288a7bd6e0f57162ca763df722de73793e542734d7d2b7af5755664e2e67910
pour cette transaction, et les données d'entrée contiennent l'appel à unemulticall
Cette transaction est envoyée dans la direction: 0x851b594033d57c98af753bcb3a7d0237a615de32 -> 0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45.0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45
est l'adresse du contrat de routeur d'Uniswap.
Lemulticall
le paquet est analysé pour appeler le contratexactInputSingle
etunwrapWETH9
les méthodes et les paramètres spécifiques de ces méthodes.
----------------exactInputSingle----------------
params: {
"tokenOut":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"fee":"10000",
"recipient":"0x0000000000000000000000000000000000000002",
"amountIn":"8952087000296027130940868",
"amountOutMinimum":"41638694112306829",
"sqrtPriceLimitX96":"0",
"tokenIn":"0xe1283567345349942acdfad3692924a1b16cf3cc"
}
----------------unwrapWETH9----------------
amountMinimum: "41638694112306829"
recipient: "0x851b594033d57c98af753bcb3a7d0237a615de32"
Si vous êtes intéressé, vous pouvez modifier et étendre l'exemple basé sur elle pour surveiller plus de transactions et analyser ces opérations sur la chaîne.