Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Sep 13, 2024
1 parent 78168d9 commit d7cc615
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/pages/developers/tutorials/hello.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: Your First Universal App
---

import { Alert } from "~/components/shared";

In this tutorial, you will create a simple universal app contract that accepts a
message with a string and emits an event with that string when called from a
connected chain. For example, a user on Ethereum will be able to send a message
Expand All @@ -16,6 +18,12 @@ You will learn how to:
blockchain in localnet.
- Handle reverts gracefully by implementing revert logic.

<Alert>
{" "}
This tutorial depends on the gateway, which is available on localnet but not yet deployed on testnet. It will be compatible
with testnet after the gateway is deployed.{" "}
</Alert>

## Prerequisites

- [Introduction to Universal Apps](/developers/apps/intro/)
Expand Down
21 changes: 14 additions & 7 deletions src/pages/developers/tutorials/swap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,18 @@ The swap contract will:
- Swap the remaining input token amount for the target token ZRC-20.
- Withdraw ZRC-20 tokens to the destination chain

<Alert>
{" "}
This tutorial depends on the gateway, which is available on localnet but not yet deployed on testnet. It will be compatible
with testnet after the gateway is deployed.{" "}
</Alert>

## Setting Up Your Environment

To set up your environment, clone the example contracts repository and install
the dependencies by running the following commands:

```bash
```
git clone https://github.com/zeta-chain/example-contracts
cd example-contracts/examples/swap
Expand Down Expand Up @@ -230,16 +236,17 @@ the tokens to the recipient on the connected chain. The `withdraw` method
handles the cross-chain transfer, ensuring that the recipient receives the
swapped tokens on their native chain, whether it's an EVM chain or Bitcoin.

<Alert> {" "} Note that you don't have to tell which chain to withdraw to
because each ZRC-20 contract knows which connected chain it is associated
with. For example, ZRC-20 Ethereum USDC can only be withdrawn to Ethereum.{"
"} </Alert>
<Alert>
{" "}
Note that you don't have to tell which chain to withdraw to because each ZRC-20 contract knows which connected chain it
is associated with. For example, ZRC-20 Ethereum USDC can only be withdrawn to Ethereum.
</Alert>

## Deploying the Contract

Compile the contract and deploy it to localnet by running:

```bash
```
yarn deploy
```

Expand All @@ -257,7 +264,7 @@ You should see output similar to:
Start the local development environment to simulate ZetaChain's behavior by
running:

```bash
```
npx hardhat localnet
```

Expand Down

0 comments on commit d7cc615

Please sign in to comment.