The present disclosure relates to a method and system to automatically synthesize smart contracts using transaction traces. The present disclosure suggests collecting transaction trace raw data from a blockchain network and transmitting the transaction trace raw data obtained to a transaction decoder system for initial data preprocessing. Thereafter, call frames are extracted from the transaction trace raw data and a Depth-First Search (DFS) traversal is performed on the extracted call frames. Subsequently, at each step of the DFS traversal, the contract address associated (that is, “to” address) with the extracted call frame is verified to determine if it is known or unknown to Etherscan data. Further, the present disclosure suggests collecting top-level calls within the child call frames when the contract address is unknown in the call frame and adding them to the contract as function definitions.
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.
KUMARESAN, RANJIT, "METHOD AND SYSTEM TO AUTOMATICALLY SYNTHESIZE SMART CONTRACTS USING TRANSACTION TRACES", Technical Disclosure Commons, (October 23, 2023)