SolMover: Feasibility of Using LLMs for Translating Smart Contracts
Abstract
Large language models (LLMs) have showcased remarkable skills, rivaling or even exceeding human intelligence in certain areas. Their proficiency in translation is notable, as they may replicate the nuanced, preparatory steps of human translators for high-quality outcomes. Although there have been some notable work exploring using LLMs for code to code translation, there has not been one for smart contracts, especially when a target language is unseen to the LLM. In this work, we aim to introduce our novel framework SolMover consisting of two different LLMs working in tandem in a framework to understand coding concepts and then use that to translate code to an unseen language. We explore the human-like learning capability of LLMs in this paper with a detailed evaluation of the methodology to translate existing smart contracts from Solidity to a low-resource one called Move. Specifically, we enable one LLM to understand coding rules for the new language to generate a planning task, for the second LLM to follow, which does not have planning capability but does have coding. Experiments show that SolMOver brings significant improvement over gpt-3.5-turbo-1106 and outperforms both Palm2 and Mixtral-8x7B-Instruct. Our further analysis shows us that employing our bug mitigation technique even without the framework still improves code quality for all models.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.