-
-
Save jochenonline/1827d2898efbf9d953dbadff5cec684b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Fetching revert reason -- https://ethereum.stackexchange.com/questions/48383/how-to-receive-revert-reason-for-past-transactions | |
if [ -z "$1" ] | |
then | |
echo "Usage: revert-reason <TX_HASH>" | |
exit | |
fi | |
TX=$1 | |
SCRIPT=" tx = eth.getTransaction( \"$TX\" ); tx.data = tx.input; eth.call(tx, tx.blockNumber)" | |
geth --exec "$SCRIPT" attach http://localhost:8545 | cut -d '"' -f 2 | cut -c139- | xxd -r -p | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment