Smart contracts have transformed decentralized finance, but flaws in their logic still create major security threats. Most existing vulnerability detection techniques focus on well-supported languages like Solidity, while low-resource counterparts such as Vyper remain largely underexplored due to scarce analysis tools and limited labeled datasets. Training a robust detection model directly on Vyper is particularly challenging, as collecting sufficiently large and diverse Vyper training datasets is difficult in practice. To address this gap, we introduce Sol2Vy, a novel framework that enables cross-language knowledge transfer from Solidity to Vyper, allowing vulnerability detection on Vyper using models trained exclusively on Solidity. This approach eliminates the need for extensive labeled Vyper datasets typically required to build a robust vulnerability detection model. We implement and evaluate Sol2Vy on various critical vulnerability types, including reentrancy, weak randomness, and unchecked transfer. Experimental results show that Sol2Vy, despite being trained exclusively on Solidity, achieves strong detection performance on Vyper contracts and significantly outperforms prior state-of-the-art methods.
翻译:智能合约已彻底改变去中心化金融生态,但其逻辑漏洞仍构成重大安全威胁。现有漏洞检测技术主要面向Solidity等主流语言,而Vyper等低资源语言因缺乏分析工具和标注数据集而鲜有研究。直接在Vyper上训练鲁棒检测模型面临特殊挑战:实践中难以收集规模充足且多样性高的Vyper训练数据集。为填补这一空白,我们提出Sol2Vy——一种实现从Solidity到Vyper跨语言知识迁移的新型框架,允许使用仅通过Solidity训练的模型对Vyper合约进行漏洞检测。该方法无需构建鲁棒漏洞检测模型通常所需的大量标注Vyper数据集。我们在重入攻击、弱随机性、未校验转账等关键漏洞类型上实现了Sol2Vy并开展评估。实验结果表明,尽管仅基于Solidity训练,Sol2Vy仍能在Vyper合约上实现优异的检测性能,并显著超越现有最优方法。