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: docs/build/hello-world-dapp.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,7 @@ Here we are importing the necessary functions from the Massa AssemblyScript SDK.
124
124
125
125
:::info
126
126
If you are familiar with Solidity smart contracts, you will soon notice that some object provided by Massa AssemblyScript SDK are very similar to the ones provided by the Solidity SDK. For example, the `Context` object is very similar to the `msg` object in Solidity. It exposes methods such as `Context.transferredCoins()` which would translate to `msg.value` in Solidity. `Context.caller()` would return the address of the function caller like `msg.sender` in solidity. Similarly, the `generateEvent` function is very similar to the `emit` function in Solidity, etc.
127
-
You can learn more about the Massa AssemblyScript SDK [here](docs/build/smart-contract/as-sdk.md).
127
+
You can learn more about the Massa AssemblyScript SDK [here](./smart-contract/as-sdk.md).
This line sets the greeting message in the contract storage. The `Storage.set()` function takes two parameters: the key and the value. The key is a string that will be used to retrieve the value from the storage. The value can be of any type. In this example, we are using a string.
147
147
148
148
:::info
149
-
In Massa, if you want some data to be persistent on the blockchain, you need to store it in the contract storage. If you are familiar with web development, you can think of the storage as the database of your application. The contract storage is a key-value store that can be used to store simple objects such as our "Hello, World!" string, or more complex objects such as serializable object arrays. Then the data can be retrieved from the storage using methods such has `Storage.get()` or `Storage.has()` provided by the SDK. You can learn more about how to handle the storage with Massa AS-SDK [here](docs/build/smart-contract/as-sdk.md#storage).
149
+
In Massa, if you want some data to be persistent on the blockchain, you need to store it in the contract storage. If you are familiar with web development, you can think of the storage as the database of your application. The contract storage is a key-value store that can be used to store simple objects such as our "Hello, World!" string, or more complex objects such as serializable object arrays. Then the data can be retrieved from the storage using methods such has `Storage.get()` or `Storage.has()` provided by the SDK. You can learn more about how to handle the storage with Massa AS-SDK [here](/docs/build/smart-contract/as-sdk.md#storage).
150
150
:::
151
151
152
152
:::info
153
-
In Massa, when writing to the persistent storage a.k.a the ledger, you need to pay for the storage space you will be using. The more data you store, the more you will have to pay. Similarly when you free-up some space from the ledger, you recover the amount of coins you paid to allocate the space. The price of storage is a fixed amount of Massa coins for each byte of data (0.001 MAS per byte). You can learn more about storage cost in Massa smart contracts [here](docs/learn/storage-costs.mdx).
153
+
In Massa, when writing to the persistent storage a.k.a the ledger, you need to pay for the storage space you will be using. The more data you store, the more you will have to pay. Similarly when you free-up some space from the ledger, you recover the amount of coins you paid to allocate the space. The price of storage is a fixed amount of Massa coins for each byte of data (0.001 MAS per byte). You can learn more about storage cost in Massa smart contracts [here](/docs/learn/storage-costs.mdx).
154
154
:::
155
155
156
156
- **Emitting an event**
157
157
158
158
```tsx
159
159
generateEvent(`Greeting has been set`);
160
160
```
161
-
Here, we are emitting an event to notify that the greeting message has been set. Events are a great way to notify the front ends of a dApp that something has happened. They are similar to events in Solidity. You can learn more about events [here](docs/build/smart-contract/as-sdk.md#utilities).
161
+
Here, we are emitting an event to notify that the greeting message has been set. Events are a great way to notify the front ends of a dApp that something has happened. They are similar to events in Solidity. You can learn more about events [here](/docs/build/smart-contract/as-sdk.md#utilities).
162
162
163
163
Now that we have written our smart contract, let's deploy it to the blockchain.
Copy file name to clipboardExpand all lines: i18n/fr/docusaurus-plugin-content-docs/current/build/hello-world-dapp.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Before we start, here's what you'll need:
39
39
You'll need a funded Massa wallet and your secret key before you deploy your smart contract to the Massa blockchain.
40
40
41
41
:::info
42
-
Not sure how to create and fund a Massa wallet? Check our guide [here](/docs/build/wallet/intro).
42
+
Not sure how to create and fund a Massa wallet? Check our guide [here](./wallet/intro).
43
43
:::
44
44
45
45
### Setting up Your Project
@@ -124,7 +124,7 @@ Here we are importing the necessary functions from the Massa AssemblyScript SDK.
124
124
125
125
:::info
126
126
If you are familiar with Solidity smart contracts, you will soon notice that some object provided by Massa AssemblyScript SDK are very similar to the ones provided by the Solidity SDK. For example, the `Context` object is very similar to the `msg` object in Solidity. It exposes methods such as `Context.transferredCoins()` which would translate to `msg.value` in Solidity. `Context.caller()` would return the address of the function caller like `msg.sender` in solidity. Similarly, the `generateEvent` function is very similar to the `emit` function in Solidity, etc.
127
-
You can learn more about the Massa AssemblyScript SDK [here](docs/build/smart-contract/as-sdk.md).
127
+
You can learn more about the Massa AssemblyScript SDK [here](./smart-contract/as-sdk.md).
This line sets the greeting message in the contract storage. The `Storage.set()` function takes two parameters: the key and the value. The key is a string that will be used to retrieve the value from the storage. The value can be of any type. In this example, we are using a string.
147
147
148
148
:::info
149
-
In Massa, if you want some data to be persistent on the blockchain, you need to store it in the contract storage. If you are familiar with web development, you can think of the storage as the database of your application. The contract storage is a key-value store that can be used to store simple objects such as our "Hello, World!" string, or more complex objects such as serializable object arrays. Then the data can be retrieved from the storage using methods such has `Storage.get()` or `Storage.has()` provided by the SDK. You can learn more about how to handle the storage with Massa AS-SDK [here](docs/build/smart-contract/as-sdk.md#storage).
149
+
In Massa, if you want some data to be persistent on the blockchain, you need to store it in the contract storage. If you are familiar with web development, you can think of the storage as the database of your application. The contract storage is a key-value store that can be used to store simple objects such as our "Hello, World!" string, or more complex objects such as serializable object arrays. Then the data can be retrieved from the storage using methods such has `Storage.get()` or `Storage.has()` provided by the SDK. You can learn more about how to handle the storage with Massa AS-SDK [here](./smart-contract/as-sdk.md#storage).
150
150
:::
151
151
152
152
:::info
153
-
In Massa, when writing to the persistent storage a.k.a the ledger, you need to pay for the storage space you will be using. The more data you store, the more you will have to pay. Similarly when you free-up some space from the ledger, you recover the amount of coins you paid to allocate the space. The price of storage is a fixed amount of Massa coins for each byte of data (0.001 MAS per byte). You can learn more about storage cost in Massa smart contracts [here](docs/learn/storage-costs.mdx).
153
+
In Massa, when writing to the persistent storage a.k.a the ledger, you need to pay for the storage space you will be using. The more data you store, the more you will have to pay. Similarly when you free-up some space from the ledger, you recover the amount of coins you paid to allocate the space. The price of storage is a fixed amount of Massa coins for each byte of data (0.001 MAS per byte). You can learn more about storage cost in Massa smart contracts [here](../learn/storage-costs.mdx).
154
154
:::
155
155
156
156
- **Emitting an event**
157
157
158
158
```tsx
159
159
generateEvent(`Greeting has been set`);
160
160
```
161
-
Here, we are emitting an event to notify that the greeting message has been set. Events are a great way to notify the front ends of a dApp that something has happened. They are similar to events in Solidity. You can learn more about events [here](docs/build/smart-contract/as-sdk.md#utilities).
161
+
Here, we are emitting an event to notify that the greeting message has been set. Events are a great way to notify the front ends of a dApp that something has happened. They are similar to events in Solidity. You can learn more about events [here](./smart-contract/as-sdk.md#utilities).
162
162
163
163
Now that we have written our smart contract, let's deploy it to the blockchain.
164
164
@@ -177,7 +177,7 @@ This command compiles your `main.ts` contract into a `main.wasm` file generated
177
177
#### Step 3: Deploy the Smart Contract
178
178
179
179
Now that your smart contract is compiled and ready, let's deploy it to the Massa blockchain.
180
-
You first need some funds in your wallet that you can request from the [faucet](/docs/build/networks-faucets/public-networks).
180
+
You first need some funds in your wallet that you can request from the [faucet](./networks-faucets/public-networks).
181
181
You can then run the following command in your project directory:
182
182
183
183
```bash
@@ -359,7 +359,7 @@ We are using the `DefaultProviderUrls.BUILDNET` constant as our provider URL. Th
359
359
The boolean is a flag that indicates whether or not we want to provide an wallet account to sign transactions. Here it is set to false because we are not going to sign any transactions. Finally, we are setting the client object to the `web3client` state variable using the `setWeb3client` function, so that the web3 client is available to the rest of our application.
360
360
361
361
:::info
362
-
The buildnet is a test network that is used to test smart contracts before deploying them to the mainnet. It is similar to the Ethereum Sepolia network. You can learn more about Massa networks [here](/docs/build/networks-faucets/public-networks).
362
+
The buildnet is a test network that is used to test smart contracts before deploying them to the mainnet. It is similar to the Ethereum Sepolia network. You can learn more about Massa networks [here](./networks-faucets/public-networks).
363
363
:::
364
364
365
365
@@ -415,5 +415,5 @@ Congratulations on writing and testing your first dApp using the Massa blockchai
415
415
416
416
There's always more to learn. To continue exploring and expanding your knowledge, you can:
417
417
418
-
- Review more detailed guides on [smart contract development](/docs/build/smart-contract/intro).
419
-
- Check out more [complex examples](/docs/tutorial/home) of dApps built on Massa.
418
+
- Review more detailed guides on [smart contract development](./smart-contract/intro).
419
+
- Check out more [complex examples](../tutorial/home) of dApps built on Massa.
0 commit comments