Smart contracts written in Solidity manage assets, permissions, and irreversible state changes, which makes code generation both useful and security-critical. A new paper introduces RAPO-Sol (Retrieval-Augmented Preference Optimization) as an approach to repository-level Solidity code generation, a setting the authors describe as particularly challenging.
The work highlights the tension between generating functional code and ensuring safety in an environment where errors can be permanent. By combining retrieval augmentation with preference optimization, RAPO-Sol aims to improve a model's ability to produce correct, context-aware Solidity code across an entire repository.
The paper is announced on arXiv and does not provide full experimental details in the abstract, so results and comparisons are not yet available. The core contribution is the proposed method itself, positioned as a response to the unique demands of Solidity development.