-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(specs): fungible module docs (#680)
* docs(specs): fungible module * fix: skip messages.md if no messages --------- Co-authored-by: brewmaster012 <88689859+brewmaster012@users.noreply.github.com>
- Loading branch information
1 parent
fe42a43
commit f3b8ff0
Showing
9 changed files
with
126 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Overview | ||
|
||
The `fungible` facilitates the deployment of fungible tokens of connected | ||
blockchains (called "foreign coins") on ZetaChain. | ||
|
||
Foreign coins are represented as ZRC20 tokens on ZetaChain. | ||
|
||
When a foreign coin is deployed on ZetaChain, a ZRC20 contract is deployed, a | ||
pool is created, liquidity is added to the pool, and the foreign coin is added | ||
to the list of foreign coins in the module's state. | ||
|
||
The module contains the logic for: | ||
|
||
- Deploying a foreign coin on ZetaChain | ||
- Deploying a system contract, Uniswap and wrapped ZETA | ||
- Depositing to and calling omnichain smart contracts on ZetaChain from | ||
connected chains (`DepositZRC20AndCallContract` and `DepositZRC20`) | ||
|
||
the module depends heavily on the | ||
[protocol contracts](https://github.com/zeta-chain/protocol-contracts). | ||
|
||
## State | ||
|
||
The `fungible` module keeps track of the following state: | ||
|
||
- System contract address | ||
- A list of foreign coins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,75 @@ | ||
# ZetaChain | ||
|
||
ZetaChain is an EVM-compatible L1 blockchain that enables omnichain, generic smart contracts and messaging between any blockchain. | ||
ZetaChain is an EVM-compatible L1 blockchain that enables omnichain, generic | ||
smart contracts and messaging between any blockchain. | ||
|
||
## Prerequisites | ||
|
||
* [Go](https://golang.org/doc/install) 1.19 | ||
* [Docker](https://docs.docker.com/install/) and [Docker Compose](https://docs.docker.com/compose/install/) (optional, for running tests locally) | ||
* [buf](https://buf.build/) (optional, for processing protocol buffer files) | ||
* [jq](https://stedolan.github.io/jq/download/) (optional, for running scripts) | ||
- [Go](https://golang.org/doc/install) 1.19 | ||
- [Docker](https://docs.docker.com/install/) and | ||
[Docker Compose](https://docs.docker.com/compose/install/) (optional, for | ||
running tests locally) | ||
- [buf](https://buf.build/) (optional, for processing protocol buffer files) | ||
- [jq](https://stedolan.github.io/jq/download/) (optional, for running scripts) | ||
|
||
## Components of ZetaChain | ||
|
||
ZetaChain is built with [Cosmos SDK](https://github.com/cosmos/cosmos-sdk), a modular framework for building blockchain and [Ethermint](https://github.com/evmos/ethermint), a module that implements EVM-compatibility. | ||
ZetaChain is built with [Cosmos SDK](https://github.com/cosmos/cosmos-sdk), a | ||
modular framework for building blockchain and | ||
[Ethermint](https://github.com/evmos/ethermint), a module that implements | ||
EVM-compatibility. | ||
|
||
* [zeta-node](https://github.com/zeta-chain/zeta-node) (this repository) contains the source code for the ZetaChain node (`zetacored`) and the ZetaChain client (`zetaclientd`). | ||
* [protocol-contracts](https://github.com/zeta-chain/protocol-contracts) contains the source code for the Solidity smart contracts that implement the core functionality of ZetaChain. | ||
- [zeta-node](https://github.com/zeta-chain/zeta-node) (this repository) | ||
contains the source code for the ZetaChain node (`zetacored`) and the | ||
ZetaChain client (`zetaclientd`). | ||
- [protocol-contracts](https://github.com/zeta-chain/protocol-contracts) | ||
contains the source code for the Solidity smart contracts that implement the | ||
core functionality of ZetaChain. | ||
|
||
## Building the source code | ||
|
||
``` | ||
make install | ||
``` | ||
|
||
This command will install the `zetacoded` and `zetaclientd` binaries in your `$GOPATH/bin` directory. | ||
This command will install the `zetacoded` and `zetaclientd` binaries in your | ||
`$GOPATH/bin` directory. | ||
|
||
## Making changes to the source code | ||
|
||
After making changes to any of the protocol buffer files, run the following command to generate the Go files: | ||
After making changes to any of the protocol buffer files, run the following | ||
command to generate the Go files: | ||
|
||
``` | ||
make proto | ||
``` | ||
|
||
This command will use `buf` to generate the Go files from the protocol buffer files and move them to the correct directories inside `x/`. It will also generate an OpenAPI spec. | ||
This command will use `buf` to generate the Go files from the protocol buffer | ||
files and move them to the correct directories inside `x/`. It will also | ||
generate an OpenAPI spec. | ||
|
||
### Generate documentation | ||
|
||
To generate the documentation, run the following command: | ||
|
||
``` | ||
make specs | ||
``` | ||
|
||
This command will run a script to update the modules' documentation. The script | ||
uses static code analysis to read the protocol buffer files and identify all | ||
Cosmos SDK messages. It then search the source code for the corresponding | ||
message handler functions and retrieves the documentation for those functions. | ||
Finally, it creates a `messages.md` file for each module, which contains the | ||
documentation for all the messages in that module. | ||
|
||
## Running tests | ||
|
||
To check that the source code is working as expected, refer to the manual on how to [run the smoke test](./contrib/localnet/README.md). | ||
To check that the source code is working as expected, refer to the manual on how | ||
to [run the smoke test](./contrib/localnet/README.md). | ||
|
||
## Community | ||
|
||
[Twitter](https://twitter.com/zetablockchain) | [Discord](https://discord.com/invite/zetachain) | [Telegram](https://t.me/zetachainofficial) | [Website](https://zetachain.com) | ||
[Twitter](https://twitter.com/zetablockchain) | | ||
[Discord](https://discord.com/invite/zetachain) | | ||
[Telegram](https://t.me/zetachainofficial) | [Website](https://zetachain.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters