diff --git a/libexec/seth/seth-verify b/libexec/seth/seth-verify new file mode 100755 index 0000000..a150ec4 --- /dev/null +++ b/libexec/seth/seth-verify @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +### seth-verify -- verify a tx target and calldata +### Usage: seth verify +### +### Verify that hash in the blockchain corresponds to a transaction +### sent to address with +### Returns true or false (and fails) +set -e +[[ $# -ge 3 ]] || seth --fail-usage "$0" +tx=$(seth tx "$1") +input=$(seth --field input <<<"$tx") +to=$(seth --field to <<<"$tx") +calldata=$(seth calldata "${@:3}") +[[ $2 == $to ]] && [[ $calldata == $input ]] && exec echo true +echo false +exit 1 \ No newline at end of file