Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor edits to README #892

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ Stablecoin have transformed the way crypto markets work by allowing traders to e

# Objective

A stablecoin is a type of cryptocurrency that is designed to maintain a stable value relative to a specific asset or basket of assets. Currently, there is no out-of-the-box solution to create and manage stablecoins on Hedera Hashgraph. This project aims to provide developers with the tools they need to build applications that make use of the stablecoin, such as wallets, as well as documentation and sample code to help developers understand how to use the SDK and other functionality provided by the stablecoin platform. With all of this, we want to enable developers to integrate the stablecoin into their own applications or systems.
A stablecoin is a type of cryptocurrency that is designed to maintain a stable value relative to a specific asset or basket of assets. Currently, there is no out-of-the-box solution to create and manage stablecoins on Hedera. This project aims to provide developers with the tools they need to build applications that make use of the stablecoin, such as wallets, as well as documentation and sample code to help developers understand how to use the SDK and other functionality provided by the stablecoin platform. With all of this, we want to enable developers to integrate the stablecoin into their own applications or systems.

# Overview

This solution consists of a set of tools, including Smart Contracts, SDK, CLI and UI to facilitate the deployment and management of stablecoins in Hedera Hashgraph.
This open source solution consists of a comprehensive set of tools, including Smart Contracts, SDK, CLI, and UI to facilitate the deployment and management of stablecoins on Hedera.

## What is a stablecoin

