Comments (13)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
@nanexcool did you implement this?
from dapptools.
I did, it was a while ago though...
from dapptools.
Is it posted anywhere?
from dapptools.
Related Issues (20)
- Negative signed integers always one less when logged
- Development of HEVM will continue? HOT 3
- License seems very ambiguous. HOT 1
- hevm VMFailure when following dapp tutorial symbolic execution HOT 5
- seth output error HOT 5
- Ledger -- ethsign: failed to sign tx HOT 1
- contract not found HOT 1
- hevm: XXXX: openBinaryFile: does not exist (No such file or directory)
- Octo-dapp
- error: Please run this script as a regular user when installing in an Image via Dockerfile
- stuck installing "EVM.FeeSchedule" on OSX at 100% CPU HOT 3
- Slow symbolic execution of the first example for `PrimalityCheck` HOT 1
- ethsign import error HOT 1
- Dapptools on Raspberry Pi 4
- Incorrect logs emitted when downcasting to `bytes2` or `bytes1` HOT 1
- Can not install dapp by nix on mac HOT 1
- Is it possible to deploy a bin file directly and easily with dapptools?
- Insufficient funds for gas * price + value HOT 4
- No support for aarch64 darwin via flakes
- Getting `Internal Error` For Different Commands When Trying To Execute Symbolic On Live Contracts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dapptools.