什么是智能合约?What is a smart contract?
智能合约,就是一段部署在区块链上、能自动执行的程序。你满足了它写好的条件,它就自动完成动作,比如自动转账、自动发奖励,全程不需要银行或平台当中间人。A smart contract is a program deployed on a blockchain that runs automatically. Once you meet the conditions it has written in, it completes the action on its own — such as auto-transferring funds or auto-distributing rewards — with no bank or platform acting as a middleman.
它最关键的特点是公开且难以私自更改。代码一旦上链,任何人都能查看,规则对所有人一视同仁,不会因为你是谁就区别对待。这也是它比传统中心化系统更透明的地方。Its key trait is being public and hard to alter privately. Once the code is on-chain, anyone can view it, and the rules treat everyone equally — you get no special treatment for who you are. This is where it's more transparent than traditional centralized systems.
但透明不等于安全。你要特别留意这几点:But transparent doesn't mean safe. Pay special attention to these points:
- 合约有没有开源,能不能看到真实代码Whether the contract is open source and you can see the real code
- 有没有管理员权限,谁能升级或暂停它Whether there are admin privileges, and who can upgrade or pause it
- 过去有没有被审计、有没有出过事Whether it has been audited in the past, and whether anything has gone wrong
换句话说,智能合约把「信任平台」变成了「信任代码」。代码写得好,它就是一台可靠的自动机器;代码里留了后门,风险同样会自动执行,所以上链自己核实非常重要。In other words, a smart contract turns "trusting a platform" into "trusting the code". If the code is well written, it's a reliable automatic machine; if a back door is left in the code, the risk executes automatically too. That's why verifying it on-chain yourself matters so much.
📝 本节测验📝 Quiz
1. 智能合约本质上是什么?1. What is a smart contract essentially?
2. 智能合约执行时通常需要谁来审批?2. Who usually needs to approve a smart contract when it executes?
3. 下面哪一点最能体现智能合约的透明性?3. Which point best reflects a smart contract's transparency?
4. 合约「开源」意味着什么?4. What does it mean for a contract to be "open source"?
5. 为什么说「透明不等于安全」?5. Why is it said that "transparent doesn't mean safe"?
❓ 常见问题❓ FAQ
智能合约真的完全改不了吗?Can a smart contract really never be changed at all?
不一定。很多合约是「可升级」的,管理员能替换背后的逻辑。是否能改、谁能改,要去合约验证中心自己看权限,别想当然。Not necessarily. Many contracts are "upgradeable", meaning an admin can replace the logic behind them. Whether it can be changed and who can change it — check the permissions yourself in the contract verify tool; don't take it for granted.
我不懂编程,怎么核实合约?I don't know how to code — how do I verify a contract?
不必读懂每行代码。先看它是否开源、有没有审计、管理员权限大不大,用合约验证中心把这几项过一遍,就能避开很多明显的坑。You don't need to read every line of code. First check whether it's open source, whether it's been audited, and how large the admin privileges are — run through these items with the contract verify tool and you'll avoid many obvious pitfalls.
合约上链后出问题能追回吗?If something goes wrong after a contract is on-chain, can it be recovered?
通常很难。链上交易一旦执行往往不可逆,所以事前核实合约、控制金额比事后维权重要得多。Usually it's very hard. On-chain transactions are often irreversible once executed, so verifying the contract beforehand and controlling your amounts matters far more than seeking recourse afterward.