From 1d57bf5fd2bd5dcb771aee02f0e8a474934676f9 Mon Sep 17 00:00:00 2001 From: Mariano Conti Date: Thu, 14 Dec 2017 12:36:16 -0300 Subject: [PATCH 1/2] Add seth-verify --- libexec/seth/seth-verify | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 libexec/seth/seth-verify diff --git a/libexec/seth/seth-verify b/libexec/seth/seth-verify new file mode 100755 index 0000000..d454f67 --- /dev/null +++ b/libexec/seth/seth-verify @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +### seth-verify -- print the byteverify of an object on the blockchain +### 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 From 101c1e2ff63a193d1e8f7436f532fd7d705819a7 Mon Sep 17 00:00:00 2001 From: Mariano Conti Date: Thu, 14 Dec 2017 12:44:20 -0300 Subject: [PATCH 2/2] Fix usage --- libexec/seth/seth-verify | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/seth/seth-verify b/libexec/seth/seth-verify index d454f67..a150ec4 100755 --- a/libexec/seth/seth-verify +++ b/libexec/seth/seth-verify @@ -1,5 +1,5 @@ #!/usr/bin/env bash -### seth-verify -- print the byteverify of an object on the blockchain +### seth-verify -- verify a tx target and calldata ### Usage: seth verify ### ### Verify that hash in the blockchain corresponds to a transaction