Skip to content

Commit

Permalink
Merge pull request #790 from johnny30678/patch-1
Browse files Browse the repository at this point in the history
fix(readme.md): Update solidity version
  • Loading branch information
AmazingAng authored Oct 19, 2024
2 parents 47dc75a + d520e79 commit 5328614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 09_Constant/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ address constant CONSTANT_ADDRESS = 0x0000000000000000000000000000000000000000;

### immutable

`immutable`变量可以在声明时或构造函数中初始化,因此更加灵活。在`Solidity v8.0.21`以后,`immutable`变量不需要显式初始化,未显式初始化的`immutable`变量将使用数值类型的初始值(见 [8. 变量初始值](https://github.com/AmazingAng/WTF-Solidity/blob/main/08_InitialValue/readme.md#%E5%8F%98%E9%87%8F%E5%88%9D%E5%A7%8B%E5%80%BC))。反之,则需要显式初始化。
`immutable`变量可以在声明时或构造函数中初始化,因此更加灵活。在`Solidity v0.8.21`以后,`immutable`变量不需要显式初始化,未显式初始化的`immutable`变量将使用数值类型的初始值(见 [8. 变量初始值](https://github.com/AmazingAng/WTF-Solidity/blob/main/08_InitialValue/readme.md#%E5%8F%98%E9%87%8F%E5%88%9D%E5%A7%8B%E5%80%BC))。反之,则需要显式初始化。
`immutable`变量既在声明时初始化,又在constructor中初始化,会使用constructor初始化的值。

``` solidity
Expand Down

0 comments on commit 5328614

Please sign in to comment.