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
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -294,9 +294,10 @@ contract WAGMI {
294
294
295
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
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.
299
-
297
+
<ContentCalloutemoji='💡'size='md'variant='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.
299
+
</ContentCallout>
300
+
300
301
#### Which visibility should I use ?
301
302
302
303
A simple answer to this is , start with giving every variable a `private` visibility then as you move further in contract developement modify variables to `internal` visibility as a next step of modification. Try to use `public` visibility as little as possible in order to be gas efficient and making less vulnerabilities in the smart contract.
0 commit comments