hashgraph / hedera-smart-contracts

Contains Hedera Smart Contract Service supporting files
Apache License 2.0
43 stars 53 forks source link

Precompile functions usage report #987

Open natanasow opened 1 week ago

natanasow commented 1 week ago

Problem

We should investigate how many times precompile functions are used in the current mainnet contracts, and how many transactions have interacted with the current contracts.

Solution

Disassemble contracts bytecode to find out calls to the 0x167, fetch the contract results for these contracts, and get the calls generated in the fetched transactions.

First part:

Second part:

Alternatives

No response

natanasow commented 1 week ago

Here is the PoC branch https://github.com/hashgraph/hedera-smart-contracts/tree/precompile-functions-usage-report/tools/analysis/precompile-contract-functions-analyzer