From 4c81bcfda292a910b8defd1ff054ccc60afb02e2 Mon Sep 17 00:00:00 2001 From: "Li, Amazing Ang" Date: Wed, 30 Nov 2022 01:08:10 +0800 Subject: [PATCH] Update readme.md --- Languages/en/09_Constant_en/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Languages/en/09_Constant_en/readme.md b/Languages/en/09_Constant_en/readme.md index eabc6f1e5..831db945c 100644 --- a/Languages/en/09_Constant_en/readme.md +++ b/Languages/en/09_Constant_en/readme.md @@ -64,16 +64,16 @@ You can initialize the `immutable` variable using a global variable such as `add ![9-1.png](./img/9-1.png) -2. After the `constant` variable is initialized, the contract cannot be compiled if there is an attempt to change its value and the compiler will issue an error of `TypeError: Cannot assign to a constant variable.` +2. After the `constant` variable is initialized, the contract cannot be compiled if there is an attempt to change its value. The compiler will throw: `TypeError: Cannot assign to a constant variable.` ![9-2.png](./img/9-2.png) -3. After the `immutable` variable is initialized, the contract cannot be compiled if there is an attempt to change its value and the compiler will issue an error of `TypeError: Immutable state variable already initialized.` +3. After the `immutable` variable is initialized, the contract cannot be compiled if there is an attempt to change its value. The compiler will throw: `TypeError: Immutable state variable already initialized.` ![9-3.png](./img/9-3.png) ## Summary -In this section, we introduced two keywords in Solidity, `constant` and `immutable`, to keep the variables that should not be changed. It will help to save `gas` while improving the contract's security. +In this section, we introduced two keywords in Solidity, `constant` and `immutable`. They keep the variables that should not be changed unchanged. It will help to save `gas` while improving the contract's security.