Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Mar 7, 2024
1 parent d2a19b6 commit ee71117
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# ZetaChain Protocol Contracts

This repository contains the smart contracts for ZetaChain. The smart contracts
are written in Solidity, and the repository includes scripts to compile the
contracts and generate Go bindings.
This repository contains ZetaChain protocol contracts: Solidity source code,
generated Go bindings, deployed contract addresses and helper utilities.

## Importing Protocol Contracts

Expand All @@ -13,6 +12,27 @@ project:
yarn add --dev @zetachain/protocol-contracts
```

Getting the TSS address on BSC testnet:

```ts
import { getAddress } from "@zetachain/protocol-contracts";

getAddress("tss", "zeta_testnet");
```

Getting a ZRC-20 BSC USDT on ZetaChain Mainnet Beta:

```ts
import { getAddress } from "@zetachain/protocol-contracts";

getAddress("zrc20", "zeta_mainnet", "USDT.BSC");
```

The third argument (symbol) is only used when querying ZRC-20 addresses to
specify which token address is needed.

To view a table of all contracts visit the [Contract Addresses](https://www.zetachain.com/docs/reference/contracts/) page in the docs.

Importing
[`ZetaInterfaces`](https://www.zetachain.com/docs/developers/cross-chain-messaging/connector/)
and `ZetaInteractor` for cross-chain messaging:
Expand All @@ -22,9 +42,9 @@ import "@zetachain/protocol-contracts/contracts/evm/interfaces/ZetaInterfaces.so
import "@zetachain/protocol-contracts/contracts/evm/tools/ZetaInteractor.sol";
```

Importing [ZRC20](https://www.zetachain.com/docs/developers/concepts/zrc-20/)
Importing [ZRC20](https://www.zetachain.com/docs/developers/tokens/zrc20/)
and the [system
contract](https://www.zetachain.com/docs/developers/concepts/system-contract/)
contract](https://www.zetachain.com/docs/developers/omnichain/system-contract/)
for omni-chain smart contracts:

```solidity
Expand All @@ -33,7 +53,7 @@ import "@zetachain/protocol-contracts/contracts/zevm/interfaces/zContract.sol";
import "@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol";
```

## Prerequisites
## Prerequisites for Development

Before you can contribute to this project, you must have the following installed:

Expand All @@ -42,21 +62,6 @@ Before you can contribute to this project, you must have the following installed
- [jq](https://stedolan.github.io/jq/)
- [abigen](https://geth.ethereum.org/docs/tools/abigen)

## Getting Started

To get started with this project, you should first clone the repository:

```
git clone https://github.com/zeta-chain/protocol-contracts
```

Once you have cloned the repository, you can navigate to the project directory
and run the following command to install the project dependencies:

```
yarn
```

## Compiling Contracts

To compile the contracts, run the following command:
Expand All @@ -68,9 +73,9 @@ yarn compile
This will compile the Solidity contracts and output the resulting JSON artifacts
to the `artifacts` directory.

## Generating Go Bindings
## Generating Go Bindings and Contract Addresses

To generate Go bindings for the Solidity contracts, run the following command:
To generate Go bindings for the Solidity contracts and fetch, run the following command:

```
yarn generate
Expand Down

0 comments on commit ee71117

Please sign in to comment.