
考虑到我们还处于采用智能合约的初期阶段,实现这类代码的最佳实践仍在探索中。然而,下面的清单可以帮助开发人员设计有效的智能合约,并给打算使用智能合约的公司一些指导。
Given that we are at the nascent stages of smart contract adoption, best practices for implementing such code is still evolving. However, the checklist below should help developers design effective smart contracts and guide companies who plan to use them.
就目前而言,订立任何类型合同的各方最好采用结合文本和代码混合的方式。如上所述,我们有充分的理由认为,只含代码的智能合约至少在明确的管辖范围内应该是可执行的。然而,在合同的有效性和可执行性明确前,仅含代码的智能合约仅应用于更简单的交易。双方将需要文本版本的协议,以便他们能够阅读已达成协议的条款,记下智能合约无法处理的条款,并准备一份他们知道法院会执行的文件。
For now, parties entering into any type of contractual arrangement would be best served using a hybrid approach that combines text and code. As noted, there are strong arguments that code-only smart contracts should be enforceable, at least under an expressed jurisdiction. However, until there is greater clarity on their validity and enforceability, code-only smart contracts should be used only for simpler transactions. Parties will continue to want text-versions of agreements so they can read the agreed-upon terms, memorialize terms that smart contracts are not equipped to address and have a document they know a court will enforce.
在使用文本和代码的混合合同中,文本应明确指定与其关联的智能合约代码,并且各方应该对传递给智能契约的变量有充分的可视性,如何定义变量以及交易事件将引起代码执行。
In a hybrid contract using text and code, the text should clearly specify the smart contract code with which it is associated, and the parties should have full visibility into the variables that are being passed to the smart contract, how they are defined and the transaction events that will trigger execution of the code.
在依赖预言机进行链外数据时,双方应解决如果预言机无法推出必要数据、提供错误数据或甚至停业会发生的问题。
When relying on oracles for off-chain data, the parties should address what would happen if the oracle is unable to push out the necessary data, provides erroneous data or simply goes out of business.
在发生编码错误时,各方应考虑风险分配。
The parties should consider risk allocation in the event of a coding error.
代码附带的文本协议应明确适用法律和管辖地,以及在发生冲突时文本和代码之间的优先顺序。
The text agreement accompanying the code should specify the governing law and venue, as well as the order of precedence between text and code in the event of a conflict.
文本协议应包括双方已审阅智能合约代码的声明,并反映文本协议中的条款。虽然这样的陈述不能强制合约一方检查代码,但它将有助于对代码从未被审查的主张进行抗辩。各方还可以选择对代码包含错误的风险投保。如上文所述,各方还可能需要第三方专家来审查代码。
The text agreement should include a representation by each party that they have reviewed the smart contract code, and that it reflects the terms found in the text agreement. Although such a representation cannot force a party to examine the code, it will help the counterparty defend against a claim that the code was never reviewed. Parties may also choose to insure against the risk that the code contains errors. As noted, parties may need to involve third-party experts to review the code.
