Giter VIP home page Giter VIP logo

Comments (13)

nanexcool avatar nanexcool commented on August 22, 2024 1

Found it! It's in a branch on the old seth repo: https://github.com/dapphub/seth/tree/verify

seth-verify

#!/usr/bin/env bash
### seth-verify -- verify a tx target and calldata
### Usage: seth verify <tx> <target> <calldata>
###
### Verify that <tx> hash in the blockchain corresponds to a transaction
### sent to address <target> with <calldata>
### 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

from dapptools.

mbrock avatar mbrock commented on August 22, 2024

Comment by dbrock
Friday Nov 17, 2017 at 23:56 GMT


Ah, interesting.

You can achieve this quite easily by doing seth tx $txhash data and comparing it to seth calldata ... (for example by piping both commands into a hash function like shasum).

from dapptools.

mbrock avatar mbrock commented on August 22, 2024

Comment by dbrock
Friday Nov 17, 2017 at 23:58 GMT


Or just [[ $(seth tx $txhash data) = $(seth calldata $txcalldata) ]] && echo ok || echo no

from dapptools.

mbrock avatar mbrock commented on August 22, 2024

Comment by dbrock
Monday Dec 11, 2017 at 08:47 GMT


But I like seth verify.

Should it be seth verify <tx> <target> <calldata>...?

from dapptools.

mbrock avatar mbrock commented on August 22, 2024

Comment by dbrock
Monday Dec 11, 2017 at 08:50 GMT


So instead of

seth -verify 0x036ae8fa1a31e36787f524e3ac21ec2fa44d3b0ff9bcf3fdd3a7933498a18095 $(seth calldata 'transfer(address, uint256)' 1dacd2508778b5caebe71f86f646793acfe22b89 $(seth --to-uint256 1501933000000))

it would be if target is 0x3465e8fa1a31e36787f524e3ac21ec2fa44d3b05

seth verify 0x036ae8fa1a31e36787f524e3ac21ec2fa44d3b0ff9bcf3fdd3a7933498a18095 0x3465e8fa1a31e36787f524e3ac21ec2fa44d3b05 'transfer(address, uint256)' 1dacd2508778b5caebe71f86f646793acfe22b89 $(seth --to-uint256 1501933000000)

from dapptools.

mbrock avatar mbrock commented on August 22, 2024

Comment by kennyrowe
Monday Dec 11, 2017 at 17:56 GMT


So this would verify the bytes as well as the recipient of those
byets. Yeah that's a good idea

On Mon, Dec 11, 2017 at 12:50 AM, Daniel Brockman [email protected]
wrote:

So instead of

seth -verify 0x036ae8fa1a31e36787f524e3ac21ec2fa44d3b0ff9bcf3fdd3a7933498a18095
$(seth calldata 'transfer(address, uint256)' 1dacd2508778b5caebe71f86f646793acfe22b89
$(seth --to-uint256 1501933000000))

it would be if target is 0x3465e8fa1a31e36787f524e3ac21ec2fa44d3b05

seth verify 0x036ae8fa1a31e36787f524e3ac21ec2fa44d3b0ff9bcf3fdd3a7933498a18095
0x3465e8fa1a31e36787f524e3ac21ec2fa44d3b05 'transfer(address, uint256)'
1dacd2508778b5caebe71f86f646793acfe22b89 $(seth --to-uint256
1501933000000)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
dapphub/seth#20 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGAAnCc_qtXgUHuWoQCD8lkcchSL9EILks5s_OzmgaJpZM4QhHxL
.

from dapptools.

mbrock avatar mbrock commented on August 22, 2024

Comment by nanexcool
Thursday Dec 14, 2017 at 15:38 GMT


@kennyrowe @dbrock something like this? #23

Tested with this tx https://etherscan.io/tx/0xb71d37280e224dfdc6f14840a1d4f05893731832ae9ba279f4d3448e4f3ad094
seth -C ethlive verify 0xb71d37280e224dfdc6f14840a1d4f05893731832ae9ba279f4d3448e4f3ad094 0x137fdd00e9a866631d8daf1a2116fb8df1ed07a7 'post(uint128,uint32,address)' $(seth --to-word $(seth --to-wei 683.947 eth)) $(seth --to-word 1513282889) 0x729d19f657bd0614b4985cf1d82531c67569197b
true

from dapptools.

mbrock avatar mbrock commented on August 22, 2024

Comment by nanexcool
Thursday Dec 14, 2017 at 16:18 GMT


Will not work for contract creation though... do we want it to?

from dapptools.

mbrock avatar mbrock commented on August 22, 2024

Comment by kennyrowe
Thursday Dec 14, 2017 at 23:36 GMT


I think contact verification is a different problem. Might be interesting but a separate issue

from dapptools.

mbrock avatar mbrock commented on August 22, 2024

Comment by nanexcool
Thursday Dec 14, 2017 at 23:45 GMT


I just remembered for contract creation checking there's dapp verify which makes a nice symmetry.

from dapptools.

asymmetric avatar asymmetric commented on August 22, 2024

@nanexcool did you implement this?

from dapptools.

nanexcool avatar nanexcool commented on August 22, 2024

I did, it was a while ago though...

from dapptools.

asymmetric avatar asymmetric commented on August 22, 2024

Is it posted anywhere?

from dapptools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.