-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can add detect function support payable ? #6
Comments
It's trivial (at least for Solidity). I'll add this to the backlog and implement it later. |
Maybe we can consider prioritizing this? This helps generate a somehow "full" abi. |
I can help implement this so that evmole can return a full |
Do you want to return https://docs.rs/alloy-json-abi/0.8.0/alloy_json_abi/struct.Function.html ? If yes, what about |
Oh, you are correct. My own code always ignores this field so I forget this. Maybe another standalone function to return if a selector is |
I've conducted some experiments in the state_mutability branch, the main idea is described here (typo: it's Using the We need to explore alternative approaches. P.S. In modern Vyper, we can extract this information from metadata, but let's focus on solving the Solidity issue first. |
I've added normal benchmark to 'state_mutability' branch, current results: 'simple' always returns 'nonpayable' strict cmp ('view' != 'nonpayable'):
non-strict cmp ('view' and 'pure' == 'nonpayable') - source
|
My two cents: to increase precision, we should firstly decode abi and ensure the call data conforms with abi?
Why the precision is just 60%? Your algorithm seems good and reasonable.
…________________________________
From: Maxim Andreev ***@***.***>
Sent: Wednesday, August 28, 2024 5:05:57 PM
To: cdump/evmole ***@***.***>
Cc: lazymio ***@***.***>; Comment ***@***.***>
Subject: Re: [cdump/evmole] Can add detect function support payable ? (Issue #6)
I've added normal benchmark to 'state_mutability' branch, current results:
'simple' always returns 'nonpayable'
strict cmp ('view' != 'nonpayable'):
dataset largest1k (1000 contracts, 24427 functions), evmole-rs:
bad: 20846 functions 85.34%
dataset largest1k (1000 contracts, 24427 functions), heimdall-rs:
bad: 13403 functions 54.87%
dataset largest1k (1000 contracts, 24427 functions), sevm:
bad: 14417 functions 59.02%
dataset largest1k (1000 contracts, 24427 functions), simple:
bad: 14864 functions 60.85%
non-strict cmp ('view' and 'pure' == 'nonpayable') - fda622a#diff-11f0a34f6da0d500562ceadaae6abfb4f9c2dd2ae5ff01ffd0e879e35ab70bdeR242<fda622a#diff-11f0a34f6da0d500562ceadaae6abfb4f9c2dd2ae5ff01ffd0e879e35ab70bdeR242>
dataset largest1k (1000 contracts, 24427 functions), evmole-rs:
bad: 16177 functions 66.23%
dataset largest1k (1000 contracts, 24427 functions), heimdall-rs:
bad: 6201 functions 25.39%
dataset largest1k (1000 contracts, 24427 functions), sevm:
bad: 501 functions 2.05%
dataset largest1k (1000 contracts, 24427 functions), simple:
bad: 643 functions 2.63%
$ cd benchmarks/
$ DATASETS=largest1k PROVIDERS_MUTABILITY="evmole-rs sevm heimdall-rs" make benchmark-mutability
$ python3 ./compare.py --datasets largest1k --mode mutability
―
Reply to this email directly, view it on GitHub<#6 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHJULOZB25OC3YF3NWJRQCLZTWHHLAVCNFSM6AAAAABLX7YONKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJUG42TQMJZGU>.
You are receiving this because you commented.Message ID: ***@***.***>
|
I found a bug - we need to track reverts even inside 'skip_until_inside_function', because if all functions are not payable, then Solidity checks CALLVALUE at the beginning of the contract execution. |
Bug was about location of this check - at the begging of the whole contract or after checking for function selector - inside function body |
Yes, I misunderstood.
…________________________________
From: Maxim Andreev ***@***.***>
Sent: Wednesday, August 28, 2024 5:47:43 PM
To: cdump/evmole ***@***.***>
Cc: lazymio ***@***.***>; Comment ***@***.***>
Subject: Re: [cdump/evmole] Can add detect function support payable ? (Issue #6)
Bug was about location of this check - at the begging of the whole contract or after checking for function selector - inside function body
―
Reply to this email directly, view it on GitHub<#6 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHJULO2V6XTEIYXQXEWKZYTZTWMD7AVCNFSM6AAAAABLX7YONKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJUHA2DSMRTHE>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Now results are even better: |
Merged to the master, will make release soon |
thanks
The text was updated successfully, but these errors were encountered: