Skip to content

Commit

Permalink
fixes after initial review
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Sep 24, 2024
1 parent 7a45c2d commit 5b2863b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/sdk-and-tools/sdk-py/installing-mxpy.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Before installing **mxpy**, please make sure you have a working **Python 3** env
You'll need **pipx** installed on your machine. For more details on how to install **pipx** check out [**this page**](https://pipx.pypa.io/stable/#install-pipx).

:::note
If you've previously installed **mxpy** using **mxpy-up** we advise you to switch to **pipx**, but make sure to remove the old `mxpy` shortcut and virtual Python environment beforehand:
If you've previously installed **mxpy** using **mxpy-up**, we advise you to switch to **pipx**, but make sure to remove the old `mxpy` shortcut and virtual Python environment beforehand:

```sh
rm ~/multiversx-sdk/mxpy
Expand Down Expand Up @@ -59,7 +59,7 @@ To check that **mxpy** installed successfully you can run the following command:
mxpy --version
```

Aditionally, if you'd like to have shell completion for `bash` and `zsh` run the following command then restart the shell:
Additionally, if you'd like to have shell completion for `bash` and `zsh`, run the following command, then restart the shell:

```sh
activate-global-python-argcomplete
Expand All @@ -69,7 +69,7 @@ activate-global-python-argcomplete

## **Upgrade mxpy using pipx**

To upgrade **mxpy** to a newer version you can simply run the following command:
To upgrade **mxpy** to a newer version, you can simply run the following command:

```sh
pipx upgrade multiversx-sdk-cli
Expand Down
16 changes: 8 additions & 8 deletions docs/sdk-and-tools/sdk-py/mxpy-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ For example, to install `rust`, you can simply type the command:
mxpy deps install rust
```

When installing dependecies the `--overwrite` argument can be used to overwrite an existing version.
When installing dependencies, the `--overwrite` argument can be used to overwrite an existing version.

For example, to overwrite your current `rust` installation, you can simply type the command:

```sh
mxpy deps install rust --overwrite
```

If the configuration is not altered **the default version** will be installed.
If the configuration is not altered, **the default version** will be installed.

:::note Default rust version
Generally speaking, the default `rust` version installed by `mxpy` is the one referenced by [the latest Docker image](https://github.com/multiversx/mx-sdk-rust-contract-builder/blob/main/Dockerfile) used for reproducible builds.
Expand Down Expand Up @@ -177,7 +177,7 @@ mxpy wallet convert --help

## Building a smart contract

In order to deploy a smart contract on the network, you need to build it first. The contract can be built using `mxpy`, but for a more granular approach [sc-meta](/developers/meta/sc-build-reference#how-to-basic-build) should be used. To learn more about `sc-meta` please check out [this page](/developers/meta/sc-meta).
In order to deploy a smart contract on the network, you need to build it first. The contract can be built using `mxpy`, but for a more granular approach, [sc-meta](/developers/meta/sc-build-reference#how-to-basic-build) should be used. To learn more about `sc-meta`, please check out [this page](/developers/meta/sc-meta).

The contract we will be using for this examples can be found [here](https://github.com/multiversx/mx-contracts-rs/tree/main/contracts/adder).

Expand Down Expand Up @@ -245,7 +245,7 @@ The `--pem` argument is used to provide the sender of the transaction, the payer

### Deploying a smart contract providing the ABI file

For functions that have complex arguments we can use the ABI file generated when building the contract. The ABI can be provided using the `--abi` argument. When using the ABI, and only when using the ABI, the arguments should be written in a `json` file and should be provided via the `--arguments-file` argument.
For functions that have complex arguments, we can use the ABI file generated when building the contract. The ABI can be provided using the `--abi` argument. When using the ABI, and only when using the ABI, the arguments should be written in a `json` file and should be provided via the `--arguments-file` argument.

For this example, we'll use the [multisig contract](https://github.com/multiversx/mx-contracts-rs/tree/main/contracts/multisig).

Expand All @@ -265,9 +265,9 @@ First, we'll prepare the file containing the constructors arguments. We'll refer
]
```

Let's go a bit through our file and see why it looks like this. First, as mentioned above, we have to place all the arguments inside a list. Then, the value `2` coresponds to the type `u32`. After that, we have another list that coresponds to the type `variadic`. Inside this list, we need to insert our addresses. For `mxpy`to encode addresses properly, we need to provide the address values inside a dictionary that can contain two keys: we can provide the address as the `bech32` representation or as the `hex encoded` public key.
Let's go a bit through our file and see why it looks like this. First, as mentioned above, we have to place all the arguments inside a list. Then, the value `2` corresponds to the type `u32`. After that, we have another list that coresponds to the type `variadic`. Inside this list, we need to insert our addresses. For `mxpy`to encode addresses properly, we need to provide the address values inside a dictionary that can contain two keys: we can provide the address as the `bech32` representation or as the `hex encoded` public key.

After finishing the arguments file we can run the following command to deploy the contract:
After finishing the arguments file, we can run the following command to deploy the contract:

```sh
mxpy contract deploy --bytecode ~/contracts/multisig/output/multisig.wasm \
Expand Down Expand Up @@ -324,9 +324,9 @@ First, we'll prepare the file containing the endpoints arguments. We'll refer to
]
```

Let's go a bit through our file and see why it looks like this. First, as mentioned above, we have to place all the arguments inside a list. Then, the contract expects an address, so we provide the `bech32` representation. After that, we have a `BigUInt` value that we can provide as a number. The third value is `Option<u64>` so we provide it as a number, as well. In case we wanted to skip this value, we could've simply used `0`. The last parameter is of type `variadic<bytes>`. Because it's a variadic value we have to place the arguments inside a list and since we can't write bytes we `hex encode` the value and place it in a dictionary containing the key-value pair `"hex": "<hex_string>"`, same as we did above for the address.
Let's go a bit through our file and see why it looks like this. First, as mentioned above, we have to place all the arguments inside a list. Then, the contract expects an address, so we provide the `bech32` representation. After that, we have a `BigUInt` value that we can provide as a number. The third value is `Option<u64>`, so we provide it as a number, as well. In case we wanted to skip this value, we could've simply used `0`. The last parameter is of type `variadic<bytes>`. Because it's a variadic value, we have to place the arguments inside a list. Since we can't write bytes, we `hex encode` the value and place it in a dictionary containing the key-value pair `"hex": "<hex_string>"`, same as we did above for the address.

After finishing the arguments file we can run the following command to call the endpoint:
After finishing the arguments file, we can run the following command to call the endpoint:

```sh
mxpy contract call erd1qqqqqqqqqqqqqpgqjsg84gq5e79rrc2rm5ervval3jrrfvvfd8sswc6xjy \
Expand Down

0 comments on commit 5b2863b

Please sign in to comment.