Smart contracts are small but highly error-prone programs that implement agreements between multiple parties. We present a reactive synthesis approach for the automatic construction of smart contract state machines. Towards this end, we extend temporal stream logic (TSL) with universally quantified parameters over infinite domains. Parameterized TSL is a convenient logic to specify the temporal control flow, i.e., the correct order of transactions, as well as the data flow of the contract's fields. We develop a two-step approach that 1) synthesizes a finite representation of the - in general - infinite-state system and 2) splits the system into a compact hierarchical architecture that enables efficient handling of the state machine in Solidity. We implement the approach in our tool ScSynt, which leverages efficient symbolic algorithms based on the observation that smart contract specifications naturally fall into the safety fragment. As a result, ScSynt synthesizes correct-by-design Solidity code from various specifications within seconds.
翻译:智能合同是执行多个当事方之间协议的小型但高度容易出错的方案。 我们为自动建造智能合同状态机器提供了一种反应式综合方法。 为此,我们扩展了时间流逻辑(TSL),在无限域上提供了普遍量化参数。 参数化的TSL是一种方便的逻辑,可以指定时间控制流程,即交易的正确顺序以及合同领域的数据流。 我们开发了两步方法, 即(1) 合成一个有限代表( 一般来说) 无限状态系统和(2) 将系统分割成一个紧凑的等级结构, 以便能够有效地处理固态国家机器。 我们在ScSynt 工具中应用这一方法, 利用高效的象征性算法, 其依据的观察是智能合同规格自然会落到安全碎片中。 结果, ScSynt 在数秒内将各种规格的正确by设计固体代码合成出来。