Smart Contracts
Blockchain programs that apply encoded rules
What is Smart Contracts?
Smart contracts are programs stored and executed within a blockchain system. Calls and transactions invoke their rules and state changes. Code can automate execution, but bugs, external inputs, upgrade permissions, and transaction conditions affect the outcome.
How it works
Read the diagram
- Call
- Check rules
- State change
Key takeaways
-
Identify call conditions and upgrade or administrator permissions.
-
Check external data and execution failures.
Illustrative example
In a hypothetical escrow, a client sends a release transaction after accepting delivery. The contract checks authority and balance before transferring payment. A rejected call, disputed acceptance, or faulty code can prevent the intended outcome.
Inspect triggers, outside data, and administrator rights
Determine what invokes the program, who may change it, and whether it relies on an oracle for facts outside the chain. Fees and network execution also matter. An audit can examine code without guaranteeing that every failure is found. Automated execution does not by itself resolve a dispute about whether real-world work was acceptable.