successn printed
@@ -21,11 +21,20 @@ async function reason() {
let tx = await provider.getTransaction(hash)
if (!tx) {
console.log('tx not found')
+ } else {
+ //console.log('tx:', tx)
+
+ let receipt = await provider.getTransactionReceipt(hash)
+ //console.log('receipt:', receipt)
+
+ if (receipt.status) {
+ console.log('tx success')
} else {
let code = await provider.call(tx, tx.blockNumber)
let reason = hex_to_ascii(code.substr(138))
console.log('revert reason:', reason)
}
}
+}
reason()
\ No newline at end of file
