You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lessons/projects/1.mdx
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -288,11 +288,14 @@ contract WAGMI {
288
288
289
289
In Solidity , there are 3 types of variable visibility modifiers that a developer can use :
290
290
291
-
-**Public**: If a state variable visibility is marked as `public` then those variables can be used within the smart contract and can be accessed by other contracts as well.
291
+
-**Public**: If a state variable visibility is marked as `public` then those variables can be used within the smart contract and can be accessed by other contracts as well.Compilers automatically generates functions to read its value when calling the contract, they are called 'getter' functions
292
292
293
-
-**Internal**: A state variable with a `internal` visibility can only be accessed within the smart contract and its subclasses. It can *NOT* be accessed externally.
293
+
-**Internal**: A state variable with a `internal` visibility can only be accessed within the smart contract and its derived contracts. It can *NOT* be accessed externally. This is the default for state variables when no visibilty is specified.
294
294
295
-
-**Private**: When a state variable visibility is marked as `private` then it means , that it is only ment to be used within the defined smart contract . No subclasses and no external function should access a variable with a `private` visibility.
295
+
-**Private**: When a state variable visibility is marked as `private` then it means , that it is only meant to be used within the defined smart contract . No derived contract can read a variable with a variable with a `private` visibility.
296
+
297
+
> [!INFO]
298
+
> While private and internal are not readable or modifiable from other contracts, its values are set on a public blockchain, making its values visible from the outside world.
296
299
297
300
#### Which visibility should I use ?
298
301
@@ -701,7 +704,7 @@ you see the magical spell that is being cast here?
701
704

702
705
703
706
Before you go ahead and tell us: **what your future in web3 is,** have a check
704
-
on what you didn’t know a little while ago, and what you know now! \*
707
+
on what you didn’t know a little while ago, and what you know now! *
705
708
706
709
Apart from a user wallet, what else uses a blockchain (Ethereum) address?
0 commit comments