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: pages/lessons/projects/1.mdx
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ icons: ['solidity', 'remix']
12
12
13
13
We’re going to build a **smart contract**, but what on Jupiter is a smart
14
14
contract? And what on Earth would we use one for? Well, you wouldn’t find a
15
-
smart contract on either Jupiter, or Earth, and although you maybe grounded to
15
+
smart contract on either Jupiter, or Earth, and although you may be grounded to
16
16
the latter, you are going to deploy yours on a **blockchain**. Not a real
17
17
blockchain, well not at first. Hang on!
18
18
@@ -25,7 +25,7 @@ and bundled into blocks of a limited capacity and they keep getting added on to
25
25
make a continuing _block chain_. Each transaction contains quite a limited
26
26
amount of information, but gives us transparency so that anyone can trace the
27
27
_money trail_. And this was one of the main intentions of blockchains.
28
-
Transparency. There are evergrowing use cases for the types of transactions,
28
+
Transparency. There are ever-growing use cases for the types of transactions,
29
29
financial and non-financial. Let’s move on. The blocks are secured to each other
30
30
with cryptography. A similar type of encryption that is used to secure the
31
31
Signal or Telegram apps on your smartphone…..(any other examples???) If someone
@@ -54,7 +54,7 @@ resistant. Think about that for a second. And it gets better…..
54
54
Really? What’s so special about all of this? Well until recently, we only
55
55
transferred data on the internet. Yes, you could send money too by using some
56
56
kind of banking app, or financial services app like Western Union, but with the
57
-
advent of crypto currencies we can now send _digital_ value… permissionlessly.
57
+
advent of cryptocurrencies we can now send _digital_ value… permissionlessly.
58
58
That's quite a thing! In the early days of crypto we could only transact with
59
59
digital tokens such as BTC and then ETH and soon later, with thousands of
60
60
different coins. But new ideas continue to emerge and we’re going to be building
@@ -286,21 +286,21 @@ contract WAGMI {
286
286
287
287
### Visibility of State Variables
288
288
289
-
In Solidity, there are 3 types of variable visibility modifiers that a developer can use :
289
+
In Solidity, there are 3 types of variable visibility modifiers that a developer can use :
290
290
291
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 an `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.
293
+
-**Internal**: A state variable with an `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 visibility is specified.
294
294
295
-
-**Private**: When a state variable visibility is marked as `private` it is only meant to be used within the defined smart contract. No derived contract can read a variable with a `private` visibility.
295
+
-**Private**: When a state variable visibility is marked as `private` it is only meant to be used within the defined smart contract. No derived contract can read a variable with a `private` visibility.
296
296
297
297
<Calloutemoji='💡'size='md'variant='info'>
298
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
299
</Callout>
300
300
301
-
#### Which visibility should I use?
301
+
#### Which visibility should I use?
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.
303
+
A simple answer to this is, start by giving every variable a `private` visibility then as you move further in contract development 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.
304
304
305
305
</SideDrawer>
306
306
@@ -332,7 +332,7 @@ symbols:
332
332
// ...
333
333
contract WAGMI {
334
334
335
-
// Don't delete our state variables here!
335
+
// Don't delete our state variables here!
336
336
337
337
function getMessage() public view returns(string memory) {
338
338
return message;
@@ -542,7 +542,7 @@ in future lessons, so no worries!
542
542
543
543
In the Ethereum Blockchain, whenever we run or execute a transaction it stores a log with the results and data of the transaction. Solidity provides us with **Events** so we can write data to said logs.
544
544
545
-
Applications can subscribe and listen to this events, or even search for past logs using filters.
545
+
Applications can subscribe and listen to these events, or even search for past logs using filters.
546
546
547
547
Whenever a function calls (**emits**) an event, the values passed as parameters are stored in a special data structure in the blockchain: the transaction log. It is worth noticing that Smart Contracts cannot access the log and its event data.
0 commit comments