Closed cdump closed 2 days ago
Hey @cdump thanks for sending this, I'll take a look when I have some time. Glad to see that you have included it in your benchmark 🙏🏼.
If you know a better way to get function selectors (or maybe arguments too, but without using an external 4bytes database), feel free to contact me. Currently, I'm using it this way: https://github.com/cdump/evmole/blob/master/benchmark/providers/sevm/main.mjs#L21
That's perfect, this doesn't use any external 4byte database. See for example https://github.com/acuarica/evm/blob/8b58da73a6364e870b0be0f2f452e69d8989f3b2/bin/sevm.mjs#L247-L252
The 4byte external lookup is decoupled from the main library through the patch
method https://acuarica.github.io/evm/tsdoc/classes/index.Contract.html#patch.
Regarding the selectors detection, this is what sevm
roughly does https://acuarica.github.io/evm/#/internals?id=detection-of-function-selectors. Hope it helps.
> new (await import("sevm")).Contract('0x60016101111b5ffd')
Error: Val is a not a valid unsigned 256-word: 15177100720513508366558296147058741458143803430094840009779784451085189728165691392
at new Val (/app/node_modules/sevm/dist/src/ast/index.js:117:19)
at Shl.eval (/app/node_modules/sevm/dist/src/ast/alu.js:274:47)
...
[00] PUSH1 01
[02] PUSH2 0111
[05] SHL
[06] PUSH0
[07] REVERT
doc: value << shift: the shifted value. If shift is bigger than 255, returns 0.
Thanks for finding this example. It should be fixed in the latest release https://github.com/acuarica/evm/releases/tag/v0.6.18.
Looks like fixed - https://github.com/cdump/evmole/commit/e59004f48a320955c65828825a26ebd75dd21392 But there are still some other errors in random50k & vyper datatests, you can find it yourself by following my steps from the 1st post in this issue
Hey, great project!
I've added it to my EVMole benchmarks here and found that there are errors in some contracts.
To find contracts with errors and reproduce:
You can also see the random50k and vyper datasets in the same way.
P.S. If you know a better way to get function selectors (or maybe arguments too, but without using an external 4bytes database), feel free to contact me. Currently, I'm using it this way: https://github.com/cdump/evmole/blob/master/benchmark/providers/sevm/main.mjs#L21