Translations: Lightweight Contracts/241/en

From ArdorDocs
Jump to: navigation, search

However, there are few steps contract developers need to take to increase the reliability of Oracle contracts, as a developer you should consider that contracts should be designed to be idempotent (i.e. can run multiple times on the same data and produce the same result). For example a contract can run once when a trigger transaction is received, then again if the node switches to a better fork and the trigger transaction is included in a different fork, and again in case the contract runner is re-downloading the blockchain. Ideally in all these cases the contract should reproduce the exact same output transactions. The blockchain itself protects against including duplicate transactions in the blockchain.