Expand Down Expand Up @@ -98,7 +98,7 @@ Every time a stablecoin is created, a new Hedera Token is created (the underlyin

An smart contract, named `StablecoinFactory`, must be previously deployed since implements the flow to create a new stablecoin in a single transaction. A default `StablecoinFactory` is deployed, but any user will be able to [deploy their own factory](#deploying-the-stablecoin-factories).

(\*)By default, the HederaTokenManager smart contract that will be used will be the pre-deployed one, but users can use any other contract they want. For more information on this check the contract module's README.
(\*)By default, the `HederaTokenManager` smart contract that will be used will be the pre-deployed one, but users can use any other contract they want. For more information on this check the contract module's README.

Users interact with the stablecoin proxy smart contract, instead of doing with the stablecoin logic smart contract, because its address will never change. stablecoin logic smart contract address change if a new version is deployed.

Expand Down Expand Up @@ -223,13 +223,13 @@ Or within any of the modules:

# Recommendations

If you are using VSCode we recommend the use of the solidity extension from nomicFoundation, it will facilitate the use of hardhat.
If you are using VSCode we recommend the use of the Solidity extension from nomicFoundation, it will facilitate the use of hardhat.
[hardhat-vscode](https://github.com/NomicFoundation/hardhat-vscode)

> This may not be compatible with others solidity extensions, such as this one. [vscode-solidity](https://github.com/juanfranblanco/vscode-solidity)
> This may not be compatible with others Solidity extensions, such as this one. [vscode-solidity](https://github.com/juanfranblanco/vscode-solidity)

# Deploying the stablecoin factories
In order to be able to deploy any stablecoin, the `HederaTokenManager` and `StablecoinFactory` smart contracts must be deployed on the network. Whenever a new version of these contracts is needed or when the testnet is reset, new contracts must be deployed. Moreover, the address of the `StablecoinFactory` smart contract must be updated in the SDK, CLI and web modules as explained above.
In order to be able to deploy any stablecoin, the `HederaTokenManager` and `StablecoinFactory` smart contracts must be deployed on the network. Whenever a new version of these contracts is needed or when the testnet is reset, new contracts must be deployed. Moreover, the address of the `StablecoinFactory` smart contract must be updated in the SDK, CLI, and web modules as explained above.

We provide default addresses for the factories that we have deployed for anyone to use that are updated whenever a new version is released.

Expand Down
34 changes: 17 additions & 17 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ The command below can be used to install the official release from the NPM repos
npm install -g @hashgraph-dev/stablecoin-npm-cli
```

Once installed globally you can use the `accelerator wizard` command to run the CLI.
Once installed globally you can use the `wizard` command to run the CLI.

```bash
accelerator wizard
npm run start:wizard
```

# Build
Expand All @@ -78,29 +78,29 @@ Then you must install and build the following projects :
From the root of the CLI project workspace:

- Run `npm install`. This will create and populate `node_modules` and build the project and dependencies.
- Run `npm start`. This will display the CLI options.
- Run `npm run start`. This will display the CLI options.
- Run `npm run start:wizard`. To start the CLI in wizard mode creating a config file in the project folder.

# Quickstart

## Starting the CLI

The first time you execute the `accelerator wizard` command in your terminal, if you haven't added your default configuration path the interface will ask you whether you want to create a new configuration file in the default path. When the configuration file is created you must configure the default network, operating accounts and the factory contract id. In order to create the default account you can use [HashPack](https://www.hashpack.app/download) or the [Hedera Developer Portal](https://portal.hedera.com/register).
The first time you execute the `npm run start:wizard` command in your terminal, if you haven't added your default configuration path the interface will ask you whether you want to create a new configuration file in the default path. When the configuration file is created you must configure the default network, operating accounts and the factory contract id. In order to create the default account you can use [HashPack](https://www.hashpack.app/download) or the [Hedera Developer Portal](https://portal.hedera.com/register).

https://github.com/hashgraph/stablecoin-studio/assets/108128685/73c2ed6c-ebc4-4717-b837-c4595c007ba0

_Note that for testing purpose you should create a **Testnet** account instead of Mainnet account. Everything executed on Mainnet will incur a cost with real money._
> _**Note:** that for testing purpose you should create a **Testnet** account instead of Mainnet account. Everything executed on Mainnet will incur a cost with real money._

# Usage

To use the CLI correctly it is necessary to generate a configuration file in which the default network, their associated accounts and the factory contract id will be included. These parameters can be modified later on, from the CLI.
To use the CLI correctly, it is necessary to generate a configuration file in which the default network, their associated accounts and the factory contract id will be included. These parameters can be modified later on from the CLI.

## Automatically creating a config file

The configuration file that is automatically generated populates its fields using the answers to the questions displayed in the CLI when the application is started for the first time.
The file format is .yaml and the structure is as follows:
The file format is `.yaml` and the structure is as follows:

```
```yaml
defaultNetwork: testnet
networks:
- name: mainnet
Expand Down Expand Up @@ -154,10 +154,10 @@ factories:
```
## Manually creating a config file

A config file can be manually created using the "hsca-config.sample.yaml" file as a template. Follow this steps:
A config file can be manually created using the `hsca-config.sample.yaml` file as a template. Follow these steps:

- **Copy/Paste** the "hsca-config.sample.yaml" file
- **Rename** it "hsca-config.yaml"
- **Copy/Paste** the `hsca-config.sample.yaml` file
- **Rename** it `hsca-config.yaml`
- **Fill** it like
- **defaultNetwork** : choose between mainnet, testnet and previewnet.
- **networks** : _(Optional)_ for each network:
Expand Down Expand Up @@ -192,7 +192,7 @@ A config file can be manually created using the "hsca-config.sample.yaml" file a

## Factories 

We provide default addresses for the factories that we have deployed for anyone to use that are updated whenever a new version is released.
We provide default addresses for the factories that we have deployed for anyone to use that is updated whenever a new version is released.

| Contract name | Address | Network |
| -------------- | ------------ | ---------- |
Expand All @@ -203,26 +203,26 @@ We provide default addresses for the factories that we have deployed for anyone

![CLI Flow](https://github.com/hashgraph/stablecoin-studio/assets/56278409/f75b66ab-b6d9-48f9-92b0-1c2a2af68556)

When the CLI is started with the configuration file properly configured, the first action will be to select the account you want to operate with. By default, the list of configured accounts belonging to the default network indicated in the configuration file, is displayed.
When the CLI is started with the configuration file properly configured, the first action will be to select the account you want to operate with. By default, the list of configured accounts belonging to the default network indicated in the configuration file is displayed.

If there are no accounts in the file for the default network, a warning message will be displayed and a list of all the accounts in the file will be displayed.

When an account is selected, the main menu is displayed. The network the account belongs to will be set.

### Main menu

When your configuration file is set up and at least one account is added and selected, you are able to see the different options that are available.
When your configuration file is set up and at least one account is added and selected, you can see the different available options.

#### Create a new stablecoin

In order to use this option you must set a factory first.
You can check our factories deployed in [our documentation](https://github.com/hashgraph/stablecoin-studio#deploying-the-stable-coin-factories).

With this option you are able to create a new stablecoin adding the mandatory details like name and symbol.
With this option, you are able to create a new stablecoin, adding the mandatory details like name and symbol.

> The auto-renew account is not requested since is automatically set to be the user's current account, otherwise the stablecoin creation will not work, this is due to the fact that the auto-renew account must sign the underlying token's creation transaction, and currently we do not support multi-signatures transactions.
> The `auto-renew` account is not requested since it is automatically set to be the user's current account. Otherwise, the stablecoin creation will not work. This is due to the fact that the `auto-renew` account must sign the underlying token's creation transaction, and currently, we do not support multi-signature transactions.

After the minimum details have been added, you will be asked if you want to add optional details like the number of decimals, the initial supply or the max supply. If you reply "no", the default values will be set.
After the minimum details have been added, you will be asked if you want to add optional details like the number of decimals, the initial supply, or the max supply. If you reply "no," the default values will be set.

Another question is prompt asking if you would like the smart contract to be set as the owner of all the underlying token keys (pause, wipe, ...), you could however set any key you wish as the owner of any token key, except for the admin key and the supply key that will be automatically set to be the smart contract.

Expand Down