diff --git a/docs/developer-docs/docs/build-a-keychain/operate-a-keychain/create-a-keychain.md b/docs/developer-docs/docs/build-a-keychain/operate-a-keychain/create-a-keychain.md
index 160a6879a..933d37e98 100644
--- a/docs/developer-docs/docs/build-a-keychain/operate-a-keychain/create-a-keychain.md
+++ b/docs/developer-docs/docs/build-a-keychain/operate-a-keychain/create-a-keychain.md
@@ -71,10 +71,10 @@ You can skip this guide and test a preconfigured Keychain. Just run a local node
2. Clone the repository with Warden source code. Then build the binary and initialize the chain home folder:
```bash
- git clone --depth 1 --branch v0.4.2 https://github.com/warden-protocol/wardenprotocol
+ git clone --depth 1 --branch v0.5.2 https://github.com/warden-protocol/wardenprotocol
cd wardenprotocol
- just build
- just install
+ just wardend build
+ just wardend install
wardend init my-chain-moniker
```
diff --git a/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-a-cross-chain-app.md b/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-a-cross-chain-app.md
index 98c6b2432..9fcdda46b 100644
--- a/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-a-cross-chain-app.md
+++ b/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-a-cross-chain-app.md
@@ -292,7 +292,7 @@ Before you start, do the following:
Start by creating a WASM contract that will burn tokens on the EVM contract:
-1. Create a CosmWasm project. You can [use a template](deploy-a-wasm-contract#1-create-a-cosmwasm-project).
+1. Create a CosmWasm project. You can [use a template](deploy-a-wasm-contract#2-create-a-cosmwasm-project).
2. In the `/src` directory of your project, create a `contract.rs` file with the code below. If you've used a template, update the existing file.
@@ -405,7 +405,7 @@ Start by creating a WASM contract that will burn tokens on the EVM contract:
### 2.2. Add supporting code
-In the following steps, you'll create files in the `/src` folder to add supporting code for your contract. If you're using a [CosmWasm project template](deploy-a-wasm-contract#1-create-a-cosmwasm-project), just update the existing files.
+In the following steps, you'll create files in the `/src` folder to add supporting code for your contract. If you're using a [CosmWasm project template](deploy-a-wasm-contract#2-create-a-cosmwasm-project), just update the existing files.
1. Create a file named `msg.rs` with the following code:
@@ -619,7 +619,7 @@ In the following steps, you'll create files in the `/src` folder to add supporti
### 2.3. Compile & optimize
-Now you can [compile](deploy-a-wasm-contract#3-compile-the-contract) and [optimize](deploy-a-wasm-contract#4-optimize-the-code) your contract.
+Now you can [compile](deploy-a-wasm-contract#4-compile-the-contract) and [optimize](deploy-a-wasm-contract#5-optimize-the-code) your contract.
### 2.4. Create a Warden account
diff --git a/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-a-wasm-contract.md b/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-a-wasm-contract.md
index dab340665..58f27be6f 100644
--- a/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-a-wasm-contract.md
+++ b/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-a-wasm-contract.md
@@ -9,10 +9,9 @@ import TabItem from '@theme/TabItem';
## Overview
-The [`x/wasm`](/learn/warden-protocol-modules/external-modules#xwasm) Warden module allows executing WebAssembly smart contracts developed with [CosmWasm](https://cosmwasm.com) and **Rust**.
-
-This guide explains how to create and deploy a simple "Hello World" WASM contract on the Warden chain. Since it's intended for testing purposes, you'll be running a local chain.
+The [`x/wasm`](/learn/warden-protocol-modules/external-modules#xwasm) Warden module allows executing **WebAssembly smart contracts** developed with [CosmWasm](https://cosmwasm.com) and **Rust**.
+This guide explains how to create and deploy a simple "Hello World" WASM contract on a Warden local chain or on [Chiado testnet](/operate-a-node/chiado-testnet/chiado-overview).
## Prerequisites
Before you start, complete the following prerequisites:
@@ -31,26 +30,89 @@ Before you start, complete the following prerequisites:
- [wasm-opt](https://docs.rs/wasm-opt/latest/wasm_opt/index.html): A tool for optimizing the compiled WebAssembly (Wasm) code.
- To install these tools, run the following commands:
-
```bash
rustup target add wasm32-unknown-unknown
cargo install cargo-generate --features vendored-openssl
brew install binaryen
```
-- [Run a local chain](/operate-a-node/run-a-local-chain) and make sure you have `wardend` correctly installed.
+## 1. Prepare the chain
- The next steps require your local account name, or key name. You can check the list of available keys by executing this command:
+### Option 1. Run a local chain
- ```bash
- wardend keys list
- ```
- :::tip
- If you used our `just` script to run the node with default settings, the local account name is `shulgin`.
- :::
+To deploy a WASM contract locally, you need to run a local chain and make sure it's configured properly, as shown in the following steps:
+
+1. Run a local chain as explained here: [Run a local chain](/operate-a-node/run-a-local-chain). Note that you'll need to [install Go](https://golang.org/doc/install) 1.22.3 or later and [just](https://github.com/casey/just) 1.34.0 or later.
+
+2. The next steps require your local account name, or key name. You can check the list of available keys by executing this command:
+
+ ```bash
+ wardend keys list
+ ```
+ :::tip
+ If you used our `just` script to run the node with default settings, the local account name is `shulgin`.
+ :::
+
+3. Check the local account balance to make sure it has funds:
+
+
+
+ ```bash
+ wardend query bank balances shulgin
+ ```
+
+
+ ```bash
+ wardend query bank balances my-key-name
+ ```
+
+
+
+### Option 2. Connect to Chiado
+
+To deploy a WASM contract on [Chiado testnet](/operate-a-node/chiado-testnet/chiado-overview), you need to install its binary and fund your key, as shown in the following steps:
+
+1. If you haven't yet, [install Go](https://golang.org/doc/install) 1.22.3 or later and [just](https://github.com/casey/just) 1.34.0 or later.
+
+2. Clone the repository with Warden source code. Then build the binary and initialize the chain home folder:
+
+ ```bash
+ git clone --depth 1 --branch v0.5.3 https://github.com/warden-protocol/wardenprotocol
+ cd wardenprotocol
+ just wardend build
+ just wardend install
+ wardend init my-chain-moniker
+ ```
-## 1. Create a CosmWasm project
+3. Create a new key:
+
+ ```bash
+ wardend keys add my-key-name
+ ```
+
+4. Write down the **mnemonic phrase** and the **address** of the new account. You'll need this information to interact with the chain and restore the account.
+
+ :::warning
+ The seed phrase is the only way to restore your keys. Losing it can result in the irrecoverable loss of WARD tokens.
+ :::
+
+ :::tip
+ You can always check your public address by running this command:
+
+ ```bash
+ wardend keys show my-key-name --address
+ ```
+ :::
+
+5. Fund your key using [Chiado faucet](https://faucet.chiado.wardenprotocol.org) and the public address obtained in the previous step.
+
+6. Check your balance. Here and in other commands, you need to add the `--node` flag with an RPC URL for connecting to Chiado.
+
+ ```bash
+ wardend query bank balances my-key-name --node https://rpc.chiado.wardenprotocol.org:443
+ ```
+
+## 2. Create a CosmWasm project
Create a new CosmWasm project template:
@@ -59,7 +121,7 @@ cargo generate --git https://github.com/CosmWasm/cw-template.git --name hello-wo
cd hello-world
```
-## 2. Modify the contract code
+## 3. Modify the contract code
Now you need to modify files in the `/src` directory as shown in the steps below.
@@ -130,11 +192,6 @@ Now you need to modify files in the `/src` directory as shown in the steps below
#[returns(String)]
GetGreeting {},
}
-
- #[cw_serde]
- pub struct GetCountResponse {
- pub count: i32,
- }
```
2. Open the `helpers.rs` file and replace its contents with this code:
@@ -171,9 +228,9 @@ Now you need to modify files in the `/src` directory as shown in the steps below
}
```
-## 3. Compile the contract
+## 4. Compile the contract
-To compile the contract, run the following from the `hellow-world` directory:
+To compile the contract, run the following from the `hello-world` directory:
```bash
cargo wasm
@@ -181,7 +238,7 @@ cargo wasm
The contract should be compiled without any errors.
-## 4. Optimize the code
+## 5. Optimize the code
Now you need to optimize your compiled Wasm code:
@@ -190,18 +247,12 @@ wasm-opt -Os -o target/wasm32-unknown-unknown/release/hello_world.wasm \
target/wasm32-unknown-unknown/release/hello_world.wasm
```
-## 5. Run the chain
+## 6. Store the contract on-chain
-If your local chain isn't running, execute this command in a separate terminal window:
-
-```bash
-wardend start
-```
+If you're deploying on a local chain, make sure it's running. You can start your chain by running `wardend start` in a separate terminal window.
-## 6. Store the contract on-chain
+To store your contract on-chain, run the command below. Specify your key name from [Step 1](#1-prepare-the-chain) in the `--from` flag, also set the chain ID.
-To store your contract on the Warden chain, run the command below. Specify your key name from [Prerequisites](#prerequisites) in the `--from` flag (typically `shulgin`), also set the chain ID.
-
```bash
@@ -225,21 +276,38 @@ wardend tx wasm store target/wasm32-unknown-unknown/release/hello_world.wasm \
--chain-id chain_123-1
```
+
+```bash
+wardend tx wasm store target/wasm32-unknown-unknown/release/hello_world.wasm \
+ --from my-key-name \
+ --gas auto \
+ --gas-adjustment 1.3 \
+ --gas-prices 100000000000award \
+ -y \
+ --chain-id chain_123-1 \
+ --node https://rpc.chiado.wardenprotocol.org:443
+```
+
The transaction should be successful without any errors.
-:::tip
-If you used a `just` script or a devnet snapshot to run your node, you can omit the `--chain-id` flag in this and the following commands.
-:::
-
## 7. Get the code ID
-Get the code ID that indentifies your Wasm code:
+Get the code ID that identifies your Wasm code:
+
+
```bash
wardend query wasm list-code
```
+
+
+```bash
+wardend query wasm list-code --node https://rpc.chiado.wardenprotocol.org:443
+```
+
+
Note down `code_id` from the output.
@@ -277,6 +345,20 @@ wardend tx wasm instantiate 1 '{}' \
--chain-id chain_123-1
```
+
+```bash
+wardend tx wasm instantiate 1 '{}' \
+ --from my-key-name \
+ --label "Hello World" \
+ --gas auto \
+ --gas-adjustment 1.3 \
+ --gas-prices 100000000000award \
+ --no-admin \
+ -y \
+ --chain-id chain_123-1 \
+ --node https://rpc.chiado.wardenprotocol.org:443
+```
+
@@ -317,6 +399,18 @@ wardend tx wasm execute my-contract-address '{"say_hello":{}}' \
--chain-id chain_123-1
```
+
+```bash
+wardend tx wasm execute my-contract-address '{"say_hello":{}}' \
+ --from my-key-name \
+ --gas auto \
+ --gas-adjustment 1.3 \
+ --gas-prices 100000000000award \
+ -y \
+ --chain-id chain_123-1 \
+ --node https://rpc.chiado.wardenprotocol.org:443
+```
+
diff --git a/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-an-evm-contract.md b/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-an-evm-contract.md
index adb628833..fe8814869 100644
--- a/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-an-evm-contract.md
+++ b/docs/developer-docs/docs/build-an-app/deploy-smart-contracts-on-warden/deploy-an-evm-contract.md
@@ -9,9 +9,9 @@ import TabItem from '@theme/TabItem';
## Overview
-The [`x/evm`](/learn/warden-protocol-modules/external-modules#xevm) Warden module allows executing Ethereum Virtual Machine (EVM) contracts charged by [Evmos](https://docs.evmos.org/protocol/modules/evm). They are written in **Solidity**.
+The [`x/evm`](/learn/warden-protocol-modules/external-modules#xevm) Warden module allows executing **Ethereum Virtual Machine (EVM)** contracts charged by [Evmos](https://docs.evmos.org/protocol/modules/evm) and written in **Solidity**.
-This guide explains how to create and deploy a simple "Hello World" Solidity smart contract on the Warden chain. Since it's intended for testing purposes, you'll be running a local chain.
+This guide explains how to create and deploy a simple "Hello World" Solidity smart contract on a Warden local chain or on [Chiado testnet](/operate-a-node/chiado-testnet/chiado-overview).
## Prerequisites
@@ -34,44 +34,116 @@ Before you start, complete the following prerequisites:
```bash
npm install @truffle/hdwallet-provider
```
-- [Run a local chain](/operate-a-node/run-a-local-chain) and make sure you have `wardend` correctly installed. Get the information required for the next steps:
- - Check the list of available keys (local accounts) and note down your key name.
+## 1. Prepare the chain
- ```bash
- wardend keys list
- ```
+### Option 1. Run a local chain
- :::tip
- If you used our `just` script to run the node with default settings, the local account name is `shulgin`.
- :::
+To deploy an EVM contract locally, you need to run a local chain and make sure it's configured properly, as shown in the following steps:
- - Execute a command for getting the private key associated with this key name. You'll need it in [Step 3](#3-configure-truffle).
+1. Run a local chain as explained here: [Run a local chain](/operate-a-node/run-a-local-chain). Note that you'll need to [install Go](https://golang.org/doc/install) 1.22.3 or later and [just](https://github.com/casey/just) 1.34.0 or later.
-
-
- ```bash
- wardend keys export shulgin --unarmored-hex --unsafe
- ```
-
-
- ```bash
- wardend keys export my-key-name --unarmored-hex --unsafe
- ```
-
-
+2. Check the list of available keys (local accounts) and note down your key name.
- - You'll also need your chain ID. Run the following and note down the value from the `network` field:
+ ```bash
+ wardend keys list
+ ```
+
+ :::tip
+ If you used our `just` script to run the node with default settings, the local account name is `shulgin`.
+ :::
+
+3. Check the local account balance to make sure it has funds:
+
+
+
+ ```bash
+ wardend query bank balances shulgin
+ ```
+
+
+ ```bash
+ wardend query bank balances my-key-name
+ ```
+
+
+
+4. The next steps require the private key associated with this account. To get it, run this:
+
+
+
+ ```bash
+ wardend keys export shulgin --unarmored-hex --unsafe
+ ```
+
+
+ ```bash
+ wardend keys export my-key-name --unarmored-hex --unsafe
+ ```
+
+
+
+5. You'll also need your chain ID. Run the following and note down the value from the `network` field:
+
+ ```bash
+ wardend status
+ ```
+
+ :::tip
+ If you used our `just` script to run the node with default settings, the chain ID is `warden_1337-1`.
+ :::
+
+### Option 2. Connect to Chiado
+
+To deploy an EVM contract on [Chiado testnet](/operate-a-node/chiado-testnet/chiado-overview), you need to install its binary and fund your key, as shown in the following steps:
+
+1. If you haven't yet, [install Go](https://golang.org/doc/install) 1.22.3 or later and [just](https://github.com/casey/just) 1.34.0 or later.
+
+2. Clone the repository with Warden source code. Then build the binary and initialize the chain home folder:
+
+ ```bash
+ git clone --depth 1 --branch v0.5.3 https://github.com/warden-protocol/wardenprotocol
+ cd wardenprotocol
+ just wardend build
+ just wardend install
+ wardend init my-chain-moniker
+ ```
+
+3. Create a new key:
+
+ ```bash
+ wardend keys add my-key-name
+ ```
+
+4. Write down the **mnemonic phrase** and the **address** of the new account. You'll need this information to interact with the chain and restore the account.
- ```
- wardend status
- ```
+ :::warning
+ The seed phrase is the only way to restore your keys. Losing it can result in the irrecoverable loss of WARD tokens.
+ :::
- :::tip
- If you used our `just` script to run the node with default settings, the chain ID is `warden_1337-1`.
- :::
+ :::tip
+ You can always check your public address by running this command:
+
+ ```bash
+ wardend keys show my-key-name --address
+ ```
+ :::
-## 1. Create an EVM project
+5. Fund your key using [Chiado faucet](https://faucet.chiado.wardenprotocol.org) and the public address obtained in the previous step.
+
+6. Check your balance:
+
+ ```bash
+ wardend query bank balances my-key-name --node https://rpc.chiado.wardenprotocol.org:443
+ ```
+
+7. The next steps require the private key associated with this account. To get it, run this:
+
+ ```bash
+ wardend keys export my-key-name --unarmored-hex --unsafe
+ ```
+
+## 2. Create an EVM project
1. Create a new directory `/warden-smart-contract` for your project and navigate there:
@@ -86,7 +158,7 @@ Before you start, complete the following prerequisites:
truffle init
```
-## 2. Create a smart contract
+## 3. Create a smart contract
In the `/contracts` directory, create a new file `HelloWarden.sol` with the following contents:
@@ -111,48 +183,79 @@ contract HelloWarden {
}
```
-## 3. Configure Truffle
-
-In the `/warden-smart-contract` directory, find the `truffle-config.js` file and update it with the code below.
-
-Make adjustments in the code using your chain settings from [Prerequisites](#prerequisites):
-
-1. Replace `your_private_key` with your actual private key.
-2. In `network_id`, specify the first number from your chain ID. For example, if your chain ID is `warden_1337-1` or `chain_123-1`, specify `1337` or `123` respectively. Alternatively, you can just use `"*"` to match any chain ID.
-3. If needed, adjust the gas limit and price – `gas` and `gasPrice`.
-
-```javascript title="/warden-smart-contract/truffle-config.js"
-const HDWalletProvider = require("@truffle/hdwallet-provider");
-
-// Your private key (keep this secret and never commit it to version control!)
-const PRIVATE_KEY = "your_private_key";
-
-module.exports = {
- networks: {
- warden: {
- provider: function() {
- return new HDWalletProvider(PRIVATE_KEY, "http://localhost:8545");
- },
- network_id: 1337, // The first number from your chain ID
- host: "127.0.0.1",
- port: 8545,
- gas: 5500000,
- gasPrice: 20000000000 // award
- },
- },
- compilers: {
- solc: {
- version: "0.8.20",
- }
- }
-};
+## 4. Configure Truffle
+
+1. In the `/warden-smart-contract` directory, find the `truffle-config.js` file and update it with this code:
+
+
+
+ ```javascript title="/warden-smart-contract/truffle-config.js"
+ const HDWalletProvider = require("@truffle/hdwallet-provider");
+
+ // Keep your private key confidential, DO NOT commit to version control!
+ const PRIVATE_KEY = "your_private_key";
+
+ // The standard localhost address and the node's RPC port
+ const RPC_URL = "http://127.0.0.1:8545";
+
+ module.exports = {
+ networks: {
+ warden: {
+ provider: function() {
+ return new HDWalletProvider(PRIVATE_KEY, RPC_URL);
+ },
+ network_id: 1337, // The first number from the chain ID
+ gas: 5500000,
+ gasPrice: 20000000000 // award
+ },
+ },
+ compilers: {
+ solc: {
+ version: "0.8.20",
+ }
+ }
+ };
+ ```
+
+
+ ```javascript title="/warden-smart-contract/truffle-config.js"
+ const HDWalletProvider = require("@truffle/hdwallet-provider");
+
+ // Keep your private key confidential, DO NOT commit to version control!
+ const PRIVATE_KEY = "your_private_key";
+
+ // Chiado's EVM endpoint
+ const RPC_URL = "https://evm.chiado.wardenprotocol.org";
+
+ module.exports = {
+ networks: {
+ warden: {
+ provider: function() {
+ return new HDWalletProvider(PRIVATE_KEY, RPC_URL);
+ },
+ network_id: 10010, // The first number from the chain ID
+ gas: 5500000,
+ gasPrice: 20000000000 // award
+ },
+ },
+ compilers: {
+ solc: {
+ version: "0.8.20",
+ }
+ }
+ };
```
+
+
-:::note
-The `host` and `port` values are the standard localhost address and the RPC port of the node. `HDWalletProvider` uses the same URL to connect to the node. If you're running your node on the same machine where you're deploying the contract, you don't need to change these settings. Otherwise, run `wardend status` to check the host address and adjust the configuration accordingly.
-:::
+2. Adjust the code and make sure all values are correct:
+
+ - `your_private_key`: Replace it with your actual private key from [Step 1](#1-prepare-the-chain).
+ - `RPC_URL`: If you're running a local chain and deploying the contract on the same machine, use the standard localhost address. Otherwise, check the chain's host address by executing `wardend status` on the machine hosting the chain. For Chiado, specify its EVM endpoint: `https://evm.chiado.wardenprotocol.org`.
+ - `network_id`: Specify the first number from the chain ID. For example, if your local chain ID is `warden_1337-1`, the network ID is `1337`. The correct value for Chiado is `10010`. Alternatively, you can just use `"*"` to match any chain ID.
+ - If needed, adjust the gas limit and price – `gas` and `gasPrice`.
-## 4. Create a migration script
+## 5. Create a migration script
In `/migrations`, create a new file `2_deploy_hello_warden.js` with the following contents:
@@ -160,11 +263,11 @@ In `/migrations`, create a new file `2_deploy_hello_warden.js` with the followin
const HelloWarden = artifacts.require("HelloWarden");
module.exports = function(deployer) {
-deployer.deploy(HelloWarden);
+ deployer.deploy(HelloWarden);
};
```
-## 5. Compile the contract
+## 6. Compile the contract
To compile your contract, run this command:
@@ -183,8 +286,10 @@ Compiling your contracts...
- solc: 0.8.20+commit.c7dfd78e.Emscripten.clang
```
-## 6. Deploy the contract
+## 7. Deploy the contract
+If you're deploying on a local chain, make sure it's running. You can start your chain by running `wardend start` in a separate terminal window.
+
To deploy the contract, run this:
```bash
@@ -237,7 +342,7 @@ Summary
Due to Evmos default settings, this log displays prices in ETH and gwei. However, the contract itself uses Warden's currency – WARD, denominated in award.
:::
-## 7. Interact with the contract
+## 8. Interact with the contract
1. To interact with your contract, open the Truffle console: