8000 Isn't there support for smart contracts with assembly code? · Issue #2 · Decurity/tx-coverage · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Isn't there support for smart contracts with assembly code? #2

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

Open
caiosabarros opened this issue Apr 25, 2024 · 2 comments
Open

Isn't there support for smart contracts with assembly code? #2

caiosabarros opened this issue Apr 25, 2024 · 2 comments

Comments

@caiosabarros
Copy link

I run the following to fetch for txs for a contract on mainnet:

$ tx-coverage 0x2A8e1E676Ec238d8A992307B495b45B3fEAa5e86 --dune-api-key API_KEY --rpc-url RPC_URL

and got on my shell:

[] Compiling...
[] Compiling 1 files with 0.5.11
[] Solc 0.5.11 finished in 75.27ms
Compiler run successful!
Error:
inline assembly block with no AST attribute

Is support for assembly codes a feasible feature? Or is it a bug with this specific contract? Currently almost all contracts have assembly code as the majority of them inherit from OZ contracts, so it'd be cool if that could be added.

Thanks for the tool, it is impressive!

@Raz0r
Copy link
Contributor
Raz0r commented Apr 25, 2024

It seems that older versions of solc do not provide AST for inline assembly, on newer versions (presumably >0.6.0) it works:

tx-coverage 0xa88800cd213da5ae406ce248380802bd53b47647
[⠊] Compiling...
[⠰] Compiling 24 files with 0.8.17
[⠔] Solc 0.8.17 finished in 303.52ms
Compiler run successful!
Fetching transaction hashes for address: 0xa88800cd213da5ae406ce248380802bd53b47647
Found 100 transaction hashes
⠤ [00:12:18] [####################################################################] 100/100 tx (0.0s)Wrote LCOV report.
| File                              | % Lines         | % Statements    | % Branches     | % Funcs        |
|-----------------------------------|-----------------|-----------------|----------------|----------------|
| src/FeeBank.sol                   | 0.00% (0/22)    | 0.00% (0/32)    | 100.00% (0/0)  | 0.00% (0/10)   |
| src/FeeBankCharger.sol            | 9.09% (1/11)    | 8.33% (1/12)    | 0.00% (0/4)    | 25.00% (1/4)   |
| src/Settlement.sol                | 88.46% (23/26)  | 86.11% (31/36)  | 62.50% (5/8)   | 100.00% (3/3)  |
| src/libraries/Address.sol         | 25.00% (1/4)    | 20.00% (2/10)   | 100.00% (0/0)  | 25.00% (1/4)   |
| src/libraries/DynamicSuffix.sol   | 100.00% (5/5)   | 100.00% (5/5)   | 100.00% (0/0)  | 100.00% (1/1)  |
| src/libraries/OrderSaltParser.sol | 80.00% (4/5)    | 80.00% (8/10)   | 100.00% (0/0)  | 80.00% (4/5)   |
| src/libraries/OrderSuffix.sol     | 78.26% (18/23)  | 68.18% (15/22)  | 55.56% (5/9)   | 100.00% (3/3)  |
| src/libraries/TakingFee.sol       | 16.67% (1/6)    | 16.67% (2/12)   | 0.00% (0/2)    | 25.00% (1/4)   |
| Total                             | 51.96% (53/102) | 46.04% (64/139) | 43.48% (10/23) | 41.18% (14/34) |

@caiosabarros
Copy link
Author

Oh, awesome! Didn't know that AST was not provided for earlier versions of solc. Will use it on the right versions.
Thank you very much! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0