Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into documents
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyelong committed Apr 18, 2023
2 parents 805baec + db8762a commit 9bd7213
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 3 deletions.
16 changes: 15 additions & 1 deletion docs/cli-client/token.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ Token module allows you to manage assets on IRIS Hub
## Available Commands

| Name | Description |
| ------------------------------------------ | ------------------------------------------ |
|--------------------------------------------|--------------------------------------------|
| [issue](#iris-tx-token-issue) | Issue a new token |
| [edit](#iris-tx-token-edit) | Edit an existing token |
| [transfer](#iris-tx-token-transfer) | Transfer the ownership of a token |
| [mint](#iris-tx-token-mint) | Mint tokens to a specified address |
| [burn](#iris-tx-token-burn) | Burn some tokens |
| [swap-fee](#iris-tx-token-swap-fee) | Swap one token with another token |
| [token](#iris-query-token-token) | Query a token by symbol |
| [tokens](#iris-query-token-tokens) | Query tokens by owner |
| [fee](#iris-query-token-fee) | Query the token related fees |
Expand Down Expand Up @@ -122,6 +123,19 @@ iris tx token mint [symbol] [flags]
| --to | string | | | Address to which the token will be minted, default to the owner address |
| --amount | uint64 | Yes | 0 | Amount of the tokens to be minted |

## iris tx token swap-fee

Swap one token with another token. For example, this feature can be used to exchange `IRIS` for `ERIS`.

```bash
iris tx token swap-fee [fee_paid] --to [reciever]
```
**Flags:**

| Name | Type | Required | Default | Description |
| -------- | ------ |----------| ------- |-------------------------------------------|
| --to | string | Yes | | Address to which the token will be swaped |

### Mint Token

```bash
Expand Down
4 changes: 2 additions & 2 deletions docs/get-started/evm-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Open the Metamask extension on your browser, you may have to log in to your Meta

Then click the top right circle and go to `Settings > Networks`. Press the `Add Network` button and fill the form as the example below with your application ChainID:

- Network Name: IRISHub
- RPC URL: http://localhost:8545
- Network Name: IRISHub 2.0
- RPC URL: https://evmrpc.irishub-1.irisnet.org
- ChainID: 6688
- Symbol: ERIS

Expand Down
63 changes: 63 additions & 0 deletions docs/migration/account.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## Introduction

IRISHub v2.0 changed the generative structure of the entire account system from `auth.BaseAccountProto` to `ethermint.ProtoAccount` , resulting in incompatibility of newly created accounts;

**Note:** **Accounts before the v2.0 upgrade will not be affected and can still be used normally**

**The following content takes nyancat testnet as an example:**

For accounts before the v2.0 upgrade, the query structure through LCD is as follows: https://lcd.nyancat.irisnet.org/cosmos/auth/v1beta1/accounts/iaa1e0rx87mdj79zejewuc4jg7ql9ud2286g2us8f2

```json
{
"account": {
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address":"iaa1e0rx87mdj79zejewuc4jg7ql9ud2286g2us8f2",
"pub_key": {
"@type": "/cosmos.crypto.secp256k1.PubKey",
"key":"AiOFJ3Jclq/8y3xV85ALNFuA7FJo1IMoTxYoB3ddMrMr"
},
"account_number": "1251",
"sequence": "12983"
}
}
```

For accounts upgraded in v2.0, the query structure through LCD is as follows: https://lcd.nyancat.irisnet.org/cosmos/auth/v1beta1/accounts/iaa1g4uak38a8fhkg5v5qky3fc9g6h50yrdcn7waug

```json
{
"account": {
"@type": "/ethermint.types.v1.EthAccount",
"base_account": {
"address":"iaa1g4uak38a8fhkg5v5qky3fc9g6h50yrdcn7waug",
"pub_key": {
"@type": "/ethermint.crypto.v1.ethsecp256k1.PubKey",
"key":"AhHKT0xpnrOmpikkd1lEPxiEHG4ngItq06KLhwU2UQHO"
},
"account_number": "5564",
"sequence": "6"
},
"code_hash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
}
}
```


### Using Proto

A new type needs to be registered, and the type structure is here: https://github.com/bianjieai/ethermint/blob/v0.20.0-irishub-1/proto/ethermint/types/v1/account.proto

When the query structure is `/ethermint.types.v1.EthAccount`, use the new structure analysis;

When the query structure is `/cosmos.auth.v1beta1.BaseAccount`, use the old structure analysis;

You can refer to the core-sdk-go written by the irisnet team. The relevant hash is at: https://github.com/irisnet/core-sdk-go/commit/68ed671727e057edb185935c42710f8777dab62f

### Useing LCD

When parsing, please make compatibility according to the required type;

If the type is `/cosmos.auth.v1beta1.BaseAccount`, use the old structure analysis;

If the type is `/ethermint.types.v1.EthAccount`, use the new structure analysis;
Binary file modified docs/pics/evm-metamask.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 9bd7213

Please sign in to comment.