Skip to content

Commit

Permalink
Merge pull request #672 from multiversx/development
Browse files Browse the repository at this point in the history
Development into main
  • Loading branch information
bogdan-rosianu committed Aug 4, 2023
2 parents 87b860b + 52555f0 commit 8bec9f8
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 38 deletions.
6 changes: 3 additions & 3 deletions docs/developers/developer-reference/serialization-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Even when simulating smart contract execution on 64-bit systems, they must still
| `i8` | `1` | `0x01` | `0x01` |
| `i8` | `-1` | `0xFF` | `0xFF` |
| `i8` | `127` | `0x7F` | `0x7F` |
| `i8` | `-0x11` | `0xEF` | `0xEF` |
| `i8` | `-128` | `0x80` | `0x80` |
| `i16` | `-0x11` | `0xEF` | `0xEF` |
| `i16` | `-1` | `0xFF` | `0xFFFF` |
| `i16` | `-0x11` | `0xEF` | `0xFFEF` |
| `i16` | `-0x1122` | `0xEEDE` | `0xEEDE` |
Expand Down Expand Up @@ -128,7 +128,7 @@ Even when simulating smart contract execution on 64-bit systems, they must still

For most smart contracts applications, number larger than the maximum uint64 value are needed.
EGLD balances for instance are represented as fixed-point decimal numbers with 18 decimals.
This means that to represent even just 1 EGLD we use the number 10<sup>18</sup>, which already exceeds the capacity of a regular 64-bit integer.
This means that to represent even just 100 EGLD we use the number 100*10<sup>18</sup>, which already exceeds the capacity of a regular 64-bit integer.

**Rust types**: `BigUint`, `BigInt`,

Expand Down Expand Up @@ -156,7 +156,7 @@ Next we encode:
| `BigUint` | `256` | `0x0100` | `0x000000020100` | `256` is the smallest number that takes 2 bytes. |
| `BigInt` | `0` | `0x` | `0x00000000` | Signed `0` is also represented as zero-length bytes. |
| `BigInt` | `1` | `0x01` | `0x0000000101` | Signed `1` is also represented as 1 byte. |
| `BigInt` | `-1` | `0x01FF` | `0x00000001FF` | The shortest 2's complement representation of `-1` if `FF`. The most significant bit is 1. |
| `BigInt` | `-1` | `0xFF` | `0x00000001FF` | The shortest 2's complement representation of `-1` is `FF`. The most significant bit is 1. |
| `BigUint` | `127` | `0x7F` | `0x000000017F` | |
| `BigInt` | `127` | `0x7F` | `0x000000017F` | |
| `BigUint` | `128` | `0x80` | `0x0000000180` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Upgrading a smart contract is a relatively easy process, but its implications ar
mxpy --verbose contract upgrade SC_ADDRESS --recall-nonce \
--pem=PEM_PATH --bytecode=WASM_PATH \
--gas-limit=100000000 \
--send --proxy="https://devnet-gateway.multiversx.com" --chain=D
--send --proxy=https://devnet-gateway.multiversx.com --chain=D
```

Replace SC_ADDRESS, PEM_PATH and WASM_PATH accordingly. Also, if you want to use testnet/mainnet, also change the proxy and chain ID.
Expand All @@ -25,7 +25,7 @@ mxpy --verbose contract upgrade SC_ADDRESS --recall-nonce \
--pem=PEM_PATH --bytecode=WASM_PATH \
--arguments arg1 arg2 arg3
--gas-limit=100000000 \
--send --proxy="https://devnet-gateway.multiversx.com" --chain=D
--send --proxy=https://devnet-gateway.multiversx.com --chain=D
```

You might've seen in many of the MultiversX contracts, we use the `set_if_empty` method in init, instead of plain `set`. This is so we don't accidentally overwrite an important config value during the upgrade process.
Expand Down
42 changes: 12 additions & 30 deletions docs/developers/tutorials/your-first-dapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,39 +194,21 @@ After running this command line, we see that a wasm file was generated. This fil
Deploy the smart contract on MultiversX Devnet
Next step is to deploy the contract to the blockchain.

**Customize the variables**

Optionally we can customize the default params in `mxpy.json`:

```javascript
{
"configurations": {
"default": {
"proxy": "https://devnet-api.multiversx.com",
"chainID": "D"
}
},
"contract":{
"deploy":{
"verbose": true,
"bytecode": "output/ping-pong.wasm",
"recall-nonce": true,
"pem": "../../wallet/wallet-owner.pem",
"gas-limit": 60000000,
"arguments": [1000000000000000000, 600],
"send": true,
"outfile": "deploy-testnet.interaction.json"
}
}
}
```

Make sure your _owner wallet PEM file_ is in the right folder, the smart contract is build and let's get to the deployment.
Make sure your _owner wallet PEM file_ is in the right folder, the smart contract is built and let's get to the deployment.
For now let's continue with the default values.
We will run:

```sh
mxpy contract deploy
```bash
mxpy --verbose contract deploy \
--bytecode output/ping-pong.wasm \
--pem ../../wallet/wallet-owner.pem \
--recal-nonce \
--gas-limit 60000000 \
--arguments [1000000000000000000, 600] \
--chain D \
--proxy https://devnet-api.multiversx.com \
--outfile deploy-testnet.interaction.json \
--send
```

We'll take a look at the log output. We have 2 elements that need our attention: the contract address and the transaction hash. Let's check them in the [Devnet Explorer](https://devnet-explorer.multiversx.com).
Expand Down
3 changes: 0 additions & 3 deletions docs/sdk-and-tools/notifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,9 @@ The `Redis` section includes the following parameters as described below:
```toml
[Redis]
# The url used to connect to a pubsub server
# Note: not required for running in the notifier mode
Url = "redis://localhost:6379/0"

# The pubsub channel used for publishing/subscribing
# Note: not required for running in the notifier mode
Channel = "pub-sub"

# The master name for failover client
Expand Down Expand Up @@ -178,7 +176,6 @@ notifier service start.
```toml
[RabbitMQ]
# The url used to connect to a rabbitMQ server
# Note: not required for running in the notifier mode
Url = "amqp://guest:guest@localhost:5672"

# The exchange which holds all logs and events
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/developers/tutorial/dapp-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/developers/tutorial/dapp-problem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/developers/tutorial/folder-structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8bec9f8

Please sign in to comment.