CCGRA: Smart Contract Code Comment Generation with Retrieval-enhanced Approach
Abstract
Smart contracts are self-executing programs on the blockchain that are critical to a range of industries, including finance, supply chain management, and healthcare.However, comprehending smart contracts can be challenging due to a lack of effective comments in most user-defined code.To address this challenge, we propose a novel retrieval-enhanced approach CC-GRA that leverages retrieval knowledge to generate high-quality comments for Solidity language code.Our approach carefully eliminates duplicated data and template data in the widely-used smart contract dataset to ensure a high-quality corpus.Extensive experiments and comprehensive analysis demonstrate the effectiveness applicability of our approach after being compared with eight state-of-the-art baselines.Finally, we conduct a human study and find the comment quality generated by our approach is better than baselines in terms of similarity, naturalness, and informativeness.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.