... // 只要 Bank 合约有资金,就持续调用 withdraw
// and the attacker wants to withdraw (e.g., 1 ether per re-entry).
// 并且攻击者想要提款(例如,每次重入 1 以太币)。
if (address(bank).balance >= 1 ether) {
bank.withdraw(1 eth...
...56 x, uint256 y) public pure returns(uint256){
// return the max of x and y
return x >= y ? x: y;
}
```
## 9. 构造函数
- 构造函数会在合约部署时,自动运行一次。可以用来初始化合约的一些参数。
- 构造函数的函数名必须为 `constructor()`
```...