Skip to content

Commit b4540c9

Browse files
authored
Merge branch 'development' into patch-1
2 parents 2479301 + 766ab81 commit b4540c9

37 files changed

+12157
-42
lines changed

docs/bridge/whitelist-requirements.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,13 @@ the EVM-compatible chain side (depending on the ERC20 contract variant, `addMint
6262
For reference, this is the list of the known smart contracts:
6363
* **Wrapper** `erd1qqqqqqqqqqqqqpgq305jfaqrdxpzjgf9y5gvzh60mergh866yfkqzqjv2h`
6464
* **Ethereum Safe** `erd1qqqqqqqqqqqqqpgqf2cu60ffz9v68r0h62sufxxf67n7xprue3yq4ap4k2`
65-
* **BSC Safe** `erd1qqqqqqqqqqqqqpgqa89ts8s3un2tpxcml340phcgypyyr609e3yqv4d8nz`
65+
* **BSC Safe** `erd1qqqqqqqqqqqqqpgqa89ts8s3un2tpxcml340phcgypyyr609e3yqv4d8nz`
66+
67+
:::warning
68+
To ensure the correct functioning of the bridge, as a MultiversX token owner please ensure the following points are met:
69+
* if you make use of the transfer-role on your token, remember to grant the role also on the **Safe**, **MultiTransfer**, **BridgedTokensWrapper**, and **BridgeProxy** contracts;
70+
* do not freeze the above-mentioned contracts;
71+
* do not wipe tokens on the above-mentioned contracts.
72+
73+
Failure to comply with these rules will force the bridge owner to blacklist the token in order to restore the correct functioning of the bridge.
74+
:::

docs/developers/tutorials/your-first-dapp.md

+49-15
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@ title: Build a dApp in 15 minutes
88
Let's build your first decentralized application(dApp) on the MultiversX Blockchain!
99

1010
## Prerequisites
11+
1112
:::important
1213
Before starting this tutorial, make sure you have the following:
14+
1315
- `stable` Rust version `≥ 1.78.0` (install via [rustup](https://docs.multiversx.com/sdk-and-tools/troubleshooting/rust-setup/#without-mxpy))
1416
- `multiversx-sc-meta` (cargo install [multiversx-sc-meta](https://docs.multiversx.com/developers/meta/sc-meta-cli/#introduction))
1517
- `Node.js` with version `≥ 20`(guide [here](https://nodejs.org/en/download/package-manager))
1618
- `yarn` ([npm install --global yarn](https://classic.yarnpkg.com/lang/en/docs/install/#debian-stable) )
19+
1720
:::
1821

1922
You are going to use `sc-meta` to:
23+
2024
1. **Create a wallet** to handle your transactions.
21-
2. **Build** and **deploy** a contract.
25+
2. **Build** and **deploy** a contract.
2226

2327
[comment]: # (mx-context-auto)
2428

@@ -28,11 +32,13 @@ You are going to use `sc-meta` to:
2832

2933
The **Ping-Pong app** is a very simple decentralized application that allows users to deposit a specific number of tokens to a smart contract address and to lock them for a specific amount of time. After this time interval passes, users can claim back the same amount of tokens.
3034

31-
Endpoints available:
35+
Endpoints available:
36+
3237
- `ping`: sending funds to the contract.
3338
- `pong`: claiming the same amount back.
3439

3540
Rules:
41+
3642
- Each user can only `ping` once before they `pong`.
3743
- The `ping` amount must be exactly the specified value—no more, no less.
3844
- `pong` becomes available only after a set waiting period following a `ping`.
@@ -57,10 +63,12 @@ For the web application, we will have two pages:
5763
### Blockchain Layer - Backend
5864

5965
You will interact with a smart contract that provides the following features:
66+
6067
- `ping`: users send tokens to the contract, locking them for a specific period;
6168
- `pong`: users retrieve their funds, but only after the lock period expires.
6269

6370
The contract also includes several views, storage mappers and one event:
71+
6472
- `didUserPing`: **view** that tells if a specific user has already `ping`-ed (_true_) or not (_false_);
6573
- `getPongEnableTimestamp`: **view** that provides the timestamp when `pong` will be available for a given address;
6674
- `getTimeToPong`: **view** that shows the remaining time until `pong` is enabled for a specific address;
@@ -86,9 +94,9 @@ Let's set up the environment for getting your first dApp up and running.
8694

8795
Start by creating a new folder for your project. Let's call it `ping-pong`.
8896

89-
```sh
97+
```bash
9098
mkdir -p ping-pong
91-
cd ping-pong
99+
cd ping-pong/
92100
```
93101

94102
By the time we are done, our project will have three subfolders: wallet, contract, and dapp.
@@ -101,20 +109,23 @@ By the time we are done, our project will have three subfolders: wallet, contrac
101109

102110
To deploy a smart contract to the blockchain, you will need a wallet-a PEM file is recommended for simplicity and ease of testing.
103111

104-
Make sure you are in the `ping-pong` folder.
112+
:::important
113+
Make sure you are in the `ping-pong/` folder before continuing.
114+
:::
105115

106-
```sh
116+
```bash
107117
mkdir -p wallet
108118
sc-meta wallet new --format pem --outfile ./wallet/wallet-owner.pem
109119
```
110120

111-
:::info
121+
:::tip
112122
PEM wallets are recommended only for testing and experimenting with non-production code. For real applications, always follow best practices and use secure wallets that can be generated [here](https://wallet.multiversx.com).
113123
:::
114124

115125
To initiate transactions on the blockchain, your wallet needs funds to cover transaction fees, commonly referred to as **gas**.
116126

117127
The [MultiversX Devnet](https://devnet-wallet.multiversx.com/dashboard) offers a **faucet** where you can claim **5 EGLD every 24 hours**. Here’s how to fund your wallet:
128+
118129
1. Go to [Devnet Wallet MultiversX](https://devnet-wallet.multiversx.com/unlock/pem) and log in using your newly generated **PEM** file;
119130
2. Once logged in, open the **Faucet** from the **Tools**;
120131
3. Request **5 xEGLD** to top up your wallet with test EGLD.
@@ -129,11 +140,14 @@ With the wallet setup complete, let's move on to the backend—the blockchain la
129140

130141
Let's start with the smart contract. You will first clone the Ping-Pong sample contract repository from [here](https://github.com/multiversx/mx-ping-pong-sc).
131142

132-
Make sure you are still in the **ping-pong** folder.
143+
:::important
144+
Make sure you are still in the `ping-pong/` folder.
145+
:::
133146

134-
```sh
147+
```bash
135148
git clone https://github.com/multiversx/mx-ping-pong-sc contract
136149
```
150+
137151
This will create a **contract** folder within ping-pong, containing all the necessary files for the Ping-Pong smart contract.
138152

139153
[comment]: # (mx-context-auto)
@@ -159,28 +173,45 @@ This file contains the bytecode for the smart contract, ready to be deployed on
159173

160174
Next, let's deploy the smart contract to the blockchain.
161175

162-
Make sure `wallet_owner.pem` is in the `wallet/` folder and that the smart contract is built.
176+
:::tip
177+
Ensure that `wallet_owner.pem` is in the `wallet/` folder and that the smart contract is built.
178+
:::
163179

164180
Before deploying, you will need to modify the wallet from which transactions are made. Currently, they are made from a test wallet. To use the wallet you created [earlier](./your-first-dapp.md#create-wallet), you will need to make the following changes:
165181

166-
At the path `/ping-pong/contract/ping-pong/interactor/src` you will run:
167-
168-
In the file `interact.rs` located at the path `/ping-pong/contract/ping-pong/interactor/src`, the variable `alice_wallet_address` from `new` function will be modified from:
182+
In the file `interact.rs` located at the path `ping-pong/contract/ping-pong/interactor/src`, the variable `alice_wallet_address` from `new` function will be modified.
169183

170184
```rust title="Before"
171185
let alice_wallet_address = interactor.register_wallet(test_wallets::alice()).await;
172186
```
187+
173188
```rust title="After"
174189
let alice_wallet_address = interactor
175-
.register_wallet(Wallet::from_pem_file("/ping-pong/wallet/wallet-owner.pem").unwrap())
190+
.register_wallet(Wallet::from_pem_file("../../../wallet/wallet-owner.pem").unwrap())
176191
.await;
177192
```
193+
194+
:::note
195+
You need to replace with the relative path from the **interactor crate** to the **created wallet**.
196+
197+
The interactor crate is located at `ping-pong/contract/ping-pong/interactor` and the wallet is in a higher-level directory: `ping-pong/wallet`.
198+
199+
To access `wallet-owner.pem` you must navigate up three folders: `../../../`, then into the **wallet** directory.
200+
:::
201+
178202
Make sure to add the absolute path at `Wallet::from_pem_file("/ping-pong/wallet/wallet-owner.pem")`, completing the missing directories above "ping-pong".
179203

180204
This next command deploys the Ping-Pong contract with the following settings:
205+
181206
- Ping Amount: **1 EGLD**.
182207
- Lock Duration: **180 seconds** (3 minutes).
183208

209+
:::important
210+
Ensure that you run the next command inside the **interactor** crate, located at:
211+
212+
`ping-pong/contract/ping-pong/interactor`
213+
:::
214+
184215
```bash
185216
cargo run deploy --ping-amount 1000000000000000000 --duration-in-seconds 180
186217
```
@@ -194,7 +225,9 @@ sc deploy tx hash: b6ca6c8e6ac54ed168bcd6929e762610e2360674f562115107cf3702b8a22
194225
deploy address: erd1qqqqqqqqqqqqqpgqymj43x6anzr38jfz7kw3td2ew33v9jtrd8sse5zzk6
195226
new address: erd1qqqqqqqqqqqqqpgqymj43x6anzr38jfz7kw3td2ew33v9jtrd8sse5zzk6
196227
```
228+
197229
Once the command runs, review the log output carefully. Two key details to note:
230+
198231
- Contract Address: in the example presented below is erd1qqqqqqqqqqqqqpgqymj43x6anzr38jfz7kw3td2ew33v9jtrd8sse5zzk6
199232
- Transaction Hash: in the example presented below is b6ca6c8e6ac54ed168bcd6929e762610e2360674f562115107cf3702b8a22467
200233
@@ -209,6 +242,7 @@ With the smart contract successfully deployed, you can now interact with it usin
209242
The smart contract source code resides in `ping-pong/contract/ping-pong/src/ping_pong.rs`.
210243

211244
The contract includes several view functions for querying information. These are invoked using the [MultiversX API](https://devnet-gateway.multiversx.com/#/vm-values/post_vm_values_query):
245+
212246
- `didUserPing`;
213247
- `getPongEnableTimestamp`;
214248
- `getTimeToPong`;
@@ -269,7 +303,7 @@ If the server is hosted on a remote machine, access it using the server's IP add
269303
270304
The production build of the app consists only of static files, so you can deploy it on any hosting platform you prefer.
271305
272-
Once the development server is up and running, seeing the _Template dApp_ screen confirms that your application is live and ready!
306+
Once the development server is up and running, seeing the _Template dApp_ screen confirms that your application is live and ready!
273307
274308
![img](/developers/tutorial/tutorial_dapp_page.png)
275309

docs/sdk-and-tools/elastic-search.md

+22-21
Original file line numberDiff line numberDiff line change
@@ -125,27 +125,28 @@ Each entry in an Elasticsearch index will have a format similar to this:
125125
}
126126
```
127127

128-
| Name | Description |
129-
| -------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
130-
| [transactions](/sdk-and-tools/indices/es-index-transactions) | Contains all transactions. |
131-
| [blocks](/sdk-and-tools/indices/es-index-blocks) | Contains all executed blocks. |
132-
| [validators](/sdk-and-tools/indices/es-index-validators) | Contains the public keys of the validators grouped by epoch and shard. |
133-
| [rating](/sdk-and-tools/indices/es-index-rating) | Contains the validators' rating for every epoch. |
134-
| [miniblocks](/sdk-and-tools/indices/es-index-miniblocks) | Contains all executed minblocks. |
135-
| [rounds](/sdk-and-tools/indices/es-index-rounds) | Contains details of each round that has passed. |
136-
| [accounts](/sdk-and-tools/indices/es-index-accounts) | Contains the addresses' balances and the timestamp when they were modified. |
137-
| [accountshistory](/sdk-and-tools/indices/es-index-accountshistory) | Contains historical information about the address balances. |
138-
| [receipts](/sdk-and-tools/indices/es-index-receipts) | Contains all generated receipts. |
139-
| [scresults](/sdk-and-tools/indices/es-index-scresults) | Contains all generated smart contract results. |
140-
| [accountsesdt](/sdk-and-tools/indices/es-index-accountsesdt) | Contains the addresses' ESDT balances. |
141-
| [accountsesdthistory](/sdk-and-tools/indices/es-index-accountsesdthistory) | Contains historical information about the address ESDT balances. |
142-
| [epochinfo](/sdk-and-tools/indices/es-index-epochinfo) | Contains the accumulated fees and the developer fees grouped by epochs. |
143-
| [scdeploys](/sdk-and-tools/indices/es-index-scdeploys) | Contains details about all the deployed smart contracts. |
144-
| [tokens](/sdk-and-tools/indices/es-index-tokens) | Contains all created ESDT tokens. |
145-
| [tags](/sdk-and-tools/indices/es-index-tags) | Contains the NFTs' tags. |
146-
| [logs](/sdk-and-tools/indices/es-index-logs) | Contains all the logs generated by transactions and smart contract results. |
147-
| [delegators](/sdk-and-tools/indices/es-index-delegators) | Contains details about all the delegators. |
148-
| [operations](/sdk-and-tools/indices/es-index-operations) | Contains all transactions and smart contract results. |
128+
| Name | Description |
129+
|----------------------------------------------------------------------------|-------------------------------------------------------------------------------|
130+
| [transactions](/sdk-and-tools/indices/es-index-transactions) | Contains all transactions. |
131+
| [blocks](/sdk-and-tools/indices/es-index-blocks) | Contains all executed blocks. |
132+
| [validators](/sdk-and-tools/indices/es-index-validators) | Contains the public keys of the validators grouped by epoch and shard. |
133+
| [rating](/sdk-and-tools/indices/es-index-rating) | Contains the validators' rating for every epoch. |
134+
| [miniblocks](/sdk-and-tools/indices/es-index-miniblocks) | Contains all executed minblocks. |
135+
| [rounds](/sdk-and-tools/indices/es-index-rounds) | Contains details of each round that has passed. |
136+
| [accounts](/sdk-and-tools/indices/es-index-accounts) | Contains the addresses' balances and the timestamp when they were modified. |
137+
| [accountshistory](/sdk-and-tools/indices/es-index-accountshistory) | Contains historical information about the address balances. |
138+
| [receipts](/sdk-and-tools/indices/es-index-receipts) | Contains all generated receipts. |
139+
| [scresults](/sdk-and-tools/indices/es-index-scresults) | Contains all generated smart contract results. |
140+
| [accountsesdt](/sdk-and-tools/indices/es-index-accountsesdt) | Contains the addresses' ESDT balances. |
141+
| [accountsesdthistory](/sdk-and-tools/indices/es-index-accountsesdthistory) | Contains historical information about the address ESDT balances. |
142+
| [epochinfo](/sdk-and-tools/indices/es-index-epochinfo) | Contains the accumulated fees and the developer fees grouped by epochs. |
143+
| [scdeploys](/sdk-and-tools/indices/es-index-scdeploys) | Contains details about all the deployed smart contracts. |
144+
| [tokens](/sdk-and-tools/indices/es-index-tokens) | Contains all created ESDT tokens. |
145+
| [tags](/sdk-and-tools/indices/es-index-tags) | Contains the NFTs' tags. |
146+
| [logs](/sdk-and-tools/indices/es-index-logs) | Contains all the logs generated by transactions and smart contract results. |
147+
| [events](/sdk-and-tools/indices/es-index-events) | Contains all the events generated by transactions and smart contract results. |
148+
| [delegators](/sdk-and-tools/indices/es-index-delegators) | Contains details about all the delegators. |
149+
| [operations](/sdk-and-tools/indices/es-index-operations) | Contains all transactions and smart contract results. |
149150

150151
[comment]: # (mx-context-auto)
151152

docs/sdk-and-tools/indices/blocks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The `_id` field of this index is represented by the block hash, in a hexadecimal
3838
| shardId | The shardId field represents the shard this block belongs to. |
3939
| txCount | The txCount field represents the number of transactions that were executed in the block. |
4040
| notarizedTxsCount | The notarizedTxsCount field represents the number of transactions that were notarized in the block. |
41-
| accumulatedFees | The accumulatedFees field represents the accumulated fees that were paid in the block. |
41+
| accumulatedFees | The accumulatedFees field represents the accumulated fees that were paid in the block. |
4242
| developerFees | The developerFees field represents the developer fees that were accumulated in the block. |
4343
| epochStartBlock | The epochStartBlock field is true if the current block is an epoch-start block. |
4444
| epochStartInfo | The epochStartInfo field is a structure that contains economic data, such as total supply. |

0 commit comments

Comments
 (0)