Skip to content

Commit

Permalink
Fix internal links pointing to legacy Docs structure (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mfigueira authored Jun 8, 2024
1 parent 8ded610 commit 30a4f94
Show file tree
Hide file tree
Showing 20 changed files with 35 additions and 38 deletions.
7 changes: 3 additions & 4 deletions src/lib/tracking.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { AnalyticsBrowser } from "@segment/analytics-next";

import { environment } from "../env.cjs";
import { isClient, isNodeEnvProd, isVercelProd } from "./app.constants";
import { isClient, isNodeEnvProd } from "./app.constants";

const samplingRate = 0.5;
const shouldLoadAnalytics = Math.random() < samplingRate;

const isClientProd = isNodeEnvProd && isVercelProd && isClient;
const isClientProd = isNodeEnvProd && isClient;

export enum AnalyticsTrackEvents {
DocsLinkClicked = "docs link clicked",
Expand All @@ -16,7 +15,7 @@ export enum AnalyticsProperties {}

type AnalyticsPropertiesRecord = Partial<Record<AnalyticsProperties, string | null>>;

const segmentKey = environment.NEXT_PUBLIC_SEGMENT_KEY || "";
const segmentKey = process.env.NEXT_PUBLIC_SEGMENT_KEY || "";

const analytics =
isClientProd && shouldLoadAnalytics && segmentKey
Expand Down
4 changes: 2 additions & 2 deletions src/pages/about/token-utility/gas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ distributed to a community or developer-kickback pool.
## Omnichain Gas Fees

You can learn more about Omnichain Smart Contract and ZetaChain's EVM gas fees
[here](/developers/omnichain/gas-fees).
[here](/developers/evm/gas/#omnichain-contract-fees).

## Cross-Chain Messaging Gas Fees

You can learn more about Cross-Chain-Messaging gas fees
[here](/developers/cross-chain-messaging/gas-fees).
[here](/developers/evm/gas/#cross-chain-messaging-fees).
5 changes: 2 additions & 3 deletions src/pages/about/token-utility/liquidity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ to ensure minimal cost or slippage for end-users or developers.
ZetaChain needs a [ZETA] / [Gas ZRC-20] Uniswap Pool (on ZetaChain's EVM) to
convert ZETA in order to write outbound transactions to that chain. Whenever a
chain's support is added, a corresponding pool between ZETA and that chain's
native gas asset is also created. You can read more about how these pool
function in the Omnichain Smart Contracts documentation
[here](/developers/omnichain/liquidity-pools/).
native gas asset is also created. You can read more about how to pool
your ZETA [here](/users/zetahub/pool).
2 changes: 1 addition & 1 deletion src/pages/about/zetachain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ by a user on Bitcoin and also enact external contract calls on Ethereum and BNB
Chain, and more legs thereafter — all in just one step for the user.

Learn how to build dApps using ZetaChain's Connector
[here](/developers/cross-chain-messaging/connector).
[here](/developers/evm/connector).

### Managed external assets

Expand Down
4 changes: 2 additions & 2 deletions src/pages/developers/architecture/contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ 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/)
[`ZetaInterfaces`](https://www.zetachain.com/docs/developers/architecture/contracts/contracts/evm/interfaces/ZetaInterfaces.sol/interface.ZetaInterfaces)
and `ZetaInteractor` for cross-chain messaging:

```solidity
Expand All @@ -44,7 +44,7 @@ import "@zetachain/protocol-contracts/contracts/evm/tools/ZetaInteractor.sol";

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

```solidity
Expand Down
2 changes: 1 addition & 1 deletion src/pages/developers/services/goldsky.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using a subgraph indexer. For the purposes of this tutorial we will be using the
[Goldsky](https://docs.goldsky.com/) subgraph.

This tutorial assumes you have already completed the
[Swap tutorial](/developers/omnichain/tutorials/swap/). If you want to get the
[Swap tutorial](/developers/tutorials/swap/). If you want to get the
source code for the completed contract, you can find it in the
[`example-contracts` repo](https://github.com/zeta-chain/example-contracts/tree/main/omnichain/swap).

Expand Down
2 changes: 1 addition & 1 deletion src/pages/developers/tokens/zrc20.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ deposited. After the CCTX is processed the token amount will be transferred to
the recipient address on the connected chain either from a TSS address (for
native gas tokens) or from the ERC-20 custody contract (for ERC-20 tokens).

Check out the [Swap tutorial](/developers/omnichain/tutorials/swap) to learn how
Check out the [Swap tutorial](/developers/tutorials/swap) to learn how
to build omnichain contracts that accept token deposits form connected chains,
swap between ZRC-20 tokens using the internal liquidity pools on ZetaChain, and
withdraw them to connected chains.
Expand Down
9 changes: 4 additions & 5 deletions src/pages/developers/transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ chain and specify omnichain contract address as the first 20 bytes of the input
data and provide a valid message.

This is an example deposit and call of [the example omnichain swap
contract](/developers/omnichain/tutorials/swap/).
contract](/developers/tutorials/swap/).

```
npx hardhat deposit --amount 3 --network sepolia_testnet --recipient 0x20C4770A73DF5e2ab4B38c08d1055c2173034257 --message '[["address", "bytes"], ["0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891", "0x4955a3F38ff86ae92A914445099caa8eA2B9bA32"]]'
Expand All @@ -77,7 +77,7 @@ A single deposit and call transaction can result in multiple outbound
transactions triggering outputs on multiple connected chains.

This is an example deposit and call of [the example omnichain multioutput
contract](/developers/omnichain/tutorials/single-input-multiple-output/).
contract](/developers/tutorials/single-input-multiple-output/).

```
npx hardhat deposit --amount 4 --network sepolia_testnet --recipient 0xa573Df1F0729FE6F1BD69b0a5dbFE393e6e09f47 --message '[["address", "bytes", "bytes"], ["0x4955a3F38ff86ae92A914445099caa8eA2B9bA32", "0x746231713873687a663761666333726877386e367736656333327338683665326d727730373764306767", "0x000000000000000000000000d97b1de3619ed2c6beb3860147e30ca8a7dc989100000000000000000000000065a45c57636f9bcced4fe193a602008578bca90b"]]'
Expand All @@ -87,8 +87,7 @@ https://sepolia.etherscan.io/tx/0xce9386cff141cfe64d38589bdd6d2de843aa07559beea1

### ❌ USDC with recipient and valid message

<Alert variant="danger">This should succeed, but it fails:
https://github.com/zeta-chain/node/issues/1906</Alert>
<Alert variant="danger">This should succeed, but it fails: https://github.com/zeta-chain/node/issues/1906</Alert>

```
npx hardhat deposit --amount 1 --network sepolia_testnet --recipient 0x20C4770A73DF5e2ab4B38c08d1055c2173034257 --message '[["address", "bytes"], ["0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891", "0x4955a3F38ff86ae92A914445099caa8eA2B9bA32"]]' --erc20 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238
Expand All @@ -115,7 +114,7 @@ To withdraw native gas tokens ZRC-20 from ZetaChain to a connected chain, call
the `withdraw` method of the ZRC-20 token contract on ZetaChain.

The withdraw amount must be higher than [the withdraw
fee](/developers/omnichain/gas-fees/). Each ZRC-20 token has its own withdraw
fee](/developers/evm/gas/#withdraw). Each ZRC-20 token has its own withdraw
fee.

```
Expand Down
6 changes: 3 additions & 3 deletions src/pages/developers/tutorials/bitcoin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wallet extension.
- [Node.js](https://nodejs.org/en/) installed on your machine with `npm` or
`yarn`
- Learn how to [Deposit and call ZetaChain's EVM contracts from
Bitcoin](/developers/omnichain/bitcoin/).
Bitcoin](/developers/evm/bitcoin/).

# Create a new project

Expand Down Expand Up @@ -69,7 +69,7 @@ This HTML page contains a simple form with three inputs:
To call an omnichain contract from Bitcoin you need to send a token transfer
transaction to the ZetaChain's [TSS address](/reference/contracts) on Bitcoin
with a memo that conforms to [the required
format](/developers/omnichain/bitcoin).
format](/developers/evm/bitcoin).

The memo is composed of two parts:

Expand Down Expand Up @@ -203,7 +203,7 @@ npx http-server
Open the page in your browser and fill in the form. You can test functionality
with your own contract address or follow one of the provided tutorials, for
example, the [Staking](/developers/omnichain/tutorials/staking/) tutorial to
example, the [Staking](/developers/tutorials/staking/) tutorial to
deploy a contract that you can call from Bitcoin.
Fill out the form and click the "Send transaction" button. You will be prompted
Expand Down
4 changes: 2 additions & 2 deletions src/pages/developers/tutorials/hello.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ contract MyContract is zContract, OnlySystem {
[`zContract` interface](https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/zevm/interfaces/zContract.sol).

The contract declares a state variable of type `SystemContract` that stores a
reference to the [system contract](/developers/omnichain/system-contract).
reference to the [system contract](/developers/architecture/contracts/contracts/zevm/SystemContract.sol/contract.SystemContract).

The constructor function accepts the address of the system contract and stores
it in the `systemContract` state variable.
Expand Down Expand Up @@ -132,7 +132,7 @@ const main = async (args: any, hre: HardhatRuntimeEnvironment) => {
throw new Error(
'🚨 Please use either "zeta_testnet" or "zeta_mainnet" network to deploy to ZetaChain.'
);
}
}

const [signer] = await hre.ethers.getSigners();
if (signer === undefined) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/developers/tutorials/multioutput.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ task("interact", "Interact with the contract", main)

Before proceeding with the next steps, make sure you have [created an account
and requested ZETA
tokens](/developers/omnichain/tutorials/hello#create-an-account) from the
tokens](/developers/tutorials/hello#create-an-account) from the
faucet.

## Deploy the Contract
Expand Down
2 changes: 1 addition & 1 deletion src/pages/developers/tutorials/nft/contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Copy the URL returned by the `goldsky subgraph deploy` command, you will need it
in the next section when building the frontend.

To learn more about setting up Goldsky, read
[the guide](/developers/omnichain/tutorials/goldsky).
[the guide](/developers/tutorials/goldsky).

## Mint an NFT

Expand Down
2 changes: 1 addition & 1 deletion src/pages/developers/tutorials/nft/frontend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ but you can replicate it in your own project.
## Prerequisites

- Complete the
[NFT Omnichain Contract](/developers/omnichain/tutorials/nft/contract)
[NFT Omnichain Contract](/developers/tutorials/nft/contract)
tutorial. Make sure that you've configured Goldsky to index events from your
contract.

Expand Down
2 changes: 1 addition & 1 deletion src/pages/developers/tutorials/staking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ Before proceeding make sure to import all newly created tasks in
## Create an Account and Request Tokens from the Faucet

Before proceeding with the next steps, make sure you have
[created an account and requested ZETA tokens](/developers/omnichain/tutorials/hello#create-an-account)
[created an account and requested ZETA tokens](/developers/tutorials/hello#create-an-account)
from the faucet.

## Interact with the Contract from an EVM-based Chain
Expand Down
2 changes: 1 addition & 1 deletion src/pages/developers/tutorials/swap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const main = async (args: any, hre: HardhatRuntimeEnvironment) => {
## Create an Account and Request Tokens from the Faucet

Before proceeding with the next steps, make sure you have
[created an account and requested ZETA tokens](/developers/omnichain/tutorials/hello#create-an-account)
[created an account and requested ZETA tokens](/developers/tutorials/hello#create-an-account)
from the faucet.

## Compile and Deploy the Contract
Expand Down
4 changes: 2 additions & 2 deletions src/pages/developers/tutorials/template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Supported types are: `address`, `bool`, `bytes32`, `string`,
`int`,`int8`,`int16`,`int128`,`int256`,`uint`,`uint8`,`uint16`,`uint128`,`uint256`.

Learn more about omnichain contracts by following the
[tutorials](/developers/omnichain/tutorials/hello/).
[tutorials](/developers/tutorials/hello/).

## Creating a Cross-Chain Messaging Contract

Expand All @@ -158,7 +158,7 @@ no type is specified, the type defaults to `string`.
The list of supported types is the same as for omnichain contracts.

Learn more about cross-chain messaging by following the
[tutorials](/developers/cross-chain-messaging/examples/hello-world/).
[tutorials](/developers/tutorials/hello).

## Tracking a Cross-Chain Transaction

Expand Down
4 changes: 2 additions & 2 deletions src/pages/developers/tutorials/zeta.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tokens between contracts on connected chains using cross-chain messaging.

- This tutorial uses ZetaChain cross-chain messaging, but in this example we're
only sending ZETA. You will learn how to send arbitrary data in a message in
the [Message](/developers/cross-chain-messaging/examples/message) tutorial.
the [Message](/developers/tutorials/message) tutorial.
- Since this contract's purpose is to send ZETA, the contract in this example
will accept ZETA as input. Example contracts in other tutorials will use
native gas assets as input for convenience.
Expand Down Expand Up @@ -118,7 +118,7 @@ valid. Then it approves the contract to spend an amount of ZETA

## Cross-Chain Fees

[Cross-chain messaging fees](/developers/cross-chain-messaging/gas-fees/) are
[Cross-chain messaging fees](/developers/evm/gas/#cross-chain-messaging-fees) are
paid in ZETA tokens. This is convenient if the caller has ZETA tokens on the
source chain. However, many users might only have native gas tokens. In this
case it's more convenient for a contract to accept native gas token, and swap it
Expand Down
6 changes: 3 additions & 3 deletions src/pages/reference/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ compare to ZetaChain in the [whitepaper](https://zetachain.com/whitepaper.pdf).

You can start building now, and add powerful cross-chain messaging capabilities
to your dApp using ZetaChain's
[Connector](/developers/cross-chain-messaging/overview/) or build an
[omnichain dapp](/developers/omnichain/overview/) that can manage assets on
[Connector](/developers/evm/connector) or build an
[omnichain dapp](/developers/apps) that can manage assets on
different chain from a single contract.

Stay tuned on our <a href={globalLinks.twitterLink} target="_blank" className="text-green-100">Twitter</a>
Expand Down Expand Up @@ -141,7 +141,7 @@ the very deep re-organization.
Same answer as above. The transaction is reverted and funds are returned to the
sender if the destination transaction is unable to successfully send. dApps can
handle reverts easily with the
[Connector docs](/developers/cross-chain-messaging/connector).
[Connector docs](/developers/evm/connector).

### Is there an interface where we can run a PoS validator?

Expand Down
2 changes: 1 addition & 1 deletion src/pages/reference/get-testnet-zeta.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ across all connected chains.
You can view the addresses on respective chains [here](/reference/contracts).
Check out [Omnichain Smart Contacts](/developers/overview) for more information
about developing smart contracts on ZetaChain, where ZETA is used for gas fees.
Check out the [Connector docs](/developers/cross-chain-messaging/connector) for
Check out the [Connector docs](/developers/evm/connector) for
information on how to send ZETA as well as any data or value via ZetaChain.

## How to get testnet ZETA
Expand Down
2 changes: 1 addition & 1 deletion src/pages/reference/wallets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To add ZetaChain to your wallet, use the information on the

In order to interact with ZetaChain from Bitcoin, you'll need a wallet that
meets certain criteria. You can learn more about it in the
[Bitcoin section](/developers/omnichain/bitcoin/) of the docs.
[Bitcoin section](/developers/evm/bitcoin) of the docs.

[XDEFI Wallet](https://xdefi.io) is a popular wallet that will meet those
criteria and you will be able to use it to interact with ZetaChain.
Expand Down

0 comments on commit 30a4f94

Please sign in to comment.