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

chore: update READMEs to have clearer prerequisites #318

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
<a href="https://sygmaprotocol.github.io/sygma-sdk/">SygmaSDK typedocs</a>
</p>

A Typescript SDK allowing users to easily add cross-chain capabilities such as bridging tokens and sending messages to their dApp projects.
The Sygma SDK is written in TypeScript and allows developers to easily add cross-chain capabilities such as bridging tokens and sending messages to their dApp projects. For complete documentation, please see our [docs site](https://docs.buildwithsygma.com).

## Features

Currently supported:
- Transfering fungible assets between **Substrate** and **EVM** chains
- Generic message passing between **EVM** chains

## Installation
```bash
Expand All @@ -34,11 +35,11 @@ yarn add @buildwithsygma/sygma-sdk-core

## Example

For examples of usage go the [`examples`](./examples/) folder
For examples of usage, go to the [`examples`](./examples/) folder

## Contracts

For interacting directly with the contracts use the `@buildwithsygma/sygma-contracts` package.
For interacting directly with the contracts, use the `@buildwithsygma/sygma-contracts` package.

## Support
<a href="https://discord.gg/ykXsJKfhgq">
Expand Down
14 changes: 6 additions & 8 deletions examples/evm-to-evm-fungible-transfer/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
## Sygma SDK ERC20 Example

This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases an ERC20 token transfer between two networks using the Sygma SDK.
This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases an ERC20 token transfer between the same account on two different testnets using the Sygma SDK.

## Prerequisites

Before running the script, ensure that you have the following:

- Node.js installed on your machine
- [Yarn](https://yarnpkg.com/) (version 3.4.1 or higher)
- Access to an Ethereum provider
- Yarn (version 3.4.1 or higher)
- A development wallet funded with `ERC20LRTest` tokens from the [Sygma faucet](https://faucet-ui-stage.buildwithsygma.com/)
- The [exported private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key) of your development wallet
- [Goerli ETH](https://goerlifaucet.com/) for gas

## Getting started

Expand Down Expand Up @@ -63,7 +65,7 @@ yarn run transfer
The example will use `ethers` in conjuction with the sygma-sdk to
create a transfer from `Goerli` to `Sepolia` with a test ERC20 token.

Replace the placeholder values in the script with your own Ethereum wallet private key and provider URL.
Replace the placeholder values in the `.env` file with your own Ethereum wallet private key.

## Script Functionality

Expand All @@ -76,7 +78,3 @@ This example script performs the following steps:
- Retrieves the fee required for the transfer from the SDK.
- Builds the necessary approval transactions for the transfer and sends them using the Ethereum wallet. The approval transactions are required to authorize the transfer of ERC20 tokens.
- Builds the final transfer transaction and sends it using the Ethereum wallet.

## Faucet

To get the test tokens needed for the transfer go to: `https://faucet-ui-stage.buildwithsygma.com/`.
24 changes: 20 additions & 4 deletions examples/evm-to-evm-generic-mesage-passing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ This is an example script that demonstrates the functionality of the SDK using t
Before running the script, ensure that you have the following:

- Node.js installed on your machine
- [Yarn](https://yarnpkg.com/) (version 3.4.1 or higher)
- Access to an Ethereum provider
- Yarn (version 3.4.1 or higher)
- A development wallet funded with [Sepolia ETH](https://sepolia-faucet.pk910.de/) for gas
- The [exported private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key) of your development wallet

## Getting started

Expand Down Expand Up @@ -39,7 +40,22 @@ yarn sdk:build

## Usage

To call a function on a destination chain contract:
This example uses the `dotenv` module to manage private keys. To run the example, you will need to configure your environment variable to include your test development account's [exported private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key). A `.env.sample` is provided as a template.

**DO NOT COMMIT PRIVATE KEYS WITH REAL FUNDS TO GITHUB. DOING SO COULD RESULT IN COMPLETE LOSS OF YOUR FUNDS.**

Create a `.env` file in the evm-to-evm GMP example folder:

```bash
cd examples/evm-to-evm-generic-mesage-passing
touch .env
```

Replace between the quotation marks your exported private key:

`PRIVATE_KEY="YOUR_PRIVATE_KEY_HERE"`

To call the function on the destination chain contract, `cd` into the example folder `examples/evm-to-evm-generic-mesage-passing` and run:

```bash
yarn run transfer
Expand All @@ -48,7 +64,7 @@ yarn run transfer
The example will use `ethers` in conjuction with the sygma-sdk to
call a function on a smart contract on `Goerli` by calling the Deposit method on `Sepolia` and passing the details of the function to be called.

Replace the placeholder values in the `.env` file with your own Ethereum wallet private key and provider URL.
Replace the placeholder values in the `.env` file with your own Ethereum wallet private key.

## Script Functionality

Expand Down
16 changes: 7 additions & 9 deletions examples/evm-to-substrate-fungible-transfer/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
## Sygma SDK ERC20 Example

This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases an ERC20 token transfer between two networks using the Sygma SDK.
This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases an ERC20 token transfer between an EVM network and a Substrate network using the Sygma SDK.

## Prerequisites

Before running the script, ensure that you have the following:

- Node.js installed on your machine
- [Yarn](https://yarnpkg.com/) (version 3.4.1 or higher)
- Access to an Ethereum provider
- Yarn (version 3.4.1 or higher)
- A development wallet funded with `gPHA` tokens from the [Sygma faucet](https://faucet-ui-stage.buildwithsygma.com/)
- The [exported private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key) of your development wallet
- A Substrate wallet to receive tokens into (the example presets an existing wallet address already)
- [Goerli ETH](https://goerlifaucet.com/) for gas

## Getting started

Expand Down Expand Up @@ -63,7 +66,7 @@ yarn run transfer
The example will use `ethers` in conjuction with the sygma-sdk to
create a transfer from `Goerli` to `Rococo-Phala` with a GPHA token.

Replace the placeholder values in the script with your own Ethereum wallet private key and provider URL.
Replace the placeholder values in the `.env` file with your own Ethereum wallet private key, and your own destination Substrate address within the script.

## Script Functionality

Expand All @@ -77,8 +80,3 @@ This example script performs the following steps:
- Retrieves the fee required for the transfer from the SDK.
- Builds the necessary approval transactions for the transfer and sends them using the Ethereum wallet. The approval transactions are required to authorize the transfer of ERC20 tokens.
- Builds the final transfer transaction and sends it using the Ethereum wallet.

## Faucet

To get the test tokens needed for the transfer go to: `https://faucet-ui-stage.buildwithsygma.com/`.
Get the `GPHA` test token from the faucet.
10 changes: 6 additions & 4 deletions examples/substrate-to-evm-fungible-transfer/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
## Sygma SDK Substrate Asset Transfer Example

This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases a Substrate Asset transfer between Substrate and EVM using the Sygma SDK.
This is an example script that demonstrates the functionality of the SDK using the Sygma ecosystem. The script showcases a Substrate Asset transfer between a Substrate network and an EVM network using the Sygma SDK.

## Prerequisites

Before running the script, ensure that you have the following:

- Node.js installed on your machine
- [Yarn](https://yarnpkg.com/) (version 3.4.1 or higher)
- Access to a Substrate node
- Yarn (version 3.4.1 or higher)
- A Substrate development wallet funded with `PHA` tokens; you may wish to run the [EVM-to-Substrate example](../evm-to-substrate-fungible-transfer/) first to preload `PHA` tokens into a Substrate wallet
haochizzle marked this conversation as resolved.
Show resolved Hide resolved
- The 12-word mnemonic for your Substrate development wallet
- An Ethereum wallet to receive tokens into (the example presets an existing wallet address already)

## Getting started

Expand Down Expand Up @@ -63,7 +65,7 @@ yarn run transfer
The example will use `@polkadot/keyring` in conjuction with the sygma-sdk to
create a transfer from `Roccoco Phala` to `Goerli`.

Replace the placeholder values in the script with your own Substrate wallet mnemonic and destination EVM address.
Replace the placeholder values in the `.env` file with your own Substrate wallet mnemonic, and your own destination EVM address within the script.

## Script Functionality

Expand Down
Loading