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

Update README.md #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
154 changes: 96 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,136 @@
# LayerZero - an Omnichain Interoperability Protocol
Here's a more readable and organized version of the LayerZero README for GitHub:

This repository contains the smart contracts for LayerZero Endpoints. For developers looking to build on top of LayerZero please refer to the [docs](https://layerzero.gitbook.io/docs/)
---

# LayerZero - An Omnichain Interoperability Protocol

This repository contains the smart contracts for LayerZero Endpoints. For developers looking to build on top of LayerZero, please refer to the [LayerZero Documentation](https://layerzero.gitbook.io/docs/).

## Overview
LayerZero is an Omnichain Interoperability Protocol designed for lightweight message passing across chains. LayerZero provides authentic and guaranteed message delivery with configurable trustlessness. The protocol is implemented as a set of gas-efficient, non-upgradable smart contracts.
LayerZero is an Omnichain Interoperability Protocol designed for lightweight message passing across chains. It ensures authentic and guaranteed message delivery with configurable trustlessness. The protocol is implemented as a set of gas-efficient, non-upgradable smart contracts.

## Development

### Interfaces
add this to your package.json
Add the following to your `package.json`:
```json
"dependencies": {
"@layerzerolabs/contracts": "latest"
}
```

`
"@layerzerolabs/contracts": "latest",
`
### Setup
- copy .env.example to .env and fill in variables
- `yarn install`
1. Copy `.env.example` to `.env` and fill in the variables.
2. Run `yarn install` to install dependencies.

### Testing
`yarn test`
#### Single Test File
`yarn test test/Endpoint.test.js`
### Gas Uasge
`yarn test:gas`
### Coverage
`yarn test:coverage`
### Lint
`yarn lint`

only lints .js/.ts files
Run all tests:
```bash
yarn test
```
Run a single test file:
```bash
yarn test test/Endpoint.test.js
```
Check gas usage:
```bash
yarn test:gas
```
Check test coverage:
```bash
yarn test:coverage
```

### Linting
Run linter (only lints `.js` and `.ts` files):
```bash
yarn lint
```

## Deployment

Deploy networks are generated based on tags.

#### Hardhat
`yarn dev`

spins up local environment and deploys contracts
### Hardhat

#### Development
Spin up the local environment and deploy contracts:
```bash
yarn dev
```

### Development

Deploy to Rinkeby testnet:
```bash
hardhat --network rinkeby-testnet deploy
hardhat --network rinkeby-sandbox deploy
```

#### Production
Deploy to Rinkeby sandbox:
```bash
hardhat --network rinkeby-sandbox deploy
```

### Production

Deploy to Ethereum mainnet:
```bash
hardhat --network ethereum deploy
```

### Adding a new network
1. Update [hardhat config](hardhat.config.ts) with network
1. refer to [STAGING_MAP](utils/deploy.js) for staging environments supported
2. Update [endpoints.json](constants/endpoints.json) with network
3. Make sure that key in endpoints.json matches network name in hardhat
### Adding a New Network

Example: One LayerZero Network
```
//hardhat.config.ts
1. Update `hardhat.config.ts` with the new network.
- Refer to `STAGING_MAP` in `utils/deploy.js` for supported staging environments.
2. Update `constants/endpoints.json` with the new network.
3. Ensure the key in `endpoints.json` matches the network name in Hardhat.

Example: Single LayerZero Network
```typescript
// hardhat.config.ts
ethereum: {
url: `{rpc address}`,
chainId: 1, //chainlist id
url: `{rpc address}`,
chainId: 1, // chainlist id
}

//endpoints.json
// endpoints.json
"production": {
...
"ethereum": {
"id": 1 //layerzero chain id
}
"ethereum": {
"id": 1 // layerzero chain id
}
}
```

Example: More than one LayerZero Network on same chain (using expandNetwork)
```
//hardhat.config.ts
Example: Multiple LayerZero Networks on the Same Chain
```typescript
// hardhat.config.ts
...expandNetwork({
ropsten: {
url: `{rpc address}`,
chainId: 3, //chainlist id
}
ropsten: {
url: `{rpc address}`,
chainId: 3, // chainlist id
}
}, ["testnet", "sandbox"]),

//endpoints.json
// endpoints.json
"development": {
...
"ropsten": {
"id": 4 //layerzero chain id
}
"ropsten": {
"id": 4 // layerzero chain id
}
}
```
### Acknowledgments

Thank you to the core development team for building the LayerZero Endpoints: Ryan Zarick, Isaac Zhang, Caleb Banister, Carmen Cheng and T. Riley Schwarz
## Acknowledgments

Special thanks to the core development team for building the LayerZero Endpoints:
- Ryan Zarick
- Isaac Zhang
- Caleb Banister
- Carmen Cheng
- T. Riley Schwarz

## Licensing

The primary license for LayerZero is the Business Source License 1.1 (BUSL-1.1). See [`LICENSE`](./LICENSE) for more details.

---

### LICENSING
The primary license for LayerZero is the Business Source License 1.1 (BUSL-1.1). see [`LICENSE`](./LICENSE).
This structured and organized README should be more accessible and easier to read for developers.