diff --git a/CLAUDE.md b/CLAUDE.md index 698c8091e..3ee9b6e7b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -70,7 +70,7 @@ When adding third-party services or partners to the docs, add them to: ```bash yarn dev # Dev server on port 3001 -yarn build # Production build (requires CONTENTFUL_GRAPHQL_URL env var for codegen) +yarn build # Production build yarn typecheck # TypeScript check yarn lint # ESLint ``` diff --git a/codegen.ts b/codegen.ts deleted file mode 100644 index 31434b8d4..000000000 --- a/codegen.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* eslint-disable import/no-extraneous-dependencies */ -/* eslint-disable import/no-default-export */ -import { CodegenConfig } from "@graphql-codegen/cli"; -import { join } from "path"; - -require("dotenv").config({ path: join(__dirname, ".env") }); - -export const CONTENTFUL_CONFIG = { - contentfulGraphqlUrl: process.env.CONTENTFUL_GRAPHQL_URL || "", - contentfulAccessToken: process.env.CONTENTFUL_ACCESS_TOKEN || "", - contentfulRedisUrl: process.env.REDIS_URL || "", -}; - -export const validateContentfulConfig = () => { - if (!CONTENTFUL_CONFIG.contentfulGraphqlUrl) { - throw new Error("CONTENTFUL_GRAPHQL_URL environment variable is required"); - } - if (!CONTENTFUL_CONFIG.contentfulAccessToken) { - throw new Error("CONTENTFUL_ACCESS_TOKEN environment variable is required"); - } -}; - -validateContentfulConfig(); - -const eslintDisablePlugin = { - add: { - content: "/* eslint-disable */", - }, -}; - -const config: CodegenConfig = { - config: { - skipTypename: false, - namingConvention: { - transformUnderscore: true, - enumValues: "keep", - }, - }, - overwrite: true, - generates: { - [`src/generated/contentful.graphql.types.ts`]: { - schema: { - [CONTENTFUL_CONFIG.contentfulGraphqlUrl]: { - headers: { - "content-type": "application/json", - Authorization: `Bearer ${CONTENTFUL_CONFIG.contentfulAccessToken}`, - }, - }, - }, - config: { - namingConvention: { - transformUnderscore: false, - }, - }, - documents: [`**/**/*.graphql.contentful.ts`], - plugins: [eslintDisablePlugin, "typescript", "typescript-operations", "typescript-graphql-request"], - }, - }, -}; - -export default config; diff --git a/package.json b/package.json index 7ea022670..df721ecb5 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "license": "MIT", "author": "zetachain", "scripts": { - "build": "NODE_OPTIONS=--max-old-space-size=6144 yarn clean && yarn graphql-codegen && next build", + "build": "NODE_OPTIONS=--max-old-space-size=6144 yarn clean && next build", "postbuild": "next-sitemap", - "dev": "yarn graphql-codegen && concurrently \"next dev -p 3001\" \"yarn graphql-codegen:watch\"", + "dev": "next dev -p 3001", "lint:fix": "npx eslint --ext .js,.jsx,.ts,.tsx --fix ./src", "lint": "npx eslint --ext .js,.jsx,.ts,.tsx ./src", "start": "next start", @@ -14,10 +14,7 @@ "clean": "rimraf .next out", "tsc:watch": "tsc --watch", "typecheck": "tsc --project ./tsconfig.json --noEmit", - "analyze": "ANALYZE=true next build", - "graphql-codegen:watch": "graphql-codegen --config ./codegen.ts --watch", - "graphql-codegen": "graphql-codegen --config ./codegen.ts", - "remove-codegen": "rimraf 'src/generated/*.types.*'" + "analyze": "ANALYZE=true next build" }, "dependencies": { "@emotion/cache": "11.11.0", @@ -46,15 +43,10 @@ "bech32": "2.0.0", "chroma-js": "2.1.0", "clsx": "1.2.1", - "concurrently": "8.2.2", - "contentful": "11.7.3", - "cors": "2.8.5", "date-fns": "^3.6.0", "dotenv": "16.3.1", "ethers": "5.7.2", "framer-motion": "6.5.1", - "graphql-request": "7.2.0", - "ioredis": "5.6.1", "js-yaml": "4.1.0", "lodash-es": "4.17.21", "moment": "^2.30.1", @@ -91,17 +83,11 @@ "@babel/preset-typescript": "7.23.3", "@emotion/babel-plugin": "11.11.0", "@emotion/babel-plugin-jsx-pragmatic": "0.2.1", - "@graphql-codegen/add": "5.0.0", - "@graphql-codegen/cli": "5.0.0", - "@graphql-codegen/typescript": "4.0.1", - "@graphql-codegen/typescript-graphql-request": "6.3.0", - "@graphql-codegen/typescript-operations": "4.0.1", "@next/eslint-plugin-next": "12.3.4", "@types/chroma-js": "2.1.0", - "@types/cors": "2.8.17", "@types/date-fns": "^2.6.0", "@types/eslint": "8.56.2", - "@types/graphql": "14.5.0", + "@types/js-yaml": "^4.0.9", "@types/lodash-es": "4.17.12", "@types/node": "17.0.45", "@types/react": "18.2.48", diff --git a/public/img/docs/zetahub/earn-zeta-xp-1.png b/public/img/docs/zetahub/earn-zeta-xp-1.png deleted file mode 100644 index c61e607e0..000000000 Binary files a/public/img/docs/zetahub/earn-zeta-xp-1.png and /dev/null differ diff --git a/public/img/docs/zetahub/earn-zeta-xp-2.png b/public/img/docs/zetahub/earn-zeta-xp-2.png deleted file mode 100644 index 4f23293ef..000000000 Binary files a/public/img/docs/zetahub/earn-zeta-xp-2.png and /dev/null differ diff --git a/public/img/docs/zetahub/earn-zeta-xp-3.png b/public/img/docs/zetahub/earn-zeta-xp-3.png deleted file mode 100644 index f1b444812..000000000 Binary files a/public/img/docs/zetahub/earn-zeta-xp-3.png and /dev/null differ diff --git a/public/img/docs/zetahub/earn-zeta-xp-4.png b/public/img/docs/zetahub/earn-zeta-xp-4.png deleted file mode 100644 index 58a6ebec1..000000000 Binary files a/public/img/docs/zetahub/earn-zeta-xp-4.png and /dev/null differ diff --git a/public/img/docs/zetahub/xp-earn-5.png b/public/img/docs/zetahub/xp-earn-5.png deleted file mode 100644 index 1aef5668d..000000000 Binary files a/public/img/docs/zetahub/xp-earn-5.png and /dev/null differ diff --git a/public/img/docs/zetahub/xp-earn-6.png b/public/img/docs/zetahub/xp-earn-6.png deleted file mode 100644 index bca515e10..000000000 Binary files a/public/img/docs/zetahub/xp-earn-6.png and /dev/null differ diff --git a/public/img/docs/zetahub/xp-earn-7.png b/public/img/docs/zetahub/xp-earn-7.png deleted file mode 100644 index e190d1c59..000000000 Binary files a/public/img/docs/zetahub/xp-earn-7.png and /dev/null differ diff --git a/public/img/docs/zetahub/xp-enroll-1.png b/public/img/docs/zetahub/xp-enroll-1.png deleted file mode 100644 index 2321d410e..000000000 Binary files a/public/img/docs/zetahub/xp-enroll-1.png and /dev/null differ diff --git a/public/img/docs/zetahub/xp-enroll-2.png b/public/img/docs/zetahub/xp-enroll-2.png deleted file mode 100644 index effc6b3ad..000000000 Binary files a/public/img/docs/zetahub/xp-enroll-2.png and /dev/null differ diff --git a/public/img/docs/zetahub/xp-enroll-3.png b/public/img/docs/zetahub/xp-enroll-3.png deleted file mode 100644 index ebc6f8bcf..000000000 Binary files a/public/img/docs/zetahub/xp-enroll-3.png and /dev/null differ diff --git a/public/img/docs/zetahub/xp-enroll-4.png b/public/img/docs/zetahub/xp-enroll-4.png deleted file mode 100644 index 035feddb5..000000000 Binary files a/public/img/docs/zetahub/xp-enroll-4.png and /dev/null differ diff --git a/public/llms-full.txt b/public/llms-full.txt index 1503bba1b..da7748406 100644 --- a/public/llms-full.txt +++ b/public/llms-full.txt @@ -8,83 +8,21 @@ - [Why Build on ZetaChain?](https://www.zetachain.com/docs/start/build/): Chain orchestration, cross-chain native token transfers, gasless execution environment. - [Universal Apps](https://www.zetachain.com/docs/start/app/): Apps that seamlessly interact with multiple blockchains, including Ethereum, Bitcoin, Solana, and more. -## Developers — Universal EVM - -The Universal EVM is ZetaChain's smart contract platform with built-in interoperability features. - -- [Universal EVM Overview](https://www.zetachain.com/docs/developers/evm/evm/): Smart contract platform with built-in interoperability features, enabling the development of universal apps. -- [Gateway](https://www.zetachain.com/docs/developers/evm/gateway/): A single point of entry for interacting with universal apps. The Gateway contract enables deposits, withdrawals, and cross-chain calls. -- [Gas Fees](https://www.zetachain.com/docs/developers/evm/gas/): Learn about ZRC-20 withdraw fees and message passing fees. -- [Cross-Chain Transactions](https://www.zetachain.com/docs/developers/evm/cctx/): How cross-chain transactions are processed on ZetaChain. -- [ZETA Token](https://www.zetachain.com/docs/developers/evm/zeta/): ZETA is the native staking, gas and governance token of ZetaChain. -- [ZRC-20 Tokens](https://www.zetachain.com/docs/developers/evm/zrc20/): Native gas and supported ERC-20 tokens from connected chains are represented as ZRC-20 on ZetaChain. -- [ERC-20 Tokens](https://www.zetachain.com/docs/developers/evm/erc20/): ZetaChain's universal EVM supports standard ERC-20 tokens. -- [Account Addresses](https://www.zetachain.com/docs/developers/evm/addresses/): Learn about types of account addresses, how to use and convert between EVM and Cosmos (bech32) formats. -- [Liquidity Throughput](https://www.zetachain.com/docs/developers/evm/throughput/): Liquidity caps on tokens and rate limiting. - -## Developers — Universal Assets - -Standards that enable cross-chain interoperability for NFTs and fungible tokens. - -- [Universal Assets Overview](https://www.zetachain.com/docs/developers/standards/overview/): A set of standards that enable cross-chain interoperability for NFTs and fungible tokens. -- [Universal NFT](https://www.zetachain.com/docs/developers/standards/nft/): The Universal NFT standard enables non-fungible tokens (ERC-721 NFT) to be minted on any chain and seamlessly transferred between connected chains. -- [Universal Token](https://www.zetachain.com/docs/developers/standards/token/): The Universal Token standard enables ERC-20 fungible tokens to be minted on any chain and seamlessly transferred between connected chains. - -## Developers — Connected Chains - -Use Gateway to make calls to and from universal apps, deposit and withdraw tokens. - -- [List of Connected Chains](https://www.zetachain.com/docs/developers/chains/list/): Blockchains connected to ZetaChain for cross-chain transactions, including Ethereum, BNB, Polygon, Base, Solana, Bitcoin, TON, and Sui. -- [Functionality Matrix](https://www.zetachain.com/docs/developers/chains/functionality/): State of ZetaChain functionality across connected chains. -- [ZetaChain](https://www.zetachain.com/docs/developers/chains/zetachain/): Make calls from universal apps and withdraw tokens to connected chains. -- [EVM Blockchains](https://www.zetachain.com/docs/developers/chains/evm/): Make calls to universal apps and deposit tokens from Ethereum, BNB, Polygon, Base and more. -- [Solana](https://www.zetachain.com/docs/developers/chains/solana/): Make calls to universal apps and deposit from Solana. -- [TON](https://www.zetachain.com/docs/developers/chains/ton/): Make calls to universal apps and deposit from TON. -- [Sui](https://www.zetachain.com/docs/developers/chains/sui/): Make calls to universal apps and deposit tokens from Sui. -- [Bitcoin](https://www.zetachain.com/docs/developers/chains/bitcoin/): Make calls to universal apps and deposit BTC from Bitcoin. - -## Developers — Tutorials - -Step-by-step guides to help you master building on ZetaChain. - -- [Getting Started](https://www.zetachain.com/docs/developers/tutorials/intro/): Learn more about universal apps and how to get started. -- [First Universal Contract](https://www.zetachain.com/docs/developers/tutorials/hello/): Build your first universal contract. -- [Build a Web App](https://www.zetachain.com/docs/developers/tutorials/frontend/): Create a web app to interact with your universal contract: connect a wallet, send cross-chain calls, and track execution. -- [Swap Tutorial](https://www.zetachain.com/docs/developers/tutorials/swap/): Implement a universal swap app compatible with chains like Ethereum, Solana and Bitcoin. -- [Messaging Tutorial](https://www.zetachain.com/docs/developers/tutorials/messaging/): Learn how to make cross-chain calls between contracts on EVM chains. -- [Calls to/from EVM](https://www.zetachain.com/docs/developers/tutorials/call/): Learn the fundamentals of message passing and cross-chain contract calls. -- [Calls to/from Solana](https://www.zetachain.com/docs/developers/tutorials/solana/): Deposit assets and call universal apps from Solana, make outgoing calls to Solana. -- [Calls from Sui](https://www.zetachain.com/docs/developers/tutorials/sui/): Deposit assets and call universal apps from Sui. -- [Calls to Sui](https://www.zetachain.com/docs/developers/tutorials/sui-withdraw-and-call/): Withdraw assets and call contracts on Sui. -- [Staking Tutorial](https://www.zetachain.com/docs/developers/tutorials/staking/): Delegate and undelegate ZETA from EVM. - -## Developers — Protocol Contracts - -Documentation for the protocol contracts on ZetaChain and connected chains. - -- [ZetaChain and EVM Protocol Contracts](https://www.zetachain.com/docs/developers/protocol/evm/): Protocol contracts deployed on ZetaChain and EVM chains. -- [Solana Protocol Contracts](https://www.zetachain.com/docs/developers/protocol/solana/): Protocol contracts deployed on Solana. -- [TON Protocol Contracts](https://www.zetachain.com/docs/developers/protocol/ton/): Protocol contracts deployed on TON. -- [Sui Protocol Contracts](https://www.zetachain.com/docs/developers/protocol/sui/): Protocol contracts deployed on Sui. - -## Developers — Architecture +## Architecture In-depth look at the technical architecture of the ZetaChain protocol. -- [Architecture Overview](https://www.zetachain.com/docs/developers/architecture/overview/): Overview of the architecture of ZetaChain. -- [Observer-Signer Validators](https://www.zetachain.com/docs/developers/architecture/observers/): List of currently active observer-signer validators. -- [Privileged Actions](https://www.zetachain.com/docs/developers/architecture/privileged/): Administrative actions that can only be executed by dedicated groups. -- [Staking Rewards](https://www.zetachain.com/docs/developers/architecture/rewards/): How staking rewards are calculated. -- [Whitelisting ERC-20](https://www.zetachain.com/docs/developers/architecture/whitelisting/): How to whitelist an ERC-20 as a supported ZRC-20. -- [Cosmos SDK Modules](https://www.zetachain.com/docs/developers/architecture/modules/): ZetaChain's Cosmos SDK modules. -- [ZetaChain Node CLI](https://www.zetachain.com/docs/developers/architecture/zetacored/): Command-line interface of the ZetaChain node binary. +- [ZetaChain EVM](https://www.zetachain.com/docs/developers/evm/): ZetaChain's EVM-compatible execution environment built on Cosmos SDK and CometBFT. +- [ZETA Token](https://www.zetachain.com/docs/developers/zeta/): ZETA is the native staking, gas and governance token of ZetaChain. +- [ERC-20 Tokens](https://www.zetachain.com/docs/developers/erc20/): ZetaChain's EVM supports standard ERC-20 tokens. +- [Account Addresses](https://www.zetachain.com/docs/developers/addresses/): Learn about types of account addresses, how to use and convert between them. +- [Staking Rewards](https://www.zetachain.com/docs/developers/rewards/): How staking rewards are calculated. ## Tools & Reference — Network -- [Network Details](https://www.zetachain.com/docs/reference/network/details/): ZetaChain testnet and mainnet details including chain IDs, network names, and currency info. -- [RPC/API Endpoints](https://www.zetachain.com/docs/reference/network/api/): API endpoints that can be used to interact with ZetaChain, including EVM RPC, Cosmos REST, and Tendermint RPC. -- [Contract Addresses](https://www.zetachain.com/docs/reference/network/contracts/): A list of protocol contract addresses for ZetaChain mainnet and testnet. -- [ZetaChain HTTP API](https://www.zetachain.com/docs/reference/network/openapi/): Swagger documentation for the API of ZetaChain. +- [Network Details](https://www.zetachain.com/docs/reference/details/): ZetaChain testnet and mainnet details including chain IDs, network names, and currency info. +- [RPC/API Endpoints](https://www.zetachain.com/docs/reference/api/): API endpoints that can be used to interact with ZetaChain, including EVM RPC, Cosmos REST, and Tendermint RPC. +- [ZetaChain HTTP API](https://www.zetachain.com/docs/reference/openapi/): Swagger documentation for the API of ZetaChain. ## Tools & Reference — Developer Tools @@ -161,7 +99,6 @@ Become an important part of the ZetaChain network by running a node. - [Wallets](https://www.zetachain.com/docs/about/services/wallets/): Supported EVM, Bitcoin and Cosmos wallets. - [The Graph](https://www.zetachain.com/docs/about/services/the-graph/): Subgraphs and decentralized indexing protocol. - [Alchemy](https://www.zetachain.com/docs/about/services/alchemy/): Node API and subgraphs. -- [Goldsky](https://www.zetachain.com/docs/about/services/goldsky/): Subgraph indexer. - [Pyth](https://www.zetachain.com/docs/about/services/pyth/): Price and VRF oracle. - [Particle Network](https://www.zetachain.com/docs/about/services/particle/): Account abstraction. - [Envio](https://www.zetachain.com/docs/about/services/envio/): Real-time data indexer. diff --git a/public/llms.txt b/public/llms.txt index 0524e45c5..4eae01737 100644 --- a/public/llms.txt +++ b/public/llms.txt @@ -8,24 +8,18 @@ - [Why Build on ZetaChain?](https://www.zetachain.com/docs/start/build/): Chain orchestration, cross-chain native token transfers, gasless execution environment. - [Universal Apps](https://www.zetachain.com/docs/start/app/): Apps that seamlessly interact with multiple blockchains, including Ethereum, Bitcoin, Solana, and more. -## Developers - -- [Universal EVM](https://www.zetachain.com/docs/developers/evm/evm/): Smart contract platform with built-in interoperability features, enabling the development of universal apps. -- [Gateway](https://www.zetachain.com/docs/developers/evm/gateway/): A single point of entry for interacting with universal apps. -- [Gas Fees](https://www.zetachain.com/docs/developers/evm/gas/): ZRC-20 withdraw fees and message passing fees. -- [Cross-Chain Transactions](https://www.zetachain.com/docs/developers/evm/cctx/): How cross-chain transactions work on ZetaChain. -- [ZRC-20 Tokens](https://www.zetachain.com/docs/developers/evm/zrc20/): Native gas and supported ERC-20 tokens from connected chains represented as ZRC-20 on ZetaChain. -- [Universal Assets](https://www.zetachain.com/docs/developers/standards/overview/): Standards that enable cross-chain interoperability for NFTs and fungible tokens. -- [Connected Chains](https://www.zetachain.com/docs/developers/chains/list/): Blockchains connected to ZetaChain including Ethereum, BNB, Polygon, Base, Solana, Bitcoin, TON, and Sui. -- [Tutorials](https://www.zetachain.com/docs/developers/tutorials/intro/): Step-by-step guides to help you master building on ZetaChain. -- [Protocol Contracts](https://www.zetachain.com/docs/developers/protocol/evm/): Documentation for the protocol contracts on ZetaChain and connected chains. -- [Architecture](https://www.zetachain.com/docs/developers/architecture/overview/): In-depth look at the technical architecture of the ZetaChain protocol. +## Architecture + +- [ZetaChain EVM](https://www.zetachain.com/docs/developers/evm/): ZetaChain's EVM-compatible execution environment built on Cosmos SDK and CometBFT. +- [ZETA Token](https://www.zetachain.com/docs/developers/zeta/): ZETA is the native staking, gas and governance token of ZetaChain. +- [ERC-20 Tokens](https://www.zetachain.com/docs/developers/erc20/): ZetaChain's EVM supports standard ERC-20 tokens. +- [Account Addresses](https://www.zetachain.com/docs/developers/addresses/): Learn about types of account addresses, how to use and convert between them. +- [Staking Rewards](https://www.zetachain.com/docs/developers/rewards/): How staking rewards are calculated. ## Tools & Reference -- [Network Details](https://www.zetachain.com/docs/reference/network/details/): ZetaChain testnet and mainnet details. -- [RPC/API Endpoints](https://www.zetachain.com/docs/reference/network/api/): API endpoints for interacting with ZetaChain. -- [Contract Addresses](https://www.zetachain.com/docs/reference/network/contracts/): Protocol contract addresses for ZetaChain. +- [Network Details](https://www.zetachain.com/docs/reference/details/): ZetaChain testnet and mainnet details. +- [RPC/API Endpoints](https://www.zetachain.com/docs/reference/api/): API endpoints for interacting with ZetaChain. - [CLI](https://www.zetachain.com/docs/reference/cli/): Command line interface for building and interacting with universal apps. - [Localnet](https://www.zetachain.com/docs/reference/localnet/): Build and interact with your universal app in a local dev environment. - [Toolkit](https://www.zetachain.com/docs/reference/toolkit/): TypeScript SDK for building universal apps. diff --git a/src/components/About/components/KeyFeatures.tsx b/src/components/About/components/KeyFeatures.tsx index 0e8aca4a2..241a2e34d 100644 --- a/src/components/About/components/KeyFeatures.tsx +++ b/src/components/About/components/KeyFeatures.tsx @@ -1,37 +1,26 @@ -import { DeterministicIconArticle, IconDocs, PrimaryLink } from "../../shared"; +import { DeterministicIconArticle } from "../../shared"; type KeyFeature = { title: string; description: string; - link?: React.ReactNode; }; const keyFeatures: KeyFeature[] = [ { title: "Chain Abstraction Framework", description: - "ZetaChain is a decentralized and public blockchain network. It is built on Cosmos SDK and Comet BFT consensus. The unique feature of ZetaChain is the Chain Abstraction Framework (CAF), which enables omnichain connectivity of the network to any blockchain. This framework is accessible through the Universal EVM, which is a synchronous environment that can be called from any chain, manage native assets on any chain, and access asynchronous arbitrary messaging to call contracts on other chains. Developing with the CAF offers the ability to build robust state management combined with multi-leg, multi-chain apps' needs, all in the familiar EVM development environment. The resulting user experience is unbounded, where the majority of apps can be used entirely from any single network while the rest of the app logic can be affordably, securely, and performantly abstracted.", + "ZetaChain is a decentralized and public blockchain network. It is built on Cosmos SDK and Comet BFT consensus. The unique feature of ZetaChain is the Chain Abstraction Framework (CAF), which connects the network to any blockchain. This framework is accessible through the Universal EVM, which is a synchronous environment that can be called from any chain, manage native assets on any chain, and access asynchronous arbitrary messaging to call contracts on other chains. Developing with the CAF offers the ability to build robust state management combined with multi-leg, multi-chain apps' needs, all in the familiar EVM development environment. The resulting user experience is unbounded, where the majority of apps can be used entirely from any single network while the rest of the app logic can be affordably, securely, and performantly abstracted.", }, { title: "Hyper-connected nodes", description: - "ZetaChain's nodes have observers that monitor transactions on every connected chain. Through ZetaChain's TSS architecture, the network can sign and verify transactions on every connected chain. By being able to read and write to connected chains in a secure, decentralized manner, these hyper-connected nodes provide a seamless Chain Abstraction Framework for developers to build novel and powerful cross-chain applications.", + "ZetaChain's nodes monitor, sign, and verify transactions on every connected chain. By being able to read and write to connected chains in a secure, decentralized manner, these hyper-connected nodes provide a seamless Chain Abstraction Framework for developers to build novel and powerful universal applications.", }, { - title: "Omnichain smart contracts", + title: "Interoperable smart contracts", description: "Smart contracts deployed natively on ZetaChain can read/write to connected chains. ZetaChain is the only public blockchain to support smart contracts with this capability, enabling a new paradigm of app development.", }, - { - title: "Cross-chain message passing", - description: - "A developer can pass messages (data and value) between chains and layers with simple function calls. Through message passing, a dApp developer can build powerful cross-chain applications by simply implementing a few functions within their existing smart contracts. By composing messaging capabilities with Omnichain Smart Contracts, apps can abstract multi-leg cross-chain transactions in tandem with native asset movements and interactions. For example, a contract on ZetaChain could be called 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.", - link: ( - }> - Start building dApps - - ), - }, { title: "Managed external assets", description: @@ -57,8 +46,6 @@ export const KeyFeatures: React.FC = () => {

{feature.description}

- - {feature.link &&
{feature.link}
} ))} diff --git a/src/components/About/components/RoadmapPillars.tsx b/src/components/About/components/RoadmapPillars.tsx index 7584a8f9c..66b929097 100644 --- a/src/components/About/components/RoadmapPillars.tsx +++ b/src/components/About/components/RoadmapPillars.tsx @@ -33,7 +33,7 @@ const pillars = [ { title: "Approach", description: - "Develop and implement secure and efficient protocols for cross-chain interoperability. Improve framework and architecture for new chain integrations modularly.", + "Develop and implement secure and efficient protocols for interoperability across connected chains. Improve framework and architecture for new chain integrations modularly.", }, { title: "Expected Outcome", @@ -42,7 +42,7 @@ const pillars = [ { title: "Challenges", description: - "Cryptography (TSS for signature schemes other than ECDSA secp256k1 curve), heterogeneous blockchain model/parameters/interaction methods, potential problems with source of information that may not be efficiently/robustly available from standard full-node, speed and cost of considerations in relation to spam deterrence.", + "Cryptography, heterogeneous blockchain model/parameters/interaction methods, potential problems with source of information that may not be efficiently/robustly available from standard full-node, speed and cost of considerations in relation to spam deterrence.", }, ], }, @@ -58,10 +58,10 @@ const pillars = [ title: "Key Features", description: ( -
  • Arbitrary omnichain smart contract messaging to/from ZetaChain.
  • +
  • Arbitrary smart contract messaging to/from ZetaChain.
  • ZRC-20 whitelisting automation and expanded onboarding process.
  • -
  • ZRC20-like NFT support for omnichain smart contracts.
  • -
  • BRC20/Ordinals support in omnichain smart contracts.
  • +
  • ZRC20-like NFT support for smart contracts.
  • +
  • BRC20/Ordinals support in smart contracts.
  • Standardized interactions with connected chains beyond fungible tokens (ZRC20 model).
  • ), @@ -89,9 +89,8 @@ const pillars = [ title: "Strategies", description: ( -
  • Shift from observation of inbound and outbound transactions to a proof-verification-based model.
  • -
  • Reduce reliance on the assumption of 2/3 honest observers for external events.
  • -
  • Improve observer/tss signer on-chain monitoring and incentives.
  • +
  • Shift from monitoring of inbound and outbound transactions to a proof-verification-based model.
  • +
  • Reduce reliance on the assumption of 2/3 honest validators for external events.
  • Gradually increase decentralization and reduce central point of failures/control.
  • Improve performance and reduce cost by utilizing zero-knowledge proof for validating external @@ -122,7 +121,7 @@ const pillars = [ title: "Key Areas", description: ( -
  • Higher cross-chain Transactions Per Second (TPS).
  • +
  • Higher Transactions Per Second (TPS) across connected chains.
  • Lower resource consumption and storage requirements for validators.
  • Increase awareness of network operation, error/exception handling and recovery.
  • Performance and chaos engineering tooling to battle-test new protocol upgrades.
  • @@ -142,7 +141,7 @@ const pillars = [ ], }, { - title: "Omnichain dApp Developer Tooling, SDK, and Support", + title: "dApp Developer Tooling, SDK, and Support", description: [ { title: "Objective", @@ -154,10 +153,10 @@ const pillars = [
  • JavaScript/TypeScript SDKs, Telegram Bot SDK.
  • Debugging tools.
  • -
  • Cross-chain transaction simulation.
  • +
  • Transaction simulation across connected chains.
  • - Explorer/observability: especially better support for complex cross-chain dApps to expose the cross-chain - sub-tx in an easy to understand way. + Explorer/observability: especially better support for complex dApps to expose connected-chain + sub-transactions in an easy to understand way.
  • ), @@ -187,7 +186,6 @@ const pillars = [ Cosmos EVM: Enhance compatibility with Ethereum tooling, efficiency, and interoperability with EVM and Cosmos modules. -
  • TSS-lib & Go-TSS: Improve security, performance, and support for new signature schemes and chains.
  • ), }, diff --git a/src/components/About/components/TechnicalRoadmap.tsx b/src/components/About/components/TechnicalRoadmap.tsx index d0188b20a..eebc4b8b9 100644 --- a/src/components/About/components/TechnicalRoadmap.tsx +++ b/src/components/About/components/TechnicalRoadmap.tsx @@ -11,14 +11,13 @@ export const TechnicalRoadmap: React.FC = () => {

    ZetaChain’s mission is to serve as a platform for universal access, simplicity, and utility across any blockchains. ZetaChain’s initial mainnet launch contains all core functionality contemplated within - ZetaChain’s proposed features, including its EVM layer, omnichain smart contracts, and cross-chain - messaging. + ZetaChain’s proposed features, including its EVM layer and interoperable smart contracts.

    - ZetaChain is a Proof-of-Stake blockchain designed for interoperability, supporting the creation of - omnichain dApps that can span any chain, including the Bitcoin blockchain, where all transaction, - incentives, data security, and cross-chain interaction requires ZETA tokens to function. + ZetaChain is a Proof-of-Stake blockchain designed for interoperability, supporting the creation of dApps + that can span any chain, including the Bitcoin blockchain, where all transactions, incentives, data + security, and interoperability rely on ZETA tokens to function.

    diff --git a/src/components/About/components/WhatIsZetaChain.tsx b/src/components/About/components/WhatIsZetaChain.tsx index 31f0be4d0..03a303c03 100644 --- a/src/components/About/components/WhatIsZetaChain.tsx +++ b/src/components/About/components/WhatIsZetaChain.tsx @@ -10,9 +10,9 @@ export const WhatIsZetaChain: React.FC = () => {

    - ZetaChain is the foundational, public blockchain that enables omnichain smart contracts and messaging - between any blockchain. It solves the problems of “cross-chain” and “multi-chain” and aims to open the - crypto and global financial ecosystem to anyone. + ZetaChain is the foundational, public blockchain that enables interoperable smart contracts and messaging + between any blockchain. It solves the problems of fragmented chains and aims to open the crypto and global + financial ecosystem to anyone.

    diff --git a/src/components/Docs/components/ConnectedChainsList.tsx b/src/components/Docs/components/ConnectedChainsList.tsx deleted file mode 100644 index 2044b5153..000000000 --- a/src/components/Docs/components/ConnectedChainsList.tsx +++ /dev/null @@ -1,233 +0,0 @@ -import Link from "next/link"; -import { useEffect, useState } from "react"; - -import { LoadingTable, NetworkTypeTabs, networkTypeTabs, rpcByNetworkType } from "~/components/shared"; - -type Chain = { - chain_id: string; - chain_name: string; - network: string; - network_type: string; - vm: string; - consensus: string; - is_external: boolean; - cctx_gateway: string; - name: string; -}; - -type ForeignCoin = { - zrc20_contract_address: string; - asset: string; - foreign_chain_id: string; - decimals: number; - name: string; - symbol: string; - coin_type: string; -}; - -type CoinsData = { - foreignCoins: ForeignCoin[]; -}; - -type ChainsData = { - chains: Chain[]; -}; - -type ParamsData = { - chain_params: { - chain_params: { - chain_id: string; - confirmation_count: string; - }[]; - }; -}; - -const CHAINS = "/zeta-chain/observer/supportedChains"; -const COINS = "/zeta-chain/fungible/foreign_coins"; -const CHAIN_PARAMS = "/zeta-chain/observer/get_chain_params"; - -const formatString = (str: string) => { - return str - .split("_") - .map((word: string) => - word.length <= 3 ? word.toUpperCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() - ) - .join(" "); -}; - -export const ConnectedChainsList = () => { - const [mainnetChains, setMainnetChains] = useState([]); - const [testnetChains, setTestnetChains] = useState([]); - const [tokens, setTokens] = useState([]); - const [confirmations, setConfirmations] = useState>({}); - const [isLoading, setIsLoading] = useState(true); - const [activeTab, setActiveTab] = useState(networkTypeTabs[0]); - - useEffect(() => { - setIsLoading(true); - - const fetchData = async () => { - try { - const CHAINS_URL = `${rpcByNetworkType[activeTab.networkType]}${CHAINS}`; - const COINS_URL = `${rpcByNetworkType[activeTab.networkType]}${COINS}`; - const CHAIN_PARAMS_URL = `${rpcByNetworkType[activeTab.networkType]}${CHAIN_PARAMS}`; - - const [chainsResponse, tokensResponse, paramsResponse] = await Promise.all([ - fetch(CHAINS_URL).then((res) => res.json() as Promise), - fetch(COINS_URL).then((res) => res.json() as Promise), - fetch(CHAIN_PARAMS_URL).then((res) => res.json()), - ]); - - const formattedChains = chainsResponse.chains.map((chain) => ({ - ...chain, - chain_name: formatString(chain.chain_name), - })); - - const sortedChains = formattedChains.sort((a, b) => a.chain_name.localeCompare(b.chain_name)); - - if (activeTab.networkType === "mainnet") setMainnetChains(sortedChains); - if (activeTab.networkType === "testnet") setTestnetChains(sortedChains); - - setTokens(tokensResponse.foreignCoins); - - const confirmationMap: Record = {}; - if ((paramsResponse as ParamsData)?.chain_params?.chain_params) { - (paramsResponse as ParamsData).chain_params.chain_params.forEach((param) => { - if (param.chain_id && param.confirmation_count) { - confirmationMap[param.chain_id] = param.confirmation_count; - } - }); - } - setConfirmations(confirmationMap); - } catch (error) { - console.error("Error fetching data:", error); - setMainnetChains([]); - setTestnetChains([]); - setTokens([]); - setConfirmations({}); - } finally { - setIsLoading(false); - } - }; - - fetchData(); - }, [activeTab.networkType]); - - const chains = activeTab.networkType === "mainnet" ? mainnetChains : testnetChains; - - const getTokensForChain = (chainId: string) => { - return tokens - .filter((token) => token.foreign_chain_id === chainId) - .map((token) => token.symbol) - .join(", "); - }; - - const getDocsLink = (chain: Chain) => { - if (chain.vm === "evm" && chain.consensus === "tendermint" && chain.cctx_gateway === "zevm") { - return { text: "ZetaChain Gateway", url: "/developers/chains/zetachain" }; - } - if (chain.vm === "evm" && chain.consensus === "ethereum") { - return { text: "EVM Gateway", url: "/developers/chains/evm" }; - } - if (chain.vm === "no_vm" && chain.consensus === "bitcoin") { - return { text: "Bitcoin Gateway", url: "/developers/chains/bitcoin" }; - } - if (chain.vm === "svm" && chain.consensus === "solana_consensus") { - return { text: "Solana Gateway", url: "/developers/chains/solana" }; - } - if (chain.vm === "tvm" && chain.consensus === "catchain_consensus") { - return { text: "TON Gateway", url: "/developers/chains/ton" }; - } - if (chain.vm === "mvm_sui" && chain.consensus === "sui_consensus") { - return { text: "Sui Gateway", url: "/developers/chains/sui" }; - } - return null; - }; - - return ( -

    - - - {isLoading ? ( - - ) : ( -
    - - - - - - - - - - - - - - - - - {chains.map((chain, index) => { - const docsLink = getDocsLink(chain); - const formattedChainName = chain.name - .replace(/_/g, " ") - .split(" ") - .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) - .join(" ") - .replace(/zeta/i, "ZetaChain") - .replace(/bsc/i, "BNB") - .replace(/btc/i, "Bitcoin") - .replace(/eth/i, "Ethereum") - .replace(/mainnet/i, "") - .trim(); - return ( - // eslint-disable-next-line react/no-array-index-key - - - - - - - - - - - - ); - })} - -
    IDNameLabelSupported TokensVMConsensusCCTX GatewayRequired ConfirmationsGateway Docs
    {chain.chain_id}{formattedChainName}{chain.name}{getTokensForChain(chain.chain_id) || ""}{formatString(chain.vm)}{formatString(chain.consensus)}{chain.cctx_gateway || ""}{confirmations[chain.chain_id] || ""} - {docsLink ? ( - - {docsLink.text} - - ) : ( - "N/A" - )} -
    -
    - )} - -

    - Source:{" "} - - {rpcByNetworkType[activeTab.networkType]} - {CHAINS} - -

    -
    - ); -}; - -export default ConnectedChainsList; diff --git a/src/components/Docs/components/ContractAddresses.tsx b/src/components/Docs/components/ContractAddresses.tsx deleted file mode 100644 index 4e6f7a070..000000000 --- a/src/components/Docs/components/ContractAddresses.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { useEffect, useState } from "react"; - -import { LoadingTable, NetworkTypeTabs, networkTypeTabs } from "~/components/shared"; -import { NetworkType } from "~/lib/app.types"; - -type ContractAddressData = { - chain_id: string; - chain_name: string; - type: string; - category: string; - address: string; - symbol?: string; -}; - -type ContractAddressesByChain = Record; - -const addressesUrl: Record = { - testnet: "https://raw.githubusercontent.com/zeta-chain/protocol-contracts-evm/main/data/addresses.testnet.json", - mainnet: "https://raw.githubusercontent.com/zeta-chain/protocol-contracts-evm/main/data/addresses.mainnet.json", -}; - -const groupDataByChain = (data: ContractAddressData[]) => - data.reduce((acc, item) => { - (acc[item.chain_name] = acc[item.chain_name] || []).push(item); - return acc; - }, {} as ContractAddressesByChain); - -const sortGroupedData = (groupedData: ContractAddressesByChain) => { - Object.keys(groupedData).forEach((chainName) => { - groupedData[chainName].sort((a, b) => a.type.localeCompare(b.type)); - }); - return groupedData; -}; - -export const ContractAddresses = () => { - const [activeTab, setActiveTab] = useState(networkTypeTabs[0]); - const [isLoading, setIsLoading] = useState(true); - const [groupedData, setGroupedData] = useState>({ - testnet: {}, - mainnet: {}, - }); - - useEffect(() => { - const fetchAndGroupAddresses = async () => { - setIsLoading(true); - - const responses = await Promise.all([fetch(addressesUrl.testnet), fetch(addressesUrl.mainnet)]); - const [testnetData, mainnetData]: ContractAddressData[][] = await Promise.all(responses.map((res) => res.json())); - - setGroupedData({ - testnet: sortGroupedData(groupDataByChain(testnetData)), - mainnet: sortGroupedData(groupDataByChain(mainnetData)), - }); - - setIsLoading(false); - }; - - fetchAndGroupAddresses(); - }, []); - - return ( -
    - - - {isLoading ? ( - - ) : ( - Object.entries(groupedData[activeTab.networkType]).map(([chainName, contracts]) => ( -
    -

    {chainName}

    - -
    - - - - - - - - - - - {contracts.map((contract, index) => ( - // eslint-disable-next-line react/no-array-index-key - - - - - - ))} - -
    TypeSymbolAddress
    {contract.type}{contract.symbol || "-"}{contract.address}
    -
    -
    - )) - )} - -

    - Source:{" "} - - {addressesUrl[activeTab.networkType]} - -

    -
    - ); -}; diff --git a/src/components/Docs/components/ForeignCoinsTable.tsx b/src/components/Docs/components/ForeignCoinsTable.tsx deleted file mode 100644 index 4dfa5d8ff..000000000 --- a/src/components/Docs/components/ForeignCoinsTable.tsx +++ /dev/null @@ -1,141 +0,0 @@ -import { useEffect, useMemo, useState } from "react"; - -import { LoadingTable, NetworkTypeTabs, networkTypeTabs, rpcByNetworkType } from "~/components/shared"; - -type ForeignCoin = { - symbol: string; - coin_type: string; - decimals: number; - zrc20_contract_address: string; - foreign_chain_id: string; - asset: string; -}; - -type CoinsData = { - foreignCoins: ForeignCoin[]; -}; - -type ChainsData = { - chains: { - chain_id: string; - name: string; - }[]; -}; - -const COINS = "/zeta-chain/fungible/foreign_coins"; -const CHAINS = "/zeta-chain/observer/supportedChains"; - -const formatString = (str: string) => { - return str - .split("_") - .map((word: string) => - word.length <= 3 ? word.toUpperCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase() - ) - .join(" "); -}; - -export const ForeignCoinsTable = () => { - const [mainnetCoins, setMainnetCoins] = useState<(ForeignCoin & { chainName: string })[]>([]); - const [testnetCoins, setTestnetCoins] = useState<(ForeignCoin & { chainName: string })[]>([]); - - const [isLoading, setIsLoading] = useState(true); - const [activeTab, setActiveTab] = useState(networkTypeTabs[0]); - - useEffect(() => { - setIsLoading(true); - - const fetchData = async () => { - try { - const COINS_URL = `${rpcByNetworkType[activeTab.networkType]}${COINS}`; - const CHAINS_URL = `${rpcByNetworkType[activeTab.networkType]}${CHAINS}`; - - const responseCoins = await fetch(COINS_URL); - const coinsData: CoinsData = await responseCoins.json(); - - const responseChains = await fetch(CHAINS_URL); - const chainsData: ChainsData = await responseChains.json(); - - const chainIdToName = chainsData.chains.reduce((acc, chain) => { - acc[chain.chain_id] = formatString(chain.name); - return acc; - }, {} as Record); - - const enrichedCoins = coinsData.foreignCoins.map((coin) => ({ - ...coin, - chainName: chainIdToName[coin.foreign_chain_id] || "Unknown", - })); - - const sortedCoins = enrichedCoins.sort((a, b) => a.chainName.localeCompare(b.chainName)); - - if (activeTab.networkType === "mainnet") setMainnetCoins(sortedCoins); - if (activeTab.networkType === "testnet") setTestnetCoins(sortedCoins); - } catch (error) { - console.error("Error fetching data:", error); - if (activeTab.networkType === "mainnet") setMainnetCoins([]); - if (activeTab.networkType === "testnet") setTestnetCoins([]); - } finally { - setIsLoading(false); - } - }; - - fetchData(); - }, [activeTab.networkType]); - - const coins = useMemo(() => { - return activeTab.networkType === "mainnet" ? mainnetCoins : testnetCoins; - }, [activeTab.networkType, mainnetCoins, testnetCoins]); - - return ( -
    - - - {isLoading ? ( - - ) : ( -
    - - - - - - - - - - - - - - {coins.map((coin, index) => ( - // eslint-disable-next-line react/no-array-index-key - - - - - - - - - ))} - -
    ChainSymbolTypeZRC-20 decimalsZRC-20 on ZetaChainERC-20 on Connected Chain
    {coin.chainName}{coin.symbol}{coin.coin_type}{coin.decimals}{coin.zrc20_contract_address}{coin.asset}
    -
    - )} - -

    - Source:{" "} - - {rpcByNetworkType[activeTab.networkType]} - {COINS} - -

    -
    - ); -}; - -export default ForeignCoinsTable; diff --git a/src/components/Docs/components/ObserverList.tsx b/src/components/Docs/components/ObserverList.tsx deleted file mode 100644 index 7b6749c47..000000000 --- a/src/components/Docs/components/ObserverList.tsx +++ /dev/null @@ -1,145 +0,0 @@ -import { bech32 } from "bech32"; -import { useCallback, useEffect, useMemo, useState } from "react"; - -import { LoadingTable, NetworkTypeTabs, networkTypeTabs, rpcByNetworkType } from "~/components/shared"; - -const convertToValoper = (address: any) => { - try { - const decoded = bech32.decode(address); - if (decoded.prefix === "zeta") { - return bech32.encode("zetavaloper", decoded.words); - } - } catch (error) { - console.error("Error converting address:", error); - } - return address; -}; - -export const ObserverList = () => { - const [mainnetObservers, setMainnetObservers] = useState([]); - const [mainnetValidators, setMainnetValidators] = useState([]); - const [testnetObservers, setTestnetObservers] = useState([]); - const [testnetValidators, setTestnetValidators] = useState([]); - - const [isLoading, setIsLoading] = useState(true); - const [activeTab, setActiveTab] = useState(networkTypeTabs[0]); - - const fetchObservers = useCallback(async () => { - setIsLoading(true); - - try { - const api = rpcByNetworkType[activeTab.networkType]; - const response = await fetch(`${api}/zeta-chain/observer/nodeAccount`); - const data = await response.json(); - const processedData = data.NodeAccount.map((observer: any) => ({ - ...observer, - valoperAddress: convertToValoper(observer.operator), - })); - - if (activeTab.networkType === "mainnet") setMainnetObservers(processedData || []); - if (activeTab.networkType === "testnet") setTestnetObservers(processedData || []); - } catch (error) { - console.error("Error fetching observer validators:", error); - if (activeTab.networkType === "mainnet") setMainnetObservers([]); - if (activeTab.networkType === "testnet") setTestnetObservers([]); - } finally { - setIsLoading(false); - } - }, [activeTab.networkType]); - - const fetchValidators = useCallback( - async (key = "") => { - setIsLoading(true); - - try { - const api = rpcByNetworkType[activeTab.networkType]; - const endpoint = "/cosmos/staking/v1beta1/validators"; - const query = key ? `pagination.key=${encodeURIComponent(key)}` : ""; - const url = `${api}${endpoint}?${query}`; - - const response = await fetch(url); - const data = await response.json(); - - if (data.validators) { - if (activeTab.networkType === "mainnet") setMainnetValidators((prev: any) => [...prev, ...data.validators]); - if (activeTab.networkType === "testnet") setTestnetValidators((prev: any) => [...prev, ...data.validators]); - - if (data.pagination && data.pagination.next_key) { - await fetchValidators(data.pagination.next_key); - } - } - } catch (error) { - console.error("Error fetching validators:", error); - if (activeTab.networkType === "mainnet") setMainnetValidators([]); - if (activeTab.networkType === "testnet") setTestnetValidators([]); - } finally { - setIsLoading(false); - } - }, - [activeTab.networkType] - ); - - useEffect(() => { - fetchObservers(); - fetchValidators(); - }, [fetchObservers, fetchValidators]); - - const observers = useMemo(() => { - return activeTab.networkType === "mainnet" ? mainnetObservers : testnetObservers; - }, [activeTab.networkType, mainnetObservers, testnetObservers]); - - const validators = useMemo(() => { - return activeTab.networkType === "mainnet" ? mainnetValidators : testnetValidators; - }, [activeTab.networkType, mainnetValidators, testnetValidators]); - - const findMoniker = useCallback( - (valoperAddress: any) => { - const validator = validators.find((v: any) => v.operator_address === valoperAddress); - return validator ? validator.description : { moniker: "Unknown", website: "", details: "" }; - }, - [validators] - ); - - const sortObserversByMoniker = useCallback(() => { - return observers.sort((a: any, b: any) => { - const monikerA = findMoniker(a.valoperAddress).moniker || ""; - const monikerB = findMoniker(b.valoperAddress).moniker || ""; - - return monikerA.localeCompare(monikerB); - }); - }, [findMoniker, observers]); - - return ( -
    - - - {isLoading ? ( - - ) : ( -
    - - - - - - - - - {sortObserversByMoniker().map((observer: any, index: number) => ( - // eslint-disable-next-line react/no-array-index-key - - - - - ))} - -
    ObserverMoniker
    - {observer.operator} -
    - {observer.valoperAddress} -
    {findMoniker(observer.valoperAddress).moniker}
    -
    - )} -
    - ); -}; diff --git a/src/components/Docs/components/ObserverParams.tsx b/src/components/Docs/components/ObserverParams.tsx deleted file mode 100644 index f83e36271..000000000 --- a/src/components/Docs/components/ObserverParams.tsx +++ /dev/null @@ -1,101 +0,0 @@ -import { useEffect, useMemo, useState } from "react"; - -import { LoadingTable, NetworkTypeTabs, networkTypeTabs } from "~/components/shared"; -import { NetworkType } from "~/lib/app.types"; - -type Chain = { - chain_id: string; - chain_name: string; -}; - -type ObserverParamsType = { - ballot_threshold: string; - chain: Chain; - is_supported: boolean; - min_observer_delegation: string; -}; - -const APIs: Record = { - testnet: "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/observer/params", - mainnet: "https://zetachain.blockpi.network/lcd/v1/public/zeta-chain/observer/params", -}; - -export const ObserverParams = () => { - const [mainnetData, setMainnetData] = useState([]); - const [testnetData, setTestnetData] = useState([]); - - const [isLoading, setIsLoading] = useState(true); - const [activeTab, setActiveTab] = useState(networkTypeTabs[0]); - - useEffect(() => { - const API = APIs[activeTab.networkType]; - - setIsLoading(true); - - fetch(API) - .then((response) => response.json()) - .then((json) => { - if (activeTab.networkType === "mainnet") setMainnetData(json.params.observer_params); - if (activeTab.networkType === "testnet") setTestnetData(json.params.observer_params); - setIsLoading(false); - }) - .catch((error) => { - console.error("Error fetching data: ", error); - if (activeTab.networkType === "mainnet") setMainnetData([]); - if (activeTab.networkType === "testnet") setTestnetData([]); - setIsLoading(false); - }); - }, [activeTab.networkType]); - - const data = useMemo(() => { - return activeTab.networkType === "mainnet" ? mainnetData : testnetData; - }, [activeTab.networkType, mainnetData, testnetData]); - - return ( -
    - - - {isLoading ? ( - - ) : ( -
    - - - - - - - - - - - - {data.map((observerParam, index) => ( - // eslint-disable-next-line react/no-array-index-key - - - {/* eslint-disable-next-line radix */} - - - - - ))} - -
    Chain NameMin Observer DelegationBallot ThresholdIs Supported
    {observerParam.chain.chain_name}{parseInt(observerParam.min_observer_delegation)}{parseFloat(observerParam.ballot_threshold) * 100}%{observerParam.is_supported ? "Yes" : "No"}
    - - -
    - )} -
    - ); -}; diff --git a/src/components/Docs/index.ts b/src/components/Docs/index.ts index 4e9a61ca2..0314bf66e 100644 --- a/src/components/Docs/index.ts +++ b/src/components/Docs/index.ts @@ -1,17 +1,12 @@ export * from "./components/AddressConverter"; export * from "./components/AdminPolicy"; -export * from "./components/ConnectedChainsList"; -export * from "./components/ContractAddresses"; export * from "./components/ContractRegistryChains"; export * from "./components/EndpointList"; export * from "./components/Fees"; -export * from "./components/ForeignCoinsTable"; export * from "./components/GovParams"; export * from "./components/GovUpgradeProposals"; export * from "./components/NetworkDetails"; export { default as NodeSnapshots } from "./components/NodeSnapshots"; -export * from "./components/ObserverList"; -export * from "./components/ObserverParams"; export * from "./components/OpenAPIBrowser"; export * from "./components/SubspaceKeyTable"; export * from "./components/ZetaTokenTable"; diff --git a/src/components/Home/Ecosystem.utils.ts b/src/components/Home/Ecosystem.utils.ts deleted file mode 100644 index beaa2a27f..000000000 --- a/src/components/Home/Ecosystem.utils.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { EcosystemProject } from "~/generated/contentful.graphql.types"; - -/** - * Parses the card border style based on the defaultCardBorder or featuredCardBorder fields from Contentful - */ -export const parseEcosystemAppCardBorder = (ecosystemAppCardBorder?: string | null) => { - if (ecosystemAppCardBorder?.startsWith("Light")) return "border border-grey-200 dark:border-none"; - if (ecosystemAppCardBorder?.startsWith("Dark")) return "dark:border dark:border-grey-600"; - return ""; -}; - -/** - * Parses the logo border style based on the defaultCardLogoBorder or featuredCardLogoBorder fields from Contentful - */ -export const parseEcosystemAppLogoBorder = (ecosystemAppLogoBorder?: string | null) => { - if (ecosystemAppLogoBorder?.includes("Grey-200")) return "border border-grey-200"; - if (ecosystemAppLogoBorder?.includes("Grey-600")) return "border border-grey-600"; - return ""; -}; - -export const UNIVERSAL_SUB_CATEGORY_ID = "32XHQgC9Od1J60bNN72g8W"; - -export const isUniversalApp = (app: EcosystemProject) => - app?.categoryCollection?.items?.some((category) => category?.sys?.id === UNIVERSAL_SUB_CATEGORY_ID) ?? false; diff --git a/src/components/Home/Home.constants.tsx b/src/components/Home/Home.constants.tsx index c44f58c24..9a65fe36b 100644 --- a/src/components/Home/Home.constants.tsx +++ b/src/components/Home/Home.constants.tsx @@ -1,6 +1,6 @@ -import { DexSvg, FrontEndSvg, FungibleTokenSvg, NftSvg } from "./components/svg/BuildAnythingSvgs"; +import { DeterministicIconArticle } from "../shared"; import { BuildWithTheCliSvg, BuildWithUiSvg } from "./components/svg/HomeHeroSvgs"; -import { CliSvg, LocalnetSvg, ToolkitSvg } from "./components/svg/ShipFasterSvgs"; +import { LocalnetSvg, ToolkitSvg, ZetaChainSvg } from "./components/svg/ShipFasterSvgs"; export type NarrowCardLink = { href: string; @@ -11,23 +11,22 @@ export type NarrowCardLink = { export const HERO_CARD_LINKS: NarrowCardLink[] = [ { - href: "/developers/tutorials/hello/", + href: "https://dashboard.anuma.ai/login", svg: , - title: "Build with the CLI", - description: "Scaffold your first app", + title: "Build on Anuma", + description: "Create your first AI app", }, { - href: "/developers/tutorials/frontend/", + href: "https://docs.anuma.ai", svg: , - title: "Build a Web App", - description: "Start with a frontend", + title: "Anuma Docs", + description: "Learn the platform", }, ]; export type BuildAnythingCard = { href: string; svg: React.ReactNode; - svgBackgroundColor: string; topTitle: string; title: string; description: string; @@ -35,98 +34,64 @@ export type BuildAnythingCard = { readType: string; }; -export const EXPLORER_TUTORIALS_LINK = "/developers/tutorials/intro/"; +export const EXPLORER_TUTORIALS_LINK = "https://docs.anuma.ai/tutorials/quickstart"; export const BUILD_ANYTHING_CARDS: BuildAnythingCard[] = [ { - href: "/developers/tutorials/swap/", - svg: , - svgBackgroundColor: "#B0FF61", - topTitle: "Universal", - title: "DEX", - description: - "Learn how to build a universal dex compatible with chains such as Zetachain, Ethereum, Solana, Bitcoin and others.", - readTime: "20 min", - readType: "Advanced", + href: "https://docs.anuma.ai/tutorials/quickstart", + svg: , + topTitle: "Anuma", + title: "Quickstart", + description: "Get up and running with the Anuma SDK — multi-model AI chat with persistent memory in minutes.", + readTime: "10 min", + readType: "Beginner", }, { - href: "/developers/standards/nft/", - svg: , - svgBackgroundColor: "#00A87D", - topTitle: "Universal", - title: "NFT", - description: - "Learn how to create a non-fungible token to be minted on any chain and seamlessly transferred between connected chains.", + href: "https://docs.anuma.ai/tutorials/nextjs", + svg: , + topTitle: "Next.js", + title: "AI Chat App", + description: "Build a web AI chat app with persistent memory and seamless switching across every model.", readTime: "20 min", readType: "Beginner", }, { - href: "/developers/standards/token/", - svg: , - svgBackgroundColor: "#006579", - topTitle: "Universal", - title: "Fungible Token", - description: - "Learn how to create a fungible token to be minted on any chain and seamlessly transferred between connected chains.", + href: "https://docs.anuma.ai/tutorials/agent", + svg: , + topTitle: "Anuma", + title: "Agent", + description: "Build an AI agent with tools, streaming, and persistent memory across every model.", readTime: "20 min", readType: "Intermediate", }, { - href: "/developers/tutorials/frontend/", - svg: , - svgBackgroundColor: "#A03595", - topTitle: "Universal", - title: "Front-end", - description: - "Create a web app to interact with your universal contract: connect a wallet, send cross-chain calls, and track execution", + href: "https://docs.anuma.ai/tutorials/expo", + svg: , + topTitle: "Expo", + title: "Mobile App", + description: "Ship an AI chat app on iOS and Android with Expo and the Anuma SDK.", readTime: "20 min", - readType: "Beginner", - }, -]; - -export type VideoCard = { - href: string; - title: string; - description: string; - readTime: string; - readType: string; -}; - -export const VIDEOS_CARDS: VideoCard[] = [ - { - href: "https://www.youtube.com/embed/4zJ1fo49X8M", - title: "Overview of example universal apps", - description: "Taking a look at a simple Hello app, cross-chain call example, universal swap and a universal NFT.", - readTime: "40 min", readType: "Intermediate", }, - { - href: "https://www.youtube.com/embed/0OKmu6fGyQ0", - title: "Dev office hours: explore our updated CLI", - description: - "Follow along as we walk through our newly updated CLI and demonstrate building a simple app, quickly.", - readTime: "60 min", - readType: "Beginner", - }, ]; export const SHIP_FASTER_CARD_LINKS: NarrowCardLink[] = [ { - href: "https://github.com/zeta-chain/cli", - svg: , - title: "CLI", - description: "Scaffolding & more", + href: "/nodes/overview/", + svg: , + title: "Run a Node", + description: "Set up a validator or full node", }, { - href: "https://github.com/zeta-chain/toolkit", + href: "/reference/api/", svg: , - title: "Toolkit", - description: "Robust tools", + title: "RPC/API Endpoints", + description: "Connect to ZetaChain nodes", }, { - href: "/reference/localnet/", - svg: , - title: "Localnet", - description: "Instant testing", + href: "/about/overview/", + svg: , + title: "About ZetaChain", + description: "The protocol behind Anuma", }, ]; diff --git a/src/components/Home/Home.graphql.contentful.ts b/src/components/Home/Home.graphql.contentful.ts deleted file mode 100644 index 697f4e791..000000000 --- a/src/components/Home/Home.graphql.contentful.ts +++ /dev/null @@ -1,99 +0,0 @@ -import { gql } from "graphql-request"; - -export const GetFeaturedEcosystemApps = gql` - query GetFeaturedEcosystemApps { - ecosystemProjectCollection(where: { isFeatured: true }, order: featuredAppOrder_ASC, limit: 5) { - items { - sys { - id - } - name - description - image { - url - } - link - textColor - - categoryCollection { - items { - sys { - id - } - } - } - - isFeatured - featuredAppOrder - featuredCardBackgroundImage { - url - } - featuredCardBorder - featuredCardLogoBorder - } - } - } -`; - -export const GetEcosystemEventsCollection = gql` - query GetEcosystemEventsCollection { - ecosystemEventsCollection { - total - items { - title - date - startTime - endTime - location - description - logo { - url - width - height - } - backgroundColor - textColor - backgroundImage { - url - width - height - } - mobileBackgroundImage { - url - width - height - } - linkLabel - link - pillColor - order - sys { - id - } - } - } - } -`; - -export const GetEngineeringBlogPosts = gql` - query GetEngineeringBlogPosts { - docsEngineeringBlogCollection { - items { - blogPostsCollection { - items { - sys { - id - firstPublishedAt - } - title - slug - image { - url - } - description - } - } - } - } - } -`; diff --git a/src/components/Home/Home.utils.ts b/src/components/Home/Home.utils.ts deleted file mode 100644 index d2dfb8508..000000000 --- a/src/components/Home/Home.utils.ts +++ /dev/null @@ -1,29 +0,0 @@ -// SWR fetcher function -export const contentfulFetcher = async (query: string, cacheKey?: string) => { - const response = await fetch("/api/contentful", { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ query, cacheKey }), - }); - - if (!response.ok) { - const errorText = await response.text(); - throw new Error(`HTTP ${response.status}: ${errorText || "Failed to fetch data"}`); - } - - const result = await response.json(); - - if (result.errors) { - throw new Error(`GraphQL errors: ${result.errors.map((e: { message?: string }) => e?.message || "").join(", ")}`); - } - - return result.data; -}; - -export const contentfulFetcherOptions = { - revalidateOnFocus: false, - revalidateOnReconnect: false, - refreshInterval: 43200000, // 12 hours in milliseconds -}; diff --git a/src/components/Home/components/BuildAnything.tsx b/src/components/Home/components/BuildAnything.tsx index 72a6eacc0..b2254af8d 100644 --- a/src/components/Home/components/BuildAnything.tsx +++ b/src/components/Home/components/BuildAnything.tsx @@ -1,29 +1,47 @@ import Link from "next/link"; +import { isExternalLink } from "~/lib/helpers/url"; + import { BUILD_ANYTHING_CARDS, EXPLORER_TUTORIALS_LINK } from "../Home.constants"; import { BuildAnythingCard } from "./BuildAnythingCard"; import { DocsSvg } from "./svg/DocsSvg"; export const BuildAnything = () => { + const exploreTutorialsClassName = + "inline-flex items-center gap-1 text-[16px] leading-[130%] font-normal text-[#00A5C6] dark:text-[#B0FF61] text-center"; + const exploreTutorialsContent = ( + <> + + Explore tutorials → + + ); + return (

    - Build anything
    you can imagine + Build with Anuma

    - Get started with step-by-step tutorials to get your idea off the ground + Step-by-step tutorials to ship your first AI app with persistent memory

    - - - Explore tutorials → - + {isExternalLink(EXPLORER_TUTORIALS_LINK) ? ( + + {exploreTutorialsContent} + + ) : ( + + {exploreTutorialsContent} + + )}
    diff --git a/src/components/Home/components/BuildAnythingCard.tsx b/src/components/Home/components/BuildAnythingCard.tsx index 12dee91f7..4c9e3bb79 100644 --- a/src/components/Home/components/BuildAnythingCard.tsx +++ b/src/components/Home/components/BuildAnythingCard.tsx @@ -1,33 +1,28 @@ import clsx from "clsx"; import Link from "next/link"; +import { isExternalLink } from "~/lib/helpers/url"; + import { BuildAnythingCard as BuildAnythingCardProps } from "../Home.constants"; import { ClockSvg } from "./svg/ClockSvg"; export const BuildAnythingCard: React.FC = ({ href, svg, - svgBackgroundColor, topTitle, title, description, readTime, readType, }) => { - return ( - -
    - {svg} -
    + const cardClassName = clsx( + "flex flex-col p-6 border border-grey-200 dark:border-grey-600 rounded-lg w-[288px] md:w-[268px]", + "hover:shadow-light hover:border-white bg-white dark:bg-grey-900 dark:hover:bg-grey-800 dark:hover:border-grey-800 transition-all" + ); + + const cardContent = ( + <> +
    {svg}

    {topTitle}

    @@ -44,6 +39,20 @@ export const BuildAnythingCard: React.FC = ({

    {readType}

    + + ); + + if (isExternalLink(href)) { + return ( + + {cardContent} + + ); + } + + return ( + + {cardContent} ); }; diff --git a/src/components/Home/components/BuildForNow.tsx b/src/components/Home/components/BuildForNow.tsx index d7a94b52c..6bded1c48 100644 --- a/src/components/Home/components/BuildForNow.tsx +++ b/src/components/Home/components/BuildForNow.tsx @@ -1,16 +1,5 @@ -import { ChainSvgLinkWrapper } from "./ChainSvgLinkWrapper"; -import { - ArbitrumSvg, - AvalancheSvg, - BaseSvg, - EthereumSvg, - FadeRightSvg, - PolygonSvg, - SolanaSvg, - SuiSvg, -} from "./svg/BuildForNowSvgs"; -import { BitcoinSvg } from "./svg/BuildForNowSvgs"; -import { FadeLeftSvg } from "./svg/BuildForNowSvgs"; +import { FadeLeftSvg, FadeRightSvg } from "./svg/BuildForNowSvgs"; +import { ChatGPTSvg, ClaudeSvg, DeepSeekSvg, GeminiSvg, GrokSvg, KimiSvg, QwenSvg } from "./svg/ModelSvgs"; export const BuildForNow = () => { return ( @@ -18,11 +7,11 @@ export const BuildForNow = () => {

    - The only layer your app
    will ever need + The foundation
    for AI apps

    - Build once. Run everywhere. + Multi-model, memory, and production primitives in one SDK.

    @@ -33,11 +22,10 @@ export const BuildForNow = () => {
    -

    - Build once. Run everywhere. -

    +

    One API, every model

    - Apps run across chains and models without rebuilding integrations for each ecosystem or provider. + Plug into OpenAI, Anthropic, Google, xAI, DeepSeek, and more through a single SDK. Switch providers + without rewriting your app.

    @@ -45,11 +33,11 @@ export const BuildForNow = () => {

    - Private memory by default + Memory that travels with the user

    - Remember context across sessions, keep it private by design, and enforce access via user-controlled - permissions. + Encrypted, persistent memory follows users across sessions, models, and devices. No vector DB, no RAG + pipeline, no account system to wire up.

    @@ -57,42 +45,25 @@ export const BuildForNow = () => {

    - Monetize without infrastructure + Ship features, not infrastructure

    - Monetize usage, access, context, or execution globally without standing up servers, billing systems, or - account flows. + Streaming, tools, agents, and conversation management are built in. Get from prototype to production + without the plumbing.

    -
    +
    - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + +
    diff --git a/src/components/Home/components/ChainSvgLinkWrapper.tsx b/src/components/Home/components/ChainSvgLinkWrapper.tsx deleted file mode 100644 index 976c46e39..000000000 --- a/src/components/Home/components/ChainSvgLinkWrapper.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import Link from "next/link"; -import { PropsWithChildren } from "react"; - -const CHAIN_PAGE_MAPPING = { - bitcoin: "/developers/chains/bitcoin/", - solana: "/developers/chains/solana/", - evm: "/developers/chains/evm/", - sui: "/developers/chains/sui/", -} as const; - -type ChainPage = keyof typeof CHAIN_PAGE_MAPPING; - -type ChainSvgLinkWrapperProps = PropsWithChildren<{ - chainPage: ChainPage; -}>; - -export const ChainSvgLinkWrapper: React.FC = ({ chainPage, children }) => { - const href = CHAIN_PAGE_MAPPING[chainPage]; - return ( - - {children} - - ); -}; diff --git a/src/components/Home/components/Ecosystem.tsx b/src/components/Home/components/Ecosystem.tsx deleted file mode 100644 index 4137d9d93..000000000 --- a/src/components/Home/components/Ecosystem.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { EcosystemProject } from "../../../generated/contentful.graphql.types"; -import { FeaturedApps } from "./FeaturedApps"; -import { DocsSvg } from "./svg/DocsSvg"; - -type EcosystemProps = { - featuredEcosystemApps: EcosystemProject[]; - isLoadingFeaturedEcosystemApps: boolean; -}; - -export const Ecosystem: React.FC = ({ featuredEcosystemApps, isLoadingFeaturedEcosystemApps }) => { - return ( -
    -
    -

    - Great products are
    built on ZetaChain -

    - -

    - Projects, products and service providers love building on ZetaChain -

    - - - - -
    - ); -}; diff --git a/src/components/Home/components/EcosystemCarousel/EcosystemCarousel.tsx b/src/components/Home/components/EcosystemCarousel/EcosystemCarousel.tsx deleted file mode 100644 index 946d3beb8..000000000 --- a/src/components/Home/components/EcosystemCarousel/EcosystemCarousel.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import clsx from "clsx"; -import { sortBy } from "lodash-es"; -import React, { useMemo, useState } from "react"; -import { useSwipeable } from "react-swipeable"; - -import { EcosystemEvents } from "~/generated/contentful.graphql.types"; - -import { HeroIconArrowLeft } from "../svg/HeroIconArrowLeft"; -import { HeroIconArrowRight } from "../svg/HeroIconArrowRight"; -import { Slide } from "./Slide"; -import { SlideItemsIndicator } from "./SlideItemsIndicator"; - -export const EcosystemCarousel: React.FC<{ - ecosystemEvents: EcosystemEvents[]; - className?: string; -}> = ({ ecosystemEvents, className }) => { - const [active, setActive] = useState(1); - - const sortedEcosystemEvents = useMemo(() => sortBy(ecosystemEvents, ["order"], ["desc"]), [ecosystemEvents]); - - const prev = () => { - const prevSlide = active > 1 ? active - 1 : sortedEcosystemEvents.length; - setActive(prevSlide); - }; - - const next = () => { - const nextSlide = active < sortedEcosystemEvents.length ? active + 1 : 1; - setActive(nextSlide); - }; - - const handlers = useSwipeable({ - onSwipedLeft: () => next(), - onSwipedRight: () => prev(), - trackMouse: true, // optional: allows mouse events to trigger swipe - }); - - return ( -
    -
    - {/* Slides */} -
    -
    - {sortedEcosystemEvents.map((slide, index) => ( - - ))} -
    - - {sortedEcosystemEvents.length > 1 && ( - <> -
    - - - -
    - -
    - {/* Mobile prev and next buttons */} -
    - - - -
    - - -
    - - )} -
    -
    -
    - ); -}; diff --git a/src/components/Home/components/EcosystemCarousel/Slide.tsx b/src/components/Home/components/EcosystemCarousel/Slide.tsx deleted file mode 100644 index 15d363f3e..000000000 --- a/src/components/Home/components/EcosystemCarousel/Slide.tsx +++ /dev/null @@ -1,193 +0,0 @@ -import { useMediaQuery } from "@mui/material"; -import chroma from "chroma-js"; -import clsx from "clsx"; -import { motion } from "framer-motion"; -import Image from "next/image"; -import React from "react"; - -import { EcosystemEvents } from "~/generated/contentful.graphql.types"; - -import { getRevealProps } from "../../../../lib/helpers/animations"; - -/** - * Returns the text color that should be used for the card based on the base color - * @param baseColor The base color of the card - * @returns The text color that should be used for the card based on the base color (either white or black) - */ -const getContrastColor = (baseColor: string): "#ffffff" | "#000000" => { - const isWhiteText = chroma.contrast(baseColor, "#ffffff") > 2; // when the baseColor is white the contrast is 1, and other colors get higher - return isWhiteText ? "#ffffff" : "#000000"; -}; - -export const Slide: React.FC<{ - slide: EcosystemEvents; - isActive: boolean; -}> = ({ slide, isActive }) => { - const isDesktopView = useMediaQuery("(min-width: 768px)"); - - const image = !isDesktopView ? slide.mobileBackgroundImage : slide.backgroundImage; - const pillBgColor = slide.pillColor || "rgba(21, 25, 30, 0.30)"; - const pillTextColor = getContrastColor(pillBgColor); - - return ( -
    -
    -
    - - {slide.logo && ( - {slide.title - )} - -
    - {slide.title} -
    -
    - -
    - {/* Date & time */} - - - - - - {slide.date} - - {(slide.startTime || slide.endTime) && ( - - - - )} - - {slide.startTime && {slide.startTime}} - {slide.startTime && slide.endTime && -} - {slide.endTime && {slide.endTime}} - - - {/* Location */} - - - - - - - - - - - - - {slide.location} - -
    - - - {slide.description} - - - {slide.link && ( - - {slide.linkLabel} - - )} -
    -
    -
    - - - {image && ( - {slide?.title - )} - -
    - ); -}; diff --git a/src/components/Home/components/EcosystemCarousel/SlideItemsIndicator.tsx b/src/components/Home/components/EcosystemCarousel/SlideItemsIndicator.tsx deleted file mode 100644 index 7d557931f..000000000 --- a/src/components/Home/components/EcosystemCarousel/SlideItemsIndicator.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import clsx from "clsx"; - -export const SlideItemsIndicator: React.FC<{ - active: number; - setActive: React.Dispatch> | ((index: number) => void); - slidesNumber: number; - className?: string; -}> = ({ slidesNumber, active, setActive, className }) => { - return ( -
    - {new Array(slidesNumber).fill(null).map((_, index) => ( -
    - ); -}; diff --git a/src/components/Home/components/EngineeringBlog.tsx b/src/components/Home/components/EngineeringBlog.tsx deleted file mode 100644 index 3f1719f80..000000000 --- a/src/components/Home/components/EngineeringBlog.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import { Skeleton } from "@mui/material"; -import { formatDate } from "date-fns"; -import { range } from "lodash"; -import Image from "next/image"; -import Link from "next/link"; - -import { BlogPost } from "../../../generated/contentful.graphql.types"; -import { ClockSvg } from "./svg/ClockSvg"; -import { DocsSvg } from "./svg/DocsSvg"; -import { EngineeringBlogSvg } from "./svg/EngineeringBlog"; - -type EngineeringBlogProps = { - engineeringBlogPosts: BlogPost[]; - isLoadingEngineeringBlogPosts: boolean; -}; - -export const EngineeringBlog: React.FC = ({ - engineeringBlogPosts, - isLoadingEngineeringBlogPosts, -}) => { - const ENGINEERING_BLOG_URL = "https://www.zetachain.com/blog/category/1YDEn2XPs3rpPas31UgBcJ/page/1"; - const BLOG_POST_BASE_URL = "https://www.zetachain.com/blog"; - - return ( -
    -
    -
    - -
    - -

    - From the
    engineering blog -

    - -

    - Latest development articles -

    - - -
    - -
    - {isLoadingEngineeringBlogPosts && - range(3).map((index) => ( - - ))} - - {!isLoadingEngineeringBlogPosts && - engineeringBlogPosts.map((post, index) => ( - -
    - {post?.title -
    - -

    - {post.title} -

    - -

    - {post.description} -

    - -
    -
    - Read More → -
    - -
    - -

    - {formatDate(post.sys.firstPublishedAt, "MMM d, yyyy")} -

    -
    -
    - - ))} -
    -
    - ); -}; diff --git a/src/components/Home/components/FeaturedAppCard.tsx b/src/components/Home/components/FeaturedAppCard.tsx deleted file mode 100644 index f3c3cdc6e..000000000 --- a/src/components/Home/components/FeaturedAppCard.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import clsx from "clsx"; -import Image from "next/image"; - -import { EcosystemProject } from "~/generated/contentful.graphql.types"; - -import { isUniversalApp, parseEcosystemAppCardBorder, parseEcosystemAppLogoBorder } from "./../Ecosystem.utils"; - -const DEFAULT_APP_BACKGROUND_URL = "/img/ecosystem/default-ecosystem-app-bg.png"; -const DEFAULT_APP_LOGO_URL = "/img/ecosystem/default-ecosystem-app-logo.png"; -const DEFAULT_TEXT_COLOR = "#FFFFFF"; - -type FeaturedAppCardProps = { - app: EcosystemProject; - className?: string; -}; - -export const FeaturedAppCard: React.FC = ({ app, className }) => { - const cardContent = ( - <> -
    - {app.name -
    - - {isUniversalApp(app) && ( -
    - Universal -
    - )} - -
    -
    - {app.name -
    - -

    - {app.name || "Title"} -

    - -

    - {app.description} -

    -
    - - ); - - const baseClassName = clsx( - "flex flex-col justify-end items-center rounded-lg relative shrink-0 px-6 pb-10 overflow-hidden", - "w-[208px] h-[288px]", - "shadow-none transition-all duration-200", - parseEcosystemAppCardBorder(app.featuredCardBorder), - className - ); - - if (app.link) { - return ( - - {cardContent} - - ); - } - - return
    {cardContent}
    ; -}; diff --git a/src/components/Home/components/FeaturedApps.tsx b/src/components/Home/components/FeaturedApps.tsx deleted file mode 100644 index 693970a82..000000000 --- a/src/components/Home/components/FeaturedApps.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { Skeleton } from "@mui/material"; -import clsx from "clsx"; -import { range } from "lodash-es"; - -import { EcosystemProject } from "~/generated/contentful.graphql.types"; - -import { FeaturedAppCard } from "./FeaturedAppCard"; - -type FeaturedAppsProps = { - featuredEcosystemApps: EcosystemProject[]; - isLoadingFeaturedEcosystemApps: boolean; -}; - -export const FeaturedApps: React.FC = ({ - featuredEcosystemApps, - isLoadingFeaturedEcosystemApps, -}) => { - return ( -
    -
    - {isLoadingFeaturedEcosystemApps - ? range(5).map((index) => ( -
    - -
    - )) - : featuredEcosystemApps.map((app) => )} -
    -
    - ); -}; diff --git a/src/components/Home/components/HomeHero.tsx b/src/components/Home/components/HomeHero.tsx index d90142991..2f059d8c0 100644 --- a/src/components/Home/components/HomeHero.tsx +++ b/src/components/Home/components/HomeHero.tsx @@ -5,12 +5,12 @@ export const HomeHero: React.FC = () => { return (

    - The Universal Layer for{" "} - AI and Web3 + The Private Memory Layer for{" "} + AI

    - Build apps that run across chains and models. Keep memory private. Monetize without infrastructure. + One private memory across every AI you use. Build with it on Anuma, the platform powered by ZetaChain.

    diff --git a/src/components/Home/components/HomePage.tsx b/src/components/Home/components/HomePage.tsx index bb65ca3c2..349d1b4ce 100644 --- a/src/components/Home/components/HomePage.tsx +++ b/src/components/Home/components/HomePage.tsx @@ -1,72 +1,28 @@ import { NextSeo } from "next-seo"; -import { useHomePageContent } from "../hooks/useHomePageContent"; import { BuildAnything } from "./BuildAnything"; import { BuildForNow } from "./BuildForNow"; -import { Ecosystem } from "./Ecosystem"; -import { EngineeringBlog } from "./EngineeringBlog"; import { HomeHero } from "./HomeHero"; -import { JoinCommunity } from "./JoinCommunity"; import { ShipFaster } from "./ShipFaster"; -import { DividerSvg, ShortDividerSvg } from "./svg/DividerSvgs"; -import { VideosSection } from "./VideosSection"; +import { DividerSvg } from "./svg/DividerSvgs"; export const HomePage: React.FC = () => { - const { - featuredEcosystemApps, - isLoadingFeaturedEcosystemApps, - - ecosystemEvents, - isLoadingEcosystemEvents, - - engineeringBlogPosts, - isLoadingEngineeringBlogPosts, - } = useHomePageContent(); - return ( <> - - - - - {(isLoadingFeaturedEcosystemApps || featuredEcosystemApps.length > 0) && ( - <> - - - - )} - - - - - {(isLoadingEngineeringBlogPosts || engineeringBlogPosts.length > 0) && ( - <> - - - - )} ); }; diff --git a/src/components/Home/components/JoinCommunity.tsx b/src/components/Home/components/JoinCommunity.tsx deleted file mode 100644 index 1f82c0d1f..000000000 --- a/src/components/Home/components/JoinCommunity.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { Skeleton } from "@mui/material"; -import clsx from "clsx"; -import Link from "next/link"; - -import { globalLinks } from "../../../constants"; -import { EcosystemEvents } from "../../../generated/contentful.graphql.types"; -import { EcosystemCarousel } from "./EcosystemCarousel/EcosystemCarousel"; -import { DiscordSvg } from "./svg/DiscordSvg"; -import { GlobalSvg } from "./svg/GlobalSvg"; -import { DeveloperCommunitySvg, GlobalCommunitySvg } from "./svg/JoinCommunitySvgs"; - -type JoinCommunityProps = { - ecosystemEvents: EcosystemEvents[]; - isLoadingEcosystemEvents: boolean; -}; - -export const JoinCommunity: React.FC = ({ ecosystemEvents, isLoadingEcosystemEvents }) => { - return ( -
    -
    -
    -

    - Join a thriving community -

    - -

    - Converse, collaborate and meet other builders -

    - -
    -
    -
    -
    -
    - -
    -
    - {isLoadingEcosystemEvents ? ( -
    - -
    - ) : ( - - )} -
    - -
    -
    -
    - -
    - -
    -

    - Developer Community -

    -

    - 773k+ Builders, Validators and more -

    - -

    - Converse with other builders from the active developer community. -

    - - - - Join the Discord → - -
    -
    - -
    -
    - -
    - -
    -

    - Global Community -

    -

    - Community-led regional support -

    - -

    - Get connected with our official channels and active global community. -

    - - - - Join the conversation → - -
    -
    -
    -
    -
    - ); -}; diff --git a/src/components/Home/components/NarrowCardLinkContent.tsx b/src/components/Home/components/NarrowCardLinkContent.tsx index 37f47c4f5..0e43c26fc 100644 --- a/src/components/Home/components/NarrowCardLinkContent.tsx +++ b/src/components/Home/components/NarrowCardLinkContent.tsx @@ -7,7 +7,7 @@ interface NarrowCardLinkContentProps { export const NarrowCardLinkContent: React.FC = ({ svg, title, description }) => { return ( <> -
    {svg}
    +
    {svg}

    diff --git a/src/components/Home/components/ShipFaster.tsx b/src/components/Home/components/ShipFaster.tsx index 7d8da56ba..6f795643d 100644 --- a/src/components/Home/components/ShipFaster.tsx +++ b/src/components/Home/components/ShipFaster.tsx @@ -7,11 +7,11 @@ export const ShipFaster = () => {

    - Crafted for Builders + The chain underneath

    - Ship faster with a
    powerful set of tools + ZetaChain network

    @@ -19,8 +19,8 @@ export const ShipFaster = () => {

    - Build anything you can imagine with a set of robust tools that empower you to build great products and ship - faster. + Anuma runs on ZetaChain, the user-owned coordination layer for AI. Dig into the protocol, run a validator, + or learn how it all fits together.

    diff --git a/src/components/Home/components/VideosSection.tsx b/src/components/Home/components/VideosSection.tsx deleted file mode 100644 index 8f35cf814..000000000 --- a/src/components/Home/components/VideosSection.tsx +++ /dev/null @@ -1,145 +0,0 @@ -import { Skeleton } from "@mui/material"; -import { useMemo, useState } from "react"; - -import { VideoCard as VideoCardProps, VIDEOS_CARDS } from "../Home.constants"; -import { ClockSvg } from "./svg/ClockSvg"; - -// YouTube video ID extraction helper -const getYouTubeVideoId = (url: string): string | null => { - const match = url.match(/(?:youtube\.com\/embed\/|youtu\.be\/|youtube\.com\/watch\?v=)([^&\n?#]+)/); - return match ? match[1] : null; -}; - -// YouTube high-quality thumbnail URL generator -const getYouTubeThumbnail = (videoId: string, quality: "maxresdefault" | "hqdefault" = "maxresdefault"): string => { - return `https://img.youtube.com/vi/${videoId}/${quality}.jpg`; -}; - -const VideoCard: React.FC = ({ href, title, description, readTime, readType }) => { - const [isPlaying, setIsPlaying] = useState(false); - const [isLoading, setIsLoading] = useState(false); - const videoId = getYouTubeVideoId(href); - - const videoDescription = useMemo( - () => ( -
    -
    -

    {title}

    -

    {description}

    -
    -
    - {readType} -
    - - {readTime} -
    -
    -
    - ), - [title, description, readType, readTime] - ); - - if (!videoId) { - // Fallback to iframe if not a valid YouTube URL - return ( -
    -
    - - -1. A contract on a connected chain calls `depositAndCall` or `call` on the - Gateway. -2. The Gateway forwards the call to a **universal contract** on ZetaChain. -3. If the `onCall` function reverts, the protocol initiates the revert process. - -Revert Behavior: - -- If the `amount` sent with the original call is **enough to cover revert gas - fees**: - - - ZetaChain swaps part of the amount into gas tokens (ZRC-20) for the - connected chain. - - The protocol sends the remaining tokens and revert message to the - `revertAddress` on the connected chain. - - If `callOnRevert` is `true`, the Gateway invokes the `onRevert` function. - -- If the `amount` is **insufficient** or zero (for example, when it's a no-asset - `call`) the Gateway calls `onAbort` on the `abortAddress` on ZetaChain. - -### ZetaChain → Connected Chain (Outgoing) - - - -This scenario occurs when a universal contract on ZetaChain calls -`withdrawAndCall` or `call` on the Gateway to interact with a contract on a -connected chain. - -Flow: - -1. A universal contract on ZetaChain initiates a call to a connected chain via - `withdrawAndCall` or `call`. -2. The Gateway forwards the message and/or tokens to the target contract on the - connected chain. -3. If the target contract reverts, ZetaChain initiates the revert process. - -Revert Behavior: - -- If `callOnRevert` is `true`: - - - The Gateway invokes the `onRevert` function on the `revertAddress` on - ZetaChain. - - The remaining ZRC-20 tokens are passed along with the revert context. - - If the `onRevert` call **itself reverts**, the Gateway transfers ZRC-20 - tokens to and calls `onAbort` on the `abortAddress` on ZetaChain. - -- If `callOnRevert` is `false`: - - - The Gateway transfers tokens to the `revertAddress` without invoking any - function. - -The `RevertOptions` struct specifies how assets are handled in case of a -cross-chain transaction (CCTX) revert. - -### `RevertOptions` Struct - -```solidity -struct RevertOptions { - address revertAddress; - bool callOnRevert; - address abortAddress; - bytes revertMessage; - uint256 onRevertGasLimit; -} -``` - -- `revertAddress`: The address that receives tokens or revert logic. If revert - address is zero, reverted tokens are transferred to the original sender of the - call. -- `callOnRevert`: Whether the Gateway should call `onRevert`. -- `abortAddress`: Address to call if `onCall` reverts (for a no-asset call) or - reverting fails (for an asset call) -- `revertMessage`: Message passed to `onRevert` and `onAbort`. -- `onRevertGasLimit`: Max gas allowed for `onRevert`. Determines the amount of - tokens that will be used - -### `onRevert` - -```solidity -struct RevertContext { - address asset; - uint64 amount; - bytes revertMessage; -} - -interface Revertable { - function onRevert(RevertContext calldata revertContext) external; -} -``` - -- On a connected chain, `asset` is the ERC-20 originally deposited (or zero - address for gas assets). -- On ZetaChain, `asset` is the ZRC-20 withdrawn during the original call. - -### `onAbort` - -```solidity -struct AbortContext { - bytes sender; - address asset; - uint256 amount; - bool outgoing; - uint256 chainID; - bytes revertMessage; -} - -interface Abortable { - function onAbort(AbortContext calldata abortContext) external; -} -``` - -- Called on ZetaChain as a fallback when revert execution fails. -- Used in both incoming and outgoing transactions. - -### Summary - -| Direction | Trigger | Revert Path | Fallback if Revert Fails | -| --------------------- | ---------------------------------------- | --------------------------------------------- | ------------------------ | -| Connected → ZetaChain | `onCall()` in universal contract fails | `onRevert()` on connected chain (if funded) | `onAbort()` on ZetaChain | -| ZetaChain → Connected | Target contract on connected chain fails | `onRevert()` on ZetaChain (if `callOnRevert`) | `onAbort()` on ZetaChain | diff --git a/src/pages/developers/chains/zetachain.zh-CN.mdx b/src/pages/developers/chains/zetachain.zh-CN.mdx deleted file mode 100644 index b5f130127..000000000 --- a/src/pages/developers/chains/zetachain.zh-CN.mdx +++ /dev/null @@ -1,228 +0,0 @@ -要从全链应用向连接链上的合约发起调用或提取代币,请使用 ZetaChain Gateway。 - -ZetaChain Gateway 支持: - -- 将 ZRC-20 代币提取为连接链上的原生 Gas 代币或 ERC-20 代币。 -- 在提取代币的同时,对连接链上的合约发起调用。 -- 单纯对连接链上的合约发起调用。 - -注意:目前不支持提取 ZETA 代币,调用会触发 `ZETANotSupported()` 回退。 - -## 提取 ZRC-20 代币 - -若要将 ZRC-20 代币提取到连接链上的 EOA 或合约,可调用 Gateway 合约的 `withdraw` 函数: - -```solidity -function withdraw(bytes memory receiver, uint256 amount, address zrc20, RevertOptions calldata revertOptions) external; -``` - -`receiver` 可以是连接链上的外部拥有账户(EOA)或智能合约。即便接收方是具备标准 `receive` 函数的合约,`withdraw` 也不会触发合约调用;如果需要在提取后调用连接链合约,请改用 `withdrawAndCall`。 - -`receiver` 类型为 `bytes`,以兼容不同链的地址格式(例如比特币的 Bech32)。当向 EVM 链提取时,需要将 `address` 转换为 `bytes`。 - -当向非 EVM 链提取时,请确保将 `receiver` 地址按**字符串**编码为 `bytes`,即将地址作为字符串逐字转换为字节。 - -例如,若 Solana 上的接收地址为: - -``` -GBwCxLUt5qn12aCD4uVKMWnoXPn2DoH126p8FrFmGNUy -``` - -对应的 `bytes` 表示为: - -``` -0x47427743784c557435716e31326143443475564b4d576e6f58506e32446f4831323670384672466d474e5579 -``` - -`amount` 指定提取数量;`zrc20` 为待提取代币的 ZRC-20 地址。 - -注意:某些连接链对提取金额设有最低限制。例如,将 ZRC-20 SOL 提取回 Solana 时,最少需 1,000,000(lamports)以满足免租金要求。 - -`revertOptions.revertMessage` 长度不得超过 1024 字节。 - -无需指定目标链,因为每个 ZRC-20 代币都绑定其存入的链,只能提取回原链。例如,要将 ZRC-20 USDC.ETH 提取到 BNB 链,必须先将其兑换为 ZRC-20 USDC.BNB。 - -## 提取 ZRC-20 并调用连接链合约 - -如需在提取 ZRC-20 的同时调用连接链上的合约,请使用 `withdrawAndCall`: - -```solidity -function withdrawAndCall(bytes memory receiver, uint256 amount, address zrc20, bytes calldata message, CallOptions calldata callOptions, RevertOptions calldata revertOptions) external; -``` - -该函数会根据 `zrc20` 所指向的链提取代币并调用合约。例如,提取 ZRC-20 ETH 时,将调用以太坊上的目标合约。 - -`message` 与 `revertOptions.revertMessage` 的总长度不得超过 1024 字节。 - -## 调用连接链合约 - -若仅需调用连接链合约(不提取代币),可使用 `call` 函数: - -```solidity -function call(bytes memory receiver, address zrc20, bytes calldata message, CallOptions calldata callOptions, RevertOptions calldata revertOptions) external; -``` - -此处 `zrc20` 表示目标链 Gas 代币的 ZRC-20 地址,用于标识目标链。例如调用以太坊合约时需使用 ZRC-20 ETH 地址。 - -`message` 与 `revertOptions.revertMessage` 总长度同样不得超过 1024 字节。 - -## 调用参数(CallOptions) - -`CallOptions` 用于配置对连接链合约的调用细节,`call` 与 `withdrawAndCall` 均会使用: - -```solidity -struct CallOptions { - uint256 gasLimit; - bool isArbitraryCall; -} -``` - -- **`gasLimit`**:跨链合约调用可消耗的最大 Gas。若实际消耗超出该值,交易将回退。 -- **`isArbitraryCall`**:决定调用类型是“任意调用”(`true`)还是“认证调用”(`false`)。 - -任意调用可以执行连接链上任意函数,但不会保留原始调用者身份,即目标合约中的 `msg.sender` 为 Gateway 地址,而非源全链合约。适用于无需调用者身份的场景(如代币兑换)。 - -认证调用只会触发连接链合约中的 `onCall` 函数。协议通过 `onCall` 接收的 `context.sender`(源全链合约地址)实现鉴权,目标合约可据此验证并信任调用方,拒绝未经授权的调用。 - -## `message` 参数格式 - -对于任意调用(`isArbitraryCall` 为 `true`),`withdrawAndCall` 与 `call` 的 `message` 参数需包含目标函数的编码选择器和参数: - -- **函数选择器**:函数签名的 Keccak-256 哈希前 4 个字节。 -- **参数**:按以太坊 ABI 规则编码的剩余字节。 - -例如: - -``` -0xa777d0dc00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000005616c696365000000000000000000000000000000000000000000000000000000 -``` - -- **函数选择器**:`0xa777d0dc` 对应 `hello(string)`。 -- **参数**:余下数据表示字符串参数 `alice` 的十六进制编码(`616c696365`)。 - -对于认证调用,`message` 仅包含 ABI 编码的参数(无需函数选择器,因为调用会路由至指定的 `onCall`)。 - -## 回退交易(Revert Transactions) - -当跨链交易(CCTX)失败时,ZetaChain 会依据 `RevertOptions` 结构体决定如何处理。行为取决于交易方向——是连接链到 ZetaChain,还是 ZetaChain 到连接链。 - -### 连接链 → ZetaChain(入向) - -该场景发生在连接链上的合约通过 Gateway 的 `depositAndCall` 或 `call` 向 ZetaChain 发送代币或消息时。 - - - -1. 连接链合约调用 Gateway 的 `depositAndCall` 或 `call`。 -2. Gateway 将调用转发至 ZetaChain 的**全链合约**。 -3. 若 `onCall` 函数回退,协议启动回退流程。 - -回退行为: - -- 若原始调用携带的 `amount` **足以覆盖回退所需 Gas**: - - - ZetaChain 会兑换部分金额为连接链对应的 Gas 代币(ZRC-20)。 - - 协议将剩余代币与回退消息发送至连接链上的 `revertAddress`。 - - 若 `callOnRevert` 为 `true`,Gateway 会调用 `onRevert`。 - -- 若 `amount` **不足**或为零(例如无资产调用),Gateway 会在 ZetaChain 上调用 `onAbort`(目标为 `abortAddress`)。 - -### ZetaChain → 连接链(出向) - - - -该场景发生在 ZetaChain 上的全链合约通过 `withdrawAndCall` 或 `call` 与连接链合约交互时。 - -流程: - -1. 全链合约在 ZetaChain 上通过 `withdrawAndCall` 或 `call` 发起调用。 -2. Gateway 将消息和/或代币转发至连接链目标合约。 -3. 若目标合约回退,ZetaChain 启动回退流程。 - -回退行为: - -- 若 `callOnRevert` 为 `true`: - - - Gateway 会在 ZetaChain 上调用 `revertAddress` 的 `onRevert`。 - - 剩余 ZRC-20 代币会连同回退上下文一并传递。 - - 若 `onRevert` 自身回退,Gateway 会将 ZRC-20 代币转给 `abortAddress` 并调用其 `onAbort`。 - -- 若 `callOnRevert` 为 `false`: - - - Gateway 仅将代币转给 `revertAddress`,不执行任何函数。 - -`RevertOptions` 结构体定义了跨链交易(CCTX)回退时资产的处理方式。 - -### `RevertOptions` 结构体 - -```solidity -struct RevertOptions { - address revertAddress; - bool callOnRevert; - address abortAddress; - bytes revertMessage; - uint256 onRevertGasLimit; -} -``` - -- `revertAddress`:接收代币或回退逻辑的地址。若为零地址,代币会退回原调用者。 -- `callOnRevert`:指定 Gateway 是否调用 `onRevert`。 -- `abortAddress`:在 `onCall` 回退(无资产调用)或回退执行失败(有资产调用)时的处理地址。 -- `revertMessage`:传递给 `onRevert` 与 `onAbort` 的消息。 -- `onRevertGasLimit`:`onRevert` 可用的最大 Gas,用于确定所需代币数量。 - -### `onRevert` - -```solidity -struct RevertContext { - address asset; - uint64 amount; - bytes revertMessage; -} - -interface Revertable { - function onRevert(RevertContext calldata revertContext) external; -} -``` - -- 在连接链上,`asset` 为最初存入的 ERC-20(或原生 Gas 代币对应的零地址)。 -- 在 ZetaChain 上,`asset` 为原始调用中提取的 ZRC-20。 - -### `onAbort` - -```solidity -struct AbortContext { - bytes sender; - address asset; - uint256 amount; - bool outgoing; - uint256 chainID; - bytes revertMessage; -} - -interface Abortable { - function onAbort(AbortContext calldata abortContext) external; -} -``` - -- 当回退执行失败时,ZetaChain 会作为兜底调用。 -- 适用于入向与出向交易。 - -### 总结 - -| 方向 | 触发条件 | 回退路径 | 回退失败的兜底措施 | -| -------------------- | -------------------------------------- | --------------------------------------------- | --------------------------- | -| 连接链 → ZetaChain | 全链合约的 `onCall()` 回退 | 若资金充足,在连接链调用 `onRevert()` | 在 ZetaChain 调用 `onAbort()` | -| ZetaChain → 连接链 | 连接链目标合约回退 | 若 `callOnRevert` 为真,在 ZetaChain 调用 `onRevert()` | 在 ZetaChain 调用 `onAbort()` | - diff --git a/src/pages/developers/evm/erc20.en-US.mdx b/src/pages/developers/erc20.en-US.mdx similarity index 100% rename from src/pages/developers/evm/erc20.en-US.mdx rename to src/pages/developers/erc20.en-US.mdx diff --git a/src/pages/developers/evm/erc20.zh-CN.mdx b/src/pages/developers/erc20.zh-CN.mdx similarity index 100% rename from src/pages/developers/evm/erc20.zh-CN.mdx rename to src/pages/developers/erc20.zh-CN.mdx diff --git a/src/pages/developers/evm.en-US.mdx b/src/pages/developers/evm.en-US.mdx new file mode 100644 index 000000000..d63c09fa2 --- /dev/null +++ b/src/pages/developers/evm.en-US.mdx @@ -0,0 +1,69 @@ +--- +title: "ZetaChain EVM" +description: "ZetaChain's EVM-compatible execution environment built on Cosmos SDK and CometBFT." +--- + +ZetaChain is a Proof of Stake Layer 1 blockchain that runs a complete Ethereum +Virtual Machine. Smart contracts compile and deploy with Solidity and the +standard EVM toolchain — Hardhat, Foundry, Remix, ethers, viem, MetaMask — with +no modifications. The chain is built on the +[Cosmos SDK](https://docs.cosmos.network/), the +[CometBFT](https://docs.cometbft.com/) consensus engine, and the +[Cosmos EVM](https://evm.cosmos.network/) module. + +## Architecture + +The Cosmos SDK provides the modular blockchain framework, including staking, +banking, governance, and other core modules. CometBFT handles consensus, +producing blocks with deterministic finality. The EVM is integrated as a Cosmos +SDK module that exposes the Ethereum execution environment natively. The result +is a sovereign Layer 1 with its own validator set, fee market, and governance, +running Ethereum-compatible smart contract execution. + +## EVM compatibility + +ZetaChain implements the full Ethereum bytecode and the complete JSON-RPC API. +Standard transaction formats are supported: EIP-155 for chain ID replay +protection, EIP-1559 for the dynamic base fee market, EIP-2930 for access +lists, and EIP-7702 for code delegation on externally owned accounts. Layer 2 +features like blob transactions (EIP-4844) are not supported, as ZetaChain +operates as an independent Layer 1 rather than a rollup. + +## Finality + +Ethereum finalizes blocks probabilistically across many confirmations. +ZetaChain finalizes deterministically through CometBFT in a single block, +typically under five seconds. There are no chain reorganizations: once a block +is committed, it is final, so contracts and integrations do not need to +account for reorg risk. + +## Accounts and addresses + +ZetaChain supports both bech32 Cosmos addresses (prefix `zeta`) and hex EVM +addresses. The two formats are derived from the same public key and represent +the same account. See [Account Addresses](/developers/addresses) for details +and conversion utilities. + +## Fees + +ZetaChain uses the EIP-1559 fee model with a dynamic base fee. From an +application developer's perspective, fees behave identically to Ethereum. The +native gas token is [ZETA](/developers/zeta); the on-chain denom is `azeta` +(1 ZETA = 10¹⁸ azeta). + +## Tooling + +Existing Ethereum tooling works without modification — MetaMask and other EVM +wallets, Hardhat, Foundry, Remix, ethers.js, viem, web3.js, and the standard +ERC-20, ERC-721, and ERC-1155 contracts. Point any EVM client at a ZetaChain +[RPC endpoint](/reference/api) to read state, send transactions, and +interact with deployed contracts. Chain IDs, public RPCs, and block explorers +are documented in [Network Details](/reference/details). + +## Cosmos features through precompiles + +Cosmos SDK functionality such as staking and governance is exposed to the EVM +through precompiled contracts at fixed addresses, so Solidity code can call +into these features directly. EVM wallets can also sign Cosmos SDK +transactions using `eth_signTypedData` (EIP-712), which lets users delegate +stake or vote on proposals without a separate Cosmos wallet. diff --git a/src/pages/developers/evm.zh-CN.mdx b/src/pages/developers/evm.zh-CN.mdx new file mode 100644 index 000000000..d63c09fa2 --- /dev/null +++ b/src/pages/developers/evm.zh-CN.mdx @@ -0,0 +1,69 @@ +--- +title: "ZetaChain EVM" +description: "ZetaChain's EVM-compatible execution environment built on Cosmos SDK and CometBFT." +--- + +ZetaChain is a Proof of Stake Layer 1 blockchain that runs a complete Ethereum +Virtual Machine. Smart contracts compile and deploy with Solidity and the +standard EVM toolchain — Hardhat, Foundry, Remix, ethers, viem, MetaMask — with +no modifications. The chain is built on the +[Cosmos SDK](https://docs.cosmos.network/), the +[CometBFT](https://docs.cometbft.com/) consensus engine, and the +[Cosmos EVM](https://evm.cosmos.network/) module. + +## Architecture + +The Cosmos SDK provides the modular blockchain framework, including staking, +banking, governance, and other core modules. CometBFT handles consensus, +producing blocks with deterministic finality. The EVM is integrated as a Cosmos +SDK module that exposes the Ethereum execution environment natively. The result +is a sovereign Layer 1 with its own validator set, fee market, and governance, +running Ethereum-compatible smart contract execution. + +## EVM compatibility + +ZetaChain implements the full Ethereum bytecode and the complete JSON-RPC API. +Standard transaction formats are supported: EIP-155 for chain ID replay +protection, EIP-1559 for the dynamic base fee market, EIP-2930 for access +lists, and EIP-7702 for code delegation on externally owned accounts. Layer 2 +features like blob transactions (EIP-4844) are not supported, as ZetaChain +operates as an independent Layer 1 rather than a rollup. + +## Finality + +Ethereum finalizes blocks probabilistically across many confirmations. +ZetaChain finalizes deterministically through CometBFT in a single block, +typically under five seconds. There are no chain reorganizations: once a block +is committed, it is final, so contracts and integrations do not need to +account for reorg risk. + +## Accounts and addresses + +ZetaChain supports both bech32 Cosmos addresses (prefix `zeta`) and hex EVM +addresses. The two formats are derived from the same public key and represent +the same account. See [Account Addresses](/developers/addresses) for details +and conversion utilities. + +## Fees + +ZetaChain uses the EIP-1559 fee model with a dynamic base fee. From an +application developer's perspective, fees behave identically to Ethereum. The +native gas token is [ZETA](/developers/zeta); the on-chain denom is `azeta` +(1 ZETA = 10¹⁸ azeta). + +## Tooling + +Existing Ethereum tooling works without modification — MetaMask and other EVM +wallets, Hardhat, Foundry, Remix, ethers.js, viem, web3.js, and the standard +ERC-20, ERC-721, and ERC-1155 contracts. Point any EVM client at a ZetaChain +[RPC endpoint](/reference/api) to read state, send transactions, and +interact with deployed contracts. Chain IDs, public RPCs, and block explorers +are documented in [Network Details](/reference/details). + +## Cosmos features through precompiles + +Cosmos SDK functionality such as staking and governance is exposed to the EVM +through precompiled contracts at fixed addresses, so Solidity code can call +into these features directly. EVM wallets can also sign Cosmos SDK +transactions using `eth_signTypedData` (EIP-712), which lets users delegate +stake or vote on proposals without a separate Cosmos wallet. diff --git a/src/pages/developers/evm/_meta.en-US.json b/src/pages/developers/evm/_meta.en-US.json deleted file mode 100644 index 5bc94f7c2..000000000 --- a/src/pages/developers/evm/_meta.en-US.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "evm": { - "title": "Overview", - "description": "Universal EVM is a smart contract platform with built-in interoperability features, enabling the development of universal apps." - }, - "gateway": { - "title": "Gateway", - "description": "A single point of entry for interacting with universal apps" - }, - "gas": { - "title": "Gas Fees", - "description": "Learn about ZRC-20 withdraw fees, message passing fees" - }, - "cctx": { - "title": "Cross-Chain Transactions", - "description": "Cross-Chain Transactions" - }, - "zeta": { - "title": "ZETA", - "description": "ZETA is the native staking, gas and governance token of ZetaChain" - }, - "zrc20": { - "title": "ZRC-20", - "description": "Native gas and supported ERC-20 tokens from connected chains are represented as ZRC-20 on ZetaChain" - }, - "erc20": { - "title": "ERC-20", - "description": "ZetaChain's universal EVM supports standard ERC-20 tokens" - }, - "addresses": { - "title": "Account Addresses", - "description": "Learn about types of account address, how to use and convert between them" - }, - "throughput": { - "title": "Liquidity Throughput", - "description": "Liquidity caps on tokens and rate limiting" - } -} \ No newline at end of file diff --git a/src/pages/developers/evm/_meta.zh-CN.json b/src/pages/developers/evm/_meta.zh-CN.json deleted file mode 100644 index 433201d01..000000000 --- a/src/pages/developers/evm/_meta.zh-CN.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "evm": { - "title": "概览" - }, - "gateway": { - "title": "网关" - }, - "gas": { - "title": "Gas 费用" - }, - "cctx": { - "title": "跨链交易" - }, - "zeta": { - "title": "ZETA" - }, - "zrc20": { - "title": "ZRC-20" - }, - "erc20": { - "title": "ERC-20" - }, - "addresses": { - "title": "账户地址" - }, - "throughput": { - "title": "流动性吞吐" - } -} \ No newline at end of file diff --git a/src/pages/developers/evm/cctx.en-US.mdx b/src/pages/developers/evm/cctx.en-US.mdx deleted file mode 100644 index 6cc3d5c59..000000000 --- a/src/pages/developers/evm/cctx.en-US.mdx +++ /dev/null @@ -1,128 +0,0 @@ -Cross-chain transactions (CCTXs) can be classified into two main types: incoming -and outgoing. - -**Incoming transactions** (connected chain → ZetaChain) are initiated on a -connected chain and result in a transaction on ZetaChain. An incoming -transaction consists of two transactions: - -- Inbound: a transaction is initiated and observed on the connected chain. -- Outbound: the corresponding transaction is broadcasted and executed on - ZetaChain. - -**Outgoing transactions** (ZetaChain → connected chain) are initiated on -ZetaChain and result in a transaction on a connected chain. An outgoing -transaction consists of two transactions: - -- Inbound: A transaction is initiated and observed on ZetaChain. -- Outbound: The corresponding transaction is broadcasted and executed on the - connected chain. - -Tracking a CCTX involves querying ZetaChain's Cosmos SDK HTTP API with an -inbound transaction hash to get a CCTX hash. If a CCTX results in another CCTX -(for example, an incoming results in an outgoing), the first CCTX hash can be -used as a inbound hash to get the second CCTX hash. - -## Incoming & Outgoing - -Consider an example of making a call from Ethereum Sepolia to a universal app -contract on ZetaChain, which triggers an outgoing call from ZetaChain to Polygon -Amoy. - -In this example a user calls EVM Gateway's `depositAndCall` to call [a universal -swap contract on ZetaChain](/developers/tutorials/swap), which swaps incoming -tokens for target ZRC-20 tokens and calls ZetaChain's Gateway `withdraw` -function, which triggers a token transfer on Polygon Amoy. - -This example involves two CCTXs: - -1. Ethereum Sepolia → ZetaChain Testnet -2. ZetaChain Testnet → Polygon Amoy - -An inbound transaction on Ethereum Sepolia: - -https://sepolia.etherscan.io/tx/0x8e925fa63c69bd27a3aa8e30f4c0f1e67e5fd3fedb23339b387b51b1543e55af - -Use the inbound transaction hash to get the CCTX 1 hash: - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x8e925fa63c69bd27a3aa8e30f4c0f1e67e5fd3fedb23339b387b51b1543e55af - -Use the CCTX 1 hash (`0x542b...11da`) as an inbound hash to get CCTX 2 hash: - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x542b6bd80004f4013b725c2170b9ed01731b8af9dc61bfb5c0534dc2f0d511da - -Outbound hash on Polygon Amoy: - -https://amoy.polygonscan.com/tx/0x49f67ece0c0b59d58312df91342d46b14496abf2d8a52a1a5ce9f4c6136e8d75 - -## Incoming - -Consider an example of making call from Ethereum Sepolia to a universal app -contract on ZetaChain. - -In this example a user calls EVM Gateway's `depositAndCall` to call [a universal -swap contract on ZetaChain](/developers/tutorials/swap), which swaps incoming -tokens for target ZRC-20 tokens, which are transferred to the recipient on -ZetaChain. - -This example results in a single CCTX: Ethereum Sepolia → ZetaChain Testnet. - -An inbound transaction on Ethereum Sepolia: - -https://sepolia.etherscan.io/tx/0xfacdad3d12988e1065e32b757d1bbc7e868fb8cbae51c909b3f178027d233f79 - -CCTX: - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0xfacdad3d12988e1065e32b757d1bbc7e868fb8cbae51c909b3f178027d233f79 - -If you try querying the API with the CCTX hash as an inbound hash, the API -responds with HTTP 404 response, because this CCTX does not trigger another -CCTX. - -## Incoming & Abort - -Consider an example of making call from Ethereum Sepolia to a universal app -contract on ZetaChain, which aborts. - -In this example a user calls EVM Gateway's `depositAndCall` to call [a universal -swap contract on ZetaChain](/developers/tutorials/swap), which swaps incoming -tokens for target ZRC-20 tokens, but the amount of supplied tokens is not enough -to cover the withdraw gas fee to Polygon Amoy, so the transaction reverts. The -amount of tokens is also not sufficient to cover a revert transaction to -Ethereum Sepolia, so the transaction aborts. - -An inbound transaction on Ethereum Sepolia: - -https://sepolia.etherscan.io/tx/0x254d687404ff8f1cd481d2b25866e8c0a68c5d7fde08deaa60e61577752e1466 - -CCTX: - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x254d687404ff8f1cd481d2b25866e8c0a68c5d7fde08deaa60e61577752e1466 - -## Incoming & Revert - -An example of making call from Base Sepolia to a universal app contract on -ZetaChain, which reverts. - -In this example a user calls EVM Gateway's `depositAndCall` to call [a universal -swap contract on ZetaChain](/developers/tutorials/swap), which swaps incoming -tokens for target ZRC-20 tokens, but the amount of supplied tokens is not enough -to cover the withdraw gas fee to Polygon Amoy, so the transaction reverts. - -An inbound transaction on Base Sepolia: - -https://sepolia.basescan.org/tx/0x9fcff3ff5ec57b7198543e6a204f08447d6dd8dc54d33100e3e79f6deb8dc407 - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x9fcff3ff5ec57b7198543e6a204f08447d6dd8dc54d33100e3e79f6deb8dc407 - -Revert transaction back on Base Sepolia: - -https://sepolia.basescan.org/tx/0xd86a5babfb7c3297b98d05d145707010aa8f7b690af151729035c3e2d0567eae - -## Multiple Outgoing - -A single transaction can trigger more than one CCTXs. - -In this example a single function call on ZetaChain makes multiple Gateway -`call`s to different chains. - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x3d56898690abb98a514b0b05b799c0d61c0e305a5f962504f3b301adf01b1b34 diff --git a/src/pages/developers/evm/cctx.zh-CN.mdx b/src/pages/developers/evm/cctx.zh-CN.mdx deleted file mode 100644 index 91912bc35..000000000 --- a/src/pages/developers/evm/cctx.zh-CN.mdx +++ /dev/null @@ -1,99 +0,0 @@ -跨链交易(CCTX)可分为两类:入站与出站。 - -**入站交易**(连接链 → ZetaChain)在连接链上发起,并在 ZetaChain 上落地。一次入站交易包含两笔链上交易: - -- 入站:在连接链上发起并被观测到的交易。 -- 出站:对应交易在 ZetaChain 上广播并执行。 - -**出站交易**(ZetaChain → 连接链)在 ZetaChain 上发起,并在连接链上落地。一次出站交易同样包含两笔交易: - -- 入站:在 ZetaChain 上发起并被观测到的交易。 -- 出站:对应交易在连接链上广播并执行。 - -追踪 CCTX 时,可使用入站交易哈希查询 ZetaChain 的 Cosmos SDK HTTP API,以获取 CCTX 哈希。如果某个 CCTX 进一步触发另一笔 CCTX(例如一次入站操作触发出站),则可将第一笔 CCTX 的哈希作为入站哈希继续查询下一笔 CCTX。 - -## 入站与出站联合流程 - -以下示例展示了从 Ethereum Sepolia 向 ZetaChain 上的全链应用发起调用,并进一步触发 ZetaChain 向 Polygon Amoy 的出站调用。 - -用户调用 EVM Gateway 的 `depositAndCall`,目标是 [ZetaChain 上的全链兑换合约](/developers/tutorials/swap)。该合约会将存入资产兑换为目标 ZRC-20 代币,并调用 ZetaChain Gateway 的 `withdraw`,从而在 Polygon Amoy 发起代币转账。 - -该流程涉及两笔 CCTX: - -1. Ethereum Sepolia → ZetaChain 测试网 -2. ZetaChain 测试网 → Polygon Amoy - -Ethereum Sepolia 上的入站交易: - -https://sepolia.etherscan.io/tx/0x8e925fa63c69bd27a3aa8e30f4c0f1e67e5fd3fedb23339b387b51b1543e55af - -使用该入站交易哈希查询 CCTX 1 哈希: - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x8e925fa63c69bd27a3aa8e30f4c0f1e67e5fd3fedb23339b387b51b1543e55af - -再将 CCTX 1 哈希(`0x542b...11da`)作为入站哈希,查询 CCTX 2: - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x542b6bd80004f4013b725c2170b9ed01731b8af9dc61bfb5c0534dc2f0d511da - -Polygon Amoy 上的出站交易: - -https://amoy.polygonscan.com/tx/0x49f67ece0c0b59d58312df91342d46b14496abf2d8a52a1a5ce9f4c6136e8d75 - -## 入站示例 - -以下示例展示了从 Ethereum Sepolia 向 ZetaChain 上的全链应用发起调用。 - -用户调用 EVM Gateway 的 `depositAndCall`,目标为 [全链兑换合约](/developers/tutorials/swap)。合约会将存入资产兑换成目标 ZRC-20,并转给 ZetaChain 上的收款人。 - -该流程仅产生一笔 CCTX:Ethereum Sepolia → ZetaChain 测试网。 - -Ethereum Sepolia 上的入站交易: - -https://sepolia.etherscan.io/tx/0xfacdad3d12988e1065e32b757d1bbc7e868fb8cbae51c909b3f178027d233f79 - -CCTX 详情: - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0xfacdad3d12988e1065e32b757d1bbc7e868fb8cbae51c909b3f178027d233f79 - -若使用该 CCTX 哈希继续查询,API 会返回 HTTP 404,说明此 CCTX 未触发新的跨链交易。 - -## 入站并终止(Abort) - -以下示例展示了从 Ethereum Sepolia 调用 ZetaChain 全链应用但最终被终止的情况。 - -用户调用 EVM Gateway 的 `depositAndCall`,目标为 [全链兑换合约](/developers/tutorials/swap)。合约尝试将存入资产兑换为目标 ZRC-20,并计划向 Polygon Amoy 提现。但提供的代币数量不足以覆盖 Polygon Amoy 的提现 Gas 费用,导致交易回退;同时,剩余代币不足以支付回退至 Ethereum Sepolia 的费用,因此交易最终终止。 - -Ethereum Sepolia 入站交易: - -https://sepolia.etherscan.io/tx/0x254d687404ff8f1cd481d2b25866e8c0a68c5d7fde08deaa60e61577752e1466 - -CCTX 详情: - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x254d687404ff8f1cd481d2b25866e8c0a68c5d7fde08deaa60e61577752e1466 - -## 入站并回退(Revert) - -以下示例展示了从 Base Sepolia 调用 ZetaChain 全链应用并发生回退的情况。 - -用户调用 EVM Gateway 的 `depositAndCall`,目标为 [全链兑换合约](/developers/tutorials/swap)。合约尝试将存入资产兑换为目标 ZRC-20,并计划向 Polygon Amoy 提现,但代币数量不足以支付提现 Gas 费用,导致交易回退。 - -Base Sepolia 入站交易: - -https://sepolia.basescan.org/tx/0x9fcff3ff5ec57b7198543e6a204f08447d6dd8dc54d33100e3e79f6deb8dc407 - -ZetaChain 上的 CCTX 详情: - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x9fcff3ff5ec57b7198543e6a204f08447d6dd8dc54d33100e3e79f6deb8dc407 - -回退后的 Base Sepolia 交易: - -https://sepolia.basescan.org/tx/0xd86a5babfb7c3297b98d05d145707010aa8f7b690af151729035c3e2d0567eae - -## 多个出站交易 - -单笔交易可以触发多个 CCTX。 - -以下示例展示了在 ZetaChain 上一次函数调用对多条链执行多个 Gateway `call`: - -https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/inboundHashToCctxData/0x3d56898690abb98a514b0b05b799c0d61c0e305a5f962504f3b301adf01b1b34 - diff --git a/src/pages/developers/evm/evm.en-US.mdx b/src/pages/developers/evm/evm.en-US.mdx deleted file mode 100644 index ce199cb92..000000000 --- a/src/pages/developers/evm/evm.en-US.mdx +++ /dev/null @@ -1,199 +0,0 @@ ---- -title: "Universal EVM" -description: "ZetaChain's EVM-compatible execution environment built with Cosmos SDK and CometBFT" ---- - -ZetaChain is a Proof of Stake (PoS) blockchain built with the [Cosmos -SDK](https://docs.cosmos.network/), the [CometBFT](https://docs.cometbft.com/) -consensus engine, and [Cosmos EVM](https://evm.cosmos.network/). - -This stack delivers: - -- Modularity: via the Cosmos SDK for flexible, upgradeable architecture. -- Fast finality: through CometBFT’s instant consensus mechanism -- Full EVM compatibility: with Cosmos EVM, enabling Ethereum smart contracts to - run natively on ZetaChain without modification. - -ZetaChain acts as a universal connector between blockchains, offering fast -~4-second blocks, instant finality, and throughput up to hundreds of -transactions per second, all on infrastructure purpose-built for secure, -seamless cross-chain interactions. - -## Architecture Overview - -### Hub-and-Spoke Model - -ZetaChain uses a hub-and-spoke architecture: - -- Hub: ZetaChain, the main coordination layer for all cross-chain activity. -- Spokes: External blockchains (EVM, Solana, Sui, Ton, and Bitcoin) connected - with standardized protocols. - -All cross-chain messages and transactions pass through ZetaChain, ensuring -consistent handling, easier integration of new chains, and a single point for -enforcing security and validation rules. - -### Validators - -ZetaChain’s validator set includes two main roles: - -**Core Validators** - -- Run ZetaChain node. -- Participate in CometBFT consensus to produce blocks and maintain state. -- Open to anyone staking the required ZETA tokens. -- Incentivized via transaction fees and rewards; subject to slashing for - malicious or negligent behavior. - -**Observer-Signer Validators** - -- Run both ZetaChain node and ZetaClient. -- Monitor ZetaChain and connected chains for cross-chain events. -- Vote on event validity; upon majority agreement, coordinate outbound - transactions. -- Sign outbound transactions using a Threshold Signature Scheme (TSS) so no - single validator controls the signing key. - -## Modules and Components - -ZetaChain's functionality is organized into several key modules, each -responsible for specific aspects of cross-chain transaction processing. - -### CrossChain Module - -The CrossChain module manages the state and lifecycle of cross-chain -transactions (CCTX), serving as the central ledger for tracking their progress -and statuses. It handles the creation of new cross-chain transaction records -when inbound events are validated, updates transaction statuses based on events -(such as `PendingInbound`, `PendingOutbound`, `OutboundMined`), and stores -detailed parameters for both inbound and outbound transactions, including sender -and receiver information, asset details, and transaction hashes. - -### Observer Module - -The Observer module handles the operations of the observer set, including -validator management, voting mechanisms, and consensus policies. It maintains a -list of authorized observers eligible to participate in the consensus process, -creates and tracks ballots for each observed event to facilitate the voting -process, and defines core parameters such as ballot thresholds, minimum observer -delegation, and supported chains. - -### Fungible Module - -The Fungible module facilitates the deployment and management of fungible tokens -(ZRC20 tokens) representing assets from connected blockchains on ZetaChain. It -handles the deployment of ZRC20 contracts corresponding to foreign coins from -connected chains, manages pools and liquidity for these tokens, and provides -functions for depositing to and calling omnichain smart contracts on ZetaChain -from connected chains. - -### Emissions Module - -The Emissions module orchestrates the distribution of rewards to network -participants, including observers, validators, and TSS signers. It calculates -rewards based on participation metrics and predefined parameters, distributes -rewards from a pre-funded emissions pool, and allows participants to securely -withdraw their earned rewards. - -### Authority Module - -The Authority module encapsulates logic for administrative functions and -permission checks, ensuring that only authorized entities can perform sensitive -actions. It maintains tables for different admin groups and their permissions, -validates whether a user or entity has the necessary permissions to execute -specific actions, and facilitates changes to admin groups or permissions through -governance proposals, ensuring transparent and decentralized decision-making. - -## Protocol Contracts - -To enable interaction between users, applications, and the ZetaChain network, -protocol contracts are deployed both on ZetaChain and on connected external -chains. These contracts provide standardized entry points for initiating and -managing cross-chain transactions, as well as registry data for discovering -deployed protocol components. - -**On ZetaChain** - -| Contract | Purpose | -| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| GatewayZEVM | Primary entry point for outbound transactions. Handles asset withdrawals, external contract calls, and ZRC-20 mint/burn logic. | -| ZRC-20 | ERC-20–compliant tokens representing assets from connected chains, enabling fungible asset transfers within ZetaChain. | -| ContractRegistry | Stores and provides metadata for deployed protocol contracts (e.g., gateway, ZRC-20s) to ensure consistent references across the network. | - -**On Connected EVM Chains** - -| Contract | Purpose | -| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| GatewayEVM | Entry point for inbound transactions. Handles deposits, contract calls to ZetaChain, and emits events for observers to track. | -| ERC20Custody | Holds ERC-20 assets deposited for cross-chain transfers, ensuring secure custody until transactions are processed. | -| ContractRegistry | Stores and provides metadata for deployed protocol contracts on the connected chain, allowing clients and services to locate the correct contract addresses. | - -**On Other Connected Chains (Solana, Sui, TON, etc.)** - -| Contract | Purpose | -| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Gateway | Entry point for initiating and receiving cross-chain transactions between the connected chain and ZetaChain. Functions are adapted to the chain’s native runtime (e.g., Solana program, Sui Move module, TON smart contract). | - -You can find up-to-date contract addresses for both mainnet and testnet in the -[Contract Addresses Reference](/reference/network/contracts/). - -## Economic Incentives and Bonded Stakes - -ZetaChain employs bonded stakes and positive/negative incentives to ensure -economic safety and encourage validators to act honestly. Validators are -required to stake bonds in the form of ZETA tokens, which are at risk if they -act maliciously or negligently. This staking mechanism aligns the interests of -validators with the network's health and security. - -Validators earn transaction fees and block rewards in return for their services -in processing transactions and maintaining network security. Those who act -dishonestly or fail to fulfill their duties can have a portion of their staked -bonds slashed as a penalty. Positive incentives are provided to encourage -validators to remain online and actively participate in consensus and -observation processes. - -## Cross-Chain Transaction Workflow - -Cross-chain transactions are at the core of ZetaChain’s functionality, enabling -assets and data to move between ZetaChain and connected blockchains. - -The process differs for **incoming** (connected chain → ZetaChain) and -**outgoing** (ZetaChain → connected chain) transactions, but both follow a -secure, validator-driven workflow. - -### Incoming Transactions (Connected Chain → ZetaChain) - -1. Initiation: A user interacts with the gateway contract on a connected chain - (e.g., deposits assets or makes a cross-chain call). -2. Observation: Observer-Signer Validators detect the emitted event and extract - transaction details. -3. Voting: Validators submit and vote on a ballot in ZetaChain; a majority is - required for approval. -4. Execution on ZetaChain: Once approved, ZetaChain updates the CCTX record, - mints assets (if applicable), and/or calls the target universal contract. - -### Outgoing Transactions (ZetaChain → Connected Chain) - -1. Initiation: A user or contract calls the `GatewayZEVM` contract on ZetaChain, - specifying the target chain, recipient, assets, and payload. -2. Preparation: Validators process the request, validate parameters, and - generate the outbound transaction. -3. TSS Signing: A subset of validators collaboratively sign the outbound - transaction using Threshold Signature Scheme (TSS), ensuring no single - validator holds the private key. -4. Submission: The signed transaction is broadcast to the destination chain. -5. Completion or Revert: - - - On success: Assets or data are delivered, and the CCTX is marked complete. - - On failure: ZetaChain executes revert logic per developer-defined options - (e.g., refund assets, trigger fallback contract calls). - -## Conclusion - -For developers, ZetaChain removes much of the friction of building cross-chain -applications. Instead of juggling different SDKs, bridges, and security models, -you get a single platform that handles cross-chain messaging, asset movement, -and contract calls for you. Fast finality and a unified protocol mean you can -focus on application logic, not infrastructure. Whether your app needs to reach -EVM chains, Solana, Sui, or even Bitcoin, ZetaChain gives you one place to build -and deploy, with security and scalability baked in from the start. diff --git a/src/pages/developers/evm/evm.zh-CN.mdx b/src/pages/developers/evm/evm.zh-CN.mdx deleted file mode 100644 index 60b3a3a5b..000000000 --- a/src/pages/developers/evm/evm.zh-CN.mdx +++ /dev/null @@ -1,129 +0,0 @@ ---- -title: "全链 EVM" -description: "基于 Cosmos SDK 和 CometBFT 构建的 ZetaChain EVM 兼容执行环境" ---- - -ZetaChain 是一条使用 [Cosmos SDK](https://docs.cosmos.network/)、[CometBFT](https://docs.cometbft.com/) 共识引擎以及 [Cosmos EVM](https://evm.cosmos.network/) 构建的权益证明(PoS)区块链。 - -该技术栈带来: - -- **模块化**:借助 Cosmos SDK,架构灵活且易于升级。 -- **快速终局性**:CometBFT 的即时共识机制提供即时确认。 -- **完全兼容 EVM**:通过 Cosmos EVM,使以太坊智能合约无需改动即可在 ZetaChain 上原生运行。 - -ZetaChain 作为区块链之间的通用连接器,提供约 4 秒出块、即时终局性与数百 TPS 的吞吐量,并以安全、无缝的跨链交互为目标进行专门构建。 - -## 架构概览 - -### 辐辐结构(Hub-and-Spoke) - -ZetaChain 采用辐辐式架构: - -- **Hub**:ZetaChain,本身作为所有跨链活动的协调层。 -- **Spokes**:与标准化协议相连的外部链(EVM、Solana、Sui、TON、比特币等)。 - -所有跨链消息与交易都会经过 ZetaChain,从而确保处理一致、便于集成新链,并在同一位置实施安全与验证规则。 - -### 验证者 - -ZetaChain 的验证者集合包含两类核心角色: - -**核心验证者** - -- 运行 ZetaChain 节点。 -- 参与 CometBFT 共识,出块并维护状态。 -- 任何质押足够 ZETA 的参与者都可加入。 -- 通过交易费与奖励获得激励;若恶意或失职则可能被削减。 - -**观察者-签名者验证者** - -- 同时运行 ZetaChain 节点与 ZetaClient。 -- 监听 ZetaChain 及连接链的跨链事件。 -- 对事件有效性进行投票;达成多数后协调出站交易。 -- 使用阈值签名(TSS)共同签署出站交易,避免单个验证者拥有签名密钥。 - -## 模块与组件 - -ZetaChain 的功能由多个关键模块构成,每个模块负责跨链交易处理的特定环节。 - -### CrossChain 模块 - -CrossChain 模块管理跨链交易(CCTX)的状态与生命周期,是追踪其进度与状态的核心账本。它在入站事件通过验证后创建新的跨链交易记录,并根据事件(如 `PendingInbound`、`PendingOutbound`、`OutboundMined`)更新状态,同时保存发起方、接收方、资产信息、交易哈希等详细参数。 - -### Observer 模块 - -Observer 模块负责观察者集合的运作,包括验证者管理、投票机制与共识策略。它维护参与共识的授权观察者列表,为每个观察到的事件创建并跟踪投票单(ballot),以支持投票流程,并定义投票阈值、最低观察者委托、支持链等核心参数。 - -### Fungible 模块 - -Fungible 模块用于部署与管理代表连接链资产的同质化代币(ZRC-20)。它负责为连接链上的外部代币部署对应的 ZRC-20 合约、管理相关池子与流动性,并提供从连接链向 ZetaChain 存入资产及调用全链智能合约的能力。 - -### Emissions 模块 - -Emissions 模块协调网络参与者(观察者、验证者、TSS 签名者)的奖励分配。它根据参与度与预设参数计算奖励,从预筹的排放资金池中分发奖励,并提供安全提取收益的接口。 - -### Authority 模块 - -Authority 模块封装管理操作与权限校验逻辑,确保仅授权实体可执行敏感操作。模块维护各类管理员群组及其权限,校验用户或实体是否具备执行特定操作的权限,并通过治理流程支持管理员或权限调整,确保决策透明、去中心化。 - -## 协议合约 - -为便于用户、应用与 ZetaChain 网络交互,协议合约分别部署在 ZetaChain 与连接链上。它们提供标准化入口以发起和管理跨链交易,并维护已部署协议组件的注册信息。 - -**部署在 ZetaChain** - -| 合约 | 作用 | -| ---------------- | ----------------------------------------------------------------------------------------------------------------------- | -| GatewayZEVM | 出站交易的主要入口。负责资产提现、外部合约调用以及 ZRC-20 的铸造/销毁逻辑。 | -| ZRC-20 | 与连接链资产对应的 ERC-20 兼容代币,使同质化资产可在 ZetaChain 内部流转。 | -| ContractRegistry | 存储并提供协议合约(如 Gateway、ZRC-20 等)的元数据,确保网络内引用一致。 | - -**部署在其他 EVM 链** - -| 合约 | 作用 | -| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| GatewayEVM | 入站交易入口。处理存入、向 ZetaChain 的合约调用,并发出事件供观察者跟踪。 | -| ERC20Custody | 托管用于跨链转移的 ERC-20 资产,在交易处理完成前提供安全保管。 | -| ContractRegistry | 存储并提供连接链上协议合约的元数据,方便客户端与服务发现正确的合约地址。 | - -**部署在其他连接链(Solana、Sui、TON 等)** - -| 合约 | 作用 | -| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Gateway | 负责在连接链与 ZetaChain 间发起与接收跨链交易,具体实现会适配各链的原生运行时(如 Solana 程序、Sui Move 模块、TON 智能合约等)。 | - -主网与测试网的最新合约地址可参考 [合约地址参考](/reference/network/contracts/)。 - -## 经济激励与质押保证 - -ZetaChain 通过质押保证与正、负向激励机制保障经济安全,鼓励验证者诚实行事。验证者需质押 ZETA 作为担保,一旦出现恶意或疏忽行为,质押资产可能被削减,从而将验证者利益与网络安全绑定。 - -验证者通过处理交易、维护网络安全获得交易费与出块奖励。若行为不当或未履行职责,将被惩罚性削减质押。与此同时,系统提供正向激励,促使验证者保持在线并积极参与共识与观察流程。 - -## 跨链交易流程 - -跨链交易是 ZetaChain 的核心能力,使资产与数据可在 ZetaChain 与连接链间流动。 - -根据方向不同,流程可分为 **入站**(连接链 → ZetaChain)与 **出站**(ZetaChain → 连接链),但都遵循安全、由验证者驱动的步骤。 - -### 入站交易(连接链 → ZetaChain) - -1. **发起**:用户在连接链的 Gateway 合约上交互(存入资产或发起跨链调用)。 -2. **观察**:观察者-签名者验证者监听事件并提取交易详情。 -3. **投票**:验证者在 ZetaChain 上提交投票,需获得多数票通过。 -4. **执行**:通过后,ZetaChain 更新 CCTX 记录,铸造资产(如适用),并/或调用目标全链合约。 - -### 出站交易(ZetaChain → 连接链) - -1. **发起**:用户或合约调用 ZetaChain 上的 `GatewayZEVM`,指定目标链、接收者、资产与载荷。 -2. **准备**:验证者处理请求,校验参数并生成出站交易。 -3. **TSS 签名**:部分验证者使用阈值签名共同签署出站交易,确保无人单独控制私钥。 -4. **广播**:已签名交易发送至目标链。 -5. **完成或回退**: - - 成功:资产或数据送达,CCTX 标记为完成。 - - 失败:ZetaChain 按开发者定义的回退选项执行(如退款、触发备用合约调用)。 - -## 总结 - -对开发者而言,ZetaChain 大幅降低构建跨链应用的复杂度。无需再处理各类 SDK、跨链桥与安全模型,只需在单一平台上完成跨链消息、资产流转与合约调用。凭借快速终局性与统一协议,你可以专注于业务逻辑,而非基础设施。无论你的应用需要覆盖 EVM、Solana、Sui 还是比特币,ZetaChain 都能提供统一的构建与部署平台,并在设计之初就兼顾安全与可扩展性。 - diff --git a/src/pages/developers/evm/gas.en-US.mdx b/src/pages/developers/evm/gas.en-US.mdx deleted file mode 100644 index d4aaf35b3..000000000 --- a/src/pages/developers/evm/gas.en-US.mdx +++ /dev/null @@ -1,74 +0,0 @@ ---- -title: Gas Fees ---- - -import { Fees } from "~/components/Docs"; - -## Calling Universal Apps - -When interacting with a universal app on ZetaChain from a connected chain -through the Gateway, fees are paid in the native gas token of the source chain, -just like in standard transactions. There are no additional charges or fees, and -execution of universal apps on ZetaChain can be considered gasless when a call -is made from a connected chain. - -For instance, depositing ETH from Ethereum to ZetaChain incurs a fee in ETH, -aligning with Ethereum's usual gas fee structure. For detailed information on -Ethereum gas, refer to the [official -documentation](https://ethereum.org/en/developers/docs/gas/). - -Direct calls to contracts on ZetaChain's EVM (not cross-chain calls) require -users to provide gas fees for each transaction. The ZetaChain EVM employs a gas -market mechanism implemented in [Cosmos -EVM](https://evm.cosmos.network/protocol/concepts/gas-and-fees) and adheres to -Ethereum's EIP 1559 fee model, which helps maintain network security and -prevents spam. - -## Outgoing Calls and Withdrawals - -Universal apps on ZetaChain can initiate calls to contracts on connected chains -or facilitate withdrawals of ZRC-20 tokens back to a connected chain. These -operations require a "withdraw gas fee," which is calculated based on the gas -limit of the target chain. - -Before making a call from a universal app to a contract on a connected chain, -query the withdraw gas fee for the expected gas limit: - -```solidity -(address gasZRC20, uint256 gasFee) = IZRC20(zrc20).withdrawGasFeeWithGasLimit(gasLimit); -``` - -- `gasZRC20` is the address of the gas token for the destination chain of the - call or withdrawal. For example, the gas token for both Ethereum USDC and ETH - is ZRC-20 ETH. -- `gasFee` is the required amount for the specified gas limit. This ensures you - can accurately estimate the necessary fees for successful execution. - -Before withdrawing ZRC-20 tokens to a connected chain, query the withdraw gas -fee: - -```solidity -(address gasZRC20, uint256 gasFee) = IZRC20(zrc20).withdrawGasFee(); -``` - -Withdrawals to connected chains result in token transfers and do not require an -explicit gas limit. - -It’s important to query the current gas fee, approve the Gateway to spend the -necessary amount, and ensure the gas ZRC-20 token balance is sufficient. If the -Gateway cannot transfer the required fee to itself, the operation will fail. - -## Current Fees - -The table below displays the current withdraw gas fees, calculated using a -default gas limit of 500,000. Fees are represented in the native gas token of -the destination chain. - - - -To calculate fees for a different gas limit, please, check out use the `query -fees` command: - -``` -npx zetachain query fees -``` diff --git a/src/pages/developers/evm/gas.zh-CN.mdx b/src/pages/developers/evm/gas.zh-CN.mdx deleted file mode 100644 index 85bcd61fc..000000000 --- a/src/pages/developers/evm/gas.zh-CN.mdx +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Gas 费用 ---- - -import { Fees } from "~/components/Docs"; - -## 调用全链应用 - -通过 Gateway 从连接链在 ZetaChain 上调用全链应用时,费用与普通交易一致,使用源链的原生 Gas 代币支付。不会产生额外费用;当调用来自连接链时,可将 ZetaChain 上执行全链应用视为“免 Gas”。 - -例如,从以太坊向 ZetaChain 存入 ETH 时,所需费用以 ETH 支付,符合以太坊的常规 Gas 计费方式。关于以太坊 Gas 的更多信息,请参阅[官方文档](https://ethereum.org/en/developers/docs/gas/)。 - -直接调用 ZetaChain EVM 上的合约(非跨链调用)时,用户需为每笔交易提供 Gas。ZetaChain EVM 采用 [Cosmos EVM](https://evm.cosmos.network/protocol/concepts/gas-and-fees) 实现的 Gas 市场机制,并遵循以太坊的 EIP-1559 费用模型,以保障网络安全、防止垃圾交易。 - -## 出站调用与提现 - -ZetaChain 上的全链应用可主动向连接链合约发起调用,或将 ZRC-20 代币提现回连接链。这类操作需要支付“提现 Gas 费用(withdraw gas fee)”,该费用基于目标链的 Gas 上限计算。 - -在全链应用向连接链合约发起调用前,应根据预期 Gas 上限查询提现 Gas 费用: - -```solidity -(address gasZRC20, uint256 gasFee) = IZRC20(zrc20).withdrawGasFeeWithGasLimit(gasLimit); -``` - -- `gasZRC20`:目标链的 Gas 代币地址。例如,以太坊的 USDC 与 ETH 都使用 ZRC-20 ETH 作为 Gas 代币。 -- `gasFee`:在指定 Gas 上限下所需的费用,便于准确估算成本。 - -在将 ZRC-20 代币提现至连接链前,可查询提现 Gas 费用: - -```solidity -(address gasZRC20, uint256 gasFee) = IZRC20(zrc20).withdrawGasFee(); -``` - -提现至连接链会触发代币转移,无需显式指定 Gas 上限。 - -务必查询最新费用、授权 Gateway 可支配所需金额,并确保 Gas ZRC-20 余额充足;若 Gateway 无法将费用转移至自身,操作将失败。 - -## 当前费用 - -下表展示了默认 Gas 上限为 500,000 时的提现 Gas 费用,费用以目标链的原生 Gas 代币表示。 - - - -如需计算其他 Gas 上限下的费用,可使用 `query fees` 命令: - -``` -npx zetachain query fees -``` - diff --git a/src/pages/developers/evm/gateway.en-US.mdx b/src/pages/developers/evm/gateway.en-US.mdx deleted file mode 100644 index 73fe50219..000000000 --- a/src/pages/developers/evm/gateway.en-US.mdx +++ /dev/null @@ -1,75 +0,0 @@ -Gateway is an interface that serves as a unified entry point for interactions -between contracts on connected chains and universal apps on ZetaChain. - - - -## Gateway on Connected Chains - -The gateway on connected chains (like Ethereum, Solana and Bitcoin) facilitates -incoming transactions: contract calls and token transfers from connected chains -to universal apps on ZetaChain. - -The implementation of the gateway depends on the connected chain: - -- EVM chains: a gateway smart contract -- Solana: a gateway program -- Bitcoin: a TSS MPC gateway address managed by a network of observer-signer - validators - -Each chain has only one gateway. The same gateway is used to interact with all -universal apps. - -Gateway supports the following features: - -- depositing native gas tokens to a universal app or an account on ZetaChain -- depositing supported ERC-20 tokens (including ZETA tokens) to a universal app - or an account on ZetaChain -- depositing native gas tokens and making a contract call (with arbitrary data - passing) to a universal app -- depositing supported ERC-20 tokens and making a contract call (with arbitrary - data passing) to a universal app -- making a contract call (with arbitrary data passing) to a universal app - -[These features may vary](/developers/chains/functionality) depending on each -specific connected chain. For example, deposits from Bitcoin can only be made in -native gas token (BTC). And deposits from Solana can be made in SOL and (soon) -SPL tokens. - -Currently, only one asset can be deposited at a time to a universal app. Support -for multi-asset deposits will be added in the future updates to the protocol. - -Learn more about Gateway functionality on connected chains: -[EVM](/developers/chains/evm), [Solana](/developers/chains/solana), -[Bitcoin](/developers/chains/bitcoin). - -## Gateway on ZetaChain - -Gateway on ZetaChain facilitates outgoing transactions: calls and token -withdrawals from universal apps to contracts on connected chains. - -Gateway supports the following features: - -- withdrawing ZRC-20 tokens as native gas or ERC-20 tokens to connected chains -- withdrawing ZETA tokens to a connected chain -- withdrawing tokens to and making a contract call on a connected chain -- making a contract call on a connected chain - -Currently, only one asset can be withdrawn at a time from a universal app. -Support for multi-asset withdrawals will be added in the future updates to the -protocol. - -Learn more about [ZetaChain Gateway](/developers/chains/zetachain). - -## Revert Handling - -The Gateway supports handling reverts during cross-chain operations with -flexible refund mechanisms. If a Gateway call fails on the destination chain, -refunds can either be issued by calling a specified contract on the source chain -or sent directly to an externally owned account (EOA) without invoking any -contract. diff --git a/src/pages/developers/evm/gateway.zh-CN.mdx b/src/pages/developers/evm/gateway.zh-CN.mdx deleted file mode 100644 index 17faf8f7c..000000000 --- a/src/pages/developers/evm/gateway.zh-CN.mdx +++ /dev/null @@ -1,56 +0,0 @@ -Gateway 是一个接口,为连接链合约与 ZetaChain 上的全链应用提供统一的交互入口。 - - - -## 连接链上的 Gateway - -连接链(如以太坊、Solana、比特币)上的 Gateway 负责入站交易:将连接链上的合约调用与代币转移路由至 ZetaChain 的全链应用。 - -Gateway 的具体实现取决于连接链: - -- EVM 链:Gateway 智能合约 -- Solana:Gateway 程序 -- 比特币:由观察者-签名者验证者网络管理的 TSS MPC Gateway 地址 - -每条链仅部署一个 Gateway,所有全链应用均通过该 Gateway 交互。 - -Gateway 支持以下功能: - -- 将原生 Gas 代币存入 ZetaChain 的全链应用或账户 -- 将受支持的 ERC-20 代币(包括 ZETA)存入全链应用或账户 -- 存入原生 Gas 代币的同时向全链应用传递任意数据并调用合约 -- 存入受支持的 ERC-20 代币的同时向全链应用传递任意数据并调用合约 -- 在不存入代币的情况下,向全链应用传递任意数据并调用合约 - -[具体支持能力](/developers/chains/functionality) 取决于每条连接链。例如,比特币只能以原生 BTC 形式存入;Solana 可以存入 SOL,随后也会支持 SPL 代币。 - -当前每次仅支持向全链应用存入一种资产,未来协议更新将加入多资产存入。 - -了解更多连接链 Gateway 细节: -[EVM](/developers/chains/evm)、[Solana](/developers/chains/solana)、[Bitcoin](/developers/chains/bitcoin)。 - -## ZetaChain 上的 Gateway - -ZetaChain 上的 Gateway 负责出站交易:从全链应用向连接链合约发起调用并提取代币。 - -Gateway 支持以下功能: - -- 将 ZRC-20 代币提取为连接链上的原生 Gas 代币或 ERC-20 -- 将 ZETA 代币提取到连接链 -- 在提取代币的同时调用连接链合约 -- 在不提取代币的情况下调用连接链合约 - -当前每次仅支持从全链应用提取一种资产,未来协议更新将加入多资产提取。 - -了解更多 [ZetaChain Gateway](/developers/chains/zetachain) 的信息。 - -## 回退处理 - -Gateway 在跨链操作中提供灵活的回退机制。如果目标链上的 Gateway 调用失败,可按配置在源链调用指定合约完成退款,或直接将代币返还给外部账户(EOA)而不触发任何合约调用。 - diff --git a/src/pages/developers/evm/index.zh-CN.mdx b/src/pages/developers/evm/index.zh-CN.mdx deleted file mode 100644 index e47ff4609..000000000 --- a/src/pages/developers/evm/index.zh-CN.mdx +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: 全链 EVM ---- diff --git a/src/pages/developers/evm/throughput.en-US.mdx b/src/pages/developers/evm/throughput.en-US.mdx deleted file mode 100644 index a5dfed1d3..000000000 --- a/src/pages/developers/evm/throughput.en-US.mdx +++ /dev/null @@ -1,40 +0,0 @@ -ZetaChain uses two mechanisms to manage liquidity throughput and ensure secure transactions: - -- Liquidity caps for incoming transactions -- Rate limiting for outgoing transactions - -These mechanisms maintain network stability and reliability, especially during high transaction volumes. By using liquidity caps for incoming transactions and rate limiting for outgoing transactions, ZetaChain controls the flow of tokens into and out of the network. This prevents abuse, safeguards the network from potential liquidity shocks, and ensures the system can handle high transaction loads without compromising performance or security. - -## Incoming Transactions: Liquidity Caps - -For transactions coming into ZetaChain from a connected chain, ZetaChain uses a -mechanism called liquidity caps. Each supported token on ZetaChain has a -predefined maximum amount, or cap, that can be sent to ZetaChain. If the cap is -reached, any further transactions attempting to send more tokens to ZetaChain -will be reverted. Each supported token has its own cap, and transactions -exceeding the cap are reverted. The current liquidity caps for supported tokens -can be accessed through the chain's API: on -[testnet](https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/fungible/foreign_coins) -and [mainnet -beta](https://zetachain.blockpi.network/lcd/v1/public/zeta-chain/fungible/foreign_coins). - -## Outgoing Transactions: Rate Limiter - -For transactions from ZetaChain to a connected chain, ZetaChain employs a rate -limiter mechanism. This mechanism ensures that the total number of tokens -withdrawn within a specified sliding window of ZetaChain blocks does not exceed -a predefined global limit. The rate limiter operates within a sliding window -defined in ZetaChain blocks, and there is a global limit denominated in ZETA -(rate) per block. The total amount of withdrawals for all tokens combined within -a single window cannot exceed the rate multiplied by the number of window -blocks. - -Each ZRC-20 token has a conversion rate to ZETA. For example, if a ZRC-20 token -XYZ has a conversion rate of 2, withdrawing 10 XYZ will be counted as 20 ZETA -towards the limit. The current rate limiter parameters can be accessed through -the rate limiter flags endpoint: on -[testnet](https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/rateLimiterFlags) -and [mainnet -beta](https://zetachain.blockpi.network/lcd/v1/public/zeta-chain/crosschain/rateLimiterFlags). - -These mechanisms ensure ZetaChain efficiently manages liquidity, prevents abuse, and maintains network stability during high transaction volumes. diff --git a/src/pages/developers/evm/throughput.zh-CN.mdx b/src/pages/developers/evm/throughput.zh-CN.mdx deleted file mode 100644 index b9650c176..000000000 --- a/src/pages/developers/evm/throughput.zh-CN.mdx +++ /dev/null @@ -1,21 +0,0 @@ -ZetaChain 通过两套机制管理流动性吞吐并确保交易安全: - -- 入站交易的流动性上限 -- 出站交易的速率限制 - -在交易量高企时,这两套机制可维护网络稳定性与可靠性。通过为入站交易设定流动性上限、为出站交易实施速率限制,ZetaChain 能够控制代币流入与流出的节奏,防止滥用,降低潜在的流动性冲击,并在不牺牲性能或安全性的前提下承载高负载。 - -## 入站交易:流动性上限 - -对于从连接链流入 ZetaChain 的交易,协议使用流动性上限机制。ZetaChain 为每种受支持代币预定义可存入的最大数量(上限)。当达到上限时,后续尝试继续向 ZetaChain 存入该代币的交易将被回退。每个受支持代币拥有独立上限,超出部分均会回退。 - -当前支持代币的流动性上限可通过链上 API 查询:[测试网](https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/fungible/foreign_coins) 与 [主网测试阶段](https://zetachain.blockpi.network/lcd/v1/public/zeta-chain/fungible/foreign_coins) 均提供接口。 - -## 出站交易:速率限制器 - -对于自 ZetaChain 流向连接链的交易,协议启用速率限制器。该机制确保在指定的滑动窗口(以 ZetaChain 区块数计)内提取的代币总量不超过预先设定的全局上限。速率限制器在以区块数定义的滑动窗口内运行,并设置以 ZETA 计价的每区块全局速率。窗口内所有代币的提现总量不得超过“速率 × 窗口区块数”。 - -每个 ZRC-20 代币都定义了向 ZETA 的换算比例。例如,若某 ZRC-20 代币 XYZ 的换算比例为 2,则提取 10 枚 XYZ 会按 20 ZETA 计入限额。当前速率限制器参数可通过速率限制器标志端点查询:[测试网](https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/rateLimiterFlags) 与 [主网测试阶段](https://zetachain.blockpi.network/lcd/v1/public/zeta-chain/crosschain/rateLimiterFlags) 均可获取。 - -通过上述机制,ZetaChain 能够高效管理流动性、防止滥用,并在高交易量场景下保持网络稳定。 - diff --git a/src/pages/developers/evm/zrc20.en-US.mdx b/src/pages/developers/evm/zrc20.en-US.mdx deleted file mode 100644 index 6a94c0db6..000000000 --- a/src/pages/developers/evm/zrc20.en-US.mdx +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: ZRC-20 on ZetaChain ---- - -import { ForeignCoinsTable } from "~/components/Docs"; - -ZRC-20 is a token standard integrated into ZetaChain's omnichain smart contract -platform. With ZRC-20, developers can build dApps that orchestrate native assets -on any connected chain. This makes building Omnichain DeFi protocols and dApps -such as Omnichain DEXs, Omnichain Lending, Omnichain Portfolio Management, and -anything else that involves fungible tokens on multiple chains from a single -place extremely simple — as if they were all on a single chain. - -## Summary - -Native gas tokens of connected blockchains and whitelisted ERC-20 tokens can be -deposited to ZetaChain as ZRC-20 tokens. During the deposit process, the -native/ERC-20 tokens are transferred to and locked in the TSS address/ERC-20 -custody contract and ZRC-20 tokens are minted on ZetaChain and deposited to the -recipient address. - -ZRC-20 tokens can be withdrawn from ZetaChain to connected blockchains. During -the withdrawal process, ZRC-20 tokens are burnt on ZetaChain and native/ERC-20 -tokens are transferred to the recipient address on the connected chain from a -TSS address/ERC-20 custody contract. - -ZRC-20 tokens can only be minted by the ZetaChain protocol. An ERC-20 token -deployed on ZetaChain does not have the properties of ZRC-20 and can't be -withdrawn from ZetaChain to a connected chain. - -The "same" ERC-20 token from two connected blockchains is represented as two -different ZRC-20 tokens on ZetaChain. For example, USDT from Ethereum is -represented as ZRC-20 USDT from Ethereum, and USDT from BSC is represented as -ZRC-20 USDT from BSC. They are not considered the same asset by ZetaChain, but -they can be swapped. That's how the transfer of the "same" ERC-20 asset can be -implemented on ZetaChain: by depositing an ERC-20 (chain A), swapping this -ZRC-20 (chain A) to an ZRC-20 (chain B), and withdrawing the ZRC-20 (chain B) to -chain B as ERC-20. - -## Supported Assets - -A list of currently supported assets: - - - -New assets can be added or removed by broadcasting a transaction with a -corresponding message of the `fungible` module on ZetaChain. - -At a high-level, ZRC-20 tokens are an extension of the standard -[ERC-20](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) -tokens found in the Ethereum ecosystem, ZRC-20 tokens have the added ability to -manage assets on all ZetaChain-connected chains. Any fungible token, including -Bitcoin, ETH, other gas assets and ERC-20-equivalents on other chains, may be -represented on ZetaChain as a ZRC-20 and orchestrated as if it were any other -fungible token (like an ERC-20). - -## Block Confirmations - -When depositing to or withdrawing from ZetaChain, the protocol requires a -certain number of confirmations on the connected chain before the transaction is -considered final. The number of confirmations required is different for each -chain. You can check the number of confirmations in the [connected chains -table](/developers/chains/list). - -## Liquidity Cap - -Each ZRC-20 has a total cap on the number of deposited tokens that the protocol -can accept. Any assets beyond this deposited to ZetaChain from connected chains -will be returned to the sender. diff --git a/src/pages/developers/evm/zrc20.zh-CN.mdx b/src/pages/developers/evm/zrc20.zh-CN.mdx deleted file mode 100644 index 8b59b8916..000000000 --- a/src/pages/developers/evm/zrc20.zh-CN.mdx +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: ZetaChain 上的 ZRC-20 ---- - -import { ForeignCoinsTable } from "~/components/Docs"; - -ZRC-20 是集成于 ZetaChain 全链智能合约平台的代币标准。借助 ZRC-20,开发者可以在任意连接链上调度原生资产,从而轻松构建全链 DeFi 协议与应用,例如全链去中心化交易所、全链借贷、全链资产管理等——就像所有代币都在同一条链上一样。 - -## 总览 - -连接链的原生 Gas 代币及列入白名单的 ERC-20 代币可作为 ZRC-20 存入 ZetaChain。存入时,原生/ ERC-20 代币会被转入并锁定在 TSS 地址或 ERC-20 托管合约中,同时在 ZetaChain 上铸造等量 ZRC-20 并发送至接收地址。 - -ZRC-20 可从 ZetaChain 提现到连接链。提现时,ZRC-20 会在 ZetaChain 上销毁,对应的原生/ ERC-20 代币由 TSS 地址或 ERC-20 托管合约转给连接链上的接收方。 - -ZRC-20 只能由 ZetaChain 协议铸造。直接在 ZetaChain 部署的 ERC-20 不具备 ZRC-20 特性,无法从 ZetaChain 提现回连接链。 - -来自两条连接链的“同一种” ERC-20 会在 ZetaChain 上表现为两个不同的 ZRC-20。例如,以太坊的 USDT 表示为 ZRC-20 USDT(Ethereum),BSC 的 USDT 表示为 ZRC-20 USDT(BSC)。ZetaChain 不将它们视为同一资产,但可以相互兑换。要在 ZetaChain 实现“同一” ERC-20 的跨链转移,可按以下步骤进行:将 ERC-20(链 A)存入换成 ZRC-20(链 A),再兑换成 ZRC-20(链 B),最后提现到链 B 变回 ERC-20。 - -## 支持资产 - -当前支持的资产列表: - - - -可通过向 ZetaChain 的 `fungible` 模块发送相应消息的交易来新增或移除资产。 - -总体而言,ZRC-20 是对以太坊生态中 [ERC-20](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) 标准的扩展,新增了管理所有连接链资产的能力。任何同质化代币(包括比特币、ETH、其他 Gas 资产及各链的 ERC-20 等价物)都可在 ZetaChain 上表示为 ZRC-20,并像 ERC-20 一样被编排调度。 - -## 区块确认 - -在向 ZetaChain 存入或从 ZetaChain 提现时,协议会要求连接链上的交易达到一定数量的确认才视为最终确认。不同链所需确认数不同,可在[连接链列表](/developers/chains/list)查询。 - -## 流动性上限 - -每个 ZRC-20 在协议中设定了可接受的总存入上限。超过上限后,从连接链存入的资产会被退回给发送者。 - diff --git a/src/pages/developers/overview.en-US.mdx b/src/pages/developers/overview.en-US.mdx index 97db6239c..ca76da136 100644 --- a/src/pages/developers/overview.en-US.mdx +++ b/src/pages/developers/overview.en-US.mdx @@ -1,6 +1,6 @@ --- -title: Build -description: ZetaChain is a blockchain for universal omnichain apps that span across any blockchain, from Ethereum and Cosmos to Bitcoin and beyond. +title: Architecture +description: Take an in-depth look into the inner workings and technical architecture of ZetaChain. heroImgUrl: /img/pages/build.svg heroImgWidth: 688 --- diff --git a/src/pages/developers/overview.zh-CN.mdx b/src/pages/developers/overview.zh-CN.mdx index 4b8929337..61ec96edb 100644 --- a/src/pages/developers/overview.zh-CN.mdx +++ b/src/pages/developers/overview.zh-CN.mdx @@ -1,6 +1,6 @@ --- -title: 开发构建 -description: ZetaChain 是一条面向全链应用的区块链,覆盖以太坊、Cosmos、比特币等任意区块链。 +title: 架构 +description: 深入了解 ZetaChain 的内部运作与技术架构。 heroImgUrl: /img/pages/build.svg heroImgWidth: 688 --- diff --git a/src/pages/developers/protocol/_meta.en-US.json b/src/pages/developers/protocol/_meta.en-US.json deleted file mode 100644 index b81940563..000000000 --- a/src/pages/developers/protocol/_meta.en-US.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "evm": { - "title": "ZetaChain and EVM", - "description": "ZetaChain and EVM protocol contracts" - }, - "solana": { - "title": "Solana", - "description": "Solana protocol contracts" - }, - "ton": { - "title": "TON", - "description": "TON protocol contracts" - }, - "sui": { - "title": "Sui", - "description": "Sui protocol contracts" - } -} \ No newline at end of file diff --git a/src/pages/developers/protocol/_meta.zh-CN.json b/src/pages/developers/protocol/_meta.zh-CN.json deleted file mode 100644 index 797fe5521..000000000 --- a/src/pages/developers/protocol/_meta.zh-CN.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "evm": { - "title": "ZetaChain 与 EVM" - }, - "solana": { - "title": "Solana" - }, - "ton": { - "title": "TON" - }, - "sui": { - "title": "Sui" - } -} diff --git a/src/pages/developers/protocol/evm.en-US.md b/src/pages/developers/protocol/evm.en-US.md deleted file mode 100644 index 1b7c318b6..000000000 --- a/src/pages/developers/protocol/evm.en-US.md +++ /dev/null @@ -1,8830 +0,0 @@ - - -## GatewayEVM -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/GatewayEVM.sol) - -The GatewayEVM contract is the endpoint to call smart contracts on external chains. - -The contract doesn't hold any funds and should never have active allowances. - - -### State Variables -#### custody -The address of the custody contract. - - -```solidity -address public custody -``` - - -#### tssAddress -The address of the TSS (Threshold Signature Scheme) contract. - - -```solidity -address public tssAddress -``` - - -#### zetaConnector -The address of the ZetaConnector contract. - - -```solidity -address public zetaConnector -``` - - -#### zetaToken -The address of the Zeta token contract. - - -```solidity -address public zetaToken -``` - - -#### additionalActionFeeWei -Fee charged for additional cross-chain actions within the same transaction. - -The first action in a transaction is free, subsequent actions incur this fee. - -This is configurable by the admin role to allow for fee adjustments. - - -```solidity -uint256 public additionalActionFeeWei -``` - - -#### TSS_ROLE -New role identifier for tss role. - - -```solidity -bytes32 public constant TSS_ROLE = keccak256("TSS_ROLE") -``` - - -#### ASSET_HANDLER_ROLE -New role identifier for asset handler role. - - -```solidity -bytes32 public constant ASSET_HANDLER_ROLE = keccak256("ASSET_HANDLER_ROLE") -``` - - -#### PAUSER_ROLE -New role identifier for pauser role. - - -```solidity -bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE") -``` - - -#### MAX_PAYLOAD_SIZE -Max size of payload + revertOptions revert message. - - -```solidity -uint256 public constant MAX_PAYLOAD_SIZE = 2880 -``` - - -#### _TRANSACTION_ACTION_COUNT_KEY -Storage slot key for tracking transaction action count. - -Uses transient storage (tload/tstore) for gas efficiency. - -Value 0x01 is used as a unique identifier for this storage slot. - - -```solidity -uint256 private constant _TRANSACTION_ACTION_COUNT_KEY = 0x01 -``` - - -### Functions -#### constructor - -**Note:** -oz-upgrades-unsafe-allow: constructor - - -```solidity -constructor() ; -``` - -#### initialize - -Initialize with tss address. address of zeta token and admin account set as DEFAULT_ADMIN_ROLE. - -Using admin to authorize upgrades and pause, and tss for tss role. - - -```solidity -function initialize(address tssAddress_, address zetaToken_, address admin_) public initializer; -``` - -#### _authorizeUpgrade - -Authorizes the upgrade of the contract, sender must be owner. - - -```solidity -function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newImplementation`|`address`|Address of the new implementation.| - - -#### updateTSSAddress - -Update tss address - - -```solidity -function updateTSSAddress(address newTSSAddress) external onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newTSSAddress`|`address`|new tss address| - - -#### pause - -Pause contract. - - -```solidity -function pause() external onlyRole(PAUSER_ROLE); -``` - -#### unpause - -Unpause contract. - - -```solidity -function unpause() external onlyRole(PAUSER_ROLE); -``` - -#### updateAdditionalActionFee - -Update the additional action fee. - -Only callable by admin role. This allows for fee adjustments based on network conditions. - -Setting fee to 0 disables additional action fees entirely. - -Fee should be adjusted based on the chain's native token decimals. - - -```solidity -function updateAdditionalActionFee(uint256 newFeeWei) external onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newFeeWei`|`uint256`|The new fee amount in wei for additional actions in the same transaction.| - - -#### executeRevert - -Transfers msg.value to destination contract and executes it's onRevert function. - -This function can only be called by the TSS address and it is payable. - - -```solidity -function executeRevert( - address destination, - bytes calldata data, - RevertContext calldata revertContext -) - public - payable - nonReentrant - onlyRole(TSS_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`destination`|`address`|Address to call.| -|`data`|`bytes`|Calldata to pass to the call.| -|`revertContext`|`RevertContext`|| - - -#### execute - -Executes a call to a destination address without ERC20 tokens. - -This function can only be called by the TSS address and it is payable. - - -```solidity -function execute( - MessageContext calldata messageContext, - address destination, - bytes calldata data -) - external - payable - nonReentrant - onlyRole(TSS_ROLE) - whenNotPaused - returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageContext`|`MessageContext`|Message context containing sender.| -|`destination`|`address`|Address to call.| -|`data`|`bytes`|Calldata to pass to the call.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|The result of the call.| - - -#### executeWithERC20 - -Executes a call to a destination contract using ERC20 tokens. - -This function can only be called by the custody or connector address. -It uses the ERC20 allowance system, resetting gateway allowance at the end. - - -```solidity -function executeWithERC20( - MessageContext calldata messageContext, - address token, - address to, - uint256 amount, - bytes calldata data -) - public - nonReentrant - onlyRole(ASSET_HANDLER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageContext`|`MessageContext`|Message context containing sender.| -|`token`|`address`|Address of the ERC20 token.| -|`to`|`address`|Address of the contract to call.| -|`amount`|`uint256`|Amount of tokens to transfer.| -|`data`|`bytes`|Calldata to pass to the call.| - - -#### revertWithERC20 - -Directly transfers ERC20 tokens and calls onRevert. - -This function can only be called by the custody or connector address. - - -```solidity -function revertWithERC20( - address token, - address to, - uint256 amount, - bytes calldata data, - RevertContext calldata revertContext -) - external - nonReentrant - onlyRole(ASSET_HANDLER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|Address of the ERC20 token.| -|`to`|`address`|Address of the contract to call.| -|`amount`|`uint256`|Amount of tokens to transfer.| -|`data`|`bytes`|Calldata to pass to the call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - -#### deposit - -Deposits ETH to the TSS address. - -This function only works for the first action in a transaction (backward compatibility). - -For subsequent actions, use the overloaded version with amount parameter. - - -```solidity -function deposit(address receiver, RevertOptions calldata revertOptions) external payable whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### deposit - -Deposits ETH to the TSS address with specified amount. - -msg.value must equal amount + required fee for the action. - - -```solidity -function deposit( - address receiver, - uint256 amount, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`amount`|`uint256`|Amount of ETH to deposit (excluding fees).| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### deposit - -Deposits ERC20 tokens to the custody or connector contract. - - -```solidity -function deposit( - address receiver, - uint256 amount, - address asset, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`amount`|`uint256`|Amount of tokens to deposit.| -|`asset`|`address`|Address of the ERC20 token.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### depositAndCall - -Deposits ETH to the TSS address and calls an omnichain smart contract. - -This function only works for the first action in a transaction (backward compatibility). - -For subsequent actions, use the overloaded version with amount parameter. - - -```solidity -function depositAndCall( - address receiver, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`payload`|`bytes`|Calldata to pass to the call.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### depositAndCall - -Deposits ETH to the TSS address and calls an omnichain smart contract with specified amount. - -msg.value must equal amount + required fee for the action. - - -```solidity -function depositAndCall( - address receiver, - uint256 amount, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`amount`|`uint256`|Amount of ETH to deposit (excluding fees).| -|`payload`|`bytes`|Calldata to pass to the call.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### depositAndCall - -Deposits ERC20 tokens to the custody or connector contract and calls an omnichain smart contract. - - -```solidity -function depositAndCall( - address receiver, - uint256 amount, - address asset, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`amount`|`uint256`|Amount of tokens to deposit.| -|`asset`|`address`|Address of the ERC20 token.| -|`payload`|`bytes`|Calldata to pass to the call.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### call - -Calls an omnichain smart contract without asset transfer. - - -```solidity -function call( - address receiver, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`payload`|`bytes`|Calldata to pass to the call.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### setCustody - -Sets the custody contract address. - - -```solidity -function setCustody(address custody_) external onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`custody_`|`address`|Address of the custody contract.| - - -#### setConnector - -Sets the connector contract address. - - -```solidity -function setConnector(address zetaConnector_) external onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`zetaConnector_`|`address`|Address of the connector contract.| - - -#### _resetApproval - -Resets the approval of a token for a specified address. -This is used to ensure that the approval is set to zero before setting it to a new value. - - -```solidity -function _resetApproval(address token, address to) private returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|Address of the ERC20 token.| -|`to`|`address`|Address to reset the approval for.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|True if the approval reset was successful or if the token reverts on zero approval.| - - -#### _transferFromToAssetHandler - -Transfers tokens from the sender to the asset handler. -This function handles the transfer of tokens to either the connector or custody contract based on the asset -type. - - -```solidity -function _transferFromToAssetHandler(address from, address token, uint256 amount) private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`from`|`address`|Address of the sender.| -|`token`|`address`|Address of the ERC20 token.| -|`amount`|`uint256`|Amount of tokens to transfer.| - - -#### _transferToAssetHandler - -Transfers tokens to the asset handler. -This function handles the transfer of tokens to either the connector or custody contract based on the asset -type. - - -```solidity -function _transferToAssetHandler(address token, uint256 amount) private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|Address of the ERC20 token.| -|`amount`|`uint256`|Amount of tokens to transfer.| - - -#### _executeArbitraryCall - -Private function to execute an arbitrary call to a destination address. - - -```solidity -function _executeArbitraryCall(address destination, bytes calldata data) private returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`destination`|`address`|Address to call.| -|`data`|`bytes`|Calldata to pass to the call.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|The result of the call.| - - -#### _executeAuthenticatedCall - -Private function to execute an authenticated call to a destination address. - - -```solidity -function _executeAuthenticatedCall( - MessageContext calldata messageContext, - address destination, - bytes calldata data -) - private - returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageContext`|`MessageContext`|Message context containing sender and arbitrary call flag.| -|`destination`|`address`|Address to call.| -|`data`|`bytes`|Calldata to pass to the call.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|The result of the call.| - - -#### _revertIfOnCallOrOnRevert - - -```solidity -function _revertIfOnCallOrOnRevert(bytes calldata data) private pure; -``` - -#### _processFee - -Processes fee collection for cross-chain actions within a transaction. - -The first action in a transaction is free, subsequent actions incur ADDITIONAL_ACTION_FEE_WEI. - -If fee is 0, the entire functionality is disabled and will revert. - - -```solidity -function _processFee() internal returns (uint256); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|The fee amount actually charged (0 for first action, ADDITIONAL_ACTION_FEE_WEI for subsequent actions).| - - -#### _validateChargedFeeForERC20 - -Validates fee payment for ERC20 operations (deposit, depositAndCall, call). - -Validates that msg.value equals the required fee (no excess ETH allowed). - - -```solidity -function _validateChargedFeeForERC20(uint256 feeCharged) internal view; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`feeCharged`|`uint256`|The fee amount that was charged.| - - -#### _validateChargedFeeForETHWithAmount - -Validates fee payment for ETH operations with specified amount. - -Validates that msg.value equals amount + feeCharged. - - -```solidity -function _validateChargedFeeForETHWithAmount(uint256 amount, uint256 feeCharged) internal view; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|The amount to deposit (excluding fees).| -|`feeCharged`|`uint256`|The fee amount that was charged.| - - -#### _getNextActionIndex - -Gets and increments the transaction action counter using transient storage. - -Uses assembly for gas efficiency with tload/tstore operations. - -Transient storage is transaction-scoped and automatically cleared after each transaction. - - -```solidity -function _getNextActionIndex() internal returns (uint256 currentIndex); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`currentIndex`|`uint256`|The current action index within the transaction (0-based).| - - - - -## GatewayZEVM -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/GatewayZEVM.sol) - -The GatewayZEVM contract is the endpoint to call smart contracts on omnichain. - -The contract doesn't hold any funds and should never have active allowances. - - -### State Variables -#### PROTOCOL_ADDRESS -The constant address of the protocol - - -```solidity -address public constant PROTOCOL_ADDRESS = 0x735b14BB79463307AAcBED86DAf3322B1e6226aB -``` - - -#### zetaToken -The address of the Zeta token. - - -```solidity -address public zetaToken -``` - - -#### PAUSER_ROLE -New role identifier for pauser role. - - -```solidity -bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE") -``` - - -#### MAX_MESSAGE_SIZE -Max size of message + revertOptions revert message. - - -```solidity -uint256 public constant MAX_MESSAGE_SIZE = 2880 -``` - - -#### MIN_GAS_LIMIT -Minimum gas limit for a call. - - -```solidity -uint256 public constant MIN_GAS_LIMIT = 100_000 -``` - - -### Functions -#### onlyProtocol - -Only protocol address allowed modifier. - - -```solidity -modifier onlyProtocol() ; -``` - -#### constructor - -**Note:** -oz-upgrades-unsafe-allow: constructor - - -```solidity -constructor() ; -``` - -#### initialize - -Initialize with address of zeta token and admin account set as DEFAULT_ADMIN_ROLE. - -Using admin to authorize upgrades and pause. - - -```solidity -function initialize(address zetaToken_, address admin_) public initializer; -``` - -#### _authorizeUpgrade - -Authorizes the upgrade of the contract. - - -```solidity -function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newImplementation`|`address`|The address of the new implementation.| - - -#### receive - -Receive function to receive ZETA from WETH9.withdraw(). - - -```solidity -receive() external payable whenNotPaused; -``` - -#### pause - -Pause contract. - - -```solidity -function pause() external onlyRole(PAUSER_ROLE); -``` - -#### unpause - -Unpause contract. - - -```solidity -function unpause() external onlyRole(PAUSER_ROLE); -``` - -#### _withdrawZRC20 - -Private function to withdraw ZRC20 tokens. - - -```solidity -function _withdrawZRC20(uint256 amount, address zrc20) private returns (uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`zrc20`|`address`|The address of the ZRC20 token.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|The gas fee for the withdrawal.| - - -#### _burnProtocolFees - -Helper function to burn gas fees. - - -```solidity -function _burnProtocolFees(address zrc20, uint256 gasLimit) private returns (uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`gasLimit`|`uint256`|Gas limit.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|gasFee Gas fee amount.| - - -#### _withdrawZRC20WithGasLimit - -Private function to withdraw ZRC20 tokens with gas limit. - - -```solidity -function _withdrawZRC20WithGasLimit( - uint256 amount, - address zrc20, - uint256 gasLimit -) - private - returns (uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`gasLimit`|`uint256`|Gas limit.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|The gas fee for the withdrawal.| - - -#### _transferZETA - -Private function to transfer ZETA tokens. - - -```solidity -function _transferZETA(uint256 amount, address to) private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|The amount of tokens to transfer.| -|`to`|`address`|The address to transfer the tokens to.| - - -#### withdraw - -Withdraw ZRC20 tokens to an external chain. - - -```solidity -function withdraw( - bytes memory receiver, - uint256 amount, - address zrc20, - RevertOptions calldata revertOptions -) - external - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### withdraw - -Withdraw ZRC20 tokens to an external chain with custom gas limit. - -Use this function for simple gas ZRC20 withdrawals to the receivers that are -either smart contract accounts or smart contracts with custom receive/fallback implementations. - - -```solidity -function withdraw( - bytes memory receiver, - uint256 amount, - address zrc20, - uint256 gasLimit, - RevertOptions calldata revertOptions -) - external - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`gasLimit`|`uint256`|The custom gas limit for the withdrawal (must be >= MIN_GAS_LIMIT).| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### withdrawAndCall - -Withdraw ZRC20 tokens and call a smart contract on an external chain. - - -```solidity -function withdrawAndCall( - bytes memory receiver, - uint256 amount, - address zrc20, - bytes calldata message, - CallOptions calldata callOptions, - RevertOptions calldata revertOptions -) - external - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`message`|`bytes`|The calldata to pass to the contract call.| -|`callOptions`|`CallOptions`|Call options including gas limit and arbirtrary call flag.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### withdrawAndCall - -Withdraw ZRC20 tokens and call a smart contract on an external chain. - - -```solidity -function withdrawAndCall( - bytes memory receiver, - uint256 amount, - address zrc20, - bytes calldata message, - uint256 version, - CallOptions calldata callOptions, - RevertOptions calldata revertOptions -) - external - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`message`|`bytes`|The calldata to pass to the contract call.| -|`version`|`uint256`|The number representing message context version.| -|`callOptions`|`CallOptions`|Call options including gas limit, arbirtrary call flag and message context version.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### withdraw - -Withdraw ZETA tokens to an external chain. - - -```solidity -function withdraw( - bytes memory, /*receiver*/ - uint256, /*amount*/ - uint256, /*chainId*/ - RevertOptions calldata /*revertOptions*/ -) - external - view - whenNotPaused; -``` - -#### withdrawAndCall - -Withdraw ZETA tokens and call a smart contract on an external chain. - - -```solidity -function withdrawAndCall( - bytes memory, /*receiver*/ - uint256, /*amount*/ - uint256, /*chainId*/ - bytes calldata, /*message*/ - CallOptions calldata, /*callOptions*/ - RevertOptions calldata /*revertOptions*/ -) - external - view - whenNotPaused; -``` - -#### call - -Call a smart contract on an external chain without asset transfer. - - -```solidity -function call( - bytes memory receiver, - address zrc20, - bytes calldata message, - CallOptions calldata callOptions, - RevertOptions calldata revertOptions -) - external - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`zrc20`|`address`|Address of zrc20 to pay fees.| -|`message`|`bytes`|The calldata to pass to the contract call.| -|`callOptions`|`CallOptions`|Call options including gas limit and arbirtrary call flag.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### _call - - -```solidity -function _call( - bytes memory receiver, - address zrc20, - bytes calldata message, - CallOptions memory callOptions, - RevertOptions memory revertOptions -) - private; -``` - -#### deposit - -Deposit foreign coins into ZRC20. - - -```solidity -function deposit(address zrc20, uint256 amount, address target) external onlyProtocol whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`amount`|`uint256`|The amount of tokens to deposit.| -|`target`|`address`|The target address to receive the deposited tokens.| - - -#### execute - -Execute a user-specified contract on ZEVM. - - -```solidity -function execute( - MessageContext calldata context, - address zrc20, - uint256 amount, - address target, - bytes calldata message -) - external - nonReentrant - onlyProtocol - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`context`|`MessageContext`|The context of the cross-chain call.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`amount`|`uint256`|The amount of tokens to transfer.| -|`target`|`address`|The target contract to call.| -|`message`|`bytes`|The calldata to pass to the contract call.| - - -#### depositAndCall - -Deposit foreign coins into ZRC20 and call a user-specified contract on ZEVM. - - -```solidity -function depositAndCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - address target, - bytes calldata message -) - external - nonReentrant - onlyProtocol - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`context`|`MessageContext`|The context of the cross-chain call.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`amount`|`uint256`|The amount of tokens to transfer.| -|`target`|`address`|The target contract to call.| -|`message`|`bytes`|The calldata to pass to the contract call.| - - -#### depositAndCall - -Deposit ZETA and call a user-specified contract on ZEVM. - - -```solidity -function depositAndCall( - MessageContext calldata context, - uint256 amount, - address target, - bytes calldata message -) - external - nonReentrant - onlyProtocol - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`context`|`MessageContext`|The context of the cross-chain call.| -|`amount`|`uint256`|The amount of tokens to transfer.| -|`target`|`address`|The target contract to call.| -|`message`|`bytes`|The calldata to pass to the contract call.| - - -#### executeRevert - -Revert a user-specified contract on ZEVM. - - -```solidity -function executeRevert( - address target, - RevertContext calldata revertContext -) - external - nonReentrant - onlyProtocol - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`target`|`address`|The target contract to call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - -#### depositAndRevert - -Deposit foreign coins into ZRC20 and revert a user-specified contract on ZEVM. - - -```solidity -function depositAndRevert( - address zrc20, - uint256 amount, - address target, - RevertContext calldata revertContext -) - external - nonReentrant - onlyProtocol - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`amount`|`uint256`|The amount of tokens to revert.| -|`target`|`address`|The target contract to call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - -#### executeAbort - -Call onAbort on a user-specified contract on ZEVM. -this function doesn't deposit the asset to the target contract. This operation is done directly by the protocol. -the assets are deposited to the target contract even if onAbort reverts. - - -```solidity -function executeAbort( - address target, - AbortContext calldata abortContext -) - external - nonReentrant - onlyProtocol - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`target`|`address`|The target contract to call.| -|`abortContext`|`AbortContext`|Abort context to pass to onAbort.| - - -### Errors -#### ZeroAddress -Error indicating a zero address was provided. - - -```solidity -error ZeroAddress(); -``` - - - -## INotSupportedMethods -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/Errors.sol) - -Interface for contracts that with non supported methods. - - -### Errors -#### ZETANotSupported - -```solidity -error ZETANotSupported(); -``` - -#### CallOnRevertNotSupported - -```solidity -error CallOnRevertNotSupported(); -``` - - - -## ERC20Custody -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/ERC20Custody.sol) - -Holds the ERC20 tokens deposited on ZetaChain and includes functionality to call a contract. - -This contract does not call smart contracts directly, it passes through the Gateway contract. - - -### State Variables -#### gateway -Gateway contract. - - -```solidity -IGatewayEVM public gateway -``` - - -#### whitelisted -Mapping of whitelisted tokens => true/false. - - -```solidity -mapping(address => bool) public whitelisted -``` - - -#### tssAddress -The address of the TSS (Threshold Signature Scheme) contract. - - -```solidity -address public tssAddress -``` - - -#### supportsLegacy -Used to flag if contract supports legacy methods (eg. deposit). - - -```solidity -bool public supportsLegacy -``` - - -#### PAUSER_ROLE -New role identifier for pauser role. - - -```solidity -bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE") -``` - - -#### WITHDRAWER_ROLE -New role identifier for withdrawer role. - - -```solidity -bytes32 public constant WITHDRAWER_ROLE = keccak256("WITHDRAWER_ROLE") -``` - - -#### WHITELISTER_ROLE -New role identifier for whitelister role. - - -```solidity -bytes32 public constant WHITELISTER_ROLE = keccak256("WHITELISTER_ROLE") -``` - - -### Functions -#### initialize - -Initializer for ERC20Custody. - -Set admin as default admin and pauser, and tssAddress as tss role. - - -```solidity -function initialize(address gateway_, address tssAddress_, address admin_) public initializer; -``` - -#### _authorizeUpgrade - -Authorizes the upgrade of the contract, sender must be owner. - - -```solidity -function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newImplementation`|`address`|Address of the new implementation.| - - -#### pause - -Pause contract. - - -```solidity -function pause() external onlyRole(PAUSER_ROLE); -``` - -#### unpause - -Unpause contract. - - -```solidity -function unpause() external onlyRole(PAUSER_ROLE); -``` - -#### updateTSSAddress - -Update tss address - - -```solidity -function updateTSSAddress(address newTSSAddress) external onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newTSSAddress`|`address`|new tss address| - - -#### setSupportsLegacy - -Unpause contract. - - -```solidity -function setSupportsLegacy(bool _supportsLegacy) external onlyRole(DEFAULT_ADMIN_ROLE); -``` - -#### whitelist - -Whitelist ERC20 token. - - -```solidity -function whitelist(address token) external onlyRole(WHITELISTER_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|address of ERC20 token| - - -#### unwhitelist - -Unwhitelist ERC20 token. - - -```solidity -function unwhitelist(address token) external onlyRole(WHITELISTER_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|address of ERC20 token| - - -#### withdraw - -Withdraw directly transfers the tokens to the destination address without contract call. - -This function can only be called by the TSS address. - - -```solidity -function withdraw( - address to, - address token, - uint256 amount -) - external - nonReentrant - onlyRole(WITHDRAWER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|Destination address for the tokens.| -|`token`|`address`|Address of the ERC20 token.| -|`amount`|`uint256`|Amount of tokens to withdraw.| - - -#### withdrawAndCall - -WithdrawAndCall transfers tokens to Gateway and call a contract through the Gateway. - -This function can only be called by the TSS address. - - -```solidity -function withdrawAndCall( - MessageContext calldata messageContext, - address to, - address token, - uint256 amount, - bytes calldata data -) - public - nonReentrant - onlyRole(WITHDRAWER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageContext`|`MessageContext`|Message context containing sender.| -|`to`|`address`|Address of the contract to call.| -|`token`|`address`|Address of the ERC20 token.| -|`amount`|`uint256`|Amount of tokens to withdraw.| -|`data`|`bytes`|Calldata to pass to the contract call.| - - -#### withdrawAndRevert - -WithdrawAndRevert transfers tokens to Gateway and call a contract with a revert functionality through -the Gateway. - -This function can only be called by the TSS address. - - -```solidity -function withdrawAndRevert( - address to, - address token, - uint256 amount, - bytes calldata data, - RevertContext calldata revertContext -) - public - nonReentrant - onlyRole(WITHDRAWER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|Address of the contract to call.| -|`token`|`address`|Address of the ERC20 token.| -|`amount`|`uint256`|Amount of tokens to withdraw.| -|`data`|`bytes`|Calldata to pass to the contract call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - -#### deposit - -Deposits asset to custody and pay fee in zeta erc20. - -**Note:** -deprecated: This method is deprecated. - - -```solidity -function deposit( - bytes calldata recipient, - IERC20 asset, - uint256 amount, - bytes calldata message -) - external - nonReentrant - whenNotPaused; -``` - - - -## IERC20Custody -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IERC20Custody.sol) - - -### Functions -#### whitelisted - -Mapping of whitelisted tokens => true/false. - - -```solidity -function whitelisted(address token) external view returns (bool); -``` - -#### withdraw - -Withdraw directly transfers the tokens to the destination address without contract call. - -This function can only be called by the TSS address. - - -```solidity -function withdraw(address token, address to, uint256 amount) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|Address of the ERC20 token.| -|`to`|`address`|Destination address for the tokens.| -|`amount`|`uint256`|Amount of tokens to withdraw.| - - -#### withdrawAndCall - -WithdrawAndCall transfers tokens to Gateway and call a contract through the Gateway. - -This function can only be called by the TSS address. - - -```solidity -function withdrawAndCall( - MessageContext calldata messageContext, - address token, - address to, - uint256 amount, - bytes calldata data -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageContext`|`MessageContext`|Message context containing sender.| -|`token`|`address`|Address of the ERC20 token.| -|`to`|`address`|Address of the contract to call.| -|`amount`|`uint256`|Amount of tokens to withdraw.| -|`data`|`bytes`|Calldata to pass to the contract call.| - - -#### withdrawAndRevert - -WithdrawAndRevert transfers tokens to Gateway and call a contract with a revert functionality through -the Gateway. - -This function can only be called by the TSS address. - - -```solidity -function withdrawAndRevert( - address token, - address to, - uint256 amount, - bytes calldata data, - RevertContext calldata revertContext -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|Address of the ERC20 token.| -|`to`|`address`|Address of the contract to call.| -|`amount`|`uint256`|Amount of tokens to withdraw.| -|`data`|`bytes`|Calldata to pass to the contract call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - - - -## IERC20CustodyErrors -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IERC20Custody.sol) - -Interface for the errors used in the ERC20 custody contract. - - -### Errors -#### ZeroAddress -Error for zero address input. - - -```solidity -error ZeroAddress(); -``` - -#### NotWhitelisted -Error for not whitelisted ERC20 token - - -```solidity -error NotWhitelisted(); -``` - -#### LegacyMethodsNotSupported -Error for calling not supported legacy methods. - - -```solidity -error LegacyMethodsNotSupported(); -``` - - - -## IERC20CustodyEvents -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IERC20Custody.sol) - -Interface for the events emitted by the ERC20 custody contract. - - -### Events -#### Withdrawn -Emitted when tokens are withdrawn. - - -```solidity -event Withdrawn(address indexed to, address indexed token, uint256 amount); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address receiving the tokens.| -|`token`|`address`|The address of the ERC20 token.| -|`amount`|`uint256`|The amount of tokens withdrawn.| - -#### WithdrawnAndCalled -Emitted when tokens are withdrawn and a contract call is made. - - -```solidity -event WithdrawnAndCalled(address indexed to, address indexed token, uint256 amount, bytes data); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address receiving the tokens.| -|`token`|`address`|The address of the ERC20 token.| -|`amount`|`uint256`|The amount of tokens withdrawn.| -|`data`|`bytes`|The calldata passed to the contract call.| - -#### WithdrawnAndReverted -Emitted when tokens are withdrawn and a revertable contract call is made. - - -```solidity -event WithdrawnAndReverted( - address indexed to, address indexed token, uint256 amount, bytes data, RevertContext revertContext -); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address receiving the tokens.| -|`token`|`address`|The address of the ERC20 token.| -|`amount`|`uint256`|The amount of tokens withdrawn.| -|`data`|`bytes`|The calldata passed to the contract call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - -#### Whitelisted -Emitted when ERC20 token is whitelisted - - -```solidity -event Whitelisted(address indexed token); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|address of ERC20 token.| - -#### Unwhitelisted -Emitted when ERC20 token is unwhitelisted - - -```solidity -event Unwhitelisted(address indexed token); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|address of ERC20 token.| - -#### Deposited -Emitted in legacy deposit method. - - -```solidity -event Deposited(bytes recipient, IERC20 indexed asset, uint256 amount, bytes message); -``` - -#### UpdatedCustodyTSSAddress -Emitted when tss address is updated - - -```solidity -event UpdatedCustodyTSSAddress(address oldTSSAddress, address newTSSAddress); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`oldTSSAddress`|`address`|old tss address| -|`newTSSAddress`|`address`|new tss address| - - - -## Callable -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IGatewayEVM.sol) - -Interface implemented by contracts receiving authenticated calls. - - -### Functions -#### onCall - - -```solidity -function onCall( - LegacyMessageContext calldata context, - bytes calldata message -) - external - payable - returns (bytes memory); -``` - - - -## CallableV2 -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IGatewayEVM.sol) - -Interface implemented by contracts receiving authenticated calls with new MessageContext. - - -### Functions -#### onCall - - -```solidity -function onCall( - MessageContext calldata context, - bytes calldata message -) - external - payable - returns (bytes memory); -``` - - - -## IGatewayEVM -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IGatewayEVM.sol) - -Interface for the GatewayEVM contract. - - -### Functions -#### executeWithERC20 - -Executes a call to a contract using ERC20 tokens. - - -```solidity -function executeWithERC20( - MessageContext calldata messageContext, - address token, - address to, - uint256 amount, - bytes calldata data -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageContext`|`MessageContext`|Message context containing sender and arbitrary call flag.| -|`token`|`address`|The address of the ERC20 token.| -|`to`|`address`|The address of the contract to call.| -|`amount`|`uint256`|The amount of tokens to transfer.| -|`data`|`bytes`|The calldata to pass to the contract call.| - - -#### executeRevert - -Transfers msg.value to destination contract and executes it's onRevert function. - -This function can only be called by the TSS address and it is payable. - - -```solidity -function executeRevert( - address destination, - bytes calldata data, - RevertContext calldata revertContext -) - external - payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`destination`|`address`|Address to call.| -|`data`|`bytes`|Calldata to pass to the call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - -#### execute - -Executes a call to a destination address without ERC20 tokens. - -This function can only be called by the TSS address and it is payable. - - -```solidity -function execute( - MessageContext calldata messageContext, - address destination, - bytes calldata data -) - external - payable - returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageContext`|`MessageContext`|Message context containing sender and arbitrary call flag.| -|`destination`|`address`|Address to call.| -|`data`|`bytes`|Calldata to pass to the call.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|The result of the call.| - - -#### revertWithERC20 - -Executes a revertable call to a contract using ERC20 tokens. - - -```solidity -function revertWithERC20( - address token, - address to, - uint256 amount, - bytes calldata data, - RevertContext calldata revertContext -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|The address of the ERC20 token.| -|`to`|`address`|The address of the contract to call.| -|`amount`|`uint256`|The amount of tokens to transfer.| -|`data`|`bytes`|The calldata to pass to the contract call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - -#### deposit - -Deposits ETH to the TSS address. - - -```solidity -function deposit(address receiver, RevertOptions calldata revertOptions) external payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### deposit - -Deposits ETH to the TSS address with specified amount. - - -```solidity -function deposit(address receiver, uint256 amount, RevertOptions calldata revertOptions) external payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`amount`|`uint256`|Amount of ETH to deposit.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### deposit - -Deposits ERC20 tokens to the custody or connector contract. - - -```solidity -function deposit( - address receiver, - uint256 amount, - address asset, - RevertOptions calldata revertOptions -) - external - payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`amount`|`uint256`|Amount of tokens to deposit.| -|`asset`|`address`|Address of the ERC20 token.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### depositAndCall - -Deposits ETH to the TSS address and calls an omnichain smart contract. - - -```solidity -function depositAndCall( - address receiver, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`payload`|`bytes`|Calldata to pass to the call.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### depositAndCall - -Deposits ETH to the TSS address and calls an omnichain smart contract with specified amount. - - -```solidity -function depositAndCall( - address receiver, - uint256 amount, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`amount`|`uint256`|Amount of ETH to deposit.| -|`payload`|`bytes`|Calldata to pass to the call.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### depositAndCall - -Deposits ERC20 tokens to the custody or connector contract and calls an omnichain smart contract. - - -```solidity -function depositAndCall( - address receiver, - uint256 amount, - address asset, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`amount`|`uint256`|Amount of tokens to deposit.| -|`asset`|`address`|Address of the ERC20 token.| -|`payload`|`bytes`|Calldata to pass to the call.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### call - -Calls an omnichain smart contract without asset transfer. - - -```solidity -function call( - address receiver, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`address`|Address of the receiver.| -|`payload`|`bytes`|Calldata to pass to the call.| -|`revertOptions`|`RevertOptions`|Revert options.| - - - - -## IGatewayEVMErrors -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IGatewayEVM.sol) - -Interface for the errors used in the GatewayEVM contract. - - -### Errors -#### ExecutionFailed -Error for failed execution. - - -```solidity -error ExecutionFailed(); -``` - -#### DepositFailed -Error for failed deposit. - - -```solidity -error DepositFailed(); -``` - -#### InsufficientETHAmount -Error for insufficient ETH amount. - - -```solidity -error InsufficientETHAmount(); -``` - -#### InsufficientERC20Amount -Error for insufficient ERC20 token amount. - - -```solidity -error InsufficientERC20Amount(); -``` - -#### ZeroAddress -Error for zero address input. - - -```solidity -error ZeroAddress(); -``` - -#### ApprovalFailed -Error for failed token approval. - - -```solidity -error ApprovalFailed(); -``` - -#### CustodyInitialized -Error for already initialized custody. - - -```solidity -error CustodyInitialized(); -``` - -#### ConnectorInitialized -Error for already initialized connector. - - -```solidity -error ConnectorInitialized(); -``` - -#### NotWhitelistedInCustody -Error when trying to transfer not whitelisted token to custody. - - -```solidity -error NotWhitelistedInCustody(); -``` - -#### NotAllowedToCallOnCall -Error when trying to call onCall method using arbitrary call. - - -```solidity -error NotAllowedToCallOnCall(); -``` - -#### NotAllowedToCallOnRevert -Error when trying to call onRevert method using arbitrary call. - - -```solidity -error NotAllowedToCallOnRevert(); -``` - -#### PayloadSizeExceeded -Error indicating payload size exceeded in external functions. - - -```solidity -error PayloadSizeExceeded(); -``` - -#### FeeTransferFailed -Error thrown when fee transfer to TSS address fails. - -This error occurs when the low-level call to transfer fees fails. - - -```solidity -error FeeTransferFailed(); -``` - -#### InsufficientFee -Error thrown when insufficient fee is provided for additional actions. - - -```solidity -error InsufficientFee(uint256 required, uint256 provided); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`required`|`uint256`|The fee amount required for the action.| -|`provided`|`uint256`|The fee amount actually provided by the caller.| - -#### ExcessETHProvided -Error thrown when excess ETH is sent for non-ETH operations. - - -```solidity -error ExcessETHProvided(uint256 required, uint256 provided); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`required`|`uint256`|The fee amount required for the action.| -|`provided`|`uint256`|The ETH amount actually provided by the caller.| - -#### AdditionalActionDisabled -Error thrown when additional action functionality is disabled (fee set to 0). - - -```solidity -error AdditionalActionDisabled(); -``` - -#### IncorrectValueProvided -Error thrown when msg.value doesn't match expected amount + fee. - - -```solidity -error IncorrectValueProvided(uint256 expected, uint256 provided); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`expected`|`uint256`|The expected value (amount + fee).| -|`provided`|`uint256`|The actual msg.value provided.| - - - -## IGatewayEVMEvents -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IGatewayEVM.sol) - -Interface for the events emitted by the GatewayEVM contract. - - -### Events -#### Executed -Emitted when a contract call is executed. - - -```solidity -event Executed(address indexed destination, uint256 value, bytes data); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`destination`|`address`|The address of the contract called.| -|`value`|`uint256`|The amount of ETH sent with the call.| -|`data`|`bytes`|The calldata passed to the contract call.| - -#### Reverted -Emitted when a contract call is reverted. - - -```solidity -event Reverted(address indexed to, address indexed token, uint256 amount, bytes data, RevertContext revertContext); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address of the contract called.| -|`token`|`address`|The address of the ERC20 token, empty if gas token| -|`amount`|`uint256`|The amount of ETH sent with the call.| -|`data`|`bytes`|The calldata passed to the contract call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - -#### ExecutedWithERC20 -Emitted when a contract call with ERC20 tokens is executed. - - -```solidity -event ExecutedWithERC20(address indexed token, address indexed to, uint256 amount, bytes data); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`token`|`address`|The address of the ERC20 token.| -|`to`|`address`|The address of the contract called.| -|`amount`|`uint256`|The amount of tokens transferred.| -|`data`|`bytes`|The calldata passed to the contract call.| - -#### Deposited -Emitted when a deposit is made. - - -```solidity -event Deposited( - address indexed sender, - address indexed receiver, - uint256 amount, - address asset, - bytes payload, - RevertOptions revertOptions -); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|The address of the sender.| -|`receiver`|`address`|The address of the receiver.| -|`amount`|`uint256`|The amount of ETH or tokens deposited.| -|`asset`|`address`|The address of the ERC20 token (zero address if ETH).| -|`payload`|`bytes`|The calldata passed with the deposit. No longer used. Kept to maintain compatibility.| -|`revertOptions`|`RevertOptions`|Revert options.| - -#### DepositedAndCalled -Emitted when a deposit and call is made. - - -```solidity -event DepositedAndCalled( - address indexed sender, - address indexed receiver, - uint256 amount, - address asset, - bytes payload, - RevertOptions revertOptions -); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|The address of the sender.| -|`receiver`|`address`|The address of the receiver.| -|`amount`|`uint256`|The amount of ETH or tokens deposited.| -|`asset`|`address`|The address of the ERC20 token (zero address if ETH).| -|`payload`|`bytes`|The calldata passed with the deposit.| -|`revertOptions`|`RevertOptions`|Revert options.| - -#### Called -Emitted when an omnichain smart contract call is made without asset transfer. - - -```solidity -event Called(address indexed sender, address indexed receiver, bytes payload, RevertOptions revertOptions); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|The address of the sender.| -|`receiver`|`address`|The address of the receiver.| -|`payload`|`bytes`|The calldata passed to the call.| -|`revertOptions`|`RevertOptions`|Revert options.| - -#### UpdatedGatewayTSSAddress -Emitted when tss address is updated. - - -```solidity -event UpdatedGatewayTSSAddress(address oldTSSAddress, address newTSSAddress); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`oldTSSAddress`|`address`|old tss address.| -|`newTSSAddress`|`address`|new tss address.| - -#### UpdatedAdditionalActionFee -Emitted when additional action fee is updated. - - -```solidity -event UpdatedAdditionalActionFee(uint256 oldFeeWei, uint256 newFeeWei); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`oldFeeWei`|`uint256`|old fee value.| -|`newFeeWei`|`uint256`|new fee value.| - - - -## LegacyMessageContext -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IGatewayEVM.sol) - -Message context passed to execute function. - - -```solidity -struct LegacyMessageContext { -address sender; -} -``` - -**Properties** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|Sender from omnichain contract.| - - - -## MessageContext -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IGatewayEVM.sol) - -Message context passed to execute function. - - -```solidity -struct MessageContext { -address sender; -address asset; -uint256 amount; -} -``` - -**Properties** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|Sender from omnichain contract.| -|`asset`|`address`|The address of the asset.| -|`amount`|`uint256`|The amount of the asset.| - - - -## IRegistry -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IRegistry.sol) - - -### Structs -#### ChainMetadataEntry -Structure for metadata entries used during bootstrapping - - -```solidity -struct ChainMetadataEntry { - /// @notice The unique identifier of the chain. - uint256 chainId; - /// @param key The metadata key to update. - string key; - /// @param value The new value for the metadata. - bytes value; -} -``` - -#### ContractConfigEntry -Structure for contract configuration entries used during bootstrapping - - -```solidity -struct ContractConfigEntry { - /// @notice Represents id of the chain where contract is deployed. - uint256 chainId; - /// @notice The type of the contract (e.g. "connector", "gateway", "tss"). - string contractType; - /// @param key The configuration key to update. - string key; - /// @param value The new value for the configuration. - bytes value; -} -``` - - - -## IZetaConnectorEvents -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IZetaConnector.sol) - -Interface for the events emitted by the ZetaConnector contracts. - - -### Events -#### Withdrawn -Emitted when tokens are withdrawn. - - -```solidity -event Withdrawn(address indexed to, uint256 amount); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address to which the tokens are withdrawn.| -|`amount`|`uint256`|The amount of tokens withdrawn.| - -#### WithdrawnAndCalled -Emitted when tokens are withdrawn and a contract is called. - - -```solidity -event WithdrawnAndCalled(address indexed to, uint256 amount, bytes data); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address to which the tokens are withdrawn.| -|`amount`|`uint256`|The amount of tokens withdrawn.| -|`data`|`bytes`|The calldata passed to the contract call.| - -#### WithdrawnAndReverted -Emitted when tokens are withdrawn and a contract is called with a revert callback. - - -```solidity -event WithdrawnAndReverted(address indexed to, uint256 amount, bytes data, RevertContext revertContext); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address to which the tokens are withdrawn.| -|`amount`|`uint256`|The amount of tokens withdrawn.| -|`data`|`bytes`|The calldata passed to the contract call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - -#### UpdatedZetaConnectorTSSAddress -Emitted when tss address is updated - - -```solidity -event UpdatedZetaConnectorTSSAddress(address oldTSSAddress, address newTSSAddress); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`oldTSSAddress`|`address`|old tss address| -|`newTSSAddress`|`address`|new tss address| - - - -## IZetaNonEthNew -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/interfaces/IZetaNonEthNew.sol) - -IZetaNonEthNew is a mintable / burnable version of IERC20. - - -### Functions -#### burnFrom - -Burns the specified amount of tokens from the specified account. - -Emits a {Transfer} event with `to` set to the zero address. - - -```solidity -function burnFrom(address account, uint256 amount) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`account`|`address`|The address of the account from which tokens will be burned.| -|`amount`|`uint256`|The amount of tokens to burn.| - - -#### mint - -Mints the specified amount of tokens to the specified account. - -Emits a {Transfer} event with `from` set to the zero address. - - -```solidity -function mint(address mintee, uint256 value, bytes32 internalSendHash) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`mintee`|`address`|The address of the account to which tokens will be minted.| -|`value`|`uint256`|The amount of tokens to mint.| -|`internalSendHash`|`bytes32`|A hash used for internal tracking of the minting transaction.| - - - - -## ConnectorErrors -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ConnectorErrors.sol) - -Interface with connector custom errors - - -### Errors -#### CallerIsNotPauser - -```solidity -error CallerIsNotPauser(address caller); -``` - -#### CallerIsNotTss - -```solidity -error CallerIsNotTss(address caller); -``` - -#### CallerIsNotTssUpdater - -```solidity -error CallerIsNotTssUpdater(address caller); -``` - -#### CallerIsNotTssOrUpdater - -```solidity -error CallerIsNotTssOrUpdater(address caller); -``` - -#### ZetaTransferError - -```solidity -error ZetaTransferError(); -``` - -#### ExceedsMaxSupply - -```solidity -error ExceedsMaxSupply(uint256 maxSupply); -``` - - - -## IZetaNonEthInterface -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/IZetaNonEthInterface.sol) - -IZetaNonEthInterface.sol is a mintable / burnable version of IERC20 - - -### Functions -#### burnFrom - - -```solidity -function burnFrom(address account, uint256 amount) external; -``` - -#### mint - - -```solidity -function mint(address mintee, uint256 value, bytes32 internalSendHash) external; -``` - - - -## ZetaConnectorBase -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaConnector.base.sol) - -Main abstraction of ZetaConnector. -This contract manages interactions between TSS and different chains. -There's an instance of this contract on each chain supported by ZetaChain. - - -### State Variables -#### zetaToken - -```solidity -address public immutable zetaToken -``` - - -#### pauserAddress -Multisig contract to pause incoming transactions. -The responsibility of pausing outgoing transactions is left to the protocol for more flexibility. - - -```solidity -address public pauserAddress -``` - - -#### tssAddress -Collectively held by ZetaChain validators. - - -```solidity -address public tssAddress -``` - - -#### tssAddressUpdater -This address will start pointing to a multisig contract, then it will become the TSS address itself. - - -```solidity -address public tssAddressUpdater -``` - - -### Functions -#### constructor - -Constructor requires initial addresses. -zetaToken address is the only immutable one, while others can be updated. - - -```solidity -constructor(address zetaToken_, address tssAddress_, address tssAddressUpdater_, address pauserAddress_) ; -``` - -#### onlyPauser - -Modifier to restrict actions to pauser address. - - -```solidity -modifier onlyPauser() ; -``` - -#### onlyTssAddress - -Modifier to restrict actions to TSS address. - - -```solidity -modifier onlyTssAddress() ; -``` - -#### onlyTssUpdater - -Modifier to restrict actions to TSS updater address. - - -```solidity -modifier onlyTssUpdater() ; -``` - -#### updatePauserAddress - -Update the pauser address. The only address allowed to do that is the current pauser. - - -```solidity -function updatePauserAddress(address pauserAddress_) external onlyPauser; -``` - -#### updateTssAddress - -Update the TSS address. The address can be updated by the TSS updater or the TSS address itself. - - -```solidity -function updateTssAddress(address tssAddress_) external; -``` - -#### renounceTssAddressUpdater - -Changes the ownership of tssAddressUpdater to be the one held by the ZetaChain TSS Signer nodes. - - -```solidity -function renounceTssAddressUpdater() external onlyTssUpdater; -``` - -#### pause - -Pause the input (send) transactions. - - -```solidity -function pause() external onlyPauser; -``` - -#### unpause - -Unpause the contract to allow transactions again. - - -```solidity -function unpause() external onlyPauser; -``` - -#### send - -Entrypoint to send data and value through ZetaChain. - - -```solidity -function send(ZetaInterfaces.SendInput calldata input) external virtual; -``` - -#### onReceive - -Handler to receive data from other chain. -This method can be called only by TSS. Access validation is in implementation. - - -```solidity -function onReceive( - bytes calldata zetaTxSenderAddress, - uint256 sourceChainId, - address destinationAddress, - uint256 zetaValue, - bytes calldata message, - bytes32 internalSendHash -) - external - virtual; -``` - -#### onRevert - -Handler to receive errors from other chain. -This method can be called only by TSS. Access validation is in implementation. - - -```solidity -function onRevert( - address zetaTxSenderAddress, - uint256 sourceChainId, - bytes calldata destinationAddress, - uint256 destinationChainId, - uint256 remainingZetaValue, - bytes calldata message, - bytes32 internalSendHash -) - external - virtual; -``` - -### Events -#### ZetaSent - -```solidity -event ZetaSent( - address sourceTxOriginAddress, - address indexed zetaTxSenderAddress, - uint256 indexed destinationChainId, - bytes destinationAddress, - uint256 zetaValueAndGas, - uint256 destinationGasLimit, - bytes message, - bytes zetaParams -); -``` - -#### ZetaReceived - -```solidity -event ZetaReceived( - bytes zetaTxSenderAddress, - uint256 indexed sourceChainId, - address indexed destinationAddress, - uint256 zetaValue, - bytes message, - bytes32 indexed internalSendHash -); -``` - -#### ZetaReverted - -```solidity -event ZetaReverted( - address zetaTxSenderAddress, - uint256 sourceChainId, - uint256 indexed destinationChainId, - bytes destinationAddress, - uint256 remainingZetaValue, - bytes message, - bytes32 indexed internalSendHash -); -``` - -#### TSSAddressUpdated - -```solidity -event TSSAddressUpdated(address callerAddress, address newTssAddress); -``` - -#### TSSAddressUpdaterUpdated - -```solidity -event TSSAddressUpdaterUpdated(address callerAddress, address newTssUpdaterAddress); -``` - -#### PauserAddressUpdated - -```solidity -event PauserAddressUpdated(address callerAddress, address newTssAddress); -``` - - - -## ZetaConnectorEth -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaConnector.eth.sol) - -ETH implementation of ZetaConnector. -This contract manages interactions between TSS and different chains. -This version is only for Ethereum network because in the other chains we mint and burn and in this one we lock and -unlock. - - -### Functions -#### constructor - - -```solidity -constructor( - address zetaToken_, - address tssAddress_, - address tssAddressUpdater_, - address pauserAddress_ -) - ZetaConnectorBase(zetaToken_, tssAddress_, tssAddressUpdater_, pauserAddress_); -``` - -#### getLockedAmount - - -```solidity -function getLockedAmount() external view returns (uint256); -``` - -#### send - -Entrypoint to send data through ZetaChain -This call locks the token on the contract and emits an event with all the data needed by the protocol. - - -```solidity -function send(ZetaInterfaces.SendInput calldata input) external override whenNotPaused; -``` - -#### onReceive - -Handler to receive data from other chain. -This method can be called only by TSS. -Transfers the Zeta tokens to destination and calls onZetaMessage if it's needed. - - -```solidity -function onReceive( - bytes calldata zetaTxSenderAddress, - uint256 sourceChainId, - address destinationAddress, - uint256 zetaValue, - bytes calldata message, - bytes32 internalSendHash -) - external - override - onlyTssAddress; -``` - -#### onRevert - -Handler to receive errors from other chain. -This method can be called only by TSS. -Transfers the Zeta tokens to destination and calls onZetaRevert if it's needed. - - -```solidity -function onRevert( - address zetaTxSenderAddress, - uint256 sourceChainId, - bytes calldata destinationAddress, - uint256 destinationChainId, - uint256 remainingZetaValue, - bytes calldata message, - bytes32 internalSendHash -) - external - override - whenNotPaused - onlyTssAddress; -``` - - - -## ZetaConnectorNonEth -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaConnector.non-eth.sol) - -Non ETH implementation of ZetaConnector. -This contract manages interactions between TSS and different chains. -This version is for every chain but Etherum network because in the other chains we mint and burn and in Etherum we -lock and unlock - - -### State Variables -#### maxSupply - -```solidity -uint256 public maxSupply = 2 ** 256 - 1 -``` - - -### Functions -#### constructor - - -```solidity -constructor( - address zetaTokenAddress_, - address tssAddress_, - address tssAddressUpdater_, - address pauserAddress_ -) - ZetaConnectorBase(zetaTokenAddress_, tssAddress_, tssAddressUpdater_, pauserAddress_); -``` - -#### getLockedAmount - - -```solidity -function getLockedAmount() external view returns (uint256); -``` - -#### setMaxSupply - - -```solidity -function setMaxSupply(uint256 maxSupply_) external onlyTssAddress; -``` - -#### send - -Entry point to send data to protocol -This call burn the token and emit an event with all the data needed by the protocol - - -```solidity -function send(ZetaInterfaces.SendInput calldata input) external override whenNotPaused; -``` - -#### onReceive - -Handler to receive data from other chain. -This method can be called only by TSS. -Transfer the Zeta tokens to destination and calls onZetaMessage if it's needed. -To perform the transfer mint new tokens, validating first the maxSupply allowed in the current chain. - - -```solidity -function onReceive( - bytes calldata zetaTxSenderAddress, - uint256 sourceChainId, - address destinationAddress, - uint256 zetaValue, - bytes calldata message, - bytes32 internalSendHash -) - external - override - onlyTssAddress; -``` - -#### onRevert - -Handler to receive errors from other chain. -This method can be called only by TSS. -Transfer the Zeta tokens to destination and calls onZetaRevert if it's needed. -To perform the transfer mint new tokens, validating first the maxSupply allowed in the current chain. - - -```solidity -function onRevert( - address zetaTxSenderAddress, - uint256 sourceChainId, - bytes calldata destinationAddress, - uint256 destinationChainId, - uint256 remainingZetaValue, - bytes calldata message, - bytes32 internalSendHash -) - external - override - whenNotPaused - onlyTssAddress; -``` - -### Events -#### MaxSupplyUpdated - -```solidity -event MaxSupplyUpdated(address callerAddress, uint256 newMaxSupply); -``` - - - -## ZetaErrors -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaErrors.sol) - -Common custom errors - - -### Errors -#### CallerIsNotTss - -```solidity -error CallerIsNotTss(address caller); -``` - -#### CallerIsNotConnector - -```solidity -error CallerIsNotConnector(address caller); -``` - -#### CallerIsNotTssUpdater - -```solidity -error CallerIsNotTssUpdater(address caller); -``` - -#### CallerIsNotTssOrUpdater - -```solidity -error CallerIsNotTssOrUpdater(address caller); -``` - -#### InvalidAddress - -```solidity -error InvalidAddress(); -``` - -#### ZetaTransferError - -```solidity -error ZetaTransferError(); -``` - - - -## ZetaEth -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaEth.sol) - -Ethereum is the origin and native chain of the ZETA token deployment (native) - -ZetaEth.sol is an implementation of OpenZeppelin's ERC20 - - -### Functions -#### constructor - - -```solidity -constructor(address creator, uint256 initialSupply) ; -``` - - - -## ZetaCommonErrors -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaInterfaces.sol) - - -### Errors -#### InvalidAddress - -```solidity -error InvalidAddress(); -``` - - - -## ZetaConnector -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaInterfaces.sol) - - -### Functions -#### send - -Sending value and data cross-chain is as easy as calling connector.send(SendInput) - - -```solidity -function send(ZetaInterfaces.SendInput calldata input) external; -``` - - - -## ZetaInterfaces -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaInterfaces.sol) - - -### Structs -#### SendInput -Use SendInput to interact with the Connector: connector.send(SendInput) - - -```solidity -struct SendInput { - /// @dev Chain id of the destination chain. More about chain ids - /// https://docs.zetachain.com/learn/glossary#chain-id - uint256 destinationChainId; - /// @dev Address receiving the message on the destination chain (expressed in bytes since it can be non-EVM) - bytes destinationAddress; - /// @dev Gas limit for the destination chain's transaction - uint256 destinationGasLimit; - /// @dev An encoded, arbitrary message to be parsed by the destination contract - bytes message; - /// @dev ZETA to be sent cross-chain + ZetaChain gas fees + destination chain gas fees (expressed in ZETA) - uint256 zetaValueAndGas; - /// @dev Optional parameters for the ZetaChain protocol - bytes zetaParams; -} -``` - -#### ZetaMessage -Our Connector calls onZetaMessage with this struct as argument - - -```solidity -struct ZetaMessage { - bytes zetaTxSenderAddress; - uint256 sourceChainId; - address destinationAddress; - /// @dev Remaining ZETA from zetaValueAndGas after subtracting ZetaChain gas fees and destination gas fees - uint256 zetaValue; - bytes message; -} -``` - -#### ZetaRevert -Our Connector calls onZetaRevert with this struct as argument - - -```solidity -struct ZetaRevert { - address zetaTxSenderAddress; - uint256 sourceChainId; - bytes destinationAddress; - uint256 destinationChainId; - /// @dev Equals to: zetaValueAndGas - ZetaChain gas fees - destination chain gas fees - source chain revert tx - /// gas fees - uint256 remainingZetaValue; - bytes message; -} -``` - - - -## ZetaReceiver -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaInterfaces.sol) - - -### Functions -#### onZetaMessage - -onZetaMessage is called when a cross-chain message reaches a contract - - -```solidity -function onZetaMessage(ZetaInterfaces.ZetaMessage calldata zetaMessage) external; -``` - -#### onZetaRevert - -onZetaRevert is called when a cross-chain message reverts. -It's useful to rollback to the original state - - -```solidity -function onZetaRevert(ZetaInterfaces.ZetaRevert calldata zetaRevert) external; -``` - - - -## ZetaTokenConsumer -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaInterfaces.sol) - -ZetaTokenConsumer makes it easier to handle the following situations: -- Getting Zeta using native coin (to pay for destination gas while using `connector.send`) -- Getting Zeta using a token (to pay for destination gas while using `connector.send`) -- Getting native coin using Zeta (to return unused destination gas when `onZetaRevert` is executed) -- Getting a token using Zeta (to return unused destination gas when `onZetaRevert` is executed) - -The interface can be implemented using different strategies, like UniswapV2, UniswapV3, etc - - -### Functions -#### getZetaFromEth - - -```solidity -function getZetaFromEth(address destinationAddress, uint256 minAmountOut) external payable returns (uint256); -``` - -#### getZetaFromToken - - -```solidity -function getZetaFromToken( - address destinationAddress, - uint256 minAmountOut, - address inputToken, - uint256 inputTokenAmount -) - external - returns (uint256); -``` - -#### getEthFromZeta - - -```solidity -function getEthFromZeta( - address destinationAddress, - uint256 minAmountOut, - uint256 zetaTokenAmount -) - external - returns (uint256); -``` - -#### getTokenFromZeta - - -```solidity -function getTokenFromZeta( - address destinationAddress, - uint256 minAmountOut, - address outputToken, - uint256 zetaTokenAmount -) - external - returns (uint256); -``` - -#### hasZetaLiquidity - - -```solidity -function hasZetaLiquidity() external view returns (bool); -``` - -### Events -#### EthExchangedForZeta - -```solidity -event EthExchangedForZeta(uint256 amountIn, uint256 amountOut); -``` - -#### TokenExchangedForZeta - -```solidity -event TokenExchangedForZeta(address token, uint256 amountIn, uint256 amountOut); -``` - -#### ZetaExchangedForEth - -```solidity -event ZetaExchangedForEth(uint256 amountIn, uint256 amountOut); -``` - -#### ZetaExchangedForToken - -```solidity -event ZetaExchangedForToken(address token, uint256 amountIn, uint256 amountOut); -``` - - - -## ZetaNonEth -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/legacy/ZetaNonEth.sol) - -On non-native (non-Ethereum) chains, ZETA tokens are minted and burned after the initial deployment on -Ethereum. - - -### State Variables -#### connectorAddress - -```solidity -address public connectorAddress -``` - - -#### tssAddress -Collectively held by Zeta blockchain validators - - -```solidity -address public tssAddress -``` - - -#### tssAddressUpdater -Initially a multi-sig, eventually held by Zeta blockchain validators (via renounceTssAddressUpdater) - - -```solidity -address public tssAddressUpdater -``` - - -### Functions -#### constructor - - -```solidity -constructor(address tssAddress_, address tssAddressUpdater_) ERC20("Zeta", "ZETA"); -``` - -#### updateTssAndConnectorAddresses - - -```solidity -function updateTssAndConnectorAddresses(address tssAddress_, address connectorAddress_) external; -``` - -#### renounceTssAddressUpdater - -Sets tssAddressUpdater to be tssAddress - - -```solidity -function renounceTssAddressUpdater() external; -``` - -#### mint - - -```solidity -function mint(address mintee, uint256 value, bytes32 internalSendHash) external override; -``` - -#### burnFrom - - -```solidity -function burnFrom(address account, uint256 amount) public override(IZetaNonEthInterface, ERC20Burnable); -``` - -### Events -#### Minted - -```solidity -event Minted(address indexed mintee, uint256 amount, bytes32 indexed internalSendHash); -``` - -#### Burnt - -```solidity -event Burnt(address indexed burnee, uint256 amount); -``` - -#### TSSAddressUpdated - -```solidity -event TSSAddressUpdated(address callerAddress, address newTssAddress); -``` - -#### TSSAddressUpdaterUpdated - -```solidity -event TSSAddressUpdaterUpdated(address callerAddress, address newTssUpdaterAddress); -``` - -#### ConnectorAddressUpdated - -```solidity -event ConnectorAddressUpdated(address callerAddress, address newConnectorAddress); -``` - - - -## Registry -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/Registry.sol) - -Satellite registry contract for connected chains, receiving updates from CoreRegistry. - -This contract is deployed on every connected chain and maintains a synchronized view of the registry. - - -### State Variables -#### GATEWAY_ROLE -Identifier for the gateway role - - -```solidity -bytes32 public constant GATEWAY_ROLE = keccak256("GATEWAY_ROLE") -``` - - -#### gatewayEVM -GatewayEVM contract that will call this contract with messages from CoreRegistry - - -```solidity -IGatewayEVM public gatewayEVM -``` - - -#### coreRegistry -Represents the address of the CoreRegistry contract on the ZetaChain - - -```solidity -address public coreRegistry -``` - - -### Functions -#### onlyRegistry - -Restricts function calls to only be made by this contract itself - -Only registry address allowed modifier. - -This is used to ensure functions receiving cross-chain messages can only be called through -the onCall function using a self-call pattern, preventing direct external calls to these functions - - -```solidity -modifier onlyRegistry() ; -``` - -#### initialize - -Initialize the Registry contract - - -```solidity -function initialize( - address admin_, - address registryManager_, - address gatewayEVM_, - address coreRegistry_ -) - public - initializer; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`admin_`|`address`|Address with DEFAULT_ADMIN_ROLE, authorized for upgrades and pausing actions| -|`registryManager_`|`address`|Address with REGISTRY_MANAGER_ROLE, authorized for all registry write actions.| -|`gatewayEVM_`|`address`|Address of the GatewayEVM contract for cross-chain messaging| -|`coreRegistry_`|`address`|Address of the CoreRegistry contract deployed on ZetaChain| - - -#### onCall - -onCall is called by the GatewayEVM when a cross-chain message is received - - -```solidity -function onCall( - LegacyMessageContext calldata context, - bytes calldata data -) - external - onlyRole(GATEWAY_ROLE) - whenNotPaused - returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`context`|`LegacyMessageContext`|Information about the cross-chain message| -|`data`|`bytes`|The encoded function call to execute| - - -#### changeChainStatus - -Changes status of the chain to activated/deactivated - -Only callable through onCall from CoreRegistry - - -```solidity -function changeChainStatus( - uint256 chainId, - address gasZRC20, - bytes calldata registry, - bool activation -) - external - onlyRegistry - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain being activated/deactivated.| -|`gasZRC20`|`address`|The address of the ZRC20 token that represents gas token for the chain.| -|`registry`|`bytes`|Address of the Registry contract on the connected chain.| -|`activation`|`bool`|Whether activate or deactivate the chain| - - -#### updateChainMetadata - -Updates chain metadata, only for the active chains - -Only callable through onCall from CoreRegistry - - -```solidity -function updateChainMetadata( - uint256 chainId, - string calldata key, - bytes calldata value -) - external - onlyRegistry - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain| -|`key`|`string`|The metadata key to update| -|`value`|`bytes`|The new value for the metadata| - - -#### registerContract - -Registers a new contract address for a specific chain - -Only callable through onCall from CoreRegistry - - -```solidity -function registerContract( - uint256 chainId, - string calldata contractType, - bytes calldata addressBytes -) - external - onlyRegistry - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed| -|`contractType`|`string`|The type of the contract (e.g., "connector", "gateway")| -|`addressBytes`|`bytes`|The address of the contract| - - -#### updateContractConfiguration - -Updates contract configuration - -Only callable through onCall from CoreRegistry - - -```solidity -function updateContractConfiguration( - uint256 chainId, - string calldata contractType, - string calldata key, - bytes calldata value -) - external - onlyRegistry - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed| -|`contractType`|`string`|The type of the contract| -|`key`|`string`|The configuration key to update| -|`value`|`bytes`|The new value for the configuration| - - -#### setContractActive - -Sets a contract's active status - -Only callable through onCall from CoreRegistry - - -```solidity -function setContractActive( - uint256 chainId, - string calldata contractType, - bool active -) - external - onlyRegistry; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed| -|`contractType`|`string`|The type of the contract| -|`active`|`bool`|Whether the contract should be active| - - -#### registerZRC20Token - -Registers a new ZRC20 token in the registry - -Only callable through onCall from CoreRegistry - - -```solidity -function registerZRC20Token( - address address_, - string calldata symbol, - uint256 originChainId, - bytes calldata originAddress, - string calldata coinType, - uint8 decimals -) - external - onlyRegistry - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token on ZetaChain| -|`symbol`|`string`|The symbol of the token| -|`originChainId`|`uint256`|The ID of the foreign chain where the original asset exists| -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain| -|`coinType`|`string`|The type of the original coin| -|`decimals`|`uint8`|The number of decimals the token uses| - - -#### setZRC20TokenActive - -Updates ZRC20 token active status - -Only callable through onCall from CoreRegistry - - -```solidity -function setZRC20TokenActive(address address_, bool active) external onlyRegistry whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token| -|`active`|`bool`|Whether the token should be active| - - -#### bootstrapChains - -Bootstrap the registry with chain data - -This function can only be called by an address with the REGISTRY_MANAGER_ROLE. - - -```solidity -function bootstrapChains( - ChainInfoDTO[] calldata chains, - ChainMetadataEntry[] calldata metadataEntries -) - external - onlyRole(REGISTRY_MANAGER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chains`|`ChainInfoDTO[]`|Array of chain data structures to bootstrap| -|`metadataEntries`|`ChainMetadataEntry[]`|Array of chain metadata entries| - - -#### bootstrapContracts - -Bootstrap the registry with contract data - -This function can only be called by an address with the REGISTRY_MANAGER_ROLE. - - -```solidity -function bootstrapContracts( - ContractInfoDTO[] calldata contracts, - ContractConfigEntry[] calldata configEntries -) - external - onlyRole(REGISTRY_MANAGER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`contracts`|`ContractInfoDTO[]`|Array of contract data structures to bootstrap| -|`configEntries`|`ContractConfigEntry[]`|Array of contract configuration entries| - - -#### bootstrapZRC20Tokens - -Bootstrap the registry with ZRC20 token data - -This function can only be called by an address with the REGISTRY_MANAGER_ROLE. - - -```solidity -function bootstrapZRC20Tokens(ZRC20Info[] calldata tokens) external onlyRole(REGISTRY_MANAGER_ROLE) whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`tokens`|`ZRC20Info[]`|Array of ZRC20 token data structures to bootstrap| - - - - -## ZetaConnectorBase -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/ZetaConnectorBase.sol) - -Abstract base contract for ZetaConnector. - -This contract implements basic functionality for handling tokens and interacting with the Gateway contract. - - -### State Variables -#### gateway -The Gateway contract used for executing cross-chain calls. - - -```solidity -IGatewayEVM public gateway -``` - - -#### zetaToken -The address of the Zeta token. - - -```solidity -address public zetaToken -``` - - -#### tssAddress -The address of the TSS (Threshold Signature Scheme) contract. - - -```solidity -address public tssAddress -``` - - -#### WITHDRAWER_ROLE -New role identifier for withdrawer role. - - -```solidity -bytes32 public constant WITHDRAWER_ROLE = keccak256("WITHDRAWER_ROLE") -``` - - -#### PAUSER_ROLE -New role identifier for pauser role. - - -```solidity -bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE") -``` - - -#### TSS_ROLE -New role identifier for tss role. - - -```solidity -bytes32 public constant TSS_ROLE = keccak256("TSS_ROLE") -``` - - -### Functions -#### initialize - -Initializer for ZetaConnectors. - -Set admin as default admin and pauser, and tssAddress as tss role. - - -```solidity -function initialize( - address gateway_, - address zetaToken_, - address tssAddress_, - address admin_ -) - public - virtual - initializer; -``` - -#### _authorizeUpgrade - -Authorizes the upgrade of the contract, sender must be owner. - - -```solidity -function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newImplementation`|`address`|Address of the new implementation.| - - -#### updateTSSAddress - -Update tss address - - -```solidity -function updateTSSAddress(address newTSSAddress) external onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newTSSAddress`|`address`|new tss address| - - -#### pause - -Pause contract. - - -```solidity -function pause() external onlyRole(PAUSER_ROLE); -``` - -#### unpause - -Unpause contract. - - -```solidity -function unpause() external onlyRole(PAUSER_ROLE); -``` - -#### withdraw - -Withdraw tokens to a specified address. - - -```solidity -function withdraw(address to, uint256 amount, bytes32 internalSendHash) external virtual; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address to withdraw tokens to.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`internalSendHash`|`bytes32`|A hash used for internal tracking of the transaction.| - - -#### withdrawAndCall - -Withdraw tokens and call a contract through Gateway. - - -```solidity -function withdrawAndCall( - MessageContext calldata messageContext, - address to, - uint256 amount, - bytes calldata data, - bytes32 internalSendHash -) - external - virtual; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageContext`|`MessageContext`|Message context containing sender.| -|`to`|`address`|The address to withdraw tokens to.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`data`|`bytes`|The calldata to pass to the contract call.| -|`internalSendHash`|`bytes32`|A hash used for internal tracking of the transaction.| - - -#### withdrawAndRevert - -Withdraw tokens and call a contract with a revert callback through Gateway. - - -```solidity -function withdrawAndRevert( - address to, - uint256 amount, - bytes calldata data, - bytes32 internalSendHash, - RevertContext calldata revertContext -) - external - virtual; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address to withdraw tokens to.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`data`|`bytes`|The calldata to pass to the contract call.| -|`internalSendHash`|`bytes32`|A hash used for internal tracking of the transaction.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - -#### receiveTokens - -Handle received tokens. - - -```solidity -function receiveTokens(uint256 amount) external virtual; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|The amount of tokens received.| - - -### Errors -#### ZeroAddress -Error indicating that a zero address was provided. - - -```solidity -error ZeroAddress(); -``` - - - -## ZetaConnectorNative -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/ZetaConnectorNative.sol) - -Implementation of ZetaConnectorBase for native token handling. - -This contract directly transfers Zeta tokens and interacts with the Gateway contract. - - -### Functions -#### initialize - - -```solidity -function initialize( - address gateway_, - address zetaToken_, - address tssAddress_, - address admin_ -) - public - override - initializer; -``` - -#### withdraw - -Withdraw tokens to a specified address. - -This function can only be called by the TSS address. - - -```solidity -function withdraw( - address to, - uint256 amount, - bytes32 /*internalSendHash*/ -) - external - override - nonReentrant - onlyRole(WITHDRAWER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address to withdraw tokens to.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|``|`bytes32`|| - - -#### withdrawAndCall - -Withdraw tokens and call a contract through Gateway. - -This function can only be called by the TSS address. - - -```solidity -function withdrawAndCall( - MessageContext calldata messageContext, - address to, - uint256 amount, - bytes calldata data, - bytes32 /*internalSendHash*/ -) - external - override - nonReentrant - onlyRole(WITHDRAWER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageContext`|`MessageContext`|Message context containing sender.| -|`to`|`address`|The address to withdraw tokens to.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`data`|`bytes`|The calldata to pass to the contract call.| -|``|`bytes32`|| - - -#### withdrawAndRevert - -Withdraw tokens and call a contract with a revert callback through Gateway. - -This function can only be called by the TSS address. - - -```solidity -function withdrawAndRevert( - address to, - uint256 amount, - bytes calldata data, - bytes32, /*internalSendHash*/ - RevertContext calldata revertContext -) - external - override - nonReentrant - onlyRole(WITHDRAWER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address to withdraw tokens to.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`data`|`bytes`|The calldata to pass to the contract call.| -|``|`bytes32`|| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - -#### receiveTokens - -Handle received tokens. - - -```solidity -function receiveTokens(uint256 amount) external override whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|The amount of tokens received.| - - - - -## ZetaConnectorNonNative -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/ZetaConnectorNonNative.sol) - -Implementation of ZetaConnectorBase for non-native token handling. - -This contract mints and burns Zeta tokens and interacts with the Gateway contract. - - -### State Variables -#### maxSupply -Max supply for minting. - - -```solidity -uint256 public maxSupply -``` - - -### Functions -#### initialize - - -```solidity -function initialize( - address gateway_, - address zetaToken_, - address tssAddress_, - address admin_ -) - public - override - initializer; -``` - -#### setMaxSupply - -Set max supply for minting. - -This function can only be called by the TSS address. - - -```solidity -function setMaxSupply(uint256 maxSupply_) external onlyRole(TSS_ROLE) whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`maxSupply_`|`uint256`|New max supply.| - - -#### withdraw - -Withdraw tokens to a specified address. - -This function can only be called by the TSS address. - - -```solidity -function withdraw( - address to, - uint256 amount, - bytes32 internalSendHash -) - external - override - nonReentrant - onlyRole(WITHDRAWER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address to withdraw tokens to.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`internalSendHash`|`bytes32`|A hash used for internal tracking of the transaction.| - - -#### withdrawAndCall - -Withdraw tokens and call a contract through Gateway. - -This function can only be called by the TSS address, and mints if supply is not reached. - - -```solidity -function withdrawAndCall( - MessageContext calldata messageContext, - address to, - uint256 amount, - bytes calldata data, - bytes32 internalSendHash -) - external - override - nonReentrant - onlyRole(WITHDRAWER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`messageContext`|`MessageContext`|Message context containing sender.| -|`to`|`address`|The address to withdraw tokens to.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`data`|`bytes`|The calldata to pass to the contract call.| -|`internalSendHash`|`bytes32`|A hash used for internal tracking of the transaction.| - - -#### withdrawAndRevert - -Withdraw tokens and call a contract with a revert callback through Gateway. - -This function can only be called by the TSS address, and mints if supply is not reached. - - -```solidity -function withdrawAndRevert( - address to, - uint256 amount, - bytes calldata data, - bytes32 internalSendHash, - RevertContext calldata revertContext -) - external - override - nonReentrant - onlyRole(WITHDRAWER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|The address to withdraw tokens to.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`data`|`bytes`|The calldata to pass to the contract call.| -|`internalSendHash`|`bytes32`|A hash used for internal tracking of the transaction.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - -#### receiveTokens - -Handle received tokens and burn them. - - -```solidity -function receiveTokens(uint256 amount) external override whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|The amount of tokens received.| - - -#### _mintTo - -mints to provided account and checks if totalSupply will be exceeded - - -```solidity -function _mintTo(address to, uint256 amount, bytes32 internalSendHash) private; -``` - -### Events -#### MaxSupplyUpdated -Event triggered when max supply is updated. - - -```solidity -event MaxSupplyUpdated(uint256 maxSupply); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`maxSupply`|`uint256`|New max supply.| - -### Errors -#### ExceedsMaxSupply - -```solidity -error ExceedsMaxSupply(); -``` - - - -## BaseRegistry -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/helpers/BaseRegistry.sol) - - -### State Variables -#### PAUSER_ROLE -New role identifier for pauser role. - - -```solidity -bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE") -``` - - -#### REGISTRY_MANAGER_ROLE -New role identifier for registry manager role. - - -```solidity -bytes32 public constant REGISTRY_MANAGER_ROLE = keccak256("REGISTRY_MANAGER_ROLE") -``` - - -#### admin -Address with DEFAULT_ADMIN_ROLE, authorized for upgrades and pausing actions. - - -```solidity -address public admin -``` - - -#### registryManager -Address with REGISTRY_MANAGER_ROLE, authorized for all registry write actions. - - -```solidity -address public registryManager -``` - - -#### _activeChains -Active chains in the registry. - - -```solidity -uint256[] internal _activeChains -``` - - -#### _allChains -Array of all chain IDs in the registry (active and inactive). - - -```solidity -uint256[] internal _allChains -``` - - -#### _allContracts -Array to store all contracts as chainId and contractType pairs. - - -```solidity -ContractIdentifier[] internal _allContracts -``` - - -#### _allZRC20Addresses -Array of all ZRC20 token addresses. - - -```solidity -address[] internal _allZRC20Addresses -``` - - -#### _chains -Maps chain IDs to their information. - - -```solidity -mapping(uint256 => ChainInfo) internal _chains -``` - - -#### _contracts -Maps chain ID -> contract type -> ContractInfo - - -```solidity -mapping(uint256 => mapping(string => ContractInfo)) internal _contracts -``` - - -#### _zrc20Tokens -Maps ZRC20 token address to their information - - -```solidity -mapping(address => ZRC20Info) internal _zrc20Tokens -``` - - -#### _zrc20SymbolToAddress -Maps token symbol to ZRC20 address. - - -```solidity -mapping(string => address) internal _zrc20SymbolToAddress -``` - - -#### _originAssetToZRC20 -Maps origin chain ID and origin address to ZRC20 token address. - - -```solidity -mapping(uint256 => mapping(bytes => address)) internal _originAssetToZRC20 -``` - - -### Functions -#### constructor - -**Note:** -oz-upgrades-unsafe-allow: constructor - - -```solidity -constructor() ; -``` - -#### _authorizeUpgrade - -Authorizes the upgrade of the contract, sender must be admin. - - -```solidity -function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newImplementation`|`address`|Address of the new implementation,| - - -#### pause - -Pause contract. - - -```solidity -function pause() external onlyRole(PAUSER_ROLE); -``` - -#### unpause - -Unpause contract. - - -```solidity -function unpause() external onlyRole(DEFAULT_ADMIN_ROLE); -``` - -#### changeAdmin - -Changes the admin address and transfers DEFAULT_ADMIN_ROLE and PAUSER_ROLE. - -Only callable by current admin. - - -```solidity -function changeAdmin(address newAdmin) external onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newAdmin`|`address`|The address of the new admin.| - - -#### changeRegistryManager - -Changes the registry manager address and transfers REGISTRY_MANAGER_ROLE and PAUSER_ROLE. - -Only callable by admin. - - -```solidity -function changeRegistryManager(address newRegistryManager) external onlyRole(DEFAULT_ADMIN_ROLE); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`newRegistryManager`|`address`|The address of the new registry manager.| - - -#### _changeChainStatus - -Changes status of the chain to activated/deactivated. - - -```solidity -function _changeChainStatus( - uint256 chainId, - address gasZRC20, - bytes calldata registry, - bool activation -) - internal; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain to activate.| -|`gasZRC20`|`address`|The address of the ZRC20 token that represents gas token for the chain.| -|`registry`|`bytes`|Address of the Registry contract on the connected chain.| -|`activation`|`bool`|Whether activate or deactivate the chain| - - -#### _updateChainMetadata - -Updates chain metadata, only for the active chains. - - -```solidity -function _updateChainMetadata(uint256 chainId, string calldata key, bytes calldata value) internal; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain.| -|`key`|`string`|The metadata key to update.| -|`value`|`bytes`|The new value for the metadata.| - - -#### _registerContract - -Registers a new contract address for a specific chain. - - -```solidity -function _registerContract( - uint256 chainId, - string calldata contractType, - bytes calldata addressBytes -) - internal; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract (e.g., "connector", "gateway").| -|`addressBytes`|`bytes`|The bytes representation of the non-EVM address.| - - -#### _updateContractConfiguration - -Updates contract configuration. - - -```solidity -function _updateContractConfiguration( - uint256 chainId, - string calldata contractType, - string calldata key, - bytes calldata value -) - internal; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract.| -|`key`|`string`|The configuration key to update.| -|`value`|`bytes`|The new value for the configuration.| - - -#### _setContractActive - -Sets a contract's active status - - -```solidity -function _setContractActive(uint256 chainId, string calldata contractType, bool active) internal; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract.| -|`active`|`bool`|Whether the contract should be active.| - - -#### _registerZRC20Token - -Registers a new ZRC20 token in the registry. - - -```solidity -function _registerZRC20Token( - address address_, - string calldata symbol, - uint256 originChainId, - bytes calldata originAddress, - string calldata coinType, - uint8 decimals -) - internal; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token on ZetaChain.| -|`symbol`|`string`|The symbol of the token.| -|`originChainId`|`uint256`|The ID of the foreign chain where the original asset exists.| -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain.| -|`coinType`|`string`|The type of the original coin.| -|`decimals`|`uint8`|The number of decimals the token uses.| - - -#### _setZRC20TokenActive - -Updates ZRC20 token active status. - - -```solidity -function _setZRC20TokenActive(address address_, bool active) internal; -``` - -#### getChainInfo - -Gets information about a specific chain. - - -```solidity -function getChainInfo(uint256 chainId) external view returns (address gasZRC20, bytes memory registry); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`gasZRC20`|`address`|The address of the ZRC20 token that represents gas token for the chain.| -|`registry`|`bytes`|The registry address deployed on the chain.| - - -#### getChainMetadata - -Gets chain-specific metadata - - -```solidity -function getChainMetadata(uint256 chainId, string calldata key) external view returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain| -|`key`|`string`|The metadata key to retrieve| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|The value of the requested metadata| - - -#### getContractInfo - -Gets information about a specific contract - - -```solidity -function getContractInfo( - uint256 chainId, - string calldata contractType -) - external - view - returns (bool active, bytes memory addressBytes); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed| -|`contractType`|`string`|The type of the contract| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`active`|`bool`|Whether the contract is active| -|`addressBytes`|`bytes`|The address of the contract| - - -#### getContractConfiguration - -Gets contract-specific configuration - - -```solidity -function getContractConfiguration( - uint256 chainId, - string calldata contractType, - string calldata key -) - external - view - returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed| -|`contractType`|`string`|The type of the contract| -|`key`|`string`|The configuration key to retrieve| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|The value of the requested configuration| - - -#### getZRC20TokenInfo - -Gets information about a specific ZRC20 token - - -```solidity -function getZRC20TokenInfo(address address_) - external - view - returns ( - bool active, - string memory symbol, - uint256 originChainId, - bytes memory originAddress, - string memory coinType, - uint8 decimals - ); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`active`|`bool`|Whether the token is active| -|`symbol`|`string`|The symbol of the token| -|`originChainId`|`uint256`|The ID of the foreign chain where the original asset exists| -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain| -|`coinType`|`string`|The type of the original coin| -|`decimals`|`uint8`|The number of decimals the token uses| - - -#### getZRC20AddressByForeignAsset - -Gets the ZRC20 token address for a specific asset on a foreign chain. - - -```solidity -function getZRC20AddressByForeignAsset( - uint256 originChainId, - bytes calldata originAddress -) - external - view - returns (address); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`originChainId`|`uint256`|The ID of the foreign chain| -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`address`|The address of the corresponding ZRC20 token on ZetaChain.| - - -#### getActiveChains - -Gets all active chains in the registry. - - -```solidity -function getActiveChains() external view returns (uint256[] memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256[]`|Array of chain IDs for all active chains.| - - -#### getAllChains - -Returns information for all chains (active and inactive) in the registry. - - -```solidity -function getAllChains() external view returns (ChainInfoDTO[] memory chainsInfo); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`chainsInfo`|`ChainInfoDTO[]`|Array of ChainInfoDTO structs containing information about all chains.| - - -#### getAllContracts - -Returns information for all contracts in the registry. - - -```solidity -function getAllContracts() external view returns (ContractInfoDTO[] memory contractsInfo); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`contractsInfo`|`ContractInfoDTO[]`|Array of ContractInfoDTO structs containing information about all contracts.| - - -#### getAllZRC20Tokens - -Returns information for all ZRC20 tokens in the registry. - - -```solidity -function getAllZRC20Tokens() external view returns (ZRC20Info[] memory tokensInfo); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`tokensInfo`|`ZRC20Info[]`|Array of ZRC20Info structs containing information about all ZRC20 tokens.| - - -#### _removeFromActiveChains - -Removes a chain ID from the active chains array. - - -```solidity -function _removeFromActiveChains(uint256 chainId) private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain to remove.| - - - - -## IBaseRegistry -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/helpers/interfaces/IBaseRegistry.sol) - -Interface for the BaseRegistry contract. - - -### Functions -#### changeChainStatus - -Changes status of the chain to activated/deactivated. - - -```solidity -function changeChainStatus( - uint256 chainId, - address gasZRC20, - bytes calldata registry, - bool activation -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain to activate.| -|`gasZRC20`|`address`|The address of the ZRC20 token that represents gas token for the chain.| -|`registry`|`bytes`|| -|`activation`|`bool`|Whether activate or deactivate a chain| - - -#### updateChainMetadata - -Updates chain metadata. - - -```solidity -function updateChainMetadata(uint256 chainId, string calldata key, bytes calldata value) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain.| -|`key`|`string`|The metadata key to update.| -|`value`|`bytes`|The new value for the metadata.| - - -#### registerContract - -Registers a new contract address for a specific chain. - - -```solidity -function registerContract( - uint256 chainId, - string calldata contractType, - bytes calldata addressBytes -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract (e.g., "connector", "gateway").| -|`addressBytes`|`bytes`|The bytes representation of the non-EVM address.| - - -#### updateContractConfiguration - -Updates contract configuration. - - -```solidity -function updateContractConfiguration( - uint256 chainId, - string calldata contractType, - string calldata key, - bytes calldata value -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract.| -|`key`|`string`|The configuration key to update.| -|`value`|`bytes`|The new value for the configuration.| - - -#### setContractActive - - -```solidity -function setContractActive(uint256 chainId, string calldata contractType, bool active) external; -``` - -#### registerZRC20Token - -Registers a new ZRC20 token in the registry. - - -```solidity -function registerZRC20Token( - address address_, - string calldata symbol, - uint256 originChainId, - bytes calldata originAddress, - string calldata coinType, - uint8 decimals -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token on ZetaChain.| -|`symbol`|`string`|The symbol of the token.| -|`originChainId`|`uint256`|The ID of the foreign chain where the original asset exists.| -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain.| -|`coinType`|`string`|| -|`decimals`|`uint8`|| - - -#### setZRC20TokenActive - -Updates ZRC20 token information. - - -```solidity -function setZRC20TokenActive(address address_, bool active) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token.| -|`active`|`bool`|Whether the token should be active.| - - -#### getChainInfo - -Gets information about a specific chain. - - -```solidity -function getChainInfo(uint256 chainId) external view returns (address gasZRC20, bytes memory registry); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`gasZRC20`|`address`|The address of the ZRC20 token that represents gas token for the chain.| -|`registry`|`bytes`|The registry address deployed on the chain.| - - -#### getChainMetadata - -Gets chain-specific metadata. - - -```solidity -function getChainMetadata(uint256 chainId, string calldata key) external view returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain.| -|`key`|`string`|The metadata key to retrieve.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|The value of the requested metadata.| - - -#### getContractInfo - -Gets information about a specific contract. - - -```solidity -function getContractInfo( - uint256 chainId, - string calldata contractType -) - external - view - returns (bool active, bytes memory addressBytes); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`active`|`bool`|Whether the contract is active.| -|`addressBytes`|`bytes`|The address of the contract.| - - -#### getContractConfiguration - -Gets contract-specific configuration. - - -```solidity -function getContractConfiguration( - uint256 chainId, - string calldata contractType, - string calldata key -) - external - view - returns (bytes memory); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract.| -|`key`|`string`|The configuration key to retrieve.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bytes`|The value of the requested configuration.| - - -#### getZRC20TokenInfo - -Gets information about a specific ZRC20 token. - - -```solidity -function getZRC20TokenInfo(address address_) - external - view - returns ( - bool active, - string memory symbol, - uint256 originChainId, - bytes memory originAddress, - string memory coinType, - uint8 decimals - ); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`active`|`bool`|Whether the token is active.| -|`symbol`|`string`|The symbol of the token| -|`originChainId`|`uint256`|The ID of the foreign chain where the original asset exists.| -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain.| -|`coinType`|`string`|The type of the original coin.| -|`decimals`|`uint8`|The number of decimals the token uses.| - - -#### getZRC20AddressByForeignAsset - -Gets the ZRC20 token address for a specific asset on a foreign chain. - - -```solidity -function getZRC20AddressByForeignAsset( - uint256 originChainId, - bytes calldata originAddress -) - external - view - returns (address); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`originChainId`|`uint256`|The ID of the foreign chain.| -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain.| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`address`|The address of the corresponding ZRC20 token on ZetaChain.| - - -#### getActiveChains - -Gets all active chains in the registry. - - -```solidity -function getActiveChains() external view returns (uint256[] memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256[]`|Array of chain IDs for all active chains.| - - -#### getAllChains - -Returns information for all chains (active and inactive) in the registry. - - -```solidity -function getAllChains() external view returns (ChainInfoDTO[] memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`ChainInfoDTO[]`|chainsInfo Array of ChainInfoDTO structs containing information about all chains.| - - -#### getAllContracts - -Returns information for all contracts in the registry. - - -```solidity -function getAllContracts() external view returns (ContractInfoDTO[] memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`ContractInfoDTO[]`|contractsInfo Array of ContractInfoDTO structs containing information about all contracts.| - - -#### getAllZRC20Tokens - -Gets all active chains in the registry. - - -```solidity -function getAllZRC20Tokens() external view returns (ZRC20Info[] memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`ZRC20Info[]`|tokensInfo Array of ZRC20Info structs containing information about all ZRC20 tokens.| - - - - -## IBaseRegistryErrors -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/helpers/interfaces/IBaseRegistry.sol) - -Interface for the errors used by the BaseRegistry contract. - - -### Errors -#### ZeroAddress -Error thrown when a zero address is provided where a non-zero address is required. - - -```solidity -error ZeroAddress(); -``` - -#### InvalidSender -Error thrown when the sender is invalid - - -```solidity -error InvalidSender(); -``` - -#### TransferFailed -Error thrown when a ZRC20 token transfer failed. - - -```solidity -error TransferFailed(); -``` - -#### ChainActive -Error thrown when a chain is already active. - - -```solidity -error ChainActive(uint256 chainId); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain that is already active.| - -#### ChainNonActive -Error thrown when a chain is not active. - - -```solidity -error ChainNonActive(uint256 chainId); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain that is not active.| - -#### InvalidContractType -Error thrown when a contract type is invalid. - - -```solidity -error InvalidContractType(string message); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`message`|`string`|Describes why error happened| - -#### ContractAlreadyRegistered -Error thrown when a contract is already registered. - - -```solidity -error ContractAlreadyRegistered(uint256 chainId, string contractType, bytes addressBytes); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain.| -|`contractType`|`string`|The type of the contract.| -|`addressBytes`|`bytes`|The address of the contract.| - -#### ContractNotFound -Error thrown when a contract is not found in the registry. - - -```solidity -error ContractNotFound(uint256 chainId, string contractType); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain,| -|`contractType`|`string`|The type of the contract.| - -#### ZRC20AlreadyRegistered -Error thrown when a ZRC20 token is already registered. - - -```solidity -error ZRC20AlreadyRegistered(address address_); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token.| - -#### ZRC20SymbolAlreadyInUse -Error thrown when a ZRC20 token symbol is already in use. - - -```solidity -error ZRC20SymbolAlreadyInUse(string symbol); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`symbol`|`string`|The symbol that is already in use.| - - - -## IBaseRegistryEvents -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/helpers/interfaces/IBaseRegistry.sol) - -Interface for the events emitted by the BaseRegistry contract. - - -### Events -#### ChainStatusChanged -Emitted when a chain status has changed. - - -```solidity -event ChainStatusChanged(uint256 indexed chainId, bool newStatus); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain.| -|`newStatus`|`bool`|The new chain status (is active or not).| - -#### ChainMetadataUpdated -Emitted when a chain metadata is set. - - -```solidity -event ChainMetadataUpdated(uint256 indexed chainId, string key, bytes value); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain.| -|`key`|`string`|The metadata key to update.| -|`value`|`bytes`|The new value for the metadata.| - -#### ContractRegistered -Emitted when a new contract is registered. - - -```solidity -event ContractRegistered(uint256 indexed chainId, string indexed contractType, bytes addressBytes); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract (e.g. "connector", "gateway", "tss").| -|`addressBytes`|`bytes`|The contract address in bytes representation.| - -#### ContractStatusChanged -Emitted when a contract status has changed. - - -```solidity -event ContractStatusChanged(bytes addressBytes); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`addressBytes`|`bytes`|The contract address in bytes representation.| - -#### ContractConfigurationUpdated -Emitted when a contract configuration is updated. - - -```solidity -event ContractConfigurationUpdated(uint256 indexed chainId, string contractType, string key, bytes value); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract.| -|`key`|`string`|The configuration key to update.| -|`value`|`bytes`|The new value for the configuration.| - -#### ZRC20TokenRegistered -Emitted when a ZRC20 token is registered. - - -```solidity -event ZRC20TokenRegistered( - bytes indexed originAddress, address indexed address_, uint8 decimals, uint256 originChainId, string symbol -); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`originAddress`|`bytes`|The address of the asset on its native chain.| -|`address_`|`address`|The address of the ZRC20 token on ZetaChain.| -|`decimals`|`uint8`|The number of decimals the token uses.| -|`originChainId`|`uint256`|The ID of the foreign chain where the original asset exists.| -|`symbol`|`string`|The symbol of the token.| - -#### ZRC20TokenUpdated -Emitted when a ZRC20 token is updated. - - -```solidity -event ZRC20TokenUpdated(address address_, bool active); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token.| -|`active`|`bool`|Whether the token should be active.| - -#### AdminChanged -Emitted when admin address is changed. - - -```solidity -event AdminChanged(address oldAdmin, address newAdmin); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`oldAdmin`|`address`|The previous admin address.| -|`newAdmin`|`address`|The new admin address.| - -#### RegistryManagerChanged -Emitted when registry manager address is changed. - - -```solidity -event RegistryManagerChanged(address oldRegistryManager, address newRegistryManager); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`oldRegistryManager`|`address`|The previous registry manager address.| -|`newRegistryManager`|`address`|The new registry manager address.| - - - -## ChainInfo -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/helpers/interfaces/IBaseRegistry.sol) - -Structure that contains information about a chain. - - -```solidity -struct ChainInfo { -/// @notice Whether the chain is active in the ecosystem. -bool active; -/// @notice The unique identifier of the chain. -uint256 chainId; -/// @notice The address of the ZRC20 token that represents gas token for the chain. -address gasZRC20; -/// @notice The registry address deployed on the chain. -bytes registry; -/// @notice Additional chain-specific metadata stored as key-value pairs. -mapping(string => bytes) metadata; -} -``` - - - -## ChainInfoDTO -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/helpers/interfaces/IBaseRegistry.sol) - -Structure that contains information about a chain, used for data retrieving. - - -```solidity -struct ChainInfoDTO { -/// @notice Whether the chain is active in the ecosystem. -bool active; -/// @notice The unique identifier of the chain. -uint256 chainId; -/// @notice The address of the ZRC20 token that represents gas token for the chain. -address gasZRC20; -/// @notice The registry address deployed on the chain. -bytes registry; -} -``` - - - -## ContractIdentifier -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/helpers/interfaces/IBaseRegistry.sol) - -Each entry consists of: chainId (uint256) and contractType (string) - - -```solidity -struct ContractIdentifier { -uint256 chainId; -string contractType; -} -``` - - - -## ContractInfo -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/helpers/interfaces/IBaseRegistry.sol) - -Structure that contains information about a contract registered in the system. - - -```solidity -struct ContractInfo { -/// @notice Whether the contract is active. -bool active; -/// @notice The contract address in bytes representation. -bytes addressBytes; -/// @notice The type of the contract (e.g. "connector", "gateway", "tss"). -string contractType; -/// @notice Additional contract-specific configuration and metadata. -mapping(string => bytes) configuration; -} -``` - - - -## ContractInfoDTO -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/helpers/interfaces/IBaseRegistry.sol) - -Structure that contains information about a contract registered in the system, used for data retrieving. - - -```solidity -struct ContractInfoDTO { -/// @notice Whether the contract is active. -bool active; -/// @notice The contract address in bytes representation. -bytes addressBytes; -/// @notice The type of the contract (e.g. "connector", "gateway", "tss"). -string contractType; -/// @notice Represents id of the chain where contract is deployed. -uint256 chainId; -} -``` - - - -## ZRC20Info -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/helpers/interfaces/IBaseRegistry.sol) - -Structure that contains information about a ZRC20 token. - - -```solidity -struct ZRC20Info { -/// @notice Whether the ZRC20 token is active. -bool active; -/// @notice The address of the ZRC20 token on ZetaChain. -address address_; -/// @notice The address or identifier of the asset on its native chain. -bytes originAddress; -/// @notice The ID of the foreign chain where the original asset exists. -uint256 originChainId; -/// @notice The symbol of the token. -string symbol; -/// @notice The type of the asset gas/erc20. -string coinType; -/// @notice The number of decimals the token uses. -uint8 decimals; -} -``` - - - -## Abortable -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/Revert.sol) - -Interface for contracts that support abortable calls. - - -### Functions -#### onAbort - -Called when a revertable call is aborted. - - -```solidity -function onAbort(AbortContext calldata abortContext) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`abortContext`|`AbortContext`|Abort context to pass to onAbort.| - - - - -## Revertable -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/Revert.sol) - -Interface for contracts that support revertable calls. - - -### Functions -#### onRevert - -Called when a revertable call is made. - - -```solidity -function onRevert(RevertContext calldata revertContext) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - - - -## AbortContext -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/Revert.sol) - -Struct containing abort context passed to onAbort. - - -```solidity -struct AbortContext { -bytes sender; -address asset; -uint256 amount; -bool outgoing; -uint256 chainID; -bytes revertMessage; -} -``` - -**Properties** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`bytes`|Address of account that initiated smart contract call. bytes is used as the crosschain transaction can be initiated from a non-EVM chain.| -|`asset`|`address`|Address of asset. On a connected chain, it contains the fungible token address or is empty if it's a gas token. On ZetaChain, it contains the address of the ZRC20.| -|`amount`|`uint256`|Amount specified with the transaction.| -|`outgoing`|`bool`|Flag to indicate if the crosschain transaction was outgoing: from ZetaChain to connected chain. if false, the transaction was incoming: from connected chain to ZetaChain.| -|`chainID`|`uint256`|Chain ID of the connected chain.| -|`revertMessage`|`bytes`|Arbitrary data specified in the RevertOptions object when initating the crosschain transaction.| - - - -## RevertContext -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/Revert.sol) - -Struct containing revert context passed to onRevert. - - -```solidity -struct RevertContext { -address sender; -address asset; -uint256 amount; -bytes revertMessage; -} -``` - -**Properties** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|Address of account that initiated smart contract call.| -|`asset`|`address`|Address of asset. On a connected chain, it contains the fungible token address or is empty if it's a gas token. On ZetaChain, it contains the address of the ZRC20.| -|`amount`|`uint256`|Amount specified with the transaction.| -|`revertMessage`|`bytes`|Arbitrary data sent back in onRevert.| - - - -## RevertOptions -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/Revert.sol) - -Struct containing revert options - - -```solidity -struct RevertOptions { -address revertAddress; -bool callOnRevert; -address abortAddress; -bytes revertMessage; -uint256 onRevertGasLimit; -} -``` - -**Properties** - -|Name|Type|Description| -|----|----|-----------| -|`revertAddress`|`address`|Address to receive revert.| -|`callOnRevert`|`bool`|Flag if onRevert hook should be called.| -|`abortAddress`|`address`|Address to receive funds if aborted.| -|`revertMessage`|`bytes`|Arbitrary data sent back in onRevert.| -|`onRevertGasLimit`|`uint256`|Gas limit for revert tx, unused on GatewayZEVM methods| - - - -## CoreRegistry -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/CoreRegistry.sol) - -Central registry for ZetaChain, managing chain info, ZRC20 data, and contract addresses across all chains. - -The contract doesn't hold any funds and should never have active allowances. - - -### State Variables -#### CROSS_CHAIN_GAS_LIMIT -Cross-chain message gas limit - - -```solidity -uint256 public constant CROSS_CHAIN_GAS_LIMIT = 500_000 -``` - - -#### gatewayZEVM -Instance of the GatewayZEVM contract for cross-chain communication - - -```solidity -IGatewayZEVM public gatewayZEVM -``` - - -### Functions -#### initialize - -Initialize the CoreRegistry contract. - - -```solidity -function initialize(address admin_, address registryManager_, address gatewayZEVM_) public initializer; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`admin_`|`address`|Address with DEFAULT_ADMIN_ROLE, authorized for upgrades and pausing actions.| -|`registryManager_`|`address`|Address with REGISTRY_MANAGER_ROLE, authorized for all registry write actions.| -|`gatewayZEVM_`|`address`|Address of the GatewayZEVM contract for cross-chain messaging| - - -#### changeChainStatus - -Changes status of the chain to activated/deactivated. - - -```solidity -function changeChainStatus( - uint256 chainId, - address gasZRC20, - bytes calldata registry, - bool activation -) - external - onlyRole(REGISTRY_MANAGER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain to activate.| -|`gasZRC20`|`address`|The address of the ZRC20 token that represents gas token for the chain.| -|`registry`|`bytes`|Address of the Registry contract on the connected chain.| -|`activation`|`bool`|Whether activate or deactivate the chain| - - -#### updateChainMetadata - -Updates chain metadata, only for the active chains. - - -```solidity -function updateChainMetadata( - uint256 chainId, - string calldata key, - bytes calldata value -) - external - onlyRole(REGISTRY_MANAGER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain.| -|`key`|`string`|The metadata key to update.| -|`value`|`bytes`|The new value for the metadata.| - - -#### registerContract - -Registers a new contract address for a specific chain. - - -```solidity -function registerContract( - uint256 chainId, - string calldata contractType, - bytes calldata addressBytes -) - external - onlyRole(REGISTRY_MANAGER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract (e.g., "connector", "gateway").| -|`addressBytes`|`bytes`|The bytes representation of the non-EVM address.| - - -#### updateContractConfiguration - -Updates contract configuration. - - -```solidity -function updateContractConfiguration( - uint256 chainId, - string calldata contractType, - string calldata key, - bytes calldata value -) - external - onlyRole(REGISTRY_MANAGER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract.| -|`key`|`string`|The configuration key to update.| -|`value`|`bytes`|The new value for the configuration.| - - -#### setContractActive - -Sets a contract's active status - - -```solidity -function setContractActive( - uint256 chainId, - string calldata contractType, - bool active -) - external - onlyRole(REGISTRY_MANAGER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed.| -|`contractType`|`string`|The type of the contract.| -|`active`|`bool`|Whether the contract should be active.| - - -#### registerZRC20Token - -Registers a new ZRC20 token in the registry. - - -```solidity -function registerZRC20Token( - address address_, - string calldata symbol, - uint256 originChainId, - bytes calldata originAddress, - string calldata coinType, - uint8 decimals -) - external - onlyRole(REGISTRY_MANAGER_ROLE) - whenNotPaused; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token on ZetaChain.| -|`symbol`|`string`|The symbol of the token.| -|`originChainId`|`uint256`|The ID of the foreign chain where the original asset exists.| -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain.| -|`coinType`|`string`|The type of the original coin.| -|`decimals`|`uint8`|The number of decimals the token uses.| - - -#### setZRC20TokenActive - -Updates ZRC20 token active status. - - -```solidity -function setZRC20TokenActive( - address address_, - bool active -) - external - onlyRole(REGISTRY_MANAGER_ROLE) - whenNotPaused; -``` - -#### _broadcastChainActivation - -Broadcast chain activation update to all satellite registries. - - -```solidity -function _broadcastChainActivation( - uint256 chainId, - address gasZRC20, - bytes calldata registry, - bool activation -) - internal; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain being activated/deactivated.| -|`gasZRC20`|`address`|The address of the ZRC20 token that represents gas token for the chain.| -|`registry`|`bytes`|Address of the Registry contract on the connected chain.| -|`activation`|`bool`|Whether activate or deactivate the chain| - - -#### _broadcastChainMetadataUpdate - -Broadcast chain metadata to all satellite registries - - -```solidity -function _broadcastChainMetadataUpdate(uint256 chainId, string calldata key, bytes calldata value) private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain whose metadata is being updated| -|`key`|`string`|The metadata key being updated| -|`value`|`bytes`|The new value for the metadata| - - -#### _broadcastContractRegistration - -Broadcast contract registration to all satellite registries - -contractType The type of the contract - -addressBytes The bytes representation of the non-EVM address - - -```solidity -function _broadcastContractRegistration( - uint256 chainId, - string calldata contractType, - bytes calldata addressBytes -) - private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed| -|`contractType`|`string`|| -|`addressBytes`|`bytes`|| - - -#### _broadcastContractConfigUpdate - -Broadcast contract configuration update to all satellite registries - -contractType The type of the contract - -key The configuration key being updated - -value The new value for the configuration - - -```solidity -function _broadcastContractConfigUpdate( - uint256 chainId, - string calldata contractType, - string calldata key, - bytes calldata value -) - private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed| -|`contractType`|`string`|| -|`key`|`string`|| -|`value`|`bytes`|| - - -#### _broadcastContractStatusUpdate - -Broadcast contract status update to all satellite registries - -contractType The type of the contract - -active Whether the contract should be active - - -```solidity -function _broadcastContractStatusUpdate( - uint256 chainId, - string calldata contractType, - bool active -) - private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainId`|`uint256`|The ID of the chain where the contract is deployed| -|`contractType`|`string`|| -|`active`|`bool`|| - - -#### _broadcastZRC20Registration - -Broadcast ZRC20 token registration to all satellite registries - - -```solidity -function _broadcastZRC20Registration( - address address_, - string calldata symbol, - uint256 originChainId, - bytes calldata originAddress, - string calldata coinType, - uint8 decimals -) - private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token on ZetaChain| -|`symbol`|`string`|The symbol of the token| -|`originChainId`|`uint256`|The ID of the foreign chain where the original asset exists| -|`originAddress`|`bytes`|The address or identifier of the asset on its native chain| -|`coinType`|`string`|The type of the original coin| -|`decimals`|`uint8`|The number of decimals the token uses| - - -#### _broadcastZRC20Update - -Broadcast ZRC20 token update to all satellite registries - - -```solidity -function _broadcastZRC20Update(address address_, bool active) private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`address_`|`address`|The address of the ZRC20 token| -|`active`|`bool`|Whether the token should be active| - - -#### _broadcastToAllChains - -Generic function to broadcast encoded messages to all satellite registries - - -```solidity -function _broadcastToAllChains(bytes memory encodedMessage) private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`encodedMessage`|`bytes`|The fully encoded function call to broadcast| - - -#### _sendCrossChainMessage - -Sends a cross-chain message to the Registry contract on a target chain. - - -```solidity -function _sendCrossChainMessage(uint256 targetChainId, bytes memory message) private; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`targetChainId`|`uint256`|The ID of the chain to send the message to.| -|`message`|`bytes`|The encoded function call to execute on the target chain.| - - - - -## ICoreRegistry -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/ICoreRegistry.sol) - - -### Functions -#### gatewayZEVM - - -```solidity -function gatewayZEVM() external returns (address); -``` - - - -## IGatewayZEVM -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/IGatewayZEVM.sol) - -Interface for the GatewayZEVM contract. - -Defines functions for cross-chain interactions and token handling. - - -### Functions -#### withdraw - -Withdraw ZRC20 tokens to an external chain. - - -```solidity -function withdraw( - bytes memory receiver, - uint256 amount, - address zrc20, - RevertOptions calldata revertOptions -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### withdraw - -Withdraw ZETA tokens to an external chain. - - -```solidity -function withdraw( - bytes memory receiver, - uint256 amount, - uint256 chainId, - RevertOptions calldata revertOptions -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`chainId`|`uint256`|| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### withdrawAndCall - -Withdraw ZRC20 tokens and call a smart contract on an external chain. - - -```solidity -function withdrawAndCall( - bytes memory receiver, - uint256 amount, - address zrc20, - bytes calldata message, - CallOptions calldata callOptions, - RevertOptions calldata revertOptions -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`message`|`bytes`|The calldata to pass to the contract call.| -|`callOptions`|`CallOptions`|Call options including gas limit and arbirtrary call flag.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### withdrawAndCall - -Withdraw ZRC20 tokens and call a smart contract on an external chain. - - -```solidity -function withdrawAndCall( - bytes memory receiver, - uint256 amount, - address zrc20, - bytes calldata message, - uint256 version, - CallOptions calldata callOptions, - RevertOptions calldata revertOptions -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`message`|`bytes`|The calldata to pass to the contract call.| -|`version`|`uint256`|The number representing message context version.| -|`callOptions`|`CallOptions`|Call options including gas limit, arbirtrary call flag and message context version.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### withdrawAndCall - -Withdraw ZETA tokens and call a smart contract on an external chain. - - -```solidity -function withdrawAndCall( - bytes memory receiver, - uint256 amount, - uint256 chainId, - bytes calldata message, - CallOptions calldata callOptions, - RevertOptions calldata revertOptions -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`amount`|`uint256`|The amount of tokens to withdraw.| -|`chainId`|`uint256`|Chain id of the external chain.| -|`message`|`bytes`|The calldata to pass to the contract call.| -|`callOptions`|`CallOptions`|Call options including gas limit and arbirtrary call flag.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### call - -Call a smart contract on an external chain without asset transfer. - - -```solidity -function call( - bytes memory receiver, - address zrc20, - bytes calldata message, - CallOptions calldata callOptions, - RevertOptions calldata revertOptions -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`zrc20`|`address`|Address of zrc20 to pay fees.| -|`message`|`bytes`|The calldata to pass to the contract call.| -|`callOptions`|`CallOptions`|Call options including gas limit and arbirtrary call flag.| -|`revertOptions`|`RevertOptions`|Revert options.| - - -#### deposit - -Deposit foreign coins into ZRC20. - - -```solidity -function deposit(address zrc20, uint256 amount, address target) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`amount`|`uint256`|The amount of tokens to deposit.| -|`target`|`address`|The target address to receive the deposited tokens.| - - -#### execute - -Execute a user-specified contract on ZEVM. - - -```solidity -function execute( - MessageContext calldata context, - address zrc20, - uint256 amount, - address target, - bytes calldata message -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`context`|`MessageContext`|The context of the cross-chain call.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`amount`|`uint256`|The amount of tokens to transfer.| -|`target`|`address`|The target contract to call.| -|`message`|`bytes`|The calldata to pass to the contract call.| - - -#### depositAndCall - -Deposit foreign coins into ZRC20 and call a user-specified contract on ZEVM. - - -```solidity -function depositAndCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - address target, - bytes calldata message -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`context`|`MessageContext`|The context of the cross-chain call.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`amount`|`uint256`|The amount of tokens to transfer.| -|`target`|`address`|The target contract to call.| -|`message`|`bytes`|The calldata to pass to the contract call.| - - -#### depositAndCall - -Deposit ZETA and call a user-specified contract on ZEVM. - - -```solidity -function depositAndCall( - MessageContext calldata context, - uint256 amount, - address target, - bytes calldata message -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`context`|`MessageContext`|The context of the cross-chain call.| -|`amount`|`uint256`|The amount of tokens to transfer.| -|`target`|`address`|The target contract to call.| -|`message`|`bytes`|The calldata to pass to the contract call.| - - -#### executeRevert - -Revert a user-specified contract on ZEVM. - - -```solidity -function executeRevert(address target, RevertContext calldata revertContext) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`target`|`address`|The target contract to call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - -#### depositAndRevert - -Deposit foreign coins into ZRC20 and revert a user-specified contract on ZEVM. - - -```solidity -function depositAndRevert( - address zrc20, - uint256 amount, - address target, - RevertContext calldata revertContext -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`amount`|`uint256`|The amount of tokens to revert.| -|`target`|`address`|The target contract to call.| -|`revertContext`|`RevertContext`|Revert context to pass to onRevert.| - - - - -## IGatewayZEVMErrors -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/IGatewayZEVM.sol) - -Interface for the errors used in the GatewayZEVM contract. - - -### Errors -#### WithdrawalFailed -Error indicating a withdrawal failure. - - -```solidity -error WithdrawalFailed(); -``` - -#### InsufficientZRC20Amount -Error indicating an insufficient ZRC20 token amount. - - -```solidity -error InsufficientZRC20Amount(); -``` - -#### InsufficientZetaAmount -Error indicating an insufficient zeta amount. - - -```solidity -error InsufficientZetaAmount(); -``` - -#### ZRC20BurnFailed -Error indicating a failure to burn ZRC20 tokens. - - -```solidity -error ZRC20BurnFailed(); -``` - -#### ZRC20TransferFailed -Error indicating a failure to transfer ZRC20 tokens. - - -```solidity -error ZRC20TransferFailed(); -``` - -#### ZRC20DepositFailed -Error indicating a failure to deposit ZRC20 tokens. - - -```solidity -error ZRC20DepositFailed(); -``` - -#### GasFeeTransferFailed -Error indicating a failure to transfer gas fee. - - -```solidity -error GasFeeTransferFailed(); -``` - -#### CallerIsNotProtocol -Error indicating that the caller is not the protocol account. - - -```solidity -error CallerIsNotProtocol(); -``` - -#### InvalidTarget -Error indicating an invalid target address. - - -```solidity -error InvalidTarget(); -``` - -#### FailedZetaSent -Error indicating a failure to send ZETA tokens. - - -```solidity -error FailedZetaSent(); -``` - -#### OnlyWZETAOrProtocol -Error indicating that only WZETA or the protocol address can call the function. - - -```solidity -error OnlyWZETAOrProtocol(); -``` - -#### InsufficientGasLimit -Error indicating an insufficient gas limit. - - -```solidity -error InsufficientGasLimit(); -``` - -#### MessageSizeExceeded -Error indicating message size exceeded in external functions. - - -```solidity -error MessageSizeExceeded(); -``` - - - -## IGatewayZEVMEvents -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/IGatewayZEVM.sol) - -Interface for the events emitted by the GatewayZEVM contract. - - -### Events -#### Called -Emitted when a cross-chain call is made. - - -```solidity -event Called( - address indexed sender, - address indexed zrc20, - bytes receiver, - bytes message, - CallOptions callOptions, - RevertOptions revertOptions -); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|The address of the sender.| -|`zrc20`|`address`|Address of zrc20 to pay fees.| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`message`|`bytes`|The calldata passed to the contract call.| -|`callOptions`|`CallOptions`|Call options including gas limit and arbirtrary call flag.| -|`revertOptions`|`RevertOptions`|Revert options.| - -#### Withdrawn -Emitted when a withdrawal is made. - - -```solidity -event Withdrawn( - address indexed sender, - uint256 indexed chainId, - bytes receiver, - address zrc20, - uint256 value, - uint256 gasfee, - uint256 protocolFlatFee, - bytes message, - CallOptions callOptions, - RevertOptions revertOptions -); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|The address from which the tokens are withdrawn.| -|`chainId`|`uint256`|Chain id of external chain.| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`value`|`uint256`|The amount of tokens withdrawn.| -|`gasfee`|`uint256`|The gas fee for the withdrawal.| -|`protocolFlatFee`|`uint256`|The protocol flat fee for the withdrawal.| -|`message`|`bytes`|The calldata passed with the withdraw. No longer used. Kept to maintain compatibility.| -|`callOptions`|`CallOptions`|Call options including gas limit and arbirtrary call flag.| -|`revertOptions`|`RevertOptions`|Revert options.| - -#### WithdrawnAndCalled -Emitted when a withdraw and call is made. - - -```solidity -event WithdrawnAndCalled( - address indexed sender, - uint256 indexed chainId, - bytes receiver, - address zrc20, - uint256 value, - uint256 gasfee, - uint256 protocolFlatFee, - bytes message, - CallOptions callOptions, - RevertOptions revertOptions -); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|The address from which the tokens are withdrawn.| -|`chainId`|`uint256`|Chain id of external chain.| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`value`|`uint256`|The amount of tokens withdrawn.| -|`gasfee`|`uint256`|The gas fee for the withdrawal.| -|`protocolFlatFee`|`uint256`|The protocol flat fee for the withdrawal.| -|`message`|`bytes`|The calldata passed to the contract call.| -|`callOptions`|`CallOptions`|Call options including gas limit and arbirtrary call flag.| -|`revertOptions`|`RevertOptions`|Revert options.| - -#### WithdrawnAndCalledV2 -Emitted when a withdraw and call is made. - - -```solidity -event WithdrawnAndCalledV2( - address indexed sender, - uint256 indexed chainId, - bytes receiver, - address zrc20, - uint256 value, - uint256 gasfee, - uint256 protocolFlatFee, - bytes message, - uint256 version, - CallOptions callOptions, - RevertOptions revertOptions -); -``` - -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|The address from which the tokens are withdrawn.| -|`chainId`|`uint256`|Chain id of external chain.| -|`receiver`|`bytes`|The receiver address on the external chain.| -|`zrc20`|`address`|The address of the ZRC20 token.| -|`value`|`uint256`|The amount of tokens withdrawn.| -|`gasfee`|`uint256`|The gas fee for the withdrawal.| -|`protocolFlatFee`|`uint256`|The protocol flat fee for the withdrawal.| -|`message`|`bytes`|The calldata passed to the contract call.| -|`version`|`uint256`|The number representing message context version.| -|`callOptions`|`CallOptions`|Call options including gas limit, arbirtrary call flag and message context version.| -|`revertOptions`|`RevertOptions`|Revert options.| - - - -## CallOptions -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/IGatewayZEVM.sol) - -CallOptions struct passed to call and withdrawAndCall functions. - - -```solidity -struct CallOptions { -uint256 gasLimit; -bool isArbitraryCall; -} -``` - -**Properties** - -|Name|Type|Description| -|----|----|-----------| -|`gasLimit`|`uint256`|Gas limit.| -|`isArbitraryCall`|`bool`|Indicates if call should be arbitrary or authenticated.| - - - -## ISystem -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/ISystem.sol) - -Interface for the System contract. - -Defines functions for system contract callable by fungible module. - - -### Functions -#### FUNGIBLE_MODULE_ADDRESS - - -```solidity -function FUNGIBLE_MODULE_ADDRESS() external view returns (address); -``` - -#### wZetaContractAddress - - -```solidity -function wZetaContractAddress() external view returns (address); -``` - -#### uniswapv2FactoryAddress - - -```solidity -function uniswapv2FactoryAddress() external view returns (address); -``` - -#### gasPriceByChainId - - -```solidity -function gasPriceByChainId(uint256 chainID) external view returns (uint256); -``` - -#### gasCoinZRC20ByChainId - - -```solidity -function gasCoinZRC20ByChainId(uint256 chainID) external view returns (address); -``` - -#### gasZetaPoolByChainId - - -```solidity -function gasZetaPoolByChainId(uint256 chainID) external view returns (address); -``` - - - -## IWETH9 -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/IWZETA.sol) - -Interface for the Weth9 contract. - - -### Functions -#### totalSupply - - -```solidity -function totalSupply() external view returns (uint256); -``` - -#### balanceOf - - -```solidity -function balanceOf(address owner) external view returns (uint256); -``` - -#### allowance - - -```solidity -function allowance(address owner, address spender) external view returns (uint256); -``` - -#### approve - - -```solidity -function approve(address spender, uint256 wad) external returns (bool); -``` - -#### transfer - - -```solidity -function transfer(address to, uint256 wad) external returns (bool); -``` - -#### transferFrom - - -```solidity -function transferFrom(address from, address to, uint256 wad) external returns (bool); -``` - -#### deposit - - -```solidity -function deposit() external payable; -``` - -#### withdraw - - -```solidity -function withdraw(uint256 wad) external; -``` - -### Events -#### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value); -``` - -#### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value); -``` - -#### Deposit - -```solidity -event Deposit(address indexed dst, uint256 wad); -``` - -#### Withdrawal - -```solidity -event Withdrawal(address indexed src, uint256 wad); -``` - - - -## CoinType -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/IZRC20.sol) - -Coin types for ZRC20. Zeta value should not be used. - - -```solidity -enum CoinType { -Zeta, -Gas, -ERC20 -} -``` - - - -## IZRC20 -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/IZRC20.sol) - -Interface for the ZRC20 token contract. - - -### Functions -#### totalSupply - - -```solidity -function totalSupply() external view returns (uint256); -``` - -#### balanceOf - - -```solidity -function balanceOf(address account) external view returns (uint256); -``` - -#### transfer - - -```solidity -function transfer(address recipient, uint256 amount) external returns (bool); -``` - -#### allowance - - -```solidity -function allowance(address owner, address spender) external view returns (uint256); -``` - -#### approve - - -```solidity -function approve(address spender, uint256 amount) external returns (bool); -``` - -#### transferFrom - - -```solidity -function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); -``` - -#### deposit - - -```solidity -function deposit(address to, uint256 amount) external returns (bool); -``` - -#### burn - - -```solidity -function burn(uint256 amount) external returns (bool); -``` - -#### withdraw - - -```solidity -function withdraw(bytes memory to, uint256 amount) external returns (bool); -``` - -#### withdrawGasFee - - -```solidity -function withdrawGasFee() external view returns (address, uint256); -``` - -#### withdrawGasFeeWithGasLimit - - -```solidity -function withdrawGasFeeWithGasLimit(uint256 gasLimit) external view returns (address, uint256); -``` - -#### PROTOCOL_FLAT_FEE - -Name is in upper case to maintain compatibility with ZRC20.sol v1 - - -```solidity -function PROTOCOL_FLAT_FEE() external view returns (uint256); -``` - -#### GAS_LIMIT - -Name is in upper case to maintain compatibility with ZRC20.sol v1 - - -```solidity -function GAS_LIMIT() external view returns (uint256); -``` - -#### setName - - -```solidity -function setName(string memory newName) external; -``` - -#### setSymbol - - -```solidity -function setSymbol(string memory newSymbol) external; -``` - -#### CHAIN_ID - -Name is in upper case to maintain compatibility with ZRC20.sol v1 - - -```solidity -function CHAIN_ID() external view returns (uint256); -``` - - - -## IZRC20Metadata -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/IZRC20.sol) - -Interface for the ZRC20 metadata. - - -### Functions -#### name - - -```solidity -function name() external view returns (string memory); -``` - -#### symbol - - -```solidity -function symbol() external view returns (string memory); -``` - -#### decimals - - -```solidity -function decimals() external view returns (uint8); -``` - - - -## ZRC20Events -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/IZRC20.sol) - -Interface for the ZRC20 events. - - -### Events -#### Transfer - -```solidity -event Transfer(address indexed from, address indexed to, uint256 value); -``` - -#### Approval - -```solidity -event Approval(address indexed owner, address indexed spender, uint256 value); -``` - -#### Deposit - -```solidity -event Deposit(bytes from, address indexed to, uint256 value); -``` - -#### Withdrawal - -```solidity -event Withdrawal(address indexed from, bytes to, uint256 value, uint256 gasFee, uint256 protocolFlatFee); -``` - -#### UpdatedSystemContract - -```solidity -event UpdatedSystemContract(address systemContract); -``` - -#### UpdatedGateway - -```solidity -event UpdatedGateway(address gateway); -``` - -#### UpdatedGasLimit - -```solidity -event UpdatedGasLimit(uint256 gasLimit); -``` - -#### UpdatedProtocolFlatFee - -```solidity -event UpdatedProtocolFlatFee(uint256 protocolFlatFee); -``` - - - -## UniversalContract -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/UniversalContract.sol) - -Abstract contract for contracts that can receive cross-chain calls on ZetaChain. - -Contracts extending this abstract contract can handle incoming cross-chain messages -and execute logic based on the provided context, token, and message payload. - - -### State Variables -#### registry -Reference to the ZetaChain Registry contract - - -```solidity -ICoreRegistry public constant registry = ICoreRegistry(0x7CCE3Eb018bf23e1FE2a32692f2C77592D110394) -``` - - -#### gateway -Reference to the ZetaChain Gateway contract - - -```solidity -IGatewayZEVM public immutable gateway -``` - - -### Functions -#### onlyGateway - -Restricts function access to only the gateway contract - -Used on functions that process cross-chain messages to ensure they're only called through the Gateway, -where message validation occurs. -Important for security in functions like `onCall()` and `onRevert()` that handle incoming cross-chain -operations. - - -```solidity -modifier onlyGateway() ; -``` - -#### constructor - -Initializes the contract by retrieving the gateway address from the registry - -Fetches the gateway contract address for the current chain from the registry. -If the gateway is not active or not found, the gateway will remain uninitialized (address(0)). - - -```solidity -constructor() ; -``` - -#### onCall - -Function to handle cross-chain calls with ZRC20 token transfers - - -```solidity -function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message -) - external - virtual; -``` - -### Errors -#### Unauthorized -Error thrown when a function is called by an unauthorized address - - -```solidity -error Unauthorized(); -``` - - - -## zContract -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/UniversalContract.sol) - -**Note:** -deprecated: should be removed once v2 SystemContract is not used anymore. -UniversalContract should be used - - -### Functions -#### onCrossChainCall - - -```solidity -function onCrossChainCall( - zContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message -) - external; -``` - - - -## MessageContext -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/UniversalContract.sol) - -Provides contextual information when executing a cross-chain call on ZetaChain. - -This struct helps identify the sender of the message across different blockchain environments. - - -```solidity -struct MessageContext { -/// @notice The address of the sender on the connected chain. -/// @dev This field uses `bytes` to remain chain-agnostic, allowing support for both EVM and non-EVM chains. -/// If the connected chain is an EVM chain, `senderEVM` will also be populated with the same value. -bytes sender; -/// @notice The sender's address in `address` type if the connected chain is an EVM-compatible chain. -address senderEVM; -/// @notice The chain ID of the connected chain. -/// @dev This identifies the origin chain of the message, allowing contract logic to differentiate between sources. -uint256 chainID; -} -``` - - - -## zContext -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/interfaces/UniversalContract.sol) - -**Note:** -deprecated: should be removed once v2 SystemContract is not used anymore. -MessageContext should be used - - -```solidity -struct zContext { -bytes origin; -address sender; -uint256 chainID; -} -``` - - - -## ZetaConnectorZEVM -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/legacy/ZetaConnectorZEVM.sol) - - -### State Variables -#### wzeta -WZETA token address. - - -```solidity -address public wzeta -``` - - -#### FUNGIBLE_MODULE_ADDRESS -Fungible module address. - - -```solidity -address public constant FUNGIBLE_MODULE_ADDRESS = payable(0x735b14BB79463307AAcBED86DAf3322B1e6226aB) -``` - - -### Functions -#### onlyFungibleModule - -Modifier to restrict actions to fungible module. - - -```solidity -modifier onlyFungibleModule() ; -``` - -#### constructor - - -```solidity -constructor(address wzeta_) ; -``` - -#### receive - -Receive function to receive ZETA from WETH9.withdraw(). - - -```solidity -receive() external payable; -``` - -#### setWzetaAddress - - -```solidity -function setWzetaAddress(address wzeta_) external onlyFungibleModule; -``` - -#### send - -Sends ZETA and bytes messages (to execute it) crosschain. - - -```solidity -function send(ZetaInterfaces.SendInput calldata input) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`input`|`ZetaInterfaces.SendInput`|| - - -#### onReceive - -Handler to receive data from other chain. -This method can be called only by Fungible Module. -Transfer the Zeta tokens to destination and calls onZetaMessage if it's needed. -To perform the transfer wrap the new tokens - - -```solidity -function onReceive( - bytes calldata zetaTxSenderAddress, - uint256 sourceChainId, - address destinationAddress, - uint256 zetaValue, - bytes calldata message, - bytes32 internalSendHash -) - external - payable - onlyFungibleModule; -``` - -#### onRevert - -Handler to receive errors from other chain. -This method can be called only by Fungible Module. -Transfer the Zeta tokens to destination and calls onZetaRevert if it's needed. - - -```solidity -function onRevert( - address zetaTxSenderAddress, - uint256 sourceChainId, - bytes calldata destinationAddress, - uint256 destinationChainId, - uint256 remainingZetaValue, - bytes calldata message, - bytes32 internalSendHash -) - external - payable - onlyFungibleModule; -``` - -### Events -#### SetWZETA - -```solidity -event SetWZETA(address wzeta_); -``` - -#### ZetaSent - -```solidity -event ZetaSent( - address sourceTxOriginAddress, - address indexed zetaTxSenderAddress, - uint256 indexed destinationChainId, - bytes destinationAddress, - uint256 zetaValueAndGas, - uint256 destinationGasLimit, - bytes message, - bytes zetaParams -); -``` - -#### ZetaReceived - -```solidity -event ZetaReceived( - bytes zetaTxSenderAddress, - uint256 indexed sourceChainId, - address indexed destinationAddress, - uint256 zetaValue, - bytes message, - bytes32 indexed internalSendHash -); -``` - -#### ZetaReverted - -```solidity -event ZetaReverted( - address zetaTxSenderAddress, - uint256 sourceChainId, - uint256 indexed destinationChainId, - bytes destinationAddress, - uint256 remainingZetaValue, - bytes message, - bytes32 indexed internalSendHash -); -``` - -### Errors -#### OnlyWZETAOrFungible -Contract custom errors. - - -```solidity -error OnlyWZETAOrFungible(); -``` - -#### WZETATransferFailed - -```solidity -error WZETATransferFailed(); -``` - -#### OnlyFungibleModule - -```solidity -error OnlyFungibleModule(); -``` - -#### FailedZetaSent - -```solidity -error FailedZetaSent(); -``` - -#### WrongValue - -```solidity -error WrongValue(); -``` - - - -## ZetaInterfaces -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/legacy/ZetaConnectorZEVM.sol) - - -### Structs -#### SendInput -Use SendInput to interact with the Connector: connector.send(SendInput) - - -```solidity -struct SendInput { - /// @dev Chain id of the destination chain. More about chain ids - /// https://docs.zetachain.com/learn/glossary#chain-id - uint256 destinationChainId; - /// @dev Address receiving the message on the destination chain (expressed in bytes since it can be non-EVM) - bytes destinationAddress; - /// @dev Gas limit for the destination chain's transaction - uint256 destinationGasLimit; - /// @dev An encoded, arbitrary message to be parsed by the destination contract - bytes message; - /// @dev ZETA to be sent cross-chain + ZetaChain gas fees + destination chain gas fees (expressed in ZETA) - uint256 zetaValueAndGas; - /// @dev Optional parameters for the ZetaChain protocol - bytes zetaParams; -} -``` - -#### ZetaMessage -Our Connector calls onZetaMessage with this struct as argument - - -```solidity -struct ZetaMessage { - bytes zetaTxSenderAddress; - uint256 sourceChainId; - address destinationAddress; - /// @dev Remaining ZETA from zetaValueAndGas after subtracting ZetaChain gas fees and destination gas fees - uint256 zetaValue; - bytes message; -} -``` - -#### ZetaRevert -Our Connector calls onZetaRevert with this struct as argument - - -```solidity -struct ZetaRevert { - address zetaTxSenderAddress; - uint256 sourceChainId; - bytes destinationAddress; - uint256 destinationChainId; - /// @dev Equals to: zetaValueAndGas - ZetaChain gas fees - destination chain gas fees - source chain revert tx - /// gas fees - uint256 remainingZetaValue; - bytes message; -} -``` - - - -## ZetaReceiver -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/legacy/ZetaConnectorZEVM.sol) - - -### Functions -#### onZetaMessage - -onZetaMessage is called when a cross-chain message reaches a contract - - -```solidity -function onZetaMessage(ZetaInterfaces.ZetaMessage calldata zetaMessage) external; -``` - -#### onZetaRevert - -onZetaRevert is called when a cross-chain message reverts. -It's useful to rollback to the original state - - -```solidity -function onZetaRevert(ZetaInterfaces.ZetaRevert calldata zetaRevert) external; -``` - - - -## SystemContract -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/SystemContract.sol) - -The system contract it's called by the protocol to interact with the blockchain. -Also includes a lot of tools to make easier to interact with ZetaChain. - - -### State Variables -#### gasPriceByChainId -Map to know the gas price of each chain given a chain id. - - -```solidity -mapping(uint256 => uint256) public gasPriceByChainId -``` - - -#### gasCoinZRC20ByChainId -Map to know the ZRC20 address of a token given a chain id, ex zETH, zBNB etc. - - -```solidity -mapping(uint256 => address) public gasCoinZRC20ByChainId -``` - - -#### gasZetaPoolByChainId - -```solidity -mapping(uint256 => address) public gasZetaPoolByChainId -``` - - -#### FUNGIBLE_MODULE_ADDRESS -Fungible address is always the same, it's on protocol level. - - -```solidity -address public constant FUNGIBLE_MODULE_ADDRESS = 0x735b14BB79463307AAcBED86DAf3322B1e6226aB -``` - - -#### uniswapv2FactoryAddress -Uniswap V2 addresses. - - -```solidity -address public immutable uniswapv2FactoryAddress -``` - - -#### uniswapv2Router02Address - -```solidity -address public immutable uniswapv2Router02Address -``` - - -#### wZetaContractAddress -Address of the wrapped ZETA to interact with Uniswap V2. - - -```solidity -address public wZetaContractAddress -``` - - -#### zetaConnectorZEVMAddress -Address of ZEVM Zeta Connector. - - -```solidity -address public zetaConnectorZEVMAddress -``` - - -### Functions -#### constructor - -Only fungible module can deploy a system contract. - - -```solidity -constructor(address wzeta_, address uniswapv2Factory_, address uniswapv2Router02_) ; -``` - -#### depositAndCall - -Deposit foreign coins into ZRC20 and call user specified contract on zEVM. - - -```solidity -function depositAndCall( - zContext calldata context, - address zrc20, - uint256 amount, - address target, - bytes calldata message -) - external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`context`|`zContext`|| -|`zrc20`|`address`|| -|`amount`|`uint256`|| -|`target`|`address`|| -|`message`|`bytes`|| - - -#### sortTokens - -Sort token addresses lexicographically. Used to handle return values from pairs sorted in the order. - - -```solidity -function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`tokenA`|`address`|| -|`tokenB`|`address`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`token0`|`address`|token1, returns sorted token addresses,.| -|`token1`|`address`|| - - -#### uniswapv2PairFor - -Calculates the CREATE2 address for a pair without making any external calls. - - -```solidity -function uniswapv2PairFor(address factory, address tokenA, address tokenB) public pure returns (address pair); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`factory`|`address`|| -|`tokenA`|`address`|| -|`tokenB`|`address`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|`pair`|`address`|tokens pair address.| - - -#### setGasPrice - -Fungible module updates the gas price oracle periodically. - - -```solidity -function setGasPrice(uint256 chainID, uint256 price) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainID`|`uint256`|| -|`price`|`uint256`|| - - -#### setGasCoinZRC20 - -Setter for gasCoinZRC20ByChainId map. - - -```solidity -function setGasCoinZRC20(uint256 chainID, address zrc20) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainID`|`uint256`|| -|`zrc20`|`address`|| - - -#### setGasZetaPool - -Set the pool wzeta/erc20 address. - - -```solidity -function setGasZetaPool(uint256 chainID, address erc20) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`chainID`|`uint256`|| -|`erc20`|`address`|| - - -#### setWZETAContractAddress - -Setter for wrapped ZETA address. - - -```solidity -function setWZETAContractAddress(address addr) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`addr`|`address`|| - - -#### setConnectorZEVMAddress - -Setter for zetaConnector ZEVM Address - - -```solidity -function setConnectorZEVMAddress(address addr) external; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`addr`|`address`|| - - -### Events -#### SystemContractDeployed -Custom SystemContract errors. - - -```solidity -event SystemContractDeployed(); -``` - -#### SetGasPrice - -```solidity -event SetGasPrice(uint256, uint256); -``` - -#### SetGasCoin - -```solidity -event SetGasCoin(uint256, address); -``` - -#### SetGasZetaPool - -```solidity -event SetGasZetaPool(uint256, address); -``` - -#### SetWZeta - -```solidity -event SetWZeta(address); -``` - -#### SetConnectorZEVM - -```solidity -event SetConnectorZEVM(address); -``` - - - -## SystemContractErrors -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/SystemContract.sol) - -Custom errors for SystemContract - - -### Errors -#### CallerIsNotFungibleModule - -```solidity -error CallerIsNotFungibleModule(); -``` - -#### InvalidTarget - -```solidity -error InvalidTarget(); -``` - -#### CantBeIdenticalAddresses - -```solidity -error CantBeIdenticalAddresses(); -``` - -#### CantBeZeroAddress - -```solidity -error CantBeZeroAddress(); -``` - -#### ZeroAddress - -```solidity -error ZeroAddress(); -``` - - - -## WETH9 -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/WZETA.sol) - - -### State Variables -#### name - -```solidity -string public name = "Wrapped Ether" -``` - - -#### symbol - -```solidity -string public symbol = "WETH" -``` - - -#### decimals - -```solidity -uint8 public decimals = 18 -``` - - -#### balanceOf - -```solidity -mapping(address => uint256) public balanceOf -``` - - -#### allowance - -```solidity -mapping(address => mapping(address => uint256)) public allowance -``` - - -### Functions -#### receive - - -```solidity -receive() external payable; -``` - -#### deposit - - -```solidity -function deposit() public payable; -``` - -#### withdraw - - -```solidity -function withdraw(uint256 wad) public; -``` - -#### totalSupply - - -```solidity -function totalSupply() public view returns (uint256); -``` - -#### approve - - -```solidity -function approve(address guy, uint256 wad) public returns (bool); -``` - -#### transfer - - -```solidity -function transfer(address dst, uint256 wad) public returns (bool); -``` - -#### transferFrom - - -```solidity -function transferFrom(address src, address dst, uint256 wad) public returns (bool); -``` - -### Events -#### Approval - -```solidity -event Approval(address indexed src, address indexed guy, uint256 wad); -``` - -#### Transfer - -```solidity -event Transfer(address indexed src, address indexed dst, uint256 wad); -``` - -#### Deposit - -```solidity -event Deposit(address indexed dst, uint256 wad); -``` - -#### Withdrawal - -```solidity -event Withdrawal(address indexed src, uint256 wad); -``` - - - -## ZRC20 -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/ZRC20.sol) - - -### State Variables -#### FUNGIBLE_MODULE_ADDRESS -Fungible address is always the same, maintained at the protocol level - - -```solidity -address public constant FUNGIBLE_MODULE_ADDRESS = 0x735b14BB79463307AAcBED86DAf3322B1e6226aB -``` - - -#### CHAIN_ID -Chain id.abi - - -```solidity -uint256 public immutable CHAIN_ID -``` - - -#### COIN_TYPE -Coin type, checkout Interfaces.sol. - - -```solidity -CoinType public immutable COIN_TYPE -``` - - -#### SYSTEM_CONTRACT_ADDRESS -System contract address. - -Name is in upper case to maintain compatibility with ZRC20.sol v1 - - -```solidity -address public SYSTEM_CONTRACT_ADDRESS -``` - - -#### GAS_LIMIT -Gas limit. - -Name is in upper case to maintain compatibility with ZRC20.sol v1 - - -```solidity -uint256 public GAS_LIMIT -``` - - -#### PROTOCOL_FLAT_FEE -Protocol flat fee. - -Name is in upper case to maintain compatibility with ZRC20.sol v1 - - -```solidity -uint256 public override PROTOCOL_FLAT_FEE -``` - - -#### _balances - -```solidity -mapping(address => uint256) private _balances -``` - - -#### _allowances - -```solidity -mapping(address => mapping(address => uint256)) private _allowances -``` - - -#### _totalSupply - -```solidity -uint256 private _totalSupply -``` - - -#### _name - -```solidity -string private _name -``` - - -#### _symbol - -```solidity -string private _symbol -``` - - -#### _decimals - -```solidity -uint8 private _decimals -``` - - -#### gatewayAddress -Gateway contract address. - -This variable is added at last position to maintain storage layout with ZRC20.sol v1 - - -```solidity -address public gatewayAddress -``` - - -### Functions -#### _msgSender - - -```solidity -function _msgSender() internal view virtual returns (address); -``` - -#### onlyFungible - -Only fungible module modifier. - - -```solidity -modifier onlyFungible() ; -``` - -#### constructor - -The only one allowed to deploy new ZRC20 is fungible address. - - -```solidity -constructor( - string memory name_, - string memory symbol_, - uint8 decimals_, - uint256 chainid_, - CoinType coinType_, - uint256 gasLimit_, - address systemContractAddress_, - address gatewayAddress_ -) ; -``` - -#### name - -ZRC20 name - - -```solidity -function name() public view virtual override returns (string memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`string`|name as string| - - -#### setName - -Name can be updated by fungible module account. - - -```solidity -function setName(string memory newName) external override onlyFungible; -``` - -#### setSymbol - -Symbol can be updated by fungible module account. - - -```solidity -function setSymbol(string memory newSymbol) external override onlyFungible; -``` - -#### symbol - -ZRC20 symbol. - - -```solidity -function symbol() public view virtual override returns (string memory); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`string`|symbol as string.| - - -#### decimals - -ZRC20 decimals. - - -```solidity -function decimals() public view virtual override returns (uint8); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint8`|returns uint8 decimals.| - - -#### totalSupply - -ZRC20 total supply. - - -```solidity -function totalSupply() public view virtual override returns (uint256); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|returns uint256 total supply.| - - -#### balanceOf - -Returns ZRC20 balance of an account. - - -```solidity -function balanceOf(address account) public view virtual override returns (uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`account`|`address`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|uint256 account balance.| - - -#### transfer - -Returns ZRC20 balance of an account. - - -```solidity -function transfer(address recipient, uint256 amount) public virtual override returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`recipient`|`address`|| -|`amount`|`uint256`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|true/false if transfer succeeded/failed.| - - -#### allowance - -Returns token allowance from owner to spender. - - -```solidity -function allowance(address owner, address spender) public view virtual override returns (uint256); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`owner`|`address`|| -|`spender`|`address`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`uint256`|uint256 allowance.| - - -#### approve - -Approves amount transferFrom for spender. - - -```solidity -function approve(address spender, uint256 amount) public virtual override returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`spender`|`address`|| -|`amount`|`uint256`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|true/false if succeeded/failed.| - - -#### transferFrom - -Transfers tokens from sender to recipient. - - -```solidity -function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`sender`|`address`|| -|`recipient`|`address`|| -|`amount`|`uint256`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|true/false if succeeded/failed.| - - -#### burn - -Burns an amount of tokens. - - -```solidity -function burn(uint256 amount) external override returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`amount`|`uint256`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|true/false if succeeded/failed.| - - -#### _transfer - - -```solidity -function _transfer(address sender, address recipient, uint256 amount) internal virtual; -``` - -#### _mint - - -```solidity -function _mint(address account, uint256 amount) internal virtual; -``` - -#### _burn - - -```solidity -function _burn(address account, uint256 amount) internal virtual; -``` - -#### _approve - - -```solidity -function _approve(address owner, address spender, uint256 amount) internal virtual; -``` - -#### deposit - -Deposits corresponding tokens from external chain, only callable by Fungible module. - - -```solidity -function deposit(address to, uint256 amount) external override returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`address`|| -|`amount`|`uint256`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|true/false if succeeded/failed.| - - -#### withdrawGasFee - -Withdraws gas fees. - - -```solidity -function withdrawGasFee() public view override returns (address, uint256); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`address`|returns the ZRC20 address for gas on the same chain of this ZRC20, and calculates the gas fee for withdraw()| -|``|`uint256`|| - - -#### withdrawGasFeeWithGasLimit - -Withdraws gas fees with specified gasLimit - - -```solidity -function withdrawGasFeeWithGasLimit(uint256 gasLimit) public view override returns (address, uint256); -``` -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`address`|returns the ZRC20 address for gas on the same chain of this ZRC20, and calculates the gas fee for withdraw()| -|``|`uint256`|| - - -#### withdraw - -Withraws ZRC20 tokens to external chains, this function causes cctx module to send out outbound tx to the -outbound chain -this contract should be given enough allowance of the gas ZRC20 to pay for outbound tx gas fee. - - -```solidity -function withdraw(bytes memory to, uint256 amount) external override returns (bool); -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`to`|`bytes`|| -|`amount`|`uint256`|| - -**Returns** - -|Name|Type|Description| -|----|----|-----------| -|``|`bool`|true/false if succeeded/failed.| - - -#### updateSystemContractAddress - -Updates system contract address. Can only be updated by the fungible module. - - -```solidity -function updateSystemContractAddress(address addr) external onlyFungible; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`addr`|`address`|| - - -#### updateGatewayAddress - -Updates gateway contract address. Can only be updated by the fungible module. - - -```solidity -function updateGatewayAddress(address addr) external onlyFungible; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`addr`|`address`|| - - -#### updateGasLimit - -Updates gas limit. Can only be updated by the fungible module. - - -```solidity -function updateGasLimit(uint256 gasLimit_) external onlyFungible; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`gasLimit_`|`uint256`|| - - -#### updateProtocolFlatFee - -Updates protocol flat fee. Can only be updated by the fungible module. - - -```solidity -function updateProtocolFlatFee(uint256 protocolFlatFee_) external onlyFungible; -``` -**Parameters** - -|Name|Type|Description| -|----|----|-----------| -|`protocolFlatFee_`|`uint256`|| - - - - -## ZRC20Errors -[Git Source](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/ZRC20.sol) - -Custom errors for ZRC20 - - -### Errors -#### CallerIsNotFungibleModule - -```solidity -error CallerIsNotFungibleModule(); -``` - -#### InvalidSender - -```solidity -error InvalidSender(); -``` - -#### GasFeeTransferFailed - -```solidity -error GasFeeTransferFailed(); -``` - -#### ZeroGasCoin - -```solidity -error ZeroGasCoin(); -``` - -#### ZeroGasPrice - -```solidity -error ZeroGasPrice(); -``` - -#### LowAllowance - -```solidity -error LowAllowance(); -``` - -#### LowBalance - -```solidity -error LowBalance(); -``` - -#### ZeroAddress - -```solidity -error ZeroAddress(); -``` - diff --git a/src/pages/developers/protocol/evm.zh-CN.md b/src/pages/developers/protocol/evm.zh-CN.md deleted file mode 100644 index 2dfa66be3..000000000 --- a/src/pages/developers/protocol/evm.zh-CN.md +++ /dev/null @@ -1,492 +0,0 @@ - - -## GatewayEVM -[源码链接](https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/evm/GatewayEVM.sol) - -`GatewayEVM` 合约是外部链调用智能合约的入口。 - -*合约本身不持有资金,也不应被授予任何额度。* - - -### 状态变量 -#### custody -托管合约地址。 - -```solidity -address public custody; -``` - -#### tssAddress -TSS(阈值签名方案)地址。 - -```solidity -address public tssAddress; -``` - -#### zetaConnector -`ZetaConnector` 合约地址。 - -```solidity -address public zetaConnector; -``` - -#### zetaToken -Zeta 代币合约地址。 - -```solidity -address public zetaToken; -``` - -#### additionalActionFeeWei -同一笔交易中跨链动作的额外手续费。 - -*同一交易中的第一个动作免费,之后的动作需支付该费用。* - -*管理员可调节该费用以适配网络状况。* - -```solidity -uint256 public additionalActionFeeWei; -``` - -#### TSS_ROLE -TSS 角色标识。 - -```solidity -bytes32 public constant TSS_ROLE = keccak256("TSS_ROLE"); -``` - -#### ASSET_HANDLER_ROLE -资产处理角色标识。 - -```solidity -bytes32 public constant ASSET_HANDLER_ROLE = keccak256("ASSET_HANDLER_ROLE"); -``` - -#### PAUSER_ROLE -暂停角色标识。 - -```solidity -bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); -``` - -#### MAX_PAYLOAD_SIZE -payload 与 `revertOptions` 中 revert message 的最大尺寸。 - -```solidity -uint256 public constant MAX_PAYLOAD_SIZE = 2880; -``` - -#### _TRANSACTION_ACTION_COUNT_KEY -记录交易动作数量的存储槽键位。 - -*使用 transient storage(tload/tstore)以节省 gas。* - -```solidity -uint256 private constant _TRANSACTION_ACTION_COUNT_KEY = 0x01; -``` - -### 函数 -#### constructor - -```solidity -constructor(); -``` - -#### initialize -初始化 TSS 地址、Zeta 代币地址,并将管理员账户设为 `DEFAULT_ADMIN_ROLE`。管理员负责升级与暂停,TSS 承担 TSS 角色。 - -```solidity -function initialize(address tssAddress_, address zetaToken_, address admin_) public initializer; -``` - -#### _authorizeUpgrade -授权合约升级,调用者必须具备管理员权限。 - -```solidity -function _authorizeUpgrade(address newImplementation) internal override onlyRole(DEFAULT_ADMIN_ROLE); -``` - -|参数|类型|说明| -|----|----|----| -|`newImplementation`|`address`|新实现合约地址| - -#### updateTSSAddress -更新 TSS 地址。 - -```solidity -function updateTSSAddress(address newTSSAddress) external onlyRole(DEFAULT_ADMIN_ROLE); -``` - -|参数|类型|说明| -|----|----|----| -|`newTSSAddress`|`address`|新的 TSS 地址| - -#### pause -暂停合约。 - -```solidity -function pause() external onlyRole(PAUSER_ROLE); -``` - -#### unpause -恢复合约。 - -```solidity -function unpause() external onlyRole(PAUSER_ROLE); -``` - -#### updateAdditionalActionFee -调整额外动作费用。 - -*仅管理员可调用,可根据网络情况调节。* - -*设置为 0 时,额外动作费用功能被禁用。* - -```solidity -function updateAdditionalActionFee(uint256 newFeeWei) external onlyRole(DEFAULT_ADMIN_ROLE); -``` - -|参数|类型|说明| -|----|----|----| -|`newFeeWei`|`uint256`|新的额外动作费用(wei)| - -#### executeRevert -向目标合约转移 `msg.value` 并执行其 `onRevert`,仅 TSS 可调用,可支付。 - -```solidity -function executeRevert( - address destination, - bytes calldata data, - RevertContext calldata revertContext -) - public - payable - nonReentrant - onlyRole(TSS_ROLE) - whenNotPaused; -``` - -|参数|类型|说明| -|----|----|----| -|`destination`|`address`|目标合约地址| -|`data`|`bytes`|Calldata| -|`revertContext`|`RevertContext`|回退上下文| - -#### execute -向目标地址发起普通调用,不包含 ERC20 转账。仅 TSS 可调用,可支付。 - -```solidity -function execute( - MessageContext calldata messageContext, - address destination, - bytes calldata data -) - external - payable - nonReentrant - onlyRole(TSS_ROLE) - whenNotPaused - returns (bytes memory); -``` - -|参数|类型|说明| -|----|----|----| -|`messageContext`|`MessageContext`|跨链消息上下文| -|`destination`|`address`|目标地址| -|`data`|`bytes`|Calldata| - -|返回值|类型|说明| -|----|----|----| -|``|`bytes`|调用返回值| - -#### executeWithERC20 -使用 ERC20 代币执行调用。仅资产处理角色可调用,使用 ERC20 allowance,结束时会重置授权。 - -```solidity -function executeWithERC20( - MessageContext calldata messageContext, - address token, - address to, - uint256 amount, - bytes calldata data -) - public - nonReentrant - onlyRole(ASSET_HANDLER_ROLE) - whenNotPaused; -``` - -|参数|类型|说明| -|----|----|----| -|`messageContext`|`MessageContext`|消息上下文| -|`token`|`address`|ERC20 代币地址| -|`to`|`address`|目标合约地址| -|`amount`|`uint256`|转账数量| -|`data`|`bytes`|Calldata| - -#### revertWithERC20 -直接转移 ERC20 并调用 `onRevert`。仅资产处理角色可调用。 - -```solidity -function revertWithERC20( - address token, - address to, - uint256 amount, - bytes calldata data, - RevertContext calldata revertContext -) - external - nonReentrant - onlyRole(ASSET_HANDLER_ROLE) - whenNotPaused; -``` - -|参数|类型|说明| -|----|----|----| -|`token`|`address`|ERC20 地址| -|`to`|`address`|目标地址| -|`amount`|`uint256`|数量| -|`data`|`bytes`|Calldata| -|`revertContext`|`RevertContext`|回退上下文| - -#### deposit (ETH,第一个动作) -向 TSS 地址存入 ETH 并调用全链合约,仅适用于交易中的第一个动作。 - -```solidity -function deposit(address receiver, RevertOptions calldata revertOptions) external payable whenNotPaused; -``` - -|参数|类型|说明| -|----|----|----| -|`receiver`|`address`|接收地址| -|`revertOptions`|`RevertOptions`|回退选项| - -#### deposit (ETH,指定金额) -向 TSS 地址存入指定 ETH,`msg.value` = `amount + fee`。 - -```solidity -function deposit( - address receiver, - uint256 amount, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` - -|参数|类型|说明| -|----|----|----| -|`receiver`|`address`|接收地址| -|`amount`|`uint256`|存入金额(不含费用)| -|`revertOptions`|`RevertOptions`|回退选项| - -#### deposit (ERC20) -向托管或连接器合约存入 ERC20。 - -```solidity -function deposit( - address receiver, - uint256 amount, - address asset, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` - -|参数|类型|说明| -|----|----|----| -|`receiver`|`address`|接收地址| -|`amount`|`uint256`|存入数量| -|`asset`|`address`|ERC20 地址| -|`revertOptions`|`RevertOptions`|回退选项| - -#### depositAndCall (ETH,第一个动作) -向 TSS 存入 ETH 并调用全链合约,仅限第一个动作。 - -```solidity -function depositAndCall( - address receiver, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` - -#### depositAndCall (ETH,指定金额) -向 TSS 存入指定 ETH 并调用合约,`msg.value` = `amount + fee`。 - -```solidity -function depositAndCall( - address receiver, - uint256 amount, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` - -#### depositAndCall (ERC20) -向托管/连接器存入 ERC20 并调用全链合约。 - -```solidity -function depositAndCall( - address receiver, - uint256 amount, - address asset, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` - -#### call -不转移资产的跨链调用。 - -```solidity -function call( - address receiver, - bytes calldata payload, - RevertOptions calldata revertOptions -) - external - payable - whenNotPaused; -``` - -#### setCustody -设置托管合约地址。 - -```solidity -function setCustody(address custody_) external onlyRole(DEFAULT_ADMIN_ROLE); -``` - -#### setConnector -设置连接器合约地址。 - -```solidity -function setConnector(address zetaConnector_) external onlyRole(DEFAULT_ADMIN_ROLE); -``` - -#### _resetApproval -重置指定地址的代币授权,确保先清零再设置新值。 - -```solidity -function _resetApproval(address token, address to) private returns (bool); -``` - -#### _transferFromToAssetHandler / _transferToAssetHandler -内部函数,用于将代币转移给资产处理者(连接器或托管合约),代码略。 - -#### _executeArbitraryCall / _executeAuthenticatedCall -内部函数,执行任意或认证调用。 - -#### _revertIfOnCallOrOnRevert -确保内部调用不会在 `onCall` / `onRevert` 执行中再次触发。 - -#### _processFee -处理跨链动作手续费:首个动作免费,之后动作收取 `ADDITIONAL_ACTION_FEE_WEI`。若费用为 0 会 revert。 - -#### _validateChargedFeeForERC20 / _validateChargedFeeForETHWithAmount -校验 ERC20 或 ETH 操作的费用是否正确。 - -#### _getNextActionIndex -使用 transient storage 获取并自增交易动作计数。 - - -## GatewayZEVM -[源码链接](https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/zevm/GatewayZEVM.sol) - -`GatewayZEVM` 合约是调用全链合约的入口。 - -*合约本身不持有资金,也不应被授予额度。* - -### 状态变量 -- `PROTOCOL_ADDRESS`:协议常量地址。 -- `PAUSER_ROLE`:暂停角色。 -- `zetaToken`:Zeta 代币地址。 -- `registry`:ZetaChain 上的注册表地址。 - -### 核心函数 -- `initialize`:初始化 Zeta 代币地址与管理员。 -- `pause` / `unpause`:暂停与恢复。 -- `setRegistryAddress`:配置注册表地址。 -- `_safeTransferFrom` / `_safeBurn` / `_safeDeposit`:内部安全操作。 -- `_burnProtocolFees`、`_burnZRC20ProtocolFees`、`_withdrawZRC20WithGasLimit`:费用结算与提现辅助。 -- `withdraw` / `withdrawAndCall` / `call`:向外部链提现或调用合约。 -- `execute` / `depositAndCall`:协议在 ZEVM 上执行/存入并调用用户合约。 -- `executeRevert` / `depositAndRevert` / `executeAbort`:回退与中止流程。 -- `getMaxMessageSize` / `getMinGasLimit` / `getMaxRevertGasLimit`:查询限制参数。 - - -## INotSupportedMethods -[源码链接](https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/Errors.sol) - -定义不支持的方法错误。 - -### 错误 -- `CallOnRevertNotSupported()`:调用不支持 `callOnRevert`。 - - -## ERC20Custody -[源码链接](https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/evm/ERC20Custody.sol) - -托管存入 ZetaChain 的 ERC20,并通过 Gateway 调用合约。 - -*该合约不会直接调用外部合约,所有调用均经由 Gateway。* - -### 状态变量 -- `gateway`:Gateway 接口。 -- `whitelisted`:白名单映射。 -- `tssAddress`:TSS 地址。 -- `supportsLegacy`:是否支持 Legacy 接口。 -- 角色:`PAUSER_ROLE`、`WITHDRAWER_ROLE`、`WHITELISTER_ROLE`。 - -### 核心函数 -- `initialize`:初始化 Gateway、TSS 与管理员角色。 -- `pause` / `unpause`:暂停控制。 -- `updateTSSAddress`:更新 TSS。 -- `setSupportsLegacy`:配置 Legacy 支持。 -- `whitelist` / `unwhitelist`:管理白名单。 -- `withdraw` / `withdrawAndCall` / `withdrawAndRevert`:提现与调用。 -- `deposit`:Legacy 存入(已弃用)。 - - -## IERC20Custody -[源码链接](https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/evm/interfaces/IERC20Custody.sol) - -### 函数 -- `whitelisted(address token)`:查询是否在白名单。 -- `withdraw(address token, address to, uint256 amount)`:直接提现。 -- `withdrawAndCall`:提现并通过 Gateway 调用。 -- `withdrawAndRevert`:提现并带回退逻辑。 - - -## IERC20CustodyErrors -[源码链接](https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/evm/interfaces/IERC20Custody.sol) - -接口错误定义: -- `ZeroAddress()`:地址为零。 -- `NotWhitelisted()`:代币未在白名单。 -- `LegacyMethodsNotSupported()`:调用不支持的旧方法。 - - -## IERC20CustodyEvents -[源码链接](https://github.com/zeta-chain/protocol-contracts/blob/main/contracts/evm/interfaces/IERC20Custody.sol) - -事件定义: -- `Withdrawn`:提现事件。 -- `WithdrawnAndCalled`:提现并调用。 -- `WithdrawnAndReverted`:提现并回退调用。 -- `Whitelisted` / `Unwhitelisted`:白名单变更。 -- `Deposited`:Legacy 存入事件。 -- `UpdatedCustodyTSSAddress`:TSS 更新事件。 - diff --git a/src/pages/developers/protocol/solana.en-US.md b/src/pages/developers/protocol/solana.en-US.md deleted file mode 100644 index 197e8c233..000000000 --- a/src/pages/developers/protocol/solana.en-US.md +++ /dev/null @@ -1,2426 +0,0 @@ -# Crate Documentation - -**Version:** 0.1.0 - -**Format Version:** 41 - -# Module `gateway` - -## Modules - -## Module `program` - -Module representing the program. - -```rust -pub mod program { /* ... */ } -``` - -### Types - -#### Struct `Gateway` - -Type representing the program. - -```rust -pub struct Gateway; -``` - -##### Implementations - -###### Trait Implementations - -- **Freeze** -- **Send** -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **Unpin** -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **RefUnwindSafe** -- **Sync** -- **UnwindSafe** -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **Same** -- **Clone** - - ```rust - fn clone(self: &Self) -> Gateway { /* ... */ } - ``` - -- **CloneToUninit** - - ```rust - unsafe fn clone_to_uninit(self: &Self, dst: *mut u8) { /* ... */ } - ``` - -- **IntoEither** -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **Id** - - ```rust - fn id() -> Pubkey { /* ... */ } - ``` - -- **ToOwned** - - ```rust - fn to_owned(self: &Self) -> T { /* ... */ } - ``` - - - ```rust - fn clone_into(self: &Self, target: &mut T) { /* ... */ } - ``` - -## Module `gateway` - -```rust -pub mod gateway { /* ... */ } -``` - -### Functions - -#### Function `initialize` - -Initializes the gateway PDA. - - -Arguments: - -* `ctx` - The instruction context. -* `tss_address` - The Ethereum TSS address (20 bytes). -* `chain_id` - The chain ID associated with the PDA. - -```rust -pub fn initialize(ctx: Context<''_, ''_, ''_, ''_, Initialize<''_>>, tss_address: [u8; 20], chain_id: u64) -> Result<()> { /* ... */ } -``` - -#### Function `increment_nonce` - -Increments nonce, used by TSS in case outbound fails. - -Arguments: - -* `ctx` - The instruction context. -* `amount` - The amount in original outbound. -* `signature` - The TSS signature. -* `recovery_id` - The recovery ID for signature verification. -* `message_hash` - Message hash for signature verification. -* `nonce` - The current nonce value. - -```rust -pub fn increment_nonce(ctx: Context<''_, ''_, ''_, ''_, IncrementNonce<''_>>, amount: u64, signature: [u8; 64], recovery_id: u8, message_hash: [u8; 32], nonce: u64) -> Result<()> { /* ... */ } -``` - -#### Function `execute` - -Withdraws amount to destination program pda, and calls on_call on destination program - -Arguments: - -* `ctx` - The instruction context. -* `amount` - Amount of SOL to transfer. -* `sender` - Sender's address. -* `data` - Arbitrary data to pass to the destination program. -* `signature` - Signature of the message. -* `recovery_id` - Recovery ID of the signature. -* `message_hash` - Hash of the message. -* `nonce` - Nonce of the message. - -```rust -pub fn execute(ctx: Context<''_, ''_, ''_, ''_, Execute<''_>>, amount: u64, sender: [u8; 20], data: Vec, signature: [u8; 64], recovery_id: u8, message_hash: [u8; 32], nonce: u64) -> Result<()> { /* ... */ } -``` - -#### Function `execute_revert` - -Withdraws amount to destination program pda, and calls on_revert on destination program - - -Arguments: - -* `ctx` - The instruction context. -* `amount` - The amount of SOL to withdraw. -* `sender` - Sender from ZEVM. -* `data` - Data to pass to destination program. -* `signature` - The TSS signature. -* `recovery_id` - The recovery ID for signature verification. -* `message_hash` - Message hash for signature verification. -* `nonce` - The current nonce value. - -```rust -pub fn execute_revert(ctx: Context<''_, ''_, ''_, ''_, Execute<''_>>, amount: u64, sender: Pubkey, data: Vec, signature: [u8; 64], recovery_id: u8, message_hash: [u8; 32], nonce: u64) -> Result<()> { /* ... */ } -``` - -#### Function `execute_spl_token` - -Withdraws amount of SPL tokens to destination program pda, and calls on_call on destination program - -Arguments: - -* `ctx` - The instruction context. -* `decimals` - Token decimals for precision. -* `amount` - The amount of tokens to withdraw. -* `sender` - Sender from ZEVM. -* `data` - Data to pass to destination program. -* `signature` - The TSS signature. -* `recovery_id` - The recovery ID for signature verification. -* `message_hash` - Message hash for signature verification. -* `nonce` - The current nonce value. - -```rust -pub fn execute_spl_token(ctx: Context<''_, ''_, ''_, ''_, ExecuteSPLToken<''_>>, decimals: u8, amount: u64, sender: [u8; 20], data: Vec, signature: [u8; 64], recovery_id: u8, message_hash: [u8; 32], nonce: u64) -> Result<()> { /* ... */ } -``` - -#### Function `execute_spl_token_revert` - -Withdraws SPL token amount to destination program pda, and calls on_revert on destination program - - -Arguments: - -* `ctx` - The instruction context. -* `decimals` - Token decimals for precision. -* `amount` - The amount of tokens to withdraw. -* `sender` - Sender from ZEVM. -* `data` - Data to pass to destination program. -* `signature` - The TSS signature. -* `recovery_id` - The recovery ID for signature verification. -* `message_hash` - Message hash for signature verification. -* `nonce` - The current nonce value. - -```rust -pub fn execute_spl_token_revert(ctx: Context<''_, ''_, ''_, ''_, ExecuteSPLToken<''_>>, decimals: u8, amount: u64, sender: Pubkey, data: Vec, signature: [u8; 64], recovery_id: u8, message_hash: [u8; 32], nonce: u64) -> Result<()> { /* ... */ } -``` - -#### Function `set_deposit_paused` - -Pauses or unpauses deposits. Caller is authority stored in PDA. - -Arguments: - -* `ctx` - The instruction context. -* `deposit_paused` - Boolean flag to pause or unpause deposits. - -```rust -pub fn set_deposit_paused(ctx: Context<''_, ''_, ''_, ''_, UpdatePaused<''_>>, deposit_paused: bool) -> Result<()> { /* ... */ } -``` - -#### Function `update_tss` - -Updates the TSS address. Caller is authority stored in PDA. - -Arguments: - -* `ctx` - The instruction context. -* `tss_address` - The new Ethereum TSS address (20 bytes). - -```rust -pub fn update_tss(ctx: Context<''_, ''_, ''_, ''_, UpdateTss<''_>>, tss_address: [u8; 20]) -> Result<()> { /* ... */ } -``` - -#### Function `update_authority` - -Updates the PDA authority. Caller is authority stored in PDA. - -Arguments: - -* `ctx` - The instruction context. -* `new_authority_address` - The new authority's public key. - -```rust -pub fn update_authority(ctx: Context<''_, ''_, ''_, ''_, UpdateAuthority<''_>>, new_authority_address: Pubkey) -> Result<()> { /* ... */ } -``` - -#### Function `reset_nonce` - -Resets the PDA nonce. Caller is authority stored in PDA. - - -Arguments: - -* `ctx` - The instruction context. -* `new_nonce` - The new nonce. - -```rust -pub fn reset_nonce(ctx: Context<''_, ''_, ''_, ''_, ResetNonce<''_>>, new_nonce: u64) -> Result<()> { /* ... */ } -``` - -#### Function `whitelist_spl_mint` - -Whitelists a new SPL token. Caller is TSS. - -Arguments: - -* `ctx` - The instruction context. -* `signature` - The TSS signature. -* `recovery_id` - The recovery ID for signature verification. -* `message_hash` - Message hash for signature verification. -* `nonce` - The current nonce value. - -```rust -pub fn whitelist_spl_mint(ctx: Context<''_, ''_, ''_, ''_, Whitelist<''_>>, signature: [u8; 64], recovery_id: u8, message_hash: [u8; 32], nonce: u64) -> Result<()> { /* ... */ } -``` - -#### Function `unwhitelist_spl_mint` - -Unwhitelists an SPL token. Caller is TSS. - -Arguments: - -* `ctx` - The instruction context. -* `signature` - The TSS signature. -* `recovery_id` - The recovery ID for signature verification. -* `message_hash` - Message hash for signature verification. -* `nonce` - The current nonce value. - -```rust -pub fn unwhitelist_spl_mint(ctx: Context<''_, ''_, ''_, ''_, Unwhitelist<''_>>, signature: [u8; 64], recovery_id: u8, message_hash: [u8; 32], nonce: u64) -> Result<()> { /* ... */ } -``` - -#### Function `deposit` - -Deposits SOL into the program and credits the `receiver` on ZetaChain zEVM. - -Arguments: - -* `ctx` - The instruction context. -* `amount` - The amount of lamports to deposit. -* `receiver` - The Ethereum address of the receiver on ZetaChain zEVM. -* `revert_options` - The revert options created by the caller. - -```rust -pub fn deposit(ctx: Context<''_, ''_, ''_, ''_, Deposit<''_>>, amount: u64, receiver: [u8; 20], revert_options: Option) -> Result<()> { /* ... */ } -``` - -#### Function `deposit_and_call` - -Deposits SOL and calls a contract on ZetaChain zEVM. - -Arguments: - -* `ctx` - The instruction context. -* `amount` - The amount of lamports to deposit. -* `receiver` - The Ethereum address of the receiver on ZetaChain zEVM. -* `message` - The message passed to the contract. -* `revert_options` - The revert options created by the caller. - -```rust -pub fn deposit_and_call(ctx: Context<''_, ''_, ''_, ''_, Deposit<''_>>, amount: u64, receiver: [u8; 20], message: Vec, revert_options: Option) -> Result<()> { /* ... */ } -``` - -#### Function `deposit_spl_token` - -Deposits SPL tokens and credits the `receiver` on ZetaChain zEVM. - -Arguments: - -* `ctx` - The instruction context. -* `amount` - The amount of SPL tokens to deposit. -* `receiver` - The Ethereum address of the receiver on ZetaChain zEVM. -* `revert_options` - The revert options created by the caller. - -```rust -pub fn deposit_spl_token(ctx: Context<''_, ''_, ''_, ''_, DepositSplToken<''_>>, amount: u64, receiver: [u8; 20], revert_options: Option) -> Result<()> { /* ... */ } -``` - -#### Function `deposit_spl_token_and_call` - -Deposits SPL tokens and calls a contract on ZetaChain zEVM. - -Arguments: - -* `ctx` - The instruction context. -* `amount` - The amount of SPL tokens to deposit. -* `receiver` - The Ethereum address of the receiver on ZetaChain zEVM. -* `message` - The message passed to the contract. -* `revert_options` - The revert options created by the caller. - -```rust -pub fn deposit_spl_token_and_call(ctx: Context<''_, ''_, ''_, ''_, DepositSplToken<''_>>, amount: u64, receiver: [u8; 20], message: Vec, revert_options: Option) -> Result<()> { /* ... */ } -``` - -#### Function `call` - -Calls a contract on ZetaChain zEVM. - -Arguments: - -* `receiver` - The Ethereum address of the receiver on ZetaChain zEVM. -* `message` - The message passed to the contract. -* `revert_options` - The revert options created by the caller. - -```rust -pub fn call(ctx: Context<''_, ''_, ''_, ''_, Call<''_>>, receiver: [u8; 20], message: Vec, revert_options: Option) -> Result<()> { /* ... */ } -``` - -#### Function `withdraw` - -Withdraws SOL. Caller is TSS. - -Arguments: - -* `ctx` - The instruction context. -* `amount` - The amount of SOL to withdraw. -* `signature` - The TSS signature. -* `recovery_id` - The recovery ID for signature verification. -* `message_hash` - Message hash for signature verification. -* `nonce` - The current nonce value. - -```rust -pub fn withdraw(ctx: Context<''_, ''_, ''_, ''_, Withdraw<''_>>, amount: u64, signature: [u8; 64], recovery_id: u8, message_hash: [u8; 32], nonce: u64) -> Result<()> { /* ... */ } -``` - -#### Function `withdraw_spl_token` - -Withdraws SPL tokens. Caller is TSS. - -Arguments: - -* `ctx` - The instruction context. -* `decimals` - Token decimals for precision. -* `amount` - The amount of tokens to withdraw. -* `signature` - The TSS signature. -* `recovery_id` - The recovery ID for signature verification. -* `message_hash` - Message hash for signature verification. -* `nonce` - The current nonce value. - -```rust -pub fn withdraw_spl_token(ctx: Context<''_, ''_, ''_, ''_, WithdrawSPLToken<''_>>, decimals: u8, amount: u64, signature: [u8; 64], recovery_id: u8, message_hash: [u8; 32], nonce: u64) -> Result<()> { /* ... */ } -``` - -## Module `instruction` - -An Anchor generated module containing the program's set of -instructions, where each method handler in the `#[program]` mod is -associated with a struct defining the input arguments to the -method. These should be used directly, when one wants to serialize -Anchor instruction data, for example, when speciying -instructions on a client. - -```rust -pub mod instruction { /* ... */ } -``` - -### Types - -#### Struct `Initialize` - -Instruction. - -```rust -pub struct Initialize { - pub tss_address: [u8; 20], - pub chain_id: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `tss_address` | `[u8; 20]` | | -| `chain_id` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **InstructionData** -- **Freeze** -- **UnwindSafe** -- **RefUnwindSafe** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **Sync** -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **IntoEither** -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **Discriminator** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **Same** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Unpin** -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **Send** -#### Struct `IncrementNonce` - -Instruction. - -```rust -pub struct IncrementNonce { - pub amount: u64, - pub signature: [u8; 64], - pub recovery_id: u8, - pub message_hash: [u8; 32], - pub nonce: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `amount` | `u64` | | -| `signature` | `[u8; 64]` | | -| `recovery_id` | `u8` | | -| `message_hash` | `[u8; 32]` | | -| `nonce` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **Same** -- **Send** -- **Unpin** -- **RefUnwindSafe** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **Freeze** -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **IntoEither** -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **Discriminator** -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **UnwindSafe** -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Sync** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **InstructionData** -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -#### Struct `Execute` - -Instruction. - -```rust -pub struct Execute { - pub amount: u64, - pub sender: [u8; 20], - pub data: Vec, - pub signature: [u8; 64], - pub recovery_id: u8, - pub message_hash: [u8; 32], - pub nonce: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `amount` | `u64` | | -| `sender` | `[u8; 20]` | | -| `data` | `Vec` | | -| `signature` | `[u8; 64]` | | -| `recovery_id` | `u8` | | -| `message_hash` | `[u8; 32]` | | -| `nonce` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **IntoEither** -- **Same** -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **Discriminator** -- **RefUnwindSafe** -- **Freeze** -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **Unpin** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **UnwindSafe** -- **Sync** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **Send** -- **InstructionData** -#### Struct `ExecuteRevert` - -Instruction. - -```rust -pub struct ExecuteRevert { - pub amount: u64, - pub sender: Pubkey, - pub data: Vec, - pub signature: [u8; 64], - pub recovery_id: u8, - pub message_hash: [u8; 32], - pub nonce: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `amount` | `u64` | | -| `sender` | `Pubkey` | | -| `data` | `Vec` | | -| `signature` | `[u8; 64]` | | -| `recovery_id` | `u8` | | -| `message_hash` | `[u8; 32]` | | -| `nonce` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **Same** -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **Sync** -- **InstructionData** -- **UnwindSafe** -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **Freeze** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Discriminator** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Unpin** -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **RefUnwindSafe** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **IntoEither** -- **Send** -#### Struct `ExecuteSplToken` - -Instruction. - -```rust -pub struct ExecuteSplToken { - pub decimals: u8, - pub amount: u64, - pub sender: [u8; 20], - pub data: Vec, - pub signature: [u8; 64], - pub recovery_id: u8, - pub message_hash: [u8; 32], - pub nonce: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `decimals` | `u8` | | -| `amount` | `u64` | | -| `sender` | `[u8; 20]` | | -| `data` | `Vec` | | -| `signature` | `[u8; 64]` | | -| `recovery_id` | `u8` | | -| `message_hash` | `[u8; 32]` | | -| `nonce` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **Same** -- **Send** -- **Sync** -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **IntoEither** -- **Unpin** -- **Freeze** -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **InstructionData** -- **RefUnwindSafe** -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **UnwindSafe** -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **Discriminator** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -#### Struct `ExecuteSplTokenRevert` - -Instruction. - -```rust -pub struct ExecuteSplTokenRevert { - pub decimals: u8, - pub amount: u64, - pub sender: Pubkey, - pub data: Vec, - pub signature: [u8; 64], - pub recovery_id: u8, - pub message_hash: [u8; 32], - pub nonce: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `decimals` | `u8` | | -| `amount` | `u64` | | -| `sender` | `Pubkey` | | -| `data` | `Vec` | | -| `signature` | `[u8; 64]` | | -| `recovery_id` | `u8` | | -| `message_hash` | `[u8; 32]` | | -| `nonce` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **UnwindSafe** -- **RefUnwindSafe** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **Unpin** -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Same** -- **Discriminator** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **InstructionData** -- **Freeze** -- **IntoEither** -- **Send** -- **Sync** -#### Struct `SetDepositPaused` - -Instruction. - -```rust -pub struct SetDepositPaused { - pub deposit_paused: bool, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `deposit_paused` | `bool` | | - -##### Implementations - -###### Trait Implementations - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **Send** -- **Freeze** -- **Unpin** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **UnwindSafe** -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **Discriminator** -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Same** -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **Sync** -- **IntoEither** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **InstructionData** -- **RefUnwindSafe** -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -#### Struct `UpdateTss` - -Instruction. - -```rust -pub struct UpdateTss { - pub tss_address: [u8; 20], -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `tss_address` | `[u8; 20]` | | - -##### Implementations - -###### Trait Implementations - -- **Same** -- **InstructionData** -- **Unpin** -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **Discriminator** -- **Freeze** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **Send** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **Sync** -- **IntoEither** -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **UnwindSafe** -- **RefUnwindSafe** -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -#### Struct `UpdateAuthority` - -Instruction. - -```rust -pub struct UpdateAuthority { - pub new_authority_address: Pubkey, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `new_authority_address` | `Pubkey` | | - -##### Implementations - -###### Trait Implementations - -- **Send** -- **UnwindSafe** -- **RefUnwindSafe** -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **Sync** -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **Same** -- **Freeze** -- **Unpin** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **IntoEither** -- **Discriminator** -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **InstructionData** -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -#### Struct `ResetNonce` - -Instruction. - -```rust -pub struct ResetNonce { - pub new_nonce: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `new_nonce` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **Same** -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **IntoEither** -- **Freeze** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **UnwindSafe** -- **RefUnwindSafe** -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **InstructionData** -- **Sync** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Unpin** -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **Send** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **Discriminator** -#### Struct `WhitelistSplMint` - -Instruction. - -```rust -pub struct WhitelistSplMint { - pub signature: [u8; 64], - pub recovery_id: u8, - pub message_hash: [u8; 32], - pub nonce: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `signature` | `[u8; 64]` | | -| `recovery_id` | `u8` | | -| `message_hash` | `[u8; 32]` | | -| `nonce` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **UnwindSafe** -- **Discriminator** -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **Same** -- **RefUnwindSafe** -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **Send** -- **InstructionData** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Freeze** -- **Unpin** -- **IntoEither** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **Sync** -#### Struct `UnwhitelistSplMint` - -Instruction. - -```rust -pub struct UnwhitelistSplMint { - pub signature: [u8; 64], - pub recovery_id: u8, - pub message_hash: [u8; 32], - pub nonce: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `signature` | `[u8; 64]` | | -| `recovery_id` | `u8` | | -| `message_hash` | `[u8; 32]` | | -| `nonce` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Send** -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **Unpin** -- **Same** -- **Discriminator** -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **IntoEither** -- **Freeze** -- **Sync** -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **InstructionData** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **RefUnwindSafe** -- **UnwindSafe** -#### Struct `Deposit` - -Instruction. - -```rust -pub struct Deposit { - pub amount: u64, - pub receiver: [u8; 20], - pub revert_options: Option, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `amount` | `u64` | | -| `receiver` | `[u8; 20]` | | -| `revert_options` | `Option` | | - -##### Implementations - -###### Trait Implementations - -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **RefUnwindSafe** -- **Unpin** -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **Discriminator** -- **InstructionData** -- **Freeze** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **UnwindSafe** -- **Sync** -- **Send** -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **IntoEither** -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **Same** -#### Struct `DepositAndCall` - -Instruction. - -```rust -pub struct DepositAndCall { - pub amount: u64, - pub receiver: [u8; 20], - pub message: Vec, - pub revert_options: Option, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `amount` | `u64` | | -| `receiver` | `[u8; 20]` | | -| `message` | `Vec` | | -| `revert_options` | `Option` | | - -##### Implementations - -###### Trait Implementations - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **Sync** -- **UnwindSafe** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **Discriminator** -- **Freeze** -- **Same** -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **IntoEither** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **InstructionData** -- **RefUnwindSafe** -- **Send** -- **Unpin** -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -#### Struct `DepositSplToken` - -Instruction. - -```rust -pub struct DepositSplToken { - pub amount: u64, - pub receiver: [u8; 20], - pub revert_options: Option, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `amount` | `u64` | | -| `receiver` | `[u8; 20]` | | -| `revert_options` | `Option` | | - -##### Implementations - -###### Trait Implementations - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **Sync** -- **Discriminator** -- **Freeze** -- **IntoEither** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **RefUnwindSafe** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **Same** -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **Send** -- **InstructionData** -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **UnwindSafe** -- **Unpin** -#### Struct `DepositSplTokenAndCall` - -Instruction. - -```rust -pub struct DepositSplTokenAndCall { - pub amount: u64, - pub receiver: [u8; 20], - pub message: Vec, - pub revert_options: Option, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `amount` | `u64` | | -| `receiver` | `[u8; 20]` | | -| `message` | `Vec` | | -| `revert_options` | `Option` | | - -##### Implementations - -###### Trait Implementations - -- **Freeze** -- **Discriminator** -- **Sync** -- **Unpin** -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **RefUnwindSafe** -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **UnwindSafe** -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **InstructionData** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **Send** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **IntoEither** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **Same** -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -#### Struct `Call` - -Instruction. - -```rust -pub struct Call { - pub receiver: [u8; 20], - pub message: Vec, - pub revert_options: Option, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `receiver` | `[u8; 20]` | | -| `message` | `Vec` | | -| `revert_options` | `Option` | | - -##### Implementations - -###### Trait Implementations - -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **Freeze** -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **Send** -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **Sync** -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **IntoEither** -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **Discriminator** -- **InstructionData** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Same** -- **Unpin** -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **RefUnwindSafe** -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **UnwindSafe** -#### Struct `Withdraw` - -Instruction. - -```rust -pub struct Withdraw { - pub amount: u64, - pub signature: [u8; 64], - pub recovery_id: u8, - pub message_hash: [u8; 32], - pub nonce: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `amount` | `u64` | | -| `signature` | `[u8; 64]` | | -| `recovery_id` | `u8` | | -| `message_hash` | `[u8; 32]` | | -| `nonce` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **Same** -- **Unpin** -- **Send** -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **UnwindSafe** -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **IntoEither** -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **InstructionData** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **Freeze** -- **Sync** -- **RefUnwindSafe** -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **Discriminator** -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -#### Struct `WithdrawSplToken` - -Instruction. - -```rust -pub struct WithdrawSplToken { - pub decimals: u8, - pub amount: u64, - pub signature: [u8; 64], - pub recovery_id: u8, - pub message_hash: [u8; 32], - pub nonce: u64, -} -``` - -##### Fields - -| Name | Type | Documentation | -|------|------|---------------| -| `decimals` | `u8` | | -| `amount` | `u64` | | -| `signature` | `[u8; 64]` | | -| `recovery_id` | `u8` | | -| `message_hash` | `[u8; 32]` | | -| `nonce` | `u64` | | - -##### Implementations - -###### Trait Implementations - -- **Any** - - ```rust - fn type_id(self: &Self) -> TypeId { /* ... */ } - ``` - -- **IntoEither** -- **BorshSerialize** - - ```rust - fn serialize(self: &Self, writer: &mut W) -> ::core::result::Result<(), borsh::maybestd::io::Error> { /* ... */ } - ``` - -- **Unpin** -- **From** - - ```rust - fn from(t: T) -> T { /* ... */ } - ``` - Returns the argument unchanged. - -- **Borrow** - - ```rust - fn borrow(self: &Self) -> &T { /* ... */ } - ``` - -- **Discriminator** -- **InstructionData** -- **Owner** - - ```rust - fn owner() -> Pubkey { /* ... */ } - ``` - -- **VZip** - - ```rust - fn vzip(self: Self) -> V { /* ... */ } - ``` - -- **Send** -- **RefUnwindSafe** -- **Same** -- **Freeze** -- **BorshDeserialize** - - ```rust - fn deserialize_reader(reader: &mut R) -> ::core::result::Result { /* ... */ } - ``` - -- **Into** - - ```rust - fn into(self: Self) -> U { /* ... */ } - ``` - Calls `U::from(self)`. - -- **Sync** -- **BorrowMut** - - ```rust - fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ } - ``` - -- **TryInto** - - ```rust - fn try_into(self: Self) -> Result>::Error> { /* ... */ } - ``` - -- **UnwindSafe** -- **TryFrom** - - ```rust - fn try_from(value: U) -> Result>::Error> { /* ... */ } - ``` - -## Module `accounts` - -An Anchor generated module, providing a set of structs -mirroring the structs deriving `Accounts`, where each field is -a `Pubkey`. This is useful for specifying accounts for a client. - -```rust -pub mod accounts { /* ... */ } -``` - -### Re-exports - -#### Re-export `crate::__client_accounts_deposit_spl_token::*` - -```rust -pub use crate::__client_accounts_deposit_spl_token::*; -``` - -#### Re-export `crate::__client_accounts_call::*` - -```rust -pub use crate::__client_accounts_call::*; -``` - -#### Re-export `crate::__client_accounts_initialize::*` - -```rust -pub use crate::__client_accounts_initialize::*; -``` - -#### Re-export `crate::__client_accounts_whitelist::*` - -```rust -pub use crate::__client_accounts_whitelist::*; -``` - -#### Re-export `crate::__client_accounts_update_authority::*` - -```rust -pub use crate::__client_accounts_update_authority::*; -``` - -#### Re-export `crate::__client_accounts_unwhitelist::*` - -```rust -pub use crate::__client_accounts_unwhitelist::*; -``` - -#### Re-export `crate::__client_accounts_execute::*` - -```rust -pub use crate::__client_accounts_execute::*; -``` - -#### Re-export `crate::__client_accounts_withdraw_spl_token::*` - -```rust -pub use crate::__client_accounts_withdraw_spl_token::*; -``` - -#### Re-export `crate::__client_accounts_withdraw::*` - -```rust -pub use crate::__client_accounts_withdraw::*; -``` - -#### Re-export `crate::__client_accounts_update_tss::*` - -```rust -pub use crate::__client_accounts_update_tss::*; -``` - -#### Re-export `crate::__client_accounts_deposit::*` - -```rust -pub use crate::__client_accounts_deposit::*; -``` - -#### Re-export `crate::__client_accounts_update_paused::*` - -```rust -pub use crate::__client_accounts_update_paused::*; -``` - -#### Re-export `crate::__client_accounts_execute_spl_token::*` - -```rust -pub use crate::__client_accounts_execute_spl_token::*; -``` - -#### Re-export `crate::__client_accounts_increment_nonce::*` - -```rust -pub use crate::__client_accounts_increment_nonce::*; -``` - -#### Re-export `crate::__client_accounts_reset_nonce::*` - -```rust -pub use crate::__client_accounts_reset_nonce::*; -``` - -## Functions - -### Function `check_id` - -Confirms that a given pubkey is equivalent to the program ID - -```rust -pub fn check_id(id: &anchor_lang::solana_program::pubkey::Pubkey) -> bool { /* ... */ } -``` - -### Function `id` - -Returns the program ID - -```rust -pub fn id() -> anchor_lang::solana_program::pubkey::Pubkey { /* ... */ } -``` - -### Function `id_const` - -Const version of `ID` - -```rust -pub const fn id_const() -> anchor_lang::solana_program::pubkey::Pubkey { /* ... */ } -``` - -### Function `entrypoint` - -**Attributes:** - -- `#[no_mangle]` - -# Safety - -```rust -pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u64 { /* ... */ } -``` - -### Function `entry` - -The Anchor codegen exposes a programming model where a user defines -a set of methods inside of a `#[program]` module in a way similar -to writing RPC request handlers. The macro then generates a bunch of -code wrapping these user defined methods into something that can be -executed on Solana. - -These methods fall into one category for now. - -Global methods - regular methods inside of the `#[program]`. - -Care must be taken by the codegen to prevent collisions between -methods in these different namespaces. For this reason, Anchor uses -a variant of sighash to perform method dispatch, rather than -something like a simple enum variant discriminator. - -The execution flow of the generated code can be roughly outlined: - -* Start program via the entrypoint. -* Check whether the declared program id matches the input program - id. If it's not, return an error. -* Find and invoke the method based on whether the instruction data - starts with the method's discriminator. -* Run the method handler wrapper. This wraps the code the user - actually wrote, deserializing the accounts, constructing the - context, invoking the user's code, and finally running the exit - routine, which typically persists account changes. - -The `entry` function here, defines the standard entry to a Solana -program, where execution begins. - -```rust -pub fn entry<''info>(program_id: &Pubkey, accounts: &''info [AccountInfo<''info>], data: &[u8]) -> anchor_lang::solana_program::entrypoint::ProgramResult { /* ... */ } -``` - -## Constants and Statics - -### Static `ID` - -The static program ID - -```rust -pub static ID: anchor_lang::solana_program::pubkey::Pubkey = _; -``` - -### Constant `ID_CONST` - -Const version of `ID` - -```rust -pub const ID_CONST: anchor_lang::solana_program::pubkey::Pubkey = _; -``` - -## Re-exports - -### Re-export `DEPOSIT_FEE` - -```rust -pub use utils::DEPOSIT_FEE; -``` - -### Re-export `contexts::*` - -```rust -pub use contexts::*; -``` - -### Re-export `errors::*` - -```rust -pub use errors::*; -``` - -### Re-export `state::*` - -```rust -pub use state::*; -``` - diff --git a/src/pages/developers/protocol/solana.zh-CN.md b/src/pages/developers/protocol/solana.zh-CN.md deleted file mode 100644 index eef2c1cea..000000000 --- a/src/pages/developers/protocol/solana.zh-CN.md +++ /dev/null @@ -1,112 +0,0 @@ -## Crate 文档 - -**版本:** 0.1.0 -**格式版本:** 41 - -本文档概述 ZetaChain Solana Gateway 程序提供的 Anchor 模块、指令与数据结构,便于在 Solana 链上与 ZetaChain 通信。 - ---- - -## 模块 `gateway` - -### 子模块 - -- `program`:Solana Program 入口,暴露 `Gateway` 类型及相关实现。 -- `gateway`:核心逻辑模块,包含所有指令处理函数。 -- `instruction`:由 Anchor 生成的指令数据结构,供客户端序列化。 - ---- - -### 类型:`Gateway` - -`Gateway` 结构代表整个 Solana Gateway 程序。它实现了 Anchor 与 SPL 运行所需的多种 trait(如 `Clone`、`Send`、`TryFrom` 等),并提供 `id()` 返回程序 `Pubkey`。 - ---- - -## 指令处理函数 - -模块 `gateway` 中定义了常用指令,以下列出主要函数及其参数: - -### `initialize` -- 初始化 Gateway PDA。 -- 参数:`tss_address`(20 字节以太坊地址)、`chain_id`。 - -### `increment_nonce` -- 在出站失败时由 TSS 调用,递增 nonce。 -- 参数:`amount`、`signature`、`recovery_id`、`message_hash`、`nonce`。 - -### `execute` -- 提取 SOL 并调用目标程序的 `on_call`。 -- 参数:`amount`、`sender`(20 字节地址)、`data`、`signature`、`recovery_id`、`message_hash`、`nonce`。 - -### `execute_revert` -- 提取 SOL 并调用目标程序的 `on_revert`。 -- 参数同 `execute`,但 `sender` 为 `Pubkey`。 - -### `execute_spl_token` / `execute_spl_token_revert` -- 处理 SPL 代币提取并回调目标程序。 -- 额外参数:`decimals`(小数位)、`amount`。 - -### `set_deposit_paused` -- 切换存入功能的启停状态,仅 PDA authority 可调用。 - -### `update_tss` -- 更新 TSS 地址,仅 PDA authority 可调用。 - -### `update_authority` -- 更新 PDA authority。 - -### `reset_nonce` -- 重置 PDA nonce。 - -### `whitelist_spl_mint` / `unwhitelist_spl_mint` -- 由 TSS 调用,管理 SPL 代币白名单。 -- 参数包含 TSS 签名、`recovery_id`、`message_hash`、`nonce`。 - -### `deposit` / `deposit_and_call` -- 从 Solana 存入 SOL 并可选携带消息调用 ZetaChain zEVM 合约。 -- 参数:`amount`、`receiver`(20 字节地址)、`message`、`revert_options`。 - -### `deposit_spl_token` / `deposit_spl_token_and_call` -- 存入 SPL 代币并可选调用 zEVM 合约。 - -### `call` -- 仅发送消息到 zEVM 合约,不携带资产。 - -### `withdraw` / `withdraw_spl_token` -- 由 TSS 调用,从 Gateway 提取 SOL 或 SPL 代币。 -- 参数包含签名、`message_hash`、`nonce`。 - ---- - -## 指令数据结构(模块 `instruction`) - -Anchor 自动生成的结构体对应每个指令。示例如下: - -- `Initialize`:包含 `tss_address`、`chain_id`。 -- `IncrementNonce`:包含 `amount`、`signature`、`recovery_id`、`message_hash`、`nonce`。 -- `Execute` / `ExecuteRevert`:包含跨链调用参数与签名。 -- `ExecuteSplToken` / `ExecuteSplTokenRevert`:扩展 SPL 代币字段。 -- `SetDepositPaused`、`UpdateTss`、`UpdateAuthority`、`ResetNonce` 等管理类结构。 -- `Deposit`、`DepositAndCall`、`DepositSplToken`、`DepositSplTokenAndCall`、`Call`:对应各类存入与调用。 - -所有结构均实现 `BorshSerialize`、`BorshDeserialize`、`InstructionData` 等 trait,方便在客户端组合交易。 - ---- - -## 辅助类型 - -文件还定义了 `RevertOptions` 等结构(未完整展示),用于描述跨链回退策略、目标信息等。 - ---- - -## 小结 - -Solana Gateway 提供了完整的跨链指令集合,让 Solana 程序可: -- 初始化与管理 Gateway 状态(TSS、nonce、authority 等) -- 存入 SOL / SPL 代币并向 ZetaChain 发起消息 -- 从 ZetaChain 提取资产并回调 Solana 程序 -- 管理白名单与暂停状态 - -开发者可使用 Anchor 生成的指令结构构建客户端交易,也可参考上方函数签名在程序内进行调用。更多细节可查阅源码与 Anchor 文档。*** - diff --git a/src/pages/developers/protocol/sui.en-US.md b/src/pages/developers/protocol/sui.en-US.md deleted file mode 100644 index 5e98553d5..000000000 --- a/src/pages/developers/protocol/sui.en-US.md +++ /dev/null @@ -1,1317 +0,0 @@ - - - -# Module `gateway::gateway` - - - -- [Struct `Vault`](#gateway_gateway_Vault) -- [Struct `Gateway`](#gateway_gateway_Gateway) -- [Struct `WithdrawCap`](#gateway_gateway_WithdrawCap) -- [Struct `WhitelistCap`](#gateway_gateway_WhitelistCap) -- [Struct `AdminCap`](#gateway_gateway_AdminCap) -- [Struct `DepositEvent`](#gateway_gateway_DepositEvent) -- [Struct `DepositAndCallEvent`](#gateway_gateway_DepositAndCallEvent) -- [Struct `WithdrawEvent`](#gateway_gateway_WithdrawEvent) -- [Struct `NonceIncreaseEvent`](#gateway_gateway_NonceIncreaseEvent) -- [Struct `DonateEvent`](#gateway_gateway_DonateEvent) -- [Constants](#@Constants_0) -- [Function `init`](#gateway_gateway_init) -- [Function `increase_nonce`](#gateway_gateway_increase_nonce) -- [Function `withdraw`](#gateway_gateway_withdraw) -- [Function `whitelist`](#gateway_gateway_whitelist) -- [Function `unwhitelist`](#gateway_gateway_unwhitelist) -- [Function `issue_withdraw_and_whitelist_cap`](#gateway_gateway_issue_withdraw_and_whitelist_cap) -- [Function `pause`](#gateway_gateway_pause) -- [Function `unpause`](#gateway_gateway_unpause) -- [Function `reset_nonce`](#gateway_gateway_reset_nonce) -- [Function `deposit`](#gateway_gateway_deposit) -- [Function `deposit_and_call`](#gateway_gateway_deposit_and_call) -- [Function `donate`](#gateway_gateway_donate) -- [Function `check_receiver_and_deposit_to_vault`](#gateway_gateway_check_receiver_and_deposit_to_vault) -- [Function `withdraw_impl`](#gateway_gateway_withdraw_impl) -- [Function `whitelist_impl`](#gateway_gateway_whitelist_impl) -- [Function `unwhitelist_impl`](#gateway_gateway_unwhitelist_impl) -- [Function `issue_withdraw_and_whitelist_cap_impl`](#gateway_gateway_issue_withdraw_and_whitelist_cap_impl) -- [Function `pause_impl`](#gateway_gateway_pause_impl) -- [Function `unpause_impl`](#gateway_gateway_unpause_impl) -- [Function `nonce`](#gateway_gateway_nonce) -- [Function `active_withdraw_cap`](#gateway_gateway_active_withdraw_cap) -- [Function `active_whitelist_cap`](#gateway_gateway_active_whitelist_cap) -- [Function `vault_balance`](#gateway_gateway_vault_balance) -- [Function `is_paused`](#gateway_gateway_is_paused) -- [Function `is_whitelisted`](#gateway_gateway_is_whitelisted) -- [Function `coin_name`](#gateway_gateway_coin_name) - - -
    use gateway::evm;
    -use std::address;
    -use std::ascii;
    -use std::bcs;
    -use std::option;
    -use std::string;
    -use std::type_name;
    -use std::vector;
    -use sui::address;
    -use sui::bag;
    -use sui::balance;
    -use sui::coin;
    -use sui::config;
    -use sui::deny_list;
    -use sui::dynamic_field;
    -use sui::dynamic_object_field;
    -use sui::event;
    -use sui::hex;
    -use sui::object;
    -use sui::party;
    -use sui::sui;
    -use sui::table;
    -use sui::transfer;
    -use sui::tx_context;
    -use sui::types;
    -use sui::url;
    -use sui::vec_map;
    -use sui::vec_set;
    -
    - - - - - -## Struct `Vault` - - - -
    public struct Vault<phantom T> has store
    -
    - - - -
    -Fields - - -
    -
    -balance: sui::balance::Balance<T> -
    -
    -
    -
    -whitelisted: bool -
    -
    -
    -
    - - -
    - - - -## Struct `Gateway` - - - -
    public struct Gateway has key
    -
    - - - -
    -Fields - - -
    -
    -id: sui::object::UID -
    -
    -
    -
    -vaults: sui::bag::Bag -
    -
    -
    -
    -nonce: u64 -
    -
    -
    -
    -active_withdraw_cap: sui::object::ID -
    -
    -
    -
    -active_whitelist_cap: sui::object::ID -
    -
    -
    -
    -deposit_paused: bool -
    -
    -
    -
    - - -
    - - - -## Struct `WithdrawCap` - - - -
    public struct WithdrawCap has key, store
    -
    - - - -
    -Fields - - -
    -
    -id: sui::object::UID -
    -
    -
    -
    - - -
    - - - -## Struct `WhitelistCap` - - - -
    public struct WhitelistCap has key, store
    -
    - - - -
    -Fields - - -
    -
    -id: sui::object::UID -
    -
    -
    -
    - - -
    - - - -## Struct `AdminCap` - - - -
    public struct AdminCap has key, store
    -
    - - - -
    -Fields - - -
    -
    -id: sui::object::UID -
    -
    -
    -
    - - -
    - - - -## Struct `DepositEvent` - - - -
    public struct DepositEvent has copy, drop
    -
    - - - -
    -Fields - - -
    -
    -coin_type: std::ascii::String -
    -
    -
    -
    -amount: u64 -
    -
    -
    -
    -sender: address -
    -
    -
    -
    -receiver: std::ascii::String -
    -
    -
    -
    - - -
    - - - -## Struct `DepositAndCallEvent` - - - -
    public struct DepositAndCallEvent has copy, drop
    -
    - - - -
    -Fields - - -
    -
    -coin_type: std::ascii::String -
    -
    -
    -
    -amount: u64 -
    -
    -
    -
    -sender: address -
    -
    -
    -
    -receiver: std::ascii::String -
    -
    -
    -
    -payload: vector<u8> -
    -
    -
    -
    - - -
    - - - -## Struct `WithdrawEvent` - - - -
    public struct WithdrawEvent has copy, drop
    -
    - - - -
    -Fields - - -
    -
    -coin_type: std::ascii::String -
    -
    -
    -
    -amount: u64 -
    -
    -
    -
    -sender: address -
    -
    -
    -
    -receiver: address -
    -
    -
    -
    -nonce: u64 -
    -
    -
    -
    - - -
    - - - -## Struct `NonceIncreaseEvent` - - - -
    public struct NonceIncreaseEvent has copy, drop
    -
    - - - -
    -Fields - - -
    -
    -sender: address -
    -
    -
    -
    -nonce: u64 -
    -
    -
    -
    - - -
    - - - -## Struct `DonateEvent` - - - -
    public struct DonateEvent has copy, drop
    -
    - - - -
    -Fields - - -
    -
    -coin_type: std::ascii::String -
    -
    -
    -
    -amount: u64 -
    -
    -
    -
    -sender: address -
    -
    -
    -
    - - -
    - - - -## Constants - - - - - - -
    const EAlreadyWhitelisted: u64 = 0;
    -
    - - - - - - - -
    const EInvalidReceiverAddress: u64 = 1;
    -
    - - - - - - - -
    const ENotWhitelisted: u64 = 2;
    -
    - - - - - - - -
    const ENonceMismatch: u64 = 3;
    -
    - - - - - - - -
    const EPayloadTooLong: u64 = 4;
    -
    - - - - - - - -
    const EInactiveWithdrawCap: u64 = 5;
    -
    - - - - - - - -
    const EInactiveWhitelistCap: u64 = 6;
    -
    - - - - - - - -
    const EDepositPaused: u64 = 7;
    -
    - - - - - - - -
    const PayloadMaxLength: u64 = 1024;
    -
    - - - - - -## Function `init` - - - -
    fun init(ctx: &mut sui::tx_context::TxContext)
    -
    - - - -
    -Implementation - - -
    fun init(ctx: &mut TxContext) {
    -    // to withdraw tokens from the gateway, the caller must have the WithdrawCap
    -    let withdraw_cap = WithdrawCap {
    -        id: object::new(ctx),
    -    };
    -    // to whitelist a new vault, the caller must have the WhitelistCap
    -    let whitelist_cap = WhitelistCap {
    -        id: object::new(ctx),
    -    };
    -    // to whitelist a new vault, the caller must have the AdminCap
    -    let admin_cap = AdminCap {
    -        id: object::new(ctx),
    -    };
    -    // create and share the gateway object
    -    let mut gateway = Gateway {
    -        id: object::new(ctx),
    -        vaults: bag::new(ctx),
    -        nonce: 0,
    -        active_withdraw_cap: object::id(&withdraw_cap),
    -        active_whitelist_cap: object::id(&whitelist_cap),
    -        deposit_paused: false,
    -    };
    -    // whitelist SUI by default
    -    whitelist_impl<SUI>(&mut gateway, &whitelist_cap);
    -    transfer::transfer(withdraw_cap, tx_context::sender(ctx));
    -    transfer::transfer(whitelist_cap, tx_context::sender(ctx));
    -    transfer::transfer(admin_cap, tx_context::sender(ctx));
    -    transfer::share_object(gateway);
    -}
    -
    - - - -
    - - - -## Function `increase_nonce` - - - -
    entry fun increase_nonce(gateway: &mut gateway::gateway::Gateway, nonce: u64, cap: &gateway::gateway::WithdrawCap, ctx: &sui::tx_context::TxContext)
    -
    - - - -
    -Implementation - - -
    entry fun increase_nonce(gateway: &mut Gateway, nonce: u64, cap: &WithdrawCap, ctx: &TxContext) {
    -    assert!(gateway.active_withdraw_cap == object::id(cap), EInactiveWithdrawCap);
    -    assert!(nonce == gateway.nonce, ENonceMismatch);
    -    gateway.nonce = nonce + 1;
    -    // Emit event
    -    event::emit(NonceIncreaseEvent {
    -        sender: tx_context::sender(ctx),
    -        nonce: gateway.nonce,
    -    });
    -}
    -
    - - - -
    - - - -## Function `withdraw` - - - -
    entry fun withdraw<T>(gateway: &mut gateway::gateway::Gateway, amount: u64, nonce: u64, receiver: address, gas_budget: u64, cap: &gateway::gateway::WithdrawCap, ctx: &mut sui::tx_context::TxContext)
    -
    - - - -
    -Implementation - - -
    entry fun withdraw<T>(
    -    gateway: &mut Gateway,
    -    amount: u64,
    -    nonce: u64,
    -    receiver: address,
    -    gas_budget: u64,
    -    cap: &WithdrawCap,
    -    ctx: &mut TxContext,
    -) {
    -    let (coins, coins_gas_budget) = withdraw_impl<T>(gateway, amount, nonce, gas_budget, cap, ctx);
    -    transfer::public_transfer(coins, receiver);
    -    transfer::public_transfer(coins_gas_budget, tx_context::sender(ctx));
    -    // Emit event
    -    event::emit(WithdrawEvent {
    -        coin_type: coin_name<T>(),
    -        amount: amount,
    -        sender: tx_context::sender(ctx),
    -        receiver: receiver,
    -        nonce: nonce,
    -    });
    -}
    -
    - - - -
    - - - -## Function `whitelist` - - - -
    entry fun whitelist<T>(gateway: &mut gateway::gateway::Gateway, cap: &gateway::gateway::WhitelistCap)
    -
    - - - -
    -Implementation - - -
    entry fun whitelist<T>(gateway: &mut Gateway, cap: &WhitelistCap) {
    -    whitelist_impl<T>(gateway, cap)
    -}
    -
    - - - -
    - - - -## Function `unwhitelist` - - - -
    entry fun unwhitelist<T>(gateway: &mut gateway::gateway::Gateway, cap: &gateway::gateway::AdminCap)
    -
    - - - -
    -Implementation - - -
    entry fun unwhitelist<T>(gateway: &mut Gateway, cap: &AdminCap) {
    -    unwhitelist_impl<T>(gateway, cap)
    -}
    -
    - - - -
    - - - -## Function `issue_withdraw_and_whitelist_cap` - - - -
    entry fun issue_withdraw_and_whitelist_cap(gateway: &mut gateway::gateway::Gateway, _cap: &gateway::gateway::AdminCap, ctx: &mut sui::tx_context::TxContext)
    -
    - - - -
    -Implementation - - -
    entry fun issue_withdraw_and_whitelist_cap(
    -    gateway: &mut Gateway,
    -    _cap: &AdminCap,
    -    ctx: &mut TxContext,
    -) {
    -    let (withdraw_cap, whitelist_cap) = issue_withdraw_and_whitelist_cap_impl(gateway, _cap, ctx);
    -    transfer::transfer(withdraw_cap, tx_context::sender(ctx));
    -    transfer::transfer(whitelist_cap, tx_context::sender(ctx));
    -}
    -
    - - - -
    - - - -## Function `pause` - - - -
    entry fun pause(gateway: &mut gateway::gateway::Gateway, cap: &gateway::gateway::AdminCap)
    -
    - - - -
    -Implementation - - -
    entry fun pause(gateway: &mut Gateway, cap: &AdminCap) {
    -    pause_impl(gateway, cap)
    -}
    -
    - - - -
    - - - -## Function `unpause` - - - -
    entry fun unpause(gateway: &mut gateway::gateway::Gateway, cap: &gateway::gateway::AdminCap)
    -
    - - - -
    -Implementation - - -
    entry fun unpause(gateway: &mut Gateway, cap: &AdminCap) {
    -    unpause_impl(gateway, cap)
    -}
    -
    - - - -
    - - - -## Function `reset_nonce` - - - -
    entry fun reset_nonce(gateway: &mut gateway::gateway::Gateway, nonce: u64, _cap: &gateway::gateway::AdminCap)
    -
    - - - -
    -Implementation - - -
    entry fun reset_nonce(gateway: &mut Gateway, nonce: u64, _cap: &AdminCap) {
    -    gateway.nonce = nonce;
    -}
    -
    - - - -
    - - - -## Function `deposit` - - - -
    public entry fun deposit<T>(gateway: &mut gateway::gateway::Gateway, coins: sui::coin::Coin<T>, receiver: std::ascii::String, ctx: &mut sui::tx_context::TxContext)
    -
    - - - -
    -Implementation - - -
    public entry fun deposit<T>(
    -    gateway: &mut Gateway,
    -    coins: Coin<T>,
    -    receiver: String,
    -    ctx: &mut TxContext,
    -) {
    -    let amount = coins.value();
    -    let coin_name = coin_name<T>();
    -    check_receiver_and_deposit_to_vault(gateway, coins, receiver);
    -    // Emit deposit event
    -    event::emit(DepositEvent {
    -        coin_type: coin_name,
    -        amount: amount,
    -        sender: tx_context::sender(ctx),
    -        receiver: receiver,
    -    });
    -}
    -
    - - - -
    - - - -## Function `deposit_and_call` - - - -
    public entry fun deposit_and_call<T>(gateway: &mut gateway::gateway::Gateway, coins: sui::coin::Coin<T>, receiver: std::ascii::String, payload: vector<u8>, ctx: &mut sui::tx_context::TxContext)
    -
    - - - -
    -Implementation - - -
    public entry fun deposit_and_call<T>(
    -    gateway: &mut Gateway,
    -    coins: Coin<T>,
    -    receiver: String,
    -    payload: vector<u8>,
    -    ctx: &mut TxContext,
    -) {
    -    assert!(payload.length() <= PayloadMaxLength, EPayloadTooLong);
    -    let amount = coins.value();
    -    let coin_name = coin_name<T>();
    -    check_receiver_and_deposit_to_vault(gateway, coins, receiver);
    -    // Emit deposit event
    -    event::emit(DepositAndCallEvent {
    -        coin_type: coin_name,
    -        amount: amount,
    -        sender: tx_context::sender(ctx),
    -        receiver: receiver,
    -        payload: payload,
    -    });
    -}
    -
    - - - -
    - - - -## Function `donate` - - - -
    public entry fun donate<T>(gateway: &mut gateway::gateway::Gateway, coins: sui::coin::Coin<T>, ctx: &mut sui::tx_context::TxContext)
    -
    - - - -
    -Implementation - - -
    public entry fun donate<T>(
    -    gateway: &mut Gateway,
    -    coins: Coin<T>,
    -    ctx: &mut TxContext,
    -) {
    -    let amount = coins.value();
    -    let coin_name = coin_name<T>();
    -    // use check_receiver_and_deposit_to_vault to deposit and provide the zero address as receiver
    -    // receiver is only passed to the function to ensure the address is valid
    -    check_receiver_and_deposit_to_vault(gateway, coins, string(b"0x0000000000000000000000000000000000000000"));
    -    // Emit donate event
    -    event::emit(DonateEvent {
    -        coin_type: coin_name,
    -        amount: amount,
    -        sender: tx_context::sender(ctx),
    -    });
    -}
    -
    - - - -
    - - - -## Function `check_receiver_and_deposit_to_vault` - - - -
    fun check_receiver_and_deposit_to_vault<T>(gateway: &mut gateway::gateway::Gateway, coins: sui::coin::Coin<T>, receiver: std::ascii::String)
    -
    - - - -
    -Implementation - - -
    fun check_receiver_and_deposit_to_vault<T>(
    -    gateway: &mut Gateway,
    -    coins: Coin<T>,
    -    receiver: String,
    -) {
    -    assert!(evm::is_valid_evm_address(receiver), EInvalidReceiverAddress);
    -    assert!(is_whitelisted<T>(gateway), ENotWhitelisted);
    -    assert!(!gateway.deposit_paused, EDepositPaused);
    -    // Deposit the coin into the vault
    -    let coin_name = coin_name<T>();
    -    let vault = bag::borrow_mut<String, Vault<T>>(&mut gateway.vaults, coin_name);
    -    balance::join(&mut vault.balance, coins.into_balance());
    -}
    -
    - - - -
    - - - -## Function `withdraw_impl` - - - -
    public fun withdraw_impl<T>(gateway: &mut gateway::gateway::Gateway, amount: u64, nonce: u64, gas_budget: u64, cap: &gateway::gateway::WithdrawCap, ctx: &mut sui::tx_context::TxContext): (sui::coin::Coin<T>, sui::coin::Coin<sui::sui::SUI>)
    -
    - - - -
    -Implementation - - -
    public fun withdraw_impl<T>(
    -    gateway: &mut Gateway,
    -    amount: u64,
    -    nonce: u64,
    -    gas_budget: u64,
    -    cap: &WithdrawCap,
    -    ctx: &mut TxContext,
    -): (Coin<T>, Coin<sui::sui::SUI>) {
    -    assert!(gateway.active_withdraw_cap == object::id(cap), EInactiveWithdrawCap);
    -    assert!(is_whitelisted<T>(gateway), ENotWhitelisted);
    -    assert!(nonce == gateway.nonce, ENonceMismatch); // prevent replay
    -    gateway.nonce = nonce + 1;
    -    // Withdraw the coin from the vault
    -    let coin_name = coin_name<T>();
    -    let vault = bag::borrow_mut<String, Vault<T>>(&mut gateway.vaults, coin_name);
    -    let coins_out = coin::take(&mut vault.balance, amount, ctx);
    -    // Withdraw SUI to cover the gas budget
    -    let sui_vault = bag::borrow_mut<String, Vault<sui::sui::SUI>>(
    -        &mut gateway.vaults,
    -        coin_name<sui::sui::SUI>(),
    -    );
    -    let coins_gas_budget = coin::take(&mut sui_vault.balance, gas_budget, ctx);
    -    (coins_out, coins_gas_budget)
    -}
    -
    - - - -
    - - - -## Function `whitelist_impl` - - - -
    public fun whitelist_impl<T>(gateway: &mut gateway::gateway::Gateway, cap: &gateway::gateway::WhitelistCap)
    -
    - - - -
    -Implementation - - -
    public fun whitelist_impl<T>(gateway: &mut Gateway, cap: &WhitelistCap) {
    -    assert!(gateway.active_whitelist_cap == object::id(cap), EInactiveWhitelistCap);
    -    assert!(is_whitelisted<T>(gateway) == false, EAlreadyWhitelisted);
    -    // if the vault already exists, set it to whitelisted, otherwise create a new vault
    -    if (bag::contains_with_type<String, Vault<T>>(&gateway.vaults, coin_name<T>())) {
    -        let vault = bag::borrow_mut<String, Vault<T>>(&mut gateway.vaults, coin_name<T>());
    -        vault.whitelisted = true;
    -    } else {
    -        let vault_name = coin_name<T>();
    -        let vault = Vault<T> {
    -            balance: balance::zero<T>(),
    -            whitelisted: true,
    -        };
    -        bag::add(&mut gateway.vaults, vault_name, vault);
    -    }
    -}
    -
    - - - -
    - - - -## Function `unwhitelist_impl` - - - -
    public fun unwhitelist_impl<T>(gateway: &mut gateway::gateway::Gateway, _cap: &gateway::gateway::AdminCap)
    -
    - - - -
    -Implementation - - -
    public fun unwhitelist_impl<T>(gateway: &mut Gateway, _cap: &AdminCap) {
    -    assert!(is_whitelisted<T>(gateway), ENotWhitelisted);
    -    let vault = bag::borrow_mut<String, Vault<T>>(&mut gateway.vaults, coin_name<T>());
    -    vault.whitelisted = false;
    -}
    -
    - - - -
    - - - -## Function `issue_withdraw_and_whitelist_cap_impl` - - - -
    public fun issue_withdraw_and_whitelist_cap_impl(gateway: &mut gateway::gateway::Gateway, _cap: &gateway::gateway::AdminCap, ctx: &mut sui::tx_context::TxContext): (gateway::gateway::WithdrawCap, gateway::gateway::WhitelistCap)
    -
    - - - -
    -Implementation - - -
    public fun issue_withdraw_and_whitelist_cap_impl(
    -    gateway: &mut Gateway,
    -    _cap: &AdminCap,
    -    ctx: &mut TxContext,
    -): (WithdrawCap, WhitelistCap) {
    -    let withdraw_cap = WithdrawCap {
    -        id: object::new(ctx),
    -    };
    -    let whitelist_cap = WhitelistCap {
    -        id: object::new(ctx),
    -    };
    -    gateway.active_withdraw_cap = object::id(&withdraw_cap);
    -    gateway.active_whitelist_cap = object::id(&whitelist_cap);
    -    (withdraw_cap, whitelist_cap)
    -}
    -
    - - - -
    - - - -## Function `pause_impl` - - - -
    public fun pause_impl(gateway: &mut gateway::gateway::Gateway, _cap: &gateway::gateway::AdminCap)
    -
    - - - -
    -Implementation - - -
    public fun pause_impl(gateway: &mut Gateway, _cap: &AdminCap) {
    -    gateway.deposit_paused = true;
    -}
    -
    - - - -
    - - - -## Function `unpause_impl` - - - -
    public fun unpause_impl(gateway: &mut gateway::gateway::Gateway, _cap: &gateway::gateway::AdminCap)
    -
    - - - -
    -Implementation - - -
    public fun unpause_impl(gateway: &mut Gateway, _cap: &AdminCap) {
    -    gateway.deposit_paused = false;
    -}
    -
    - - - -
    - - - -## Function `nonce` - - - -
    public fun nonce(gateway: &gateway::gateway::Gateway): u64
    -
    - - - -
    -Implementation - - -
    public fun nonce(gateway: &Gateway): u64 {
    -    gateway.nonce
    -}
    -
    - - - -
    - - - -## Function `active_withdraw_cap` - - - -
    public fun active_withdraw_cap(gateway: &gateway::gateway::Gateway): sui::object::ID
    -
    - - - -
    -Implementation - - -
    public fun active_withdraw_cap(gateway: &Gateway): ID {
    -    gateway.active_withdraw_cap
    -}
    -
    - - - -
    - - - -## Function `active_whitelist_cap` - - - -
    public fun active_whitelist_cap(gateway: &gateway::gateway::Gateway): sui::object::ID
    -
    - - - -
    -Implementation - - -
    public fun active_whitelist_cap(gateway: &Gateway): ID {
    -    gateway.active_whitelist_cap
    -}
    -
    - - - -
    - - - -## Function `vault_balance` - - - -
    public fun vault_balance<T>(gateway: &gateway::gateway::Gateway): u64
    -
    - - - -
    -Implementation - - -
    public fun vault_balance<T>(gateway: &Gateway): u64 {
    -    if (!is_whitelisted<T>(gateway)) {
    -        return 0
    -    };
    -    let coin_name = coin_name<T>();
    -    let vault = bag::borrow<String, Vault<T>>(&gateway.vaults, coin_name);
    -    balance::value(&vault.balance)
    -}
    -
    - - - -
    - - - -## Function `is_paused` - - - -
    public fun is_paused(gateway: &gateway::gateway::Gateway): bool
    -
    - - - -
    -Implementation - - -
    public fun is_paused(gateway: &Gateway): bool {
    -    gateway.deposit_paused
    -}
    -
    - - - -
    - - - -## Function `is_whitelisted` - - - -
    public fun is_whitelisted<T>(gateway: &gateway::gateway::Gateway): bool
    -
    - - - -
    -Implementation - - -
    public fun is_whitelisted<T>(gateway: &Gateway): bool {
    -    let vault_name = coin_name<T>();
    -    if (!bag::contains_with_type<String, Vault<T>>(&gateway.vaults, vault_name)) {
    -        return false
    -    };
    -    let vault = bag::borrow<String, Vault<T>>(&gateway.vaults, vault_name);
    -    vault.whitelisted
    -}
    -
    - - - -
    - - - -## Function `coin_name` - - - -
    fun coin_name<T>(): std::ascii::String
    -
    - - - -
    -Implementation - - -
    fun coin_name<T>(): String {
    -    into_string(get<T>())
    -}
    -
    - - - -
    diff --git a/src/pages/developers/protocol/sui.zh-CN.md b/src/pages/developers/protocol/sui.zh-CN.md deleted file mode 100644 index f2b80b4bf..000000000 --- a/src/pages/developers/protocol/sui.zh-CN.md +++ /dev/null @@ -1,84 +0,0 @@ -## 模块 `gateway::gateway` - -本文档概述 ZetaChain Sui Gateway 模块中暴露的结构体、常量与函数,帮助开发者理解如何在 Sui 链上与 ZetaChain 交互。 - ---- - -### 核心结构体 - -- `Vault`:托管特定代币的仓库,包含余额与白名单标记。 -- `Gateway`:模块主对象,维护所有 `Vault`、当前 `nonce`、活跃权限 ID 及暂停状态。 -- `WithdrawCap` / `WhitelistCap` / `AdminCap`:分别控制提现、白名单和管理员操作的能力凭证。 -- `DepositEvent`、`DepositAndCallEvent`、`WithdrawEvent`、`NonceIncreaseEvent`、`DonateEvent`:跨链操作时发布的事件,便于链上追踪。 - ---- - -### 常量 - -定义了若干错误码与限制: - -- `EAlreadyWhitelisted`、`ENotWhitelisted`:白名单状态校验。 -- `ENonceMismatch`:防止 nonce 复用。 -- `EInvalidReceiverAddress`:无效的 EVM 接收地址。 -- `EPayloadTooLong`:消息载荷超限,`PayloadMaxLength = 1024` 字节。 -- `EInactiveWithdrawCap`、`EInactiveWhitelistCap`:权限凭证校验。 -- `EDepositPaused`:暂停状态提示。 - ---- - -### 初始化与权限管理 - -- `init`:创建 Gateway 对象,生成三类 Cap 并分发给交易发起者,默认将 `SUI` 加入白名单。 -- `issue_withdraw_and_whitelist_cap` / `issue_withdraw_and_whitelist_cap_impl`:管理员重新签发新的提现与白名单 Cap,并更新活跃 ID。 -- `pause` / `unpause`:管理员暂停或恢复存入功能,对应实现 `pause_impl` / `unpause_impl`。 -- `reset_nonce`:管理员重置 `nonce`。 - ---- - -### Nonce 与权限校验 - -- `increase_nonce`:持有 `WithdrawCap` 的调用者(通常为 TSS)可在出站失败时手动递增 nonce,并触发 `NonceIncreaseEvent`。 -- `nonce` / `active_withdraw_cap` / `active_whitelist_cap`:查询当前 `nonce` 和活跃 Cap ID。 - ---- - -### 白名单操作 - -- `whitelist` / `whitelist_impl`:使用 `WhitelistCap` 将某种代币加入白名单,若 vault 已存在则更新标记,否则创建新 vault。 -- `unwhitelist` / `unwhitelist_impl`:管理员移除白名单。 -- `is_whitelisted`:检测某代币是否被允许存入。 - ---- - -### 存入与事件 - -- `deposit`:用户将代币存入 Gateway,传入 EVM 接收地址,记录事件 `DepositEvent`。 -- `deposit_and_call`:在存入的同时附带 payload 触发 zEVM 合约调用,payload 不得超过 `1024` 字节,对应事件 `DepositAndCallEvent`。 -- `donate`:向 Gateway 捐赠代币,接收地址固定为零地址,触发 `DonateEvent`。 -- `check_receiver_and_deposit_to_vault`:内部函数,统一检查接收地址有效性、白名单状态及暂停状态,并将代币注入 Vault。 - ---- - -### 提现与回调 - -- `withdraw`:持有 `WithdrawCap` 的调用者从 Vault 中提取代币和用于 gas 的 SUI,分别转给跨链接收地址与交易发起者,同时发布 `WithdrawEvent`。 -- `withdraw_impl`:提现实现函数,校验 Cap、nonce 与白名单状态,并返回 `(Coin, Coin)`。 - ---- - -### 工具函数 - -- `vault_balance`:查询指定代币在 Vault 中的余额。 -- `is_paused`:返回存入功能是否被暂停。 -- `coin_name`:将类型名称转换为 ASCII 字符串,用作 Vault 键值。 - ---- - -## 总结 - -Sui Gateway 模块通过 Cap 权限体系与事件机制,为跨链存取、消息传递提供安全保障。常见流程包括: -1. 管理员使用 `init` 初始化,并根据需要签发新的权限 Cap。 -2. 用户调用 `deposit` 或 `deposit_and_call` 将资产跨链至 zEVM。 -3. TSS 或授权实体使用 `withdraw` / `increase_nonce` 等函数处理出站资产与异常情况。 -4. 通过事件与查询函数监控状态、余额及暂停标识。*** - diff --git a/src/pages/developers/protocol/ton.en-US.md b/src/pages/developers/protocol/ton.en-US.md deleted file mode 100644 index ac7e6a534..000000000 --- a/src/pages/developers/protocol/ton.en-US.md +++ /dev/null @@ -1,107 +0,0 @@ -# TON Gateway Docs - -## gateway.fc - -### Constants - -- **op::internal::donate** = 100 -- **op::internal::deposit** = 101 -- **op::internal::deposit_and_call** = 102 -- **op::internal::call** = 103 -- **op::external::withdraw** = 200 -- **op::external::increase_seqno** = 205 -- **op::authority::set_deposits_enabled** = 201 -- **op::authority::update_tss** = 202 -- **op::authority::update_code** = 203 -- **op::authority::update_authority** = 204 -- **op::authority::reset_seqno** = 206 - -### `handle_deposit` - -```func -() handle_deposit(int amount, slice in_msg_body) impure inline { -``` - -Deposit TON to the gateway and specify the EVM recipient on ZetaChain - -### `handle_call` - -```func -() handle_call(int amount, slice in_msg_body) impure inline { -``` - -Handles zeta's onCall method by ensuring call_data size and gas costs are covered; - -NOTE that this operation DOESN'T rebate sent amount if it's bigger than tx fee! -We can consider sending surplus amount back in the future improvements. -For now, send amount that is equal to calculate_gas_fee(op::call) - -### `handle_set_deposits_enabled` - -```func -() handle_set_deposits_enabled(slice sender, slice message) impure inline { -``` - -Enables or disables deposits. - -### `handle_update_tss` - -```func -() handle_update_tss(slice sender, slice message) impure inline { -``` - -Updates the TSS address. WARNING! Execute with extra caution. -Wrong TSS address leads to loss of funds. - -### `handle_update_code` - -```func -() handle_update_code(slice sender, slice message) impure inline { -``` - -Updated the code of the contract -Handle_code_update (cell new_code) - -### `handle_reset_seqno` - -```func -() handle_reset_seqno(slice sender, slice message) impure inline { -``` - -Resets the seqno to the specified value -Handles reset_seqno (uint32 new_seqno) - -### `recv_internal` - -```func -() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure { -``` - -Input for all internal messages - -### `handle_withdrawal` - -```func -() handle_withdrawal(slice payload) impure inline { -``` - -Withdraws assets to the recipient - -Handle_withdrawal (MsgAddr recipient, Coins amount, uint32 seqno) - -### `handle_increase_seqno` - -```func -() handle_increase_seqno(slice payload) impure inline { -``` - -Increases seqno by 1 without doing any other operations. -Handle_increase_seqno (uint32 failure_reason, uint32 seqno) - -### `recv_external` - -```func -() recv_external(slice message) impure { -``` - -Entry point for all external messages diff --git a/src/pages/developers/protocol/ton.zh-CN.md b/src/pages/developers/protocol/ton.zh-CN.md deleted file mode 100644 index e6d608a1e..000000000 --- a/src/pages/developers/protocol/ton.zh-CN.md +++ /dev/null @@ -1,99 +0,0 @@ - -## TON Gateway 文档 - -### 文件 `gateway.fc` - -#### 操作码常量 - -- `op::internal::donate = 100` -- `op::internal::deposit = 101` -- `op::internal::deposit_and_call = 102` -- `op::internal::call = 103` -- `op::external::withdraw = 200` -- `op::external::increase_seqno = 205` -- `op::authority::set_deposits_enabled = 201` -- `op::authority::update_tss = 202` -- `op::authority::update_code = 203` -- `op::authority::update_authority = 204` -- `op::authority::reset_seqno = 206` - -#### `handle_deposit` - -```func -() handle_deposit(int amount, slice in_msg_body) impure inline { -``` - -处理用户向 Gateway 存入 TON,并指定 ZetaChain zEVM 上的接收地址。 - -#### `handle_call` - -```func -() handle_call(int amount, slice in_msg_body) impure inline { -``` - -执行 zEVM 合约的 `onCall`,确保 `call_data` 大小与 gas 成本满足要求。当前不会退还超过手续费的多余金额,建议仅发送与 `op::call` 计算结果相等的金额。 - -#### `handle_set_deposits_enabled` - -```func -() handle_set_deposits_enabled(slice sender, slice message) impure inline { -``` - -启用或停用存款功能。 - -#### `handle_update_tss` - -```func -() handle_update_tss(slice sender, slice message) impure inline { -``` - -更新 TSS 地址,需格外谨慎,错误地址会导致资金损失。 - -#### `handle_update_code` - -```func -() handle_update_code(slice sender, slice message) impure inline { -``` - -升级合约代码。内部调用 `handle_code_update(cell new_code)`。 - -#### `handle_reset_seqno` - -```func -() handle_reset_seqno(slice sender, slice message) impure inline { -``` - -将序列号重置为指定值,对应 `reset_seqno(uint32 new_seqno)`。 - -#### `recv_internal` - -```func -() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure { -``` - -所有内部消息的入口。 - -#### `handle_withdrawal` - -```func -() handle_withdrawal(slice payload) impure inline { -``` - -执行资产提现,参数包括接收地址、金额和 `seqno`。 - -#### `handle_increase_seqno` - -```func -() handle_increase_seqno(slice payload) impure inline { -``` - -单纯将 `seqno` 加一,用于处理失败后的重试。载荷包含 `failure_reason` 与 `seqno`。 - -#### `recv_external` - -```func -() recv_external(slice message) impure { -``` - -所有外部消息的入口,依赖上述处理函数完成具体逻辑。*** - diff --git a/src/pages/developers/architecture/rewards.en-US.mdx b/src/pages/developers/rewards.en-US.mdx similarity index 100% rename from src/pages/developers/architecture/rewards.en-US.mdx rename to src/pages/developers/rewards.en-US.mdx diff --git a/src/pages/developers/architecture/rewards.zh-CN.mdx b/src/pages/developers/rewards.zh-CN.mdx similarity index 100% rename from src/pages/developers/architecture/rewards.zh-CN.mdx rename to src/pages/developers/rewards.zh-CN.mdx diff --git a/src/pages/developers/standards/_meta.en-US.json b/src/pages/developers/standards/_meta.en-US.json deleted file mode 100644 index 6463be178..000000000 --- a/src/pages/developers/standards/_meta.en-US.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "overview": { - "title": "Overview", - "description": "A set of standards that enable cross-chain interoperability for NFTs and fungible tokens" - }, - "nft": { - "title": "Universal NFT", - "description": "The Universal NFT standard enables non-fungible tokens (ERC-721 NFT) to be minted on any chain and seamlessly transferred between connected chains." - }, - "token": { - "title": "Universal Token", - "description": "The Universal Token standard enables ERC-20 fungible tokens to be minted on any chain and seamlessly transferred between connected chains." - } -} \ No newline at end of file diff --git a/src/pages/developers/standards/_meta.zh-CN.json b/src/pages/developers/standards/_meta.zh-CN.json deleted file mode 100644 index 6165df3e6..000000000 --- a/src/pages/developers/standards/_meta.zh-CN.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "overview": { - "title": "概览" - }, - "nft": { - "title": "通用 NFT" - }, - "token": { - "title": "通用代币" - } -} diff --git a/src/pages/developers/standards/nft.en-US.mdx b/src/pages/developers/standards/nft.en-US.mdx deleted file mode 100644 index 1e36cf65d..000000000 --- a/src/pages/developers/standards/nft.en-US.mdx +++ /dev/null @@ -1,236 +0,0 @@ -Universal NFTs are fully interoperable ERC-721 tokens that can be minted and -transferred across any connected chain without wrapping or bridging. Each NFT -has a persistent token ID that remains the same on every chain, and metadata is -preserved during cross-chain transfers. This enables true chain-agnostic -ownership and interaction for use cases like cross-chain games, marketplaces, -and identity. - -Universal NFTs on ZetaChain are built on the standard [OpenZeppelin -ERC-721](https://docs.openzeppelin.com/contracts/5.x/api/token/erc721) -implementation and use [UUPS -upgradeable](https://docs.openzeppelin.com/contracts/5.x/api/proxy#UUPSUpgradeable) -proxy patterns, allowing developers to extend and upgrade NFT logic safely over -time. - -## Option 1: Create a New Universal NFT - -Create a new Universal NFT project: - -``` -npx zetachain@latest new --project nft -``` - -Install dependencies: - -``` -cd nft -yarn -forge soldeer update -``` - -Compile contracts: - -``` -forge build -``` - -## Option 2: Upgrade an Existing ERC-721 Project - -You can upgrade your existing ERC-721 project to become a Universal NFT by -installing the official standard contracts package: - -```bash -yarn add @zetachain/standard-contracts -``` - -Then, update your contract using the [example -implementation](https://github.com/zeta-chain/example-contracts/tree/main/examples/nft/contracts) -as a reference, see the commented lines that include Universal NFT-specific -logic for ZetaChain integration. - -This allows your NFT to support cross-chain minting, transfers, and persistent -token IDs across ZetaChain and connected EVM chains. - -## Deploy on Testnet - -``` -RPC_ETHEREUM=$(zetachain q chains show --chain-id 11155111 -f rpc) -RPC_BASE=$(zetachain q chains show --chain-id 84532 -f rpc) -RPC_ZETACHAIN=$(zetachain q chains show --chain-id 7001 -f rpc) - -ZRC20_ETHEREUM=$(zetachain q tokens show -s ETH.ETHSEP -f zrc20) -ZRC20_BASE=$(zetachain q tokens show -s ETH.BASESEP -f zrc20) - -GATEWAY_ETHEREUM=0x0c487a766110c85d301d96e33579c5b317fa4995 -GATEWAY_BASE=0x0c487a766110c85d301d96e33579c5b317fa4995 -GATEWAY_ZETACHAIN=0x6c533f7fe93fae114d0954697069df33c9b74fd7 - -GAS_LIMIT=1000000 -``` - -``` -PRIVATE_KEY=... -``` - -Deploy contracts on ZetaChain, Base and Ethereum. - -``` -NFT_ZETACHAIN=$(npx tsx commands deploy \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --name ZetaChainUniversalNFT \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $NFT_ZETACHAIN -``` - -``` -0x6335bAB2eF31B79eE01dCFDB656a1eEf5ACd0840 -``` - -``` -NFT_BASE=$(npx tsx commands deploy \ - --rpc $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --name EVMUniversalNFT \ - --gateway $GATEWAY_BASE \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $NFT_BASE -``` - -``` -0xB7c73Ee9B4E65458C972d64bbfAe653d0E6F389A -``` - -``` -NFT_ETHEREUM=$(npx tsx commands deploy \ - --rpc $RPC_ETHEREUM \ - --private-key $PRIVATE_KEY \ - --name EVMUniversalNFT \ - --gateway $GATEWAY_ETHEREUM \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $NFT_ETHEREUM -``` - -``` -0x166d406a3049C04bF884a4C8cfe99c5bdCebC928 -``` - -### Connect Contracts - -After deployment, link the contracts so they can trust each other for -cross-chain communication. Use `setConnected` on ZetaChain to register Connected -contracts by their ZRC-20 gas token (used to identify the chain): - -``` -cast send $NFT_ZETACHAIN 'setConnected(address,bytes)' $ZRC20_BASE $NFT_BASE --rpc-url $RPC_ZETACHAIN --private-key $PRIVATE_KEY -``` - -``` -cast send $NFT_ZETACHAIN 'setConnected(address,bytes)' $ZRC20_ETHEREUM $NFT_ETHEREUM --rpc-url $RPC_ZETACHAIN --private-key $PRIVATE_KEY -``` - -Then, on each connected chain, use `setUniversal` to point back to the Universal -contract on ZetaChain: - -``` -cast send $NFT_BASE 'setUniversal(address)' $NFT_ZETACHAIN --rpc-url $RPC_BASE --private-key $PRIVATE_KEY -``` - -``` -cast send $NFT_ETHEREUM 'setUniversal(address)' $NFT_ZETACHAIN --rpc-url $RPC_ETHEREUM --private-key $PRIVATE_KEY -``` - -This ensures only authorized contracts can send and receive NFT transfers across -chains. - -### Mint on ZetaChain - -``` -TOKEN_ID=$(npx tsx commands mint \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --contract $NFT_ZETACHAIN \ - --token-uri https://example.com/nft/metadata/1 | jq -r .tokenId) && echo $TOKEN_ID -``` - -### Transfer from ZetaChain to Base - -Transfer the token from ZetaChain to Base. Gas amount (specified in ZETA) is an -estimate. Unused tokens are refunded to the user. - -Use ZRC-20 Base ETH as the destination address to specify the chain to which the -NFT will be transferred. - -``` -npx tsx commands transfer \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --contract $NFT_ZETACHAIN \ - --token-id $TOKEN_ID \ - --destination $ZRC20_BASE \ - --gas-amount 5 | jq -r .transferTransactionHash -``` - -``` -0xc1d363c8fddd21add48580c52550248f969a9a3b65d1377440cefe7fa8631db8 -``` - -Outgoing cross-chain transaction from ZetaChain to Base: - -``` -zetachain q cctx --hash 0xc1d363c8fddd21add48580c52550248f969a9a3b65d1377440cefe7fa8631db8 -``` - -``` -7001 → 84532 ✅ OutboundMined -CCTX: 0x8066aaf467afb79d5c969b3389f958d566637ad690410b7538706d20d6eeceac -Tx Hash: 0xc1d363c8fddd21add48580c52550248f969a9a3b65d1377440cefe7fa8631db8 (on chain 7001) -Tx Hash: 0xe2c966b67fdc6759669cebc021466c408449f5c2c19954ffdb6e73d714ec29bc (on chain 84532) -Sender: 0x6335bAB2eF31B79eE01dCFDB656a1eEf5ACd0840 -Receiver: 0xB7c73Ee9B4E65458C972d64bbfAe653d0E6F389A -Message: 0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000a6ca386bc8dc2baad9c67208f0129de2244bda1b00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba320000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002268747470733a2f2f6578616d706c652e636f6d2f6e66742f6d657461646174612f310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -``` - -### Transfer from Base to Ethereum - -Let’s move the NFT again — this time from Base to Ethereum. You’ll reference the -same token ID, which remains unchanged. - -``` -npx tsx commands transfer \ - --rpc $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --contract $NFT_BASE \ - --token-id $TOKEN_ID \ - --destination $ZRC20_ETHEREUM \ - --gas-amount 0.05 | jq -r .transferTransactionHash -``` - -``` -0x4aa957b2678232fb3f09557e8fcee22d5503272b6d6b8001677f32cbcdfa30dc -``` - -``` -zetachain q cctx --hash 0x4aa957b2678232fb3f09557e8fcee22d5503272b6d6b8001677f32cbcdfa30dc -``` - -``` -84532 → 7001 ✅ OutboundMined -CCTX: 0xa54aea97073e6f76bf28c46290b0544b80aa1e85702284aacbedf03d5f59c322 -Tx Hash: 0x4aa957b2678232fb3f09557e8fcee22d5503272b6d6b8001677f32cbcdfa30dc (on chain 84532) -Tx Hash: 0xe8d8432917cc0cb98f60285c711608003859924f3dc962c648db23232a36dcbb (on chain 7001) -Sender: 0xB7c73Ee9B4E65458C972d64bbfAe653d0E6F389A -Receiver: 0x6335bAB2eF31B79eE01dCFDB656a1eEf5ACd0840 -Message: 00000000000000000000000005ba149a7bd6dc1f937fa9046a9e05c05f3b18b00000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000a6ca386bc8dc2baad9c67208f0129de2244bda1b00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba320000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002268747470733a2f2f6578616d706c652e636f6d2f6e66742f6d657461646174612f310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Amount: 50000000000000000 Gas tokens - -7001 → 11155111 ✅ OutboundMined -CCTX: 0x34656cbd3210f3e33edb6d261bfdbc800476baa85f40fc15b75f934efbbd30c9 -Tx Hash: 0xa54aea97073e6f76bf28c46290b0544b80aa1e85702284aacbedf03d5f59c322 (on chain 7001) -Tx Hash: 0xe7c0d400bd94e5c84cb44752d1e9e05e05f73f0433f6e915e77cc7fdde47d8fd (on chain 11155111) -Sender: 0x6335bAB2eF31B79eE01dCFDB656a1eEf5ACd0840 -Receiver: 0x166d406a3049C04bF884a4C8cfe99c5bdCebC928 -Message: 0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000a6ca386bc8dc2baad9c67208f0129de2244bda1b00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000e22dfad4b38420000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba320000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002268747470733a2f2f6578616d706c652e636f6d2f6e66742f6d657461646174612f310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Amount: 3978993754388546 Gas tokens -``` - -## Source Code - -https://github.com/zeta-chain/example-contracts/tree/main/examples/nft diff --git a/src/pages/developers/standards/nft.zh-CN.mdx b/src/pages/developers/standards/nft.zh-CN.mdx deleted file mode 100644 index d3b837483..000000000 --- a/src/pages/developers/standards/nft.zh-CN.mdx +++ /dev/null @@ -1,213 +0,0 @@ -通用 NFT 是完全互操作的 ERC-721 代币,可在任意已连接链上铸造与转移,无需包装或跨链桥。每个 NFT 拥有跨链保持一致的持久 Token ID,元数据显示在跨链转移中始终保留。这为跨链游戏、市场与身份等场景带来真正的链无关所有权与交互体验。 - -ZetaChain 上的通用 NFT 基于标准的 [OpenZeppelin ERC-721](https://docs.openzeppelin.com/contracts/5.x/api/token/erc721) 实现,并采用 [UUPS 可升级](https://docs.openzeppelin.com/contracts/5.x/api/proxy#UUPSUpgradeable) 代理模式,使开发者能够在保证安全的前提下扩展与升级 NFT 逻辑。 - -## 方案一:创建新的通用 NFT - -新建通用 NFT 项目: - -``` -npx zetachain@latest new --project nft -``` - -安装依赖: - -``` -cd nft -yarn -forge soldeer update -``` - -编译合约: - -``` -forge build -``` - -## 方案二:升级现有 ERC-721 项目 - -你可以在现有的 ERC-721 项目中集成通用 NFT 能力,只需安装官方标准合约包: - -```bash -yarn add @zetachain/standard-contracts -``` - -随后参考 [示例实现](https://github.com/zeta-chain/example-contracts/tree/main/examples/nft/contracts),按照注释加入专为通用 NFT 设计的 ZetaChain 集成逻辑。 - -这样即可在 ZetaChain 与所有已连接的 EVM 链上支持跨链铸造、转移与持久 Token ID。 - -## 部署到测试网 - -``` -RPC_ETHEREUM=$(zetachain q chains show --chain-id 11155111 -f rpc) -RPC_BASE=$(zetachain q chains show --chain-id 84532 -f rpc) -RPC_ZETACHAIN=$(zetachain q chains show --chain-id 7001 -f rpc) - -ZRC20_ETHEREUM=$(zetachain q tokens show -s ETH.ETHSEP -f zrc20) -ZRC20_BASE=$(zetachain q tokens show -s ETH.BASESEP -f zrc20) - -GATEWAY_ETHEREUM=0x0c487a766110c85d301d96e33579c5b317fa4995 -GATEWAY_BASE=0x0c487a766110c85d301d96e33579c5b317fa4995 -GATEWAY_ZETACHAIN=0x6c533f7fe93fae114d0954697069df33c9b74fd7 - -GAS_LIMIT=1000000 -``` - -``` -PRIVATE_KEY=... -``` - -在 ZetaChain、Base 与 Ethereum 上部署合约。 - -``` -NFT_ZETACHAIN=$(npx tsx commands deploy \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --name ZetaChainUniversalNFT \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $NFT_ZETACHAIN -``` - -``` -0x6335bAB2eF31B79eE01dCFDB656a1eEf5ACd0840 -``` - -``` -NFT_BASE=$(npx tsx commands deploy \ - --rpc $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --name EVMUniversalNFT \ - --gateway $GATEWAY_BASE \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $NFT_BASE -``` - -``` -0xB7c73Ee9B4E65458C972d64bbfAe653d0E6F389A -``` - -``` -NFT_ETHEREUM=$(npx tsx commands deploy \ - --rpc $RPC_ETHEREUM \ - --private-key $PRIVATE_KEY \ - --name EVMUniversalNFT \ - --gateway $GATEWAY_ETHEREUM \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $NFT_ETHEREUM -``` - -``` -0x166d406a3049C04bF884a4C8cfe99c5bdCebC928 -``` - -### 连接合约 - -部署完成后,需要将各合约互信,使其能进行跨链通信。在 ZetaChain 上调用 `setConnected`,按链对应的 ZRC-20 Gas 代币注册 Connected 合约: - -``` -cast send $NFT_ZETACHAIN 'setConnected(address,bytes)' $ZRC20_BASE $NFT_BASE --rpc-url $RPC_ZETACHAIN --private-key $PRIVATE_KEY -``` - -``` -cast send $NFT_ZETACHAIN 'setConnected(address,bytes)' $ZRC20_ETHEREUM $NFT_ETHEREUM --rpc-url $RPC_ZETACHAIN --private-key $PRIVATE_KEY -``` - -随后在每条已连接链上,调用 `setUniversal` 将 Universal 合约地址指回 ZetaChain: - -``` -cast send $NFT_BASE 'setUniversal(address)' $NFT_ZETACHAIN --rpc-url $RPC_BASE --private-key $PRIVATE_KEY -``` - -``` -cast send $NFT_ETHEREUM 'setUniversal(address)' $NFT_ZETACHAIN --rpc-url $RPC_ETHEREUM --private-key $PRIVATE_KEY -``` - -这样即可确保只有经过授权的合约可以跨链发送与接收 NFT。 - -### 在 ZetaChain 铸造 - -``` -TOKEN_ID=$(npx tsx commands mint \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --contract $NFT_ZETACHAIN \ - --token-uri https://example.com/nft/metadata/1 | jq -r .tokenId) && echo $TOKEN_ID -``` - -### 从 ZetaChain 转移至 Base - -将该 NFT 从 ZetaChain 转移到 Base。Gas 金额(以 ZETA 指定)为估算值,剩余部分会退回用户。 - -使用 ZRC-20 Base ETH 作为目标地址,用于指明目标链。 - -``` -npx tsx commands transfer \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --contract $NFT_ZETACHAIN \ - --token-id $TOKEN_ID \ - --destination $ZRC20_BASE \ - --gas-amount 5 | jq -r .transferTransactionHash -``` - -``` -0xc1d363c8fddd21add48580c52550248f969a9a3b65d1377440cefe7fa8631db8 -``` - -``` -zetachain q cctx --hash 0xc1d363c8fddd21add48580c52550248f969a9a3b65d1377440cefe7fa8631db8 -``` - -``` -7001 → 84532 ✅ OutboundMined -CCTX: 0x8066aaf467afb79d5c969b3389f958d566637ad690410b7538706d20d6eeceac -Tx Hash: 0xc1d363c8fddd21add48580c52550248f969a9a3b65d1377440cefe7fa8631db8 (on chain 7001) -Tx Hash: 0xe2c966b67fdc6759669cebc021466c408449f5c2c19954ffdb6e73d714ec29bc (on chain 84532) -Sender: 0x6335bAB2eF31B79eE01dCFDB656a1eEf5ACd0840 -Receiver: 0xB7c73Ee9B4E65458C972d64bbfAe653d0E6F389A -Message: 0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000a6ca386bc8dc2baad9c67208f0129de2244bda1b00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba320000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002268747470733a2f2f6578616d706c652e636f6d2f6e66742f6d657461646174612f310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -``` - -### 从 Base 转移至 Ethereum - -再将 NFT 从 Base 转移到 Ethereum。Token ID 保持不变。 - -``` -npx tsx commands transfer \ - --rpc $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --contract $NFT_BASE \ - --token-id $TOKEN_ID \ - --destination $ZRC20_ETHEREUM \ - --gas-amount 0.05 | jq -r .transferTransactionHash -``` - -``` -0x4aa957b2678232fb3f09557e8fcee22d5503272b6d6b8001677f32cbcdfa30dc -``` - -``` -zetachain q cctx --hash 0x4aa957b2678232fb3f09557e8fcee22d5503272b6d6b8001677f32cbcdfa30dc -``` - -``` -84532 → 7001 ✅ OutboundMined -CCTX: 0xa54aea97073e6f76bf28c46290b0544b80aa1e85702284aacbedf03d5f59c322 -Tx Hash: 0x4aa957b2678232fb3f09557e8fcee22d5503272b6d6b8001677f32cbcdfa30dc (on chain 84532) -Tx Hash: 0xe8d8432917cc0cb98f60285c711608003859924f3dc962c648db23232a36dcbb (on chain 7001) -Sender: 0xB7c73Ee9B4E65458C972d64bbfAe653d0E6F389A -Receiver: 0x6335bAB2eF31B79eE01dCFDB656a1eEf5ACd0840 -Message: 00000000000000000000000005ba149a7bd6dc1f937fa9046a9e05c05f3b18b00000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000a6ca386bc8dc2baad9c67208f0129de2244bda1b00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba320000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002268747470733a2f2f6578616d706c652e636f6d2f6e66742f6d657461646174612f310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Amount: 50000000000000000 Gas tokens - -7001 → 11155111 ✅ OutboundMined -CCTX: 0x34656cbd3210f3e33edb6d261bfdbc800476baa85f40fc15b75f934efbbd30c9 -Tx Hash: 0xa54aea97073e6f76bf28c46290b0544b80aa1e85702284aacbedf03d5f59c322 (on chain 7001) -Tx Hash: 0xe7c0d400bd94e5c84cb44752d1e9e05e05f73f0433f6e915e77cc7fdde47d8fd (on chain 11155111) -Sender: 0x6335bAB2eF31B79eE01dCFDB656a1eEf5ACd0840 -Receiver: 0x166d406a3049C04bF884a4C8cfe99c5bdCebC928 -Message: 0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000a6ca386bc8dc2baad9c67208f0129de2244bda1b00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000e22dfad4b38420000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba320000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000002268747470733a2f2f6578616d706c652e636f6d2f6e66742f6d657461646174612f310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Amount: 3978993754388546 Gas tokens -``` - -## 源码 - -https://github.com/zeta-chain/example-contracts/tree/main/examples/nft - diff --git a/src/pages/developers/standards/overview.en-US.mdx b/src/pages/developers/standards/overview.en-US.mdx deleted file mode 100644 index fceaf1372..000000000 --- a/src/pages/developers/standards/overview.en-US.mdx +++ /dev/null @@ -1,108 +0,0 @@ -The Universal NFT and Token standards enable non-fungible tokens (ERC-721 NFTs) -and fungible tokens (ERC-20) to be minted on any chain and seamlessly -transferred between connected chains. - -For simplicity, we'll refer to both Universal NFTs and Universal Tokens as -"assets" throughout this document. - -When transferring assets between chains, an asset is burned on the source chain. -The asset's metadata and information are sent in a message to the asset contract -on the destination chain, where a corresponding asset is minted. - -Both Universal NFT and Universal Token projects consist of two contracts: -**Universal** and **Connected**. - -The Universal contract is deployed on ZetaChain. It is used to: - -- Mint assets on ZetaChain -- Transfer assets from ZetaChain to a connected chain -- Handle incoming asset transfers from a connected chain to ZetaChain -- Handle asset transfers between connected chains - -The Connected contract is deployed on one or more connected EVM chains. It is -used to: - -- Mint assets on a connected chain -- Transfer assets to another connected chain or ZetaChain -- Handle incoming asset transfers from ZetaChain or another connected chain - -A Universal contract deployment on ZetaChain is required, while Connected -contracts can be deployed as needed to enable asset transfers for specific -chains. - -A universal asset can be minted on any chain — ZetaChain or any connected EVM -chain. - -For Universal NFTs, when an asset is minted, it receives a persistent ID that is -unique across all chains. This ID remains unchanged when the asset is -transferred between chains. - -Assets can be transferred from ZetaChain to a connected chain, from a connected -chain to ZetaChain, and between connected chains. ZetaChain acts as a hub for -cross-chain transactions, so all transfers are routed through it. For example, -when transferring an asset from Ethereum to BNB, two cross-chain transactions -are initiated: Ethereum → ZetaChain → BNB. This does not affect transfer time or -cost, but it allows the system to scale linearly as more chains are added. - -Cross-chain asset transfers support reverts. If the transfer fails on the -destination chain, the asset is returned to the original sender on the source -chain. - -Asset contracts only accept cross-chain calls from trusted contracts. Each -contract on a connected chain stores the address of the Universal contract on -ZetaChain. The Universal contract, in turn, stores the addresses of the -connected contracts on other chains. This ensures that only contracts from the -same asset collection can participate in cross-chain transfers. - -Here’s the flow using a Universal NFT as an example: - -![https://excalidraw.com/#json=dQJisu_uJ0N8T6IPi2m0E,PJU63ktFfbi1WsfAXsompA](/img/docs/tutorials-nft.png) - -## Deployment - -1. Deploy the **Universal** contract on ZetaChain. This is a required step, as - ZetaChain acts as the hub for all cross-chain transfers, even between - connected EVM chains. -2. Deploy a **Connected** contract on a supported EVM chain (e.g., Ethereum, - Base, Polygon, BNB). -3. On a universal contract on ZetaChain, run `setConnected(zrc20, connectedAddress)`, where: - - `zrc20` is the [ZRC-20 contract](/developers/evm/zrc20) of the gas token - for the target EVM chain. This acts as a chain identifier. - - `connectedAddress` is the address of the **Connected** contract on the EVM - chain (from step 2). -4. On the connected EVM chain, run - `ConnectedAsset.setUniversal(universalAddress)`, where `universalAddress` is - the address of the **Universal** contract on ZetaChain (from step 1). - -You now have trusted asset contracts deployed and linked on ZetaChain and a -connected EVM chain. - -To enable transfers to additional EVM chains, repeat steps 2 and 3 for each new -chain. - -> `setConnected` and `setUniversal` are required to establish a secure trust -> relationship between the asset contracts. Each contract verifies that -> cross-chain calls originate from a trusted counterpart. - -## Gas Fees - -- **EVM → ZetaChain:** No cross-chain fee is charged. -- **ZetaChain → EVM:** A cross-chain fee is paid in **ZETA**, based on the - ZRC-20 withdraw fee for the destination chain. ZETA is automatically swapped - to the destination chain's gas token ZRC-20 to cover execution. -- **EVM → EVM:** A cross-chain fee is paid in the **gas token of the source - chain**. For example, if transferring an asset from Ethereum to BNB, the fee - is paid in ETH. ZetaChain uses ZRC-20 ETH to cover the execution and swaps it - for ZRC-20 BNB to call the destination chain. - -## Revert Handling - -If a cross-chain transfer fails on the destination chain (e.g., due to -out-of-gas, contract rejection, or network error), the asset is **reverted to -the original sender**. - -When a transfer between two connected EVM chains fails, the asset is reverted to -the **original sender on ZetaChain**, rather than the original source chain. -This avoids costly return operations to the EVM chain where the transfer -started. The sender can then initiate a new transfer to the same or another -chain. diff --git a/src/pages/developers/standards/overview.zh-CN.mdx b/src/pages/developers/standards/overview.zh-CN.mdx deleted file mode 100644 index c052f0396..000000000 --- a/src/pages/developers/standards/overview.zh-CN.mdx +++ /dev/null @@ -1,65 +0,0 @@ -通用 NFT 与通用代币标准,使非同质化代币(ERC-721)与同质化代币(ERC-20)能够在任意链上铸造,并在已连接的链之间无缝转移。 - -为方便起见,本文将通用 NFT 与通用代币统称为“资产”。 - -当资产在链间转移时,会先在源链上销毁,并将资产的元数据与信息通过消息发送给目标链上的资产合约,由该合约铸造出对应资产。 - -通用 NFT 与通用代币项目均由两个合约组成:**Universal** 与 **Connected**。 - -Universal 合约部署在 ZetaChain,用于: - -- 在 ZetaChain 上铸造资产 -- 将资产从 ZetaChain 转移到已连接的链 -- 处理来自已连接链到 ZetaChain 的入站资产转移 -- 处理已连接链之间的资产转移 - -Connected 合约部署在一个或多个已连接的 EVM 链上,用于: - -- 在已连接链上铸造资产 -- 将资产转移到另一条已连接链或 ZetaChain -- 处理来自 ZetaChain 或其他已连接链的入站资产转移 - -Universal 合约必须在 ZetaChain 上部署;Connected 合约可按需部署,以便为特定链启用资产转移。 - -通用资产可以在任意链上铸造——无论是 ZetaChain,还是任何已连接的 EVM 链。 - -对于通用 NFT,资产铸造后会获得一个跨所有链唯一的持久 ID。该 ID 在资产跨链流转时保持不变。 - -资产可从 ZetaChain 转移到已连接链、从已连接链转移回 ZetaChain,也能在已连接链之间互转。ZetaChain 作为跨链交易的枢纽,所有转移都会经由它进行路由。例如,当资产从以太坊转移到 BNB 时,会触发两笔跨链交易:Ethereum → ZetaChain → BNB。这样的设计不会增加时间或成本,却能在新增链时线性扩展。 - -跨链资产转移支持回退(revert)。如果目标链上的转移失败,资产会返还给源链上的原始发送者。 - -资产合约只接受来自可信合约的跨链调用。每个已连接链上的合约都会存储 ZetaChain 上 Universal 合约的地址;Universal 合约则保存其他链上 Connected 合约的地址。这样可确保只有同一资产合集下的合约才可发起跨链转移。 - -以下以通用 NFT 为例,展示整体流程: - -![https://excalidraw.com/#json=dQJisu_uJ0N8T6IPi2m0E,PJU63ktFfbi1WsfAXsompA](/img/docs/tutorials-nft.png) - -## 部署 - -1. 在 ZetaChain 上部署 **Universal** 合约。该步骤必不可少,因为 ZetaChain 是所有跨链转移(包括已连接 EVM 链之间互转)的枢纽。 -2. 在任一受支持的 EVM 链(如 Ethereum、Base、Polygon、BNB)部署 **Connected** 合约。 -3. 在 ZetaChain 上的 Universal 合约中执行 `setConnected(zrc20, connectedAddress)`: - - `zrc20` 是目标 EVM 链的 [ZRC-20 合约](/developers/evm/zrc20),用来标识该链。 - - `connectedAddress` 是该 EVM 链上 **Connected** 合约的地址(步骤 2)。 -4. 在已连接的 EVM 链上执行 - `ConnectedAsset.setUniversal(universalAddress)`,其中 `universalAddress` 为 ZetaChain 上 **Universal** 合约的地址(步骤 1)。 - -至此,ZetaChain 与已连接 EVM 链上可信的资产合约已部署并互相绑定。 - -若要支持更多 EVM 链,重复步骤 2 与步骤 3 即可。 - -> `setConnected` 与 `setUniversal` 用于建立合约之间的信任关系。每个合约都会验证跨链调用是否来自受信任的对应方。 - -## Gas 费用 - -- **EVM → ZetaChain:** 不收取跨链费用。 -- **ZetaChain → EVM:** 需要支付 **ZETA** 作为跨链费用,金额基于目标链的 ZRC-20 提现费用。系统会将 ZETA 自动兑换成目标链的 ZRC-20 Gas 代币以完成执行。 -- **EVM → EVM:** 跨链费用以**源链的 Gas 代币**支付。例如,从 Ethereum 转移资产到 BNB 时,费用以 ETH 支付。ZetaChain 使用 ZRC-20 ETH 进行执行,并兑换为 ZRC-20 BNB 调用目标链。 - -## 回退处理 - -如果跨链转移在目标链失败(例如因为耗尽 Gas、合约拒绝或网络错误),资产会**返还给原始发送者**。 - -当两个已连接 EVM 链之间的转移失败时,资产会回退到 **ZetaChain 上的原始发送者**,而非源链。这避免了将资产退回源链时的高昂开销,发送者随后可再次发起到同链或其他链的转移。*** - diff --git a/src/pages/developers/standards/token.en-US.mdx b/src/pages/developers/standards/token.en-US.mdx deleted file mode 100644 index e55223e38..000000000 --- a/src/pages/developers/standards/token.en-US.mdx +++ /dev/null @@ -1,215 +0,0 @@ -Universal Tokens are fully interoperable ERC-20 tokens that can be minted and -transferred across any connected chain without wrapping or bridging. Each token -retains its supply and metadata across chains, enabling true chain-agnostic -fungibility and seamless use in multichain DeFi, payments, and governance -systems. - -Universal Tokens on ZetaChain are built on the standard [OpenZeppelin -ERC-20](https://docs.openzeppelin.com/contracts/5.x/api/token/erc20) -implementation and use [UUPS -upgradeable](https://docs.openzeppelin.com/contracts/5.x/api/proxy#UUPSUpgradeable) -proxy patterns, allowing developers to extend and upgrade token logic safely -over time. - -## Option 1: Create a New Universal Token - -Create a new Universal Token project: - -``` -npx zetachain@latest new --project token -``` - -Install dependencies: - -``` -cd token -yarn -forge soldeer update -``` - -Compile contracts: - -``` -forge build -``` - -## Option 2: Upgrade an Existing ERC-20 Project - -You can upgrade your existing ERC-20 project to become a Universal Token by -installing the official standard contracts package: - -```bash -yarn add @zetachain/standard-contracts -``` - -Then, update your contract using the [example -implementation](https://github.com/zeta-chain/example-contracts/tree/main/examples/token/contracts) -as a reference—see the commented lines that include Universal Token-specific -logic for ZetaChain integration. - -This allows your token to support cross-chain minting, transfers, and persistent -supply tracking across ZetaChain and connected EVM chains. - -## Deploy on Testnet - -``` -RPC_ETHEREUM=$(zetachain q chains show --chain-id 11155111 -f rpc) -RPC_BASE=$(zetachain q chains show --chain-id 84532 -f rpc) -RPC_ZETACHAIN=$(zetachain q chains show --chain-id 7001 -f rpc) - -ZRC20_ETHEREUM=$(zetachain q tokens show -s ETH.ETHSEP -f zrc20) -ZRC20_BASE=$(zetachain q tokens show -s ETH.BASESEP -f zrc20) - -GATEWAY_ETHEREUM=0x0c487a766110c85d301d96e33579c5b317fa4995 -GATEWAY_BASE=0x0c487a766110c85d301d96e33579c5b317fa4995 -GATEWAY_ZETACHAIN=0x6c533f7fe93fae114d0954697069df33c9b74fd7 - -GAS_LIMIT=1000000 -``` - -``` -PRIVATE_KEY=... -``` - -Deploy contracts on ZetaChain, Base and Ethereum. - -``` -ZETACHAIN_TOKEN=$(npx tsx commands deploy \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --name ZetaChainUniversalToken \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $ZETACHAIN_TOKEN -``` - -``` -BASE_TOKEN=$(npx tsx commands deploy \ - --rpc $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --name EVMUniversalToken \ - --gateway $GATEWAY_BASE \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $BASE_TOKEN -``` - -``` -ETHEREUM_TOKEN=$(npx tsx commands deploy \ - --rpc $RPC_ETHEREUM \ - --private-key $PRIVATE_KEY \ - --name EVMUniversalToken \ - --gateway $GATEWAY_ETHEREUM \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $ETHEREUM_TOKEN -``` - -### Connect Contracts - -After deployment, link the contracts so they can trust each other for -cross-chain communication. Use `setConnected` on ZetaChain to register Connected -contracts by their ZRC-20 gas token (used to identify the chain): - -``` -cast send $ZETACHAIN_TOKEN 'setConnected(address,bytes)' $ZRC20_BASE $BASE_TOKEN --rpc-url $RPC_ZETACHAIN --private-key $PRIVATE_KEY -``` - -``` -cast send $ZETACHAIN_TOKEN 'setConnected(address,bytes)' $ZRC20_ETHEREUM $ETHEREUM_TOKEN --rpc-url $RPC_ZETACHAIN --private-key $PRIVATE_KEY -``` - -Then, on each connected chain, use `setUniversal` to point back to the Universal -contract on ZetaChain: - -``` -cast send $BASE_TOKEN 'setUniversal(address)' $ZETACHAIN_TOKEN --rpc-url $RPC_BASE --private-key $PRIVATE_KEY -``` - -``` -cast send $ETHEREUM_TOKEN 'setUniversal(address)' $ZETACHAIN_TOKEN --rpc-url $RPC_ETHEREUM --private-key $PRIVATE_KEY -``` - -This ensures only authorized contracts can send and receive token transfers -across chains. - -### Mint on ZetaChain - -``` -npx tsx commands mint \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --contract $ZETACHAIN_TOKEN \ - --amount 10 | jq -r .mintTransactionHash -``` - -https://zetachain-testnet.blockscout.com/tx/0xbe550cb123e34c4bddf3b273e854837ea6f727e527bf80a752870c3f8bff0ef1 - -### Transfer from ZetaChain to Base - -Transfer the token from ZetaChain to Base. Gas amount (specified in ZETA) is an -estimate. Unused tokens are refunded to the user. - -Use ZRC-20 Base ETH as the destination address to specify the chain to which the -tokens will be transferred. - -``` -npx tsx commands transfer \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --from $ZETACHAIN_TOKEN \ - --destination $ZRC20_BASE \ - --amount 10 \ - --gas-amount 5 | jq -r .transferTransactionHash -``` - -``` -zetachain q cctx --hash 0x2ced374831b7612f4f2df98f2d1f30b2fa797ddcc62df0a5883b402b9310fe7a -``` - -``` -7001 → 84532 ✅ OutboundMined -CCTX: 0x88ac99d5ce593af62f5e56e2cdeb14797e23fb890933f50d74f1c8944b91b991 -Tx Hash: 0x2ced374831b7612f4f2df98f2d1f30b2fa797ddcc62df0a5883b402b9310fe7a (on chain 7001) -Tx Hash: 0x4c0dbfda09e0364a54be7f812a49c677739f0c3a9bc6d2e6bf0c8d5ea4a7903d (on chain 84532) -Sender: 0xE3CA615E4Bd2b106ff51e88A04Ec39A2Afc75212 -Receiver: 0x449777033Ff53aD3B4F70C17c31110476E61D2A8 -Message: 0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba3200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000 -``` - -### Transfer from Base to Ethereum - -Let’s move the token again — this time from Base to Ethereum. - -``` -npx tsx commands transfer \ - --rpc $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --from $BASE_TOKEN \ - --destination $ZRC20_ETHEREUM \ - --amount 10 \ - --gas-amount 0.005 | jq -r .transferTransactionHash -``` - -``` -zetachain q cctx --hash 0x8db12522169485a44ba8490d53f734ac6b7f5da72a6decbe3ae462198a960cee -``` - -``` -84532 → 7001 ✅ OutboundMined -CCTX: 0x39d970fc742519c87e67733ffd13315dce907c07e65cf97ba4ffba2e2bf2ceed -Tx Hash: 0x8db12522169485a44ba8490d53f734ac6b7f5da72a6decbe3ae462198a960cee (on chain 84532) -Tx Hash: 0x180f7fecd37f9e097ae5372ec729502933aa15cd6ec078af1efb911370fb33ea (on chain 7001) -Sender: 0x449777033Ff53aD3B4F70C17c31110476E61D2A8 -Receiver: 0xE3CA615E4Bd2b106ff51e88A04Ec39A2Afc75212 -Message: 00000000000000000000000005ba149a7bd6dc1f937fa9046a9e05c05f3b18b00000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba3200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000 -Amount: 5000000000000000 Gas tokens - -7001 → 11155111 ✅ PendingOutbound (transaction broadcasted to target chain) -CCTX: 0xbbc4e169decc986556b079445dc5055725dff65e9ee66a48613374c1b4e64eda -Tx Hash: 0x39d970fc742519c87e67733ffd13315dce907c07e65cf97ba4ffba2e2bf2ceed (on chain 7001) -Tx Hash: 0x5f973954ab6c6745e770e02f4697309b3e18be60fc53764c7b6deec07cd5fe4b (on chain 11155111) -Sender: 0xE3CA615E4Bd2b106ff51e88A04Ec39A2Afc75212 -Receiver: 0xBc1eE0E9452eC2E809FC2dBD0000A7D6095fDfC2 -Message: 0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000006ba661563e1c0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba3200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000 -Amount: 118362341785116 Gas tokens -Status: PendingOutbound, initiating outbound -``` - -## Source Code - -https://github.com/zeta-chain/example-contracts/tree/main/examples/token diff --git a/src/pages/developers/standards/token.zh-CN.mdx b/src/pages/developers/standards/token.zh-CN.mdx deleted file mode 100644 index 876bd0265..000000000 --- a/src/pages/developers/standards/token.zh-CN.mdx +++ /dev/null @@ -1,196 +0,0 @@ -通用代币是完全互操作的 ERC-20 代币,可在任意已连接链上铸造与转移,无需包装或跨链桥。每个代币在所有链上都保持统一的总量与元数据,为多链 DeFi、支付与治理系统带来真正的链无关流动性。 - -ZetaChain 上的通用代币基于标准的 [OpenZeppelin ERC-20](https://docs.openzeppelin.com/contracts/5.x/api/token/erc20) 实现,并采用 [UUPS 可升级](https://docs.openzeppelin.com/contracts/5.x/api/proxy#UUPSUpgradeable) 代理模式,使开发者可以在保障安全的前提下迭代与升级代币逻辑。 - -## 方案一:创建新的通用代币 - -新建通用代币项目: - -``` -npx zetachain@latest new --project token -``` - -安装依赖: - -``` -cd token -yarn -forge soldeer update -``` - -编译合约: - -``` -forge build -``` - -## 方案二:升级现有 ERC-20 项目 - -你可以将现有 ERC-20 项目升级为通用代币,只需安装官方标准合约包: - -```bash -yarn add @zetachain/standard-contracts -``` - -随后参考 [示例实现](https://github.com/zeta-chain/example-contracts/tree/main/examples/token/contracts),留意带有通用代币专用逻辑的注释,并将相关代码整合进你的合约中。 - -这样即可让代币支持在 ZetaChain 与已连接 EVM 链之间进行跨链铸造、转移与总量跟踪。 - -## 部署到测试网 - -``` -RPC_ETHEREUM=$(zetachain q chains show --chain-id 11155111 -f rpc) -RPC_BASE=$(zetachain q chains show --chain-id 84532 -f rpc) -RPC_ZETACHAIN=$(zetachain q chains show --chain-id 7001 -f rpc) - -ZRC20_ETHEREUM=$(zetachain q tokens show -s ETH.ETHSEP -f zrc20) -ZRC20_BASE=$(zetachain q tokens show -s ETH.BASESEP -f zrc20) - -GATEWAY_ETHEREUM=0x0c487a766110c85d301d96e33579c5b317fa4995 -GATEWAY_BASE=0x0c487a766110c85d301d96e33579c5b317fa4995 -GATEWAY_ZETACHAIN=0x6c533f7fe93fae114d0954697069df33c9b74fd7 - -GAS_LIMIT=1000000 -``` - -``` -PRIVATE_KEY=... -``` - -在 ZetaChain、Base 与 Ethereum 上部署合约。 - -``` -ZETACHAIN_TOKEN=$(npx tsx commands deploy \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --name ZetaChainUniversalToken \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $ZETACHAIN_TOKEN -``` - -``` -BASE_TOKEN=$(npx tsx commands deploy \ - --rpc $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --name EVMUniversalToken \ - --gateway $GATEWAY_BASE \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $BASE_TOKEN -``` - -``` -ETHEREUM_TOKEN=$(npx tsx commands deploy \ - --rpc $RPC_ETHEREUM \ - --private-key $PRIVATE_KEY \ - --name EVMUniversalToken \ - --gateway $GATEWAY_ETHEREUM \ - --gas-limit $GAS_LIMIT | jq -r .contractAddress) && echo $ETHEREUM_TOKEN -``` - -### 连接合约 - -部署完成后,需要让各合约互信以支持跨链通信。在 ZetaChain 上调用 `setConnected`,按链对应的 ZRC-20 Gas 代币注册 Connected 合约: - -``` -cast send $ZETACHAIN_TOKEN 'setConnected(address,bytes)' $ZRC20_BASE $BASE_TOKEN --rpc-url $RPC_ZETACHAIN --private-key $PRIVATE_KEY -``` - -``` -cast send $ZETACHAIN_TOKEN 'setConnected(address,bytes)' $ZRC20_ETHEREUM $ETHEREUM_TOKEN --rpc-url $RPC_ZETACHAIN --private-key $PRIVATE_KEY -``` - -随后在每条已连接链上,调用 `setUniversal` 指回 ZetaChain 上的 Universal 合约: - -``` -cast send $BASE_TOKEN 'setUniversal(address)' $ZETACHAIN_TOKEN --rpc-url $RPC_BASE --private-key $PRIVATE_KEY -``` - -``` -cast send $ETHEREUM_TOKEN 'setUniversal(address)' $ZETACHAIN_TOKEN --rpc-url $RPC_ETHEREUM --private-key $PRIVATE_KEY -``` - -这样即可确保只有授权合约能跨链发送与接收代币。 - -### 在 ZetaChain 铸造 - -``` -npx tsx commands mint \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --contract $ZETACHAIN_TOKEN \ - --amount 10 | jq -r .mintTransactionHash -``` - -https://zetachain-testnet.blockscout.com/tx/0xbe550cb123e34c4bddf3b273e854837ea6f727e527bf80a752870c3f8bff0ef1 - -### 从 ZetaChain 转移至 Base - -将代币从 ZetaChain 转移到 Base。Gas 金额(以 ZETA 指定)为估算值,未使用部分会退还给用户。 - -使用 ZRC-20 Base ETH 作为目标地址,指明代币要转移到的链。 - -``` -npx tsx commands transfer \ - --rpc $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --from $ZETACHAIN_TOKEN \ - --destination $ZRC20_BASE \ - --amount 10 \ - --gas-amount 5 | jq -r .transferTransactionHash -``` - -``` -zetachain q cctx --hash 0x2ced374831b7612f4f2df98f2d1f30b2fa797ddcc62df0a5883b402b9310fe7a -``` - -``` -7001 → 84532 ✅ OutboundMined -CCTX: 0x88ac99d5ce593af62f5e56e2cdeb14797e23fb890933f50d74f1c8944b91b991 -Tx Hash: 0x2ced374831b7612f4f2df98f2d1f30b2fa797ddcc62df0a5883b402b9310fe7a (on chain 7001) -Tx Hash: 0x4c0dbfda09e0364a54be7f812a49c677739f0c3a9bc6d2e6bf0c8d5ea4a7903d (on chain 84532) -Sender: 0xE3CA615E4Bd2b106ff51e88A04Ec39A2Afc75212 -Receiver: 0x449777033Ff53aD3B4F70C17c31110476E61D2A8 -Message: 0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba3200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000 -``` - -### 从 Base 转移至 Ethereum - -再将代币从 Base 转移到 Ethereum。 - -``` -npx tsx commands transfer \ - --rpc $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --from $BASE_TOKEN \ - --destination $ZRC20_ETHEREUM \ - --amount 10 \ - --gas-amount 0.005 | jq -r .transferTransactionHash -``` - -``` -zetachain q cctx --hash 0x8db12522169485a44ba8490d53f734ac6b7f5da72a6decbe3ae462198a960cee -``` - -``` -84532 → 7001 ✅ OutboundMined -CCTX: 0x39d970fc742519c87e67733ffd13315dce907c07e65cf97ba4ffba2e2bf2ceed -Tx Hash: 0x8db12522169485a44ba8490d53f734ac6b7f5da72a6decbe3ae462198a960cee (on chain 84532) -Tx Hash: 0x180f7fecd37f9e097ae5372ec729502933aa15cd6ec078af1efb911370fb33ea (on chain 7001) -Sender: 0x449777033Ff53aD3B4F70C17c31110476E61D2A8 -Receiver: 0xE3CA615E4Bd2b106ff51e88A04Ec39A2Afc75212 -Message: 00000000000000000000000005ba149a7bd6dc1f937fa9046a9e05c05f3b18b00000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba3200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000 -Amount: 5000000000000000 Gas tokens - -7001 → 11155111 ✅ PendingOutbound (transaction broadcasted to target chain) -CCTX: 0xbbc4e169decc986556b079445dc5055725dff65e9ee66a48613374c1b4e64eda -Tx Hash: 0x39d970fc742519c87e67733ffd13315dce907c07e65cf97ba4ffba2e2bf2ceed (on chain 7001) -Tx Hash: 0x5f973954ab6c6745e770e02f4697309b3e18be60fc53764c7b6deec07cd5fe4b (on chain 11155111) -Sender: 0xE3CA615E4Bd2b106ff51e88A04Ec39A2Afc75212 -Receiver: 0xBc1eE0E9452eC2E809FC2dBD0000A7D6095fDfC2 -Message: 0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000006ba661563e1c0000000000000000000000004955a3f38ff86ae92a914445099caa8ea2b9ba3200000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000 -Amount: 118362341785116 Gas tokens -Status: PendingOutbound, initiating outbound -``` - -## 源码 - -https://github.com/zeta-chain/example-contracts/tree/main/examples/token - diff --git a/src/pages/developers/tutorials/_meta.en-US.json b/src/pages/developers/tutorials/_meta.en-US.json deleted file mode 100644 index 3420835ea..000000000 --- a/src/pages/developers/tutorials/_meta.en-US.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "intro": { - "title": "Getting Started", - "readTime": "10 min", - "description": "Learn more about universal apps" - }, - "hello": { - "title": "First Universal Contract", - "readTime": "10 min", - "description": "Build your first universal contract" - }, - "frontend": { - "title": "Build a Web App", - "readTime": "10 min", - "description": "Create a web app to interact with your universal contract: connect a wallet, send cross-chain calls, and track execution" - }, - "swap": { - "title": "Swap", - "readTime": "30 min", - "description": "Implement a universal swap app compatible with chains like Ethereum, Solana and Bitcoin" - }, - "messaging": { - "title": "Messaging", - "readTime": "30 min", - "description": "Learn how to make cross-chain calls between contracts on EVM chains" - }, - "call": { - "title": "Calls to/from EVM", - "readTime": "30 min", - "description": "Learn the fundamentals of message passing and cross-chain contract calls" - }, - "solana": { - "title": "Calls to/from Solana", - "readTime": "60 min", - "description": "Deposit assets and call universal apps from Solana, make outgoing calls to Solana" - }, - "sui": { - "title": "Calls from Sui", - "readTime": "60 min", - "description": "Deposit assets and call universal apps from Sui" - }, - "sui-withdraw-and-call": { - "title": "Calls to Sui", - "readTime": "60 min", - "description": "Withdraw assets and call contracts on Sui" - }, - "staking": { - "title": "Staking", - "readTime": "10 min", - "description": "Delegate and undelegate ZETA from EVM" - } -} \ No newline at end of file diff --git a/src/pages/developers/tutorials/_meta.zh-CN.json b/src/pages/developers/tutorials/_meta.zh-CN.json deleted file mode 100644 index ab2fe1bac..000000000 --- a/src/pages/developers/tutorials/_meta.zh-CN.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "intro": { - "title": "入门指南" - }, - "hello": { - "title": "第一个全链合约" - }, - "frontend": { - "title": "构建 Web 应用" - }, - "swap": { - "title": "跨链兑换" - }, - "messaging": { - "title": "跨链消息" - }, - "call": { - "title": "往返 EVM 的调用" - }, - "solana": { - "title": "往返 Solana 的调用" - }, - "sui": { - "title": "从 Sui 发起调用" - }, - "sui-withdraw-and-call": { - "title": "调用 Sui" - }, - "staking": { - "title": "质押" - } -} diff --git a/src/pages/developers/tutorials/call.en-US.mdx b/src/pages/developers/tutorials/call.en-US.mdx deleted file mode 100644 index c861a299b..000000000 --- a/src/pages/developers/tutorials/call.en-US.mdx +++ /dev/null @@ -1,550 +0,0 @@ -In this tutorial, you’ll learn how to build a Universal App on ZetaChain that -can: - -- Handle incoming calls from connected EVM chains -- Make outgoing calls to a contract on a connected EVM chain -- Gracefully handle failures using revert handling - -You’ll deploy two contracts: - -- A Universal App on ZetaChain that processes cross-chain calls and can send - calls back to a connected chain, optionally including token transfers. -- A Connected Contract on a connected EVM chain that can call into your - Universal App and receive calls back from it. - -This pattern demonstrates the core flows for two-way communication between -ZetaChain and a connected chain: - -- Incoming calls: connected chain → ZetaChain -- Outgoing calls: ZetaChain → connected chain -- Optional token transfers alongside calls in either direction -- Revert handling to recover gracefully from failed calls - -By the end, you’ll have a minimal, working example of bi-directional contract -calls with optional token movement and robust error handling. - -## Prerequisites - -Before you begin, make sure you've completed the following tutorials: - -- [Introduction to Universal Apps](/start/app/) -- [Getting Started with ZetaChain](/developers/tutorials/intro) -- [First Universal App](/developers/tutorials/hello) - -## Set Up Your Environment - -Start by creating a new project from the `call` template: - -```bash -zetachain new --project call -cd call -``` - -Install dependencies: - -```bash -yarn -``` - -Pull Solidity dependencies and compile the contracts: - -```bash -forge soldeer update -forge build -``` - -Your workspace is now ready for adding the Universal App and Connected Contract -logic. Next, we’ll walk through the key parts of the Universal App that handles -incoming calls and makes outgoing calls to a connected chain. - -## Universal App - -The Universal App runs on ZetaChain and implements the `UniversalContract` -interface. It receives calls from connected chains via the Gateway and can send -calls (with or without tokens) back to them. - -### Handling incoming calls - -When a connected chain calls your Universal App, the Gateway invokes `onCall`. -Here you decode the message and run your app’s logic: - -```solidity -function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message -) external override onlyGateway { - string memory name = abi.decode(message, (string)); - emit HelloEvent("Hello on ZetaChain", name); -} -``` - -- `context` identifies the source chain and sender -- `zrc20` is the token address representing the source chain’s gas asset (or - token sent) -- `amount` is the token amount delivered -- `message` is arbitrary calldata encoded on the source chain - -### Making outgoing calls - -To call a contract on a connected chain from your Universal App, first quote the -destination gas fee for your intended gas limit, pull that fee from the caller, -and approve the Gateway to spend it: - -```solidity -(, uint256 gasFee) = IZRC20(zrc20).withdrawGasFeeWithGasLimit(callOptions.gasLimit); -IZRC20(zrc20).transferFrom(msg.sender, address(this), gasFee); -IZRC20(zrc20).approve(address(gateway), gasFee); -``` - -Then use `gateway.call` to send the cross-chain request: - -```solidity -gateway.call( - receiver, // bytes: address of the contract on the connected chain - zrc20, // ZRC-20 for the destination chain’s gas token - message, // calldata for the destination contract - callOptions, // gas limit, call type - revertOptions // revert handling -); -``` - -### Withdrawing tokens and calling in one step - -To send tokens and call a function on the connected chain in the same -transaction, use: - -```solidity -gateway.withdrawAndCall( - receiver, - amount, - zrc20, - message, - callOptions, - revertOptions -); -``` - -This burns the ZRC-20 representation of the token on ZetaChain and releases the -corresponding native asset or ERC-20 on the destination chain, while also -executing the call. - -## Connected Contract - -The Connected contract lives on a connected EVM chain and uses EVM Gateway to -interact with your Universal App on ZetaChain. - -A Connected contract is not required to make calls to a Universal App, you can -call the Gateway directly from an EOA to trigger a cross-chain call. - -In this tutorial, the Connected contract is simply an example showing how a -contract on a connected chain can programmatically interact with a Universal -App, making it easier to embed cross-chain calls into on-chain workflows. - -### Calling a Universal App (EVM → ZetaChain) - -Send arbitrary calldata to a Universal App on ZetaChain: - -```solidity -gateway.call( - receiver, // address: Universal App on ZetaChain (EVM address) - message, // bytes: ABI-encoded payload for Universal onCall - revertOptions // revert behavior if delivery/execution fails -); -``` - -Once the cross-chain transaction is processed, the `onCall` function of the -target Universal App on ZetaChain is executed with the provided calldata. - -### Deposit tokens - -Deposit native gas (e.g., ETH) to an address/contract on ZetaChain: - -```solidity -gateway.deposit{value: msg.value}(receiver, revertOptions); -``` - -Deposit a supported ERC-20: - -```solidity -IERC20(asset).transferFrom(msg.sender, address(this), amount); -IERC20(asset).approve(address(gateway), amount); -gateway.deposit(receiver, amount, asset, revertOptions); -``` - -`deposit` only transfers tokens to the `receiver` on ZetaChain (EOA or contract) -and does not execute any code. The tokens arrive as ZRC-20. - -### Deposit and call - -Send value and execute logic on ZetaChain in the same transaction. - -Native gas: - -```solidity -gateway.depositAndCall{value: msg.value}( - receiver, - message, - revertOptions -); -``` - -ERC-20: - -```solidity -IERC20(asset).transferFrom(msg.sender, address(this), amount); -IERC20(asset).approve(address(gateway), amount); -gateway.depositAndCall( - receiver, - amount, - asset, - message, - revertOptions -); -``` - -After the cross-chain transaction is processed, the `onCall` function of the -target Universal App on ZetaChain runs, receiving both the transferred tokens -and the provided calldata in the same execution. - -## Revert Handling - -Cross-chain calls can fail for many reasons: insufficient gas on the destination -chain, a missing function in the target contract, or logic reverts in the called -function. To handle these cases gracefully, you can pass a `RevertOptions` -struct when making the call. - -If the call fails, the Gateway invokes the `onRevert` function of the -originating contract with a `RevertContext` containing details about the -failure. - -### Example: Universal App onRevert - -```solidity -function onRevert(RevertContext calldata revertContext) - external - onlyGateway -{ - emit RevertEvent("Revert on ZetaChain", revertContext); -} -``` - -You can use this hook to: - -- Emit events for off-chain monitoring -- Refund tokens to the original sender -- Retry or take compensating actions - -### Passing RevertOptions - -When calling or withdrawing with a call, provide `RevertOptions` to define: - -- The revert address (where to send refunds) -- Whether to call `onRevert` -- A custom revert message -- Gas limits for the revert call - -Example when making an outgoing call: - -```solidity -gateway.call( - receiver, - zrc20, - message, - callOptions, - RevertOptions({ - revertAddress: msg.sender, - callOnRevert: true, - abortAddress: address(0), - revertMessage: abi.encode("refund"), - onRevertGasLimit: 500_000 - }) -); -``` - -## Option 1: Deploy on Testnet - -Before deploying, you need a private key funded on both ZetaChain testnet and -your connected EVM testnet (for example, Base Sepolia) and the Gateway addresses -for each chain. - -```bash -GATEWAY_BASE=0x0c487a766110c85d301d96e33579c5b317fa4995 - -RPC_ZETACHAIN=https://zetachain-athens-evm.blockpi.network/v1/rpc/public -RPC_BASE=https://sepolia.base.org -``` - -### Deploy Universal to ZetaChain testnet - -```bash -UNIVERSAL=$(forge create Universal \ - --rpc-url $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json | jq -r .deployedTo) && echo $UNIVERSAL -``` - -### Deploy Connected to Base Sepolia - -```bash -CONNECTED=$(forge create Connected \ - --rpc-url $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json \ - --constructor-args $GATEWAY_BASE | jq -r .deployedTo) && echo $CONNECTED -``` - -### Make a call to the Universal App - -Call the Connected contract on Base Sepolia. It forwards through the Gateway to -your Universal App on ZetaChain. After the cross-chain transaction is processed, -the Universal App’s `onCall` executes. - -```bash -cast send $CONNECTED \ - --rpc-url $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --json \ - "call(address,bytes,(address,bool,address,bytes,uint256))" \ - $UNIVERSAL \ - $(cast abi-encode "f(string)" "hello") \ - "(0x0000000000000000000000000000000000000000,false,$UNIVERSAL,0x,0)" | jq -r '.transactionHash' -``` - -The third parameter to the `call` function is the RevertOptions struct: - -``` -(revertAddress, callOnRevert, abortAddress, revertMessage, onRevertGasLimit) -``` - -- `revertAddress`: address to receive refunded tokens if the call fails. For a - `call` with no token transfer, use zero address.. -- `callOnRevert`: whether to invoke `onRevert` if the call fails. The Gateway’s - `call` does not support this, so it must be `false`. -- `abortAddress`: address where the message is considered aborted if delivery - fails. Use the universal contract address, so that if the call fails, - `onAbort` is called on the universal contract. -- `revertMessage`: arbitrary bytes returned in the revert context. -- `onRevertGasLimit`: gas allocated for `onRevert`. Since `callOnRevert` is - `false`, set this to `0`. - -You can also run the same call with a command: - -```bash -npx tsx ./commands connected call \ - --rpc $RPC_BASE \ - --contract $CONNECTED \ - --private-key $PRIVATE_KEY \ - --receiver $UNIVERSAL \ - --types string \ - --values hello \ - --name Connected -``` - -After you broadcast a transaction on testnet, you can track its progress -end-to-end using the ZetaChain CLI: - -```bash -zetachain query cctx --hash $HASH -``` - -This command shows the full cross-chain transaction (CCTX) lifecycle, including -its current status, source and destination chain events, and any error or revert -details if execution fails. It's the easiest way to confirm when your -cross-chain call has been delivered and processed successfully. - -## Make a call from the Universal App - -Your Universal App on ZetaChain can initiate an outgoing call to a contract on a -connected EVM chain. The Universal App pulls the destination gas fee in the -chain’s gas ZRC-20, then calls the Gateway. - -First, quote the exact fee using the destination gas limit: - -```bash -GAS_LIMIT=500000 -ZRC20_BASE=0x236b0DE675cC8F46AE186897fCCeFe3370C9eDeD - -GAS_FEE=$(cast call --json $ZRC20_BASE \ - "withdrawGasFeeWithGasLimit(uint256)(address,uint256)" \ - $GAS_LIMIT \ - --rpc-url $RPC_ZETACHAIN | jq -r '.[1]') && echo $GAS_FEE -``` - -Approve the Universal App to spend the quoted fee: - -```bash -cast send $ZRC20_BASE \ - "approve(address,uint256)" \ - $UNIVERSAL \ - $GAS_FEE \ - --rpc-url $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY -``` - -Make the cross-chain call: - -```bash -cast send --json \ - --rpc-url $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - $UNIVERSAL \ - "call(bytes,address,bytes,(uint256,bool),(address,bool,address,bytes,uint256))" \ - $(cast abi-encode "f(bytes)" $CONNECTED) \ - $ZRC20_BASE \ - $(cast abi-encode "f(string)" "hello") \ - "($GAS_LIMIT,false)" \ - "($UNIVERSAL,false,$UNIVERSAL,0x,0)" | jq -r '.transactionHash' -``` - -- `$GAS_LIMIT` is the amount of gas forwarded to the destination call. It must - match the value used in `withdrawGasFeeWithGasLimit`. -- isArbitraryCall controls call type. Use false for an authenticated message, - use true for an arbitrary function call payload. - -RevertOptions: - -- `revertAddress` is the Universal contract address, so if the outgoing call - fails, a revert cross-chain transaction will be sent back to the Universal - contract. -- `callOnRevert` is true. Outgoing calls from ZetaChain support `callOnRevert` - because transactions from connected chains to ZetaChain incur no gas fees. -- `abortAddress` is also the Universal contract address, so if the outgoing call - fails and cannot be reverted, the abort is handled by the Universal contract. -- `revertMessage` is left empty in this example to keep the payload minimal. -- `onRevertGasLimit` is set to 0, because revert calls from connected chains to - ZetaChain do not incur gas fees. - -You can also run the same call with a command: - -``` -npx tsx ./commands universal call \ - --rpc $RPC_ZETACHAIN \ - --contract $UNIVERSAL \ - --private-key $PRIVATE_KEY \ - --receiver $CONNECTED \ - --types string \ - --values hello \ - --name Universal \ - --zrc20 $ZRC20_BASE -``` - -## Option 2: Deploy on Localnet - -Localnet lets you deploy and test both contracts entirely on your machine. It -runs a local ZetaChain instance alongside connected EVM chains, so you can -iterate quickly without waiting for testnet confirmations or dealing with -faucets. - -```bash -npx zetachain localnet start -``` - -This command launches Anvil with pre-funded accounts and deploys the ZetaChain -core contracts locally. Deployment metadata is saved under -`~/.zetachain/localnet/`. - -Extract the RPC URL, a funded private key, and the relevant contract addresses -from the localnet registry: - -```bash -RPC=http://localhost:8545 -ZRC20_ETHEREUM=$(jq -r '."11155112".zrc20Tokens[] | select(.coinType == "gas" and .originChainId == "11155112") | .address' ~/.zetachain/localnet/registry.json) && echo $ZRC20_ETHEREUM -PRIVATE_KEY=$(jq -r '.private_keys[0]' ~/.zetachain/localnet/anvil.json) && echo $PRIVATE_KEY -GATEWAY_ETHEREUM=$(jq -r '.["11155112"].contracts[] | select(.contractType == "gateway") | .address' ~/.zetachain/localnet/registry.json) && echo $GATEWAY_ETHEREUM -``` - -Deploy the Universal App: - -```bash -UNIVERSAL=$(forge create Universal \ - --rpc-url $RPC \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json | jq -r .deployedTo) && echo $UNIVERSAL -``` - -Deploy the Connected contract: - -```bash -CONNECTED=$(forge create Connected \ - --rpc-url $RPC \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json \ - --constructor-args $GATEWAY_ETHEREUM | jq -r .deployedTo) && echo $CONNECTED -``` - -This simulates a connected chain sending a message to the Universal App on -ZetaChain: - -```bash -npx tsx ./commands connected call \ - --rpc $RPC \ - --contract $CONNECTED \ - --private-key $PRIVATE_KEY \ - --receiver $UNIVERSAL \ - --types string \ - --values hello \ - --name Connected -``` - -Once the cross-chain transaction is processed locally, the Universal App’s -`onCall` will execute. - -This sends a message in the opposite direction, from ZetaChain to the connected -chain: - -```bash -npx tsx ./commands universal call \ - --rpc $RPC \ - --contract $UNIVERSAL \ - --private-key $PRIVATE_KEY \ - --receiver $CONNECTED \ - --types string \ - --values hello \ - --name Universal \ - --zrc20 $ZRC20_ETHEREUM -``` - -The command will: - -1. Quote the destination gas fee in $ZRC20_ETHEREUM -2. Approve the Universal App to spend that fee -3. Send the cross-chain call through the Gateway - -## Conclusion - -You’ve now built and tested a Universal App that demonstrates the core mechanics -of two-way contract communication on ZetaChain. By deploying both the Universal -App (on ZetaChain) and the Connected Contract (on a connected EVM chain), you -learned how to: - -- Receive and process incoming calls from connected chains through the Gateway. -- Send calls back from ZetaChain to a connected chain. -- Handle failures gracefully using revert handling so your cross-chain logic - remains robust. -- Run the exact same flows on testnet or entirely on localnet for faster - iteration. - -This pattern is the backbone of building Universal dApps applications that are -not limited to a single chain, but instead can orchestrate logic, assets, and -data across multiple environments from one place. - -From here, you can: - -- Add more connected chains to expand your app’s reach. -- Extend the contract logic to support complex workflows like swaps, staking, or - NFT transfers. -- Integrate your Universal App into larger protocols to unify liquidity and user - experience across ecosystems. - -With ZetaChain, these patterns work the same regardless of which chains you -connect, making your application future-proof and chain-agnostic from day one. - -Your next step is to take this minimal example and turn it into a real -cross-chain feature for your project without ever having to think in “single -chain” terms again. diff --git a/src/pages/developers/tutorials/call.zh-CN.mdx b/src/pages/developers/tutorials/call.zh-CN.mdx deleted file mode 100644 index 16f480ddc..000000000 --- a/src/pages/developers/tutorials/call.zh-CN.mdx +++ /dev/null @@ -1,482 +0,0 @@ ---- -title: 往返 EVM 的调用 ---- - -在本教程中,你将构建一个 ZetaChain 全链应用,使其能够: - -- 处理来自连接 EVM 链的入站调用 -- 向连接 EVM 链上的合约发起出站调用 -- 使用回退机制优雅处理失败 - -你将部署两个合约: - -- **Universal App**:部署在 ZetaChain,处理跨链调用,可向连接链回发调用并可选携带代币。 -- **Connected Contract**:部署在连接的 EVM 链,可调用 Universal App,并接收其回调。 - -该模式展示了 ZetaChain 与连接链之间双向通信的核心流程: - -- 入站调用:连接链 → ZetaChain -- 出站调用:ZetaChain → 连接链 -- 可选的双向代币转移 -- 回退处理以在失败时平稳恢复 - -完成后,你将拥有一个最小可用的双向合约调用示例,支持可选代币流转与健壮的错误处理。 - -## 前置条件 - -请先完成以下教程: - -- [全链应用简介](/start/app/) -- [ZetaChain 入门](/developers/tutorials/intro) -- [第一个全链应用](/developers/tutorials/hello) - -## 环境初始化 - -使用 `call` 模板创建项目: - -```bash -zetachain new --project call -cd call -``` - -安装依赖: - -```bash -yarn -``` - -拉取 Solidity 依赖并编译合约: - -```bash -forge soldeer update -forge build -``` - -现在可以开始编写 Universal App 与 Connected Contract 的核心逻辑。接下来我们先解析 Universal App 如何处理入站调用并向连接链发起出站调用。 - -## Universal App - -Universal App 部署在 ZetaChain,实现 `UniversalContract` 接口。它通过 Gateway 接收来自连接链的调用,也可以(带或不带代币)向连接链发起调用。 - -### 处理入站调用 - -当连接链调用 Universal App 时,Gateway 会触发 `onCall`。在此解码消息并执行你的业务逻辑: - -```solidity -function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message -) external override onlyGateway { - string memory name = abi.decode(message, (string)); - emit HelloEvent("Hello on ZetaChain", name); -} -``` - -- `context`:包含来源链与发送者信息 -- `zrc20`:源链 Gas 资产(或转入代币)的 ZRC-20 地址 -- `amount`:转入的代币数量 -- `message`:源链编码的任意载荷 - -### 发起出站调用 - -若要从 Universal App 调用连接链合约,首先根据目标链的 Gas 上限报价手续费,向调用方收取后批准 Gateway: - -```solidity -(, uint256 gasFee) = IZRC20(zrc20).withdrawGasFeeWithGasLimit(callOptions.gasLimit); -IZRC20(zrc20).transferFrom(msg.sender, address(this), gasFee); -IZRC20(zrc20).approve(address(gateway), gasFee); -``` - -然后通过 `gateway.call` 发送跨链请求: - -```solidity -gateway.call( - receiver, // bytes:连接链合约地址 - zrc20, // 目标链 Gas 对应的 ZRC-20 - message, // 目标合约的 calldata - callOptions, // Gas 上限、调用类型 - revertOptions // 回退处理配置 -); -``` - -### 同步提取代币并调用 - -如果希望在一次交易中既提取代币又调用目标链合约,可使用: - -```solidity -gateway.withdrawAndCall( - receiver, - amount, - zrc20, - message, - callOptions, - revertOptions -); -``` - -该流程会在 ZetaChain 销毁相应 ZRC-20,并在目标链释放对应原生资产或 ERC-20,同时执行合约调用。 - -## Connected Contract - -Connected 合约部署在连接的 EVM 链,通过 EVM Gateway 与 ZetaChain 上的 Universal App 交互。 - -实际上,你也可以直接从 EOA 调用 Gateway 发起跨链调用,这里使用合约仅为示例,展示如何在链上工作流中嵌入跨链逻辑。 - -### 调用 Universal App(EVM → ZetaChain) - -向 Universal App 发送任意 calldata: - -```solidity -gateway.call( - receiver, // address:ZetaChain 上 Universal App 的 EVM 地址 - message, // bytes:传入 Universal onCall 的 ABI 编码载荷 - revertOptions // 执行失败时的回退处理 -); -``` - -跨链交易完成后,目标 Universal App 的 `onCall` 会收到该载荷。 - -### 存入代币 - -向 ZetaChain 的地址/合约存入原生 Gas: - -```solidity -gateway.deposit{value: msg.value}(receiver, revertOptions); -``` - -存入受支持的 ERC-20: - -```solidity -IERC20(asset).transferFrom(msg.sender, address(this), amount); -IERC20(asset).approve(address(gateway), amount); -gateway.deposit(receiver, amount, asset, revertOptions); -``` - -`deposit` 仅将代币转给 ZetaChain 上的 `receiver`(EOA 或合约),不执行任何逻辑,代币以 ZRC-20 形式到账。 - -### 存入并调用 - -在一次交易中发送价值并在 ZetaChain 执行逻辑。 - -原生 Gas: - -```solidity -gateway.depositAndCall{value: msg.value}( - receiver, - message, - revertOptions -); -``` - -ERC-20: - -```solidity -IERC20(asset).transferFrom(msg.sender, address(this), amount); -IERC20(asset).approve(address(gateway), amount); -gateway.depositAndCall( - receiver, - amount, - asset, - message, - revertOptions -); -``` - -跨链交易完成后,目标 Universal App 的 `onCall` 会在收到代币与载荷的同一执行中运行。 - -## 回退处理 - -跨链调用可能因为目标链 Gas 不足、目标合约不存在函数、或逻辑回退等原因失败。通过传入 `RevertOptions` 结构体,可以优雅应对这些情况。 - -当调用失败时,Gateway 会调用发起方合约的 `onRevert`,并携带 `RevertContext` 说明原因。 - -### 示例:Universal App 的 onRevert - -```solidity -function onRevert(RevertContext calldata revertContext) - external - onlyGateway -{ - emit RevertEvent("Revert on ZetaChain", revertContext); -} -``` - -你可以利用该钩子: - -- 触发事件供链下监控 -- 向原始发送者退款 -- 重试或执行补偿逻辑 - -### 传递 RevertOptions - -在调用或 `withdrawAndCall` 时,传入 `RevertOptions` 可配置: - -- 回退地址(接收退款) -- 是否调用 `onRevert` -- 自定义回退消息 -- 回退调用的 Gas 限额 - -出站调用示例: - -```solidity -gateway.call( - receiver, - zrc20, - message, - callOptions, - RevertOptions({ - revertAddress: msg.sender, - callOnRevert: true, - abortAddress: address(0), - revertMessage: abi.encode("refund"), - onRevertGasLimit: 500_000 - }) -); -``` - -## 方案一:部署到测试网 - -部署前需要准备: - -- 拥有资金的私钥(ZetaChain 测试网与连接 EVM 测试网,如 Base Sepolia) -- 两条链的 Gateway 地址 - -```bash -GATEWAY_BASE=0x0c487a766110c85d301d96e33579c5b317fa4995 - -RPC_ZETACHAIN=https://zetachain-athens-evm.blockpi.network/v1/rpc/public -RPC_BASE=https://sepolia.base.org -``` - -### 部署 Universal 至 ZetaChain 测试网 - -```bash -UNIVERSAL=$(forge create Universal \ - --rpc-url $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json | jq -r .deployedTo) && echo $UNIVERSAL -``` - -### 部署 Connected 至 Base Sepolia - -```bash -CONNECTED=$(forge create Connected \ - --rpc-url $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json \ - --constructor-args $GATEWAY_BASE | jq -r .deployedTo) && echo $CONNECTED -``` - -### 调用 Universal App - -在 Base Sepolia 上调用 Connected 合约,它会通过 Gateway 转发至 ZetaChain 上的 Universal App。跨链交易完成后,`onCall` 会执行。 - -```bash -cast send $CONNECTED \ - --rpc-url $RPC_BASE \ - --private-key $PRIVATE_KEY \ - --json \ - "call(address,bytes,(address,bool,address,bytes,uint256))" \ - $UNIVERSAL \ - $(cast abi-encode "f(string)" "hello") \ - "(0x0000000000000000000000000000000000000000,false,$UNIVERSAL,0x,0)" | jq -r '.transactionHash' -``` - -第三个参数即 RevertOptions 结构: - -``` -(revertAddress, callOnRevert, abortAddress, revertMessage, onRevertGasLimit) -``` - -- `revertAddress`:失败时退款地址。对于无代币转移的 `call`,使用零地址。 -- `callOnRevert`:Gateway 的 `call` 不支持回退调用,因此必须为 `false`。 -- `abortAddress`:交付失败时的中止地址。使用 Universal 合约地址,以便触发 `onAbort`。 -- `revertMessage`:回退时返回的任意字节。 -- `onRevertGasLimit`:`callOnRevert` 为 `false` 时设为 `0`。 - -也可使用命令: - -```bash -npx tsx ./commands connected call \ - --rpc $RPC_BASE \ - --contract $CONNECTED \ - --private-key $PRIVATE_KEY \ - --receiver $UNIVERSAL \ - --types string \ - --values hello \ - --name Connected -``` - -广播交易后,可使用 ZetaChain CLI 追踪跨链流程: - -```bash -zetachain query cctx --hash $HASH -``` - -该命令会展示 CCTX 全生命周期,包括当前状态、源/目标链事件以及错误或回退详情,是确认跨链调用成功最便捷的方式。 - -## 从 Universal App 发起出站调用 - -Universal App 可主动向连接 EVM 链的合约发起调用。应用会使用目标链 Gas 对应的 ZRC-20 代币支付费用,然后调用 Gateway。 - -首先根据目标 Gas 上限报价费用: - -```bash -GAS_LIMIT=500000 -ZRC20_BASE=0x236b0DE675cC8F46AE186897fCCeFe3370C9eDeD - -GAS_FEE=$(cast call --json $ZRC20_BASE \ - "withdrawGasFeeWithGasLimit(uint256)(address,uint256)" \ - $GAS_LIMIT \ - --rpc-url $RPC_ZETACHAIN | jq -r '.[1]') && echo $GAS_FEE -``` - -批准 Universal App 支付该费用: - -```bash -cast send $ZRC20_BASE \ - "approve(address,uint256)" \ - $UNIVERSAL \ - $GAS_FEE \ - --rpc-url $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY -``` - -发起跨链调用: - -```bash -cast send --json \ - --rpc-url $RPC_ZETACHAIN \ - --private-key $PRIVATE_KEY \ - $UNIVERSAL \ - "call(bytes,address,bytes,(uint256,bool),(address,bool,address,bytes,uint256))" \ - $(cast abi-encode "f(bytes)" $CONNECTED) \ - $ZRC20_BASE \ - $(cast abi-encode "f(string)" "hello") \ - "($GAS_LIMIT,false)" \ - "($UNIVERSAL,false,$UNIVERSAL,0x,0)" | jq -r '.transactionHash' -``` - -- `$GAS_LIMIT` 必须与 `withdrawGasFeeWithGasLimit` 中使用的值一致。 -- `isArbitraryCall` 控制调用类型:`false` 表示认证消息,`true` 表示任意函数调用载荷。 - -回退配置说明: - -- `revertAddress`:使用 Universal 合约地址,若出站调用失败,将回退交易发送回该合约。 -- `callOnRevert`:设为 `true`。从 ZetaChain 向外的调用支持回退调用,因为从连接链到 ZetaChain 的交易不需再支付 Gas。 -- `abortAddress`:同样设为 Universal 合约地址,以便处理无法回退的情况。 -- `revertMessage`:示例中留空。 -- `onRevertGasLimit`:设为 0,因回退调用到 ZetaChain 不产生 Gas 费用。 - -也可使用命令: - -``` -npx tsx ./commands universal call \ - --rpc $RPC_ZETACHAIN \ - --contract $UNIVERSAL \ - --private-key $PRIVATE_KEY \ - --receiver $CONNECTED \ - --types string \ - --values hello \ - --name Universal \ - --zrc20 $ZRC20_BASE -``` - -## 方案二:部署到 Localnet - -Localnet 允许你在本机部署并测试两个合约,同时运行本地 ZetaChain 与连接的 EVM 链,迭代速度更快,无需等待测试网确认或申请水龙头。 - -```bash -npx zetachain localnet start -``` - -该命令会启动带预置账户的 Anvil,并部署本地 ZetaChain 核心合约。部署信息保存在 `~/.zetachain/localnet/`。 - -从 Localnet 注册表中获取 RPC、预置私钥与相关合约地址: - -```bash -RPC=http://localhost:8545 -ZRC20_ETHEREUM=$(jq -r '."11155112".zrc20Tokens[] | select(.coinType == "gas" and .originChainId == "11155112") | .address' ~/.zetachain/localnet/registry.json) && echo $ZRC20_ETHEREUM -PRIVATE_KEY=$(jq -r '.private_keys[0]' ~/.zetachain/localnet/anvil.json) && echo $PRIVATE_KEY -GATEWAY_ETHEREUM=$(jq -r '.["11155112"].contracts[] | select(.contractType == "gateway") | .address' ~/.zetachain/localnet/registry.json) && echo $GATEWAY_ETHEREUM -``` - -部署 Universal App: - -```bash -UNIVERSAL=$(forge create Universal \ - --rpc-url $RPC \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json | jq -r .deployedTo) && echo $UNIVERSAL -``` - -部署 Connected 合约: - -```bash -CONNECTED=$(forge create Connected \ - --rpc-url $RPC \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json \ - --constructor-args $GATEWAY_ETHEREUM | jq -r .deployedTo) && echo $CONNECTED -``` - -模拟连接链向 Universal App 发送消息: - -```bash -npx tsx ./commands connected call \ - --rpc $RPC \ - --contract $CONNECTED \ - --private-key $PRIVATE_KEY \ - --receiver $UNIVERSAL \ - --types string \ - --values hello \ - --name Connected -``` - -本地跨链交易完成后,Universal App 的 `onCall` 会执行。 - -再模拟 ZetaChain → 连接链的调用: - -```bash -npx tsx ./commands universal call \ - --rpc $RPC \ - --contract $UNIVERSAL \ - --private-key $PRIVATE_KEY \ - --receiver $CONNECTED \ - --types string \ - --values hello \ - --name Universal \ - --zrc20 $ZRC20_ETHEREUM -``` - -该命令将: - -1. 报价目标链所需 Gas 费用(以 `$ZRC20_ETHEREUM` 表示) -2. 批准 Universal App 支付该费用 -3. 通过 Gateway 发送跨链调用 - -## 总结 - -你已经构建并测试了一个展示双向合约通信核心机制的全链应用。通过部署 ZetaChain 上的 Universal App 与连接链上的 Connected 合约,你学会了: - -- 如何通过 Gateway 接收并处理来自连接链的调用 -- 如何从 ZetaChain 向连接链回发调用 -- 如何利用回退机制在失败时保障跨链逻辑稳定 -- 如何在测试网或完全本地环境中运行相同流程以加速迭代 - -这一模式是构建真正全链 dApp 的基础:不再局限于单链,而是能够在同一处协调多链逻辑、资产与数据。 - -接下来你可以: - -- 接入更多连接链,扩展应用的覆盖面 -- 拓展合约逻辑,支持兑换、质押、NFT 转移等复杂流程 -- 将 Universal App 整合至更大的协议,统一多链流动性与用户体验 - -借助 ZetaChain,这些模式在接入任何区块链时都保持一致,使你的应用从第一天起即具备跨链、可拓展的能力。现在就将这个最小示例打造成真正的跨链功能吧! - diff --git a/src/pages/developers/tutorials/frontend.en-US.mdx b/src/pages/developers/tutorials/frontend.en-US.mdx deleted file mode 100644 index 6f1a399ff..000000000 --- a/src/pages/developers/tutorials/frontend.en-US.mdx +++ /dev/null @@ -1,278 +0,0 @@ -In this tutorial, you’ll extend the **Hello World Universal App** by adding a -React-based frontend. The app will connect to an EVM testnet wallet, send a -cross-chain call through ZetaChain’s Gateway, and track the resulting execution -on ZetaChain. - -You’ll learn how to: - -- Import and use the ZetaChain Toolkit (`evmCall`) in React -- Configure network and contract addresses -- Send a message from a connected EVM chain to your Hello contract on ZetaChain -- Poll ZetaChain for the cross-chain transaction status (CCTX) and display links - to both explorers - -![Web App](/img/docs/frontend.png) - -## What the App Does - -The Hello frontend provides a simple UI to demonstrate a full cross-chain flow: - -1. Connect a wallet on a supported EVM testnet (e.g., Arbitrum Sepolia). -2. Send a message through the ZetaChain Gateway using `evmCall`, targeting your - Hello contract deployed on ZetaChain. -3. Track the transaction: the app saves the source-chain transaction hash, polls - ZetaChain for the cross-chain execution (CCTX), and displays links to both - explorers. - -## Prerequisites - -Before you begin, make sure you've completed the following tutorials: - -- [Introduction to Universal Apps](/start/app/) -- [Getting Started with ZetaChain](/developers/tutorials/intro) -- [First Universal App](/developers/tutorials/hello) - -## Set Up Your Environment - -Assuming you already have the Hello project from the First Universal App -tutorial, simply navigate into the frontend directory and install dependencies: - -```bash -cd hello/frontend -yarn -``` - -If you don’t yet have the project, scaffold it now: - -```bash -npx zetachain@latest new --project hello -cd hello/frontend -yarn -``` - -## How It Works - -The frontend integrates with ZetaChain by importing helpers, connecting to a -wallet, preparing call parameters, and polling for the cross-chain result. Let’s -look at the important pieces. - -### Import the Toolkit - -```ts filename="frontend/src/MessageFlowCard.tsx" -import { evmCall } from "@zetachain/toolkit/chains/evm"; -import { ethers, ZeroAddress } from "ethers"; -``` - -The ZetaChain Toolkit provides the `evmCall` function used to send cross-chain -transactions. Alongside it, the app uses `ethers` for wallet and transaction -management, and `ZeroAddress` for revert configuration. - -### Get a Signer from the Wallet - -```ts filename="frontend/src/MessageFlowCard.tsx" -const ethersProvider = new ethers.BrowserProvider(selectedProvider.provider); -const signer = (await ethersProvider.getSigner()) as ethers.AbstractSigner; -``` - -The app connects to a wallet via the -[EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) standard. A signer is -required to authorize and send the cross-chain call. - -### Define the Hello Contract Address - -```ts filename="frontend/src/constants/contracts.ts" -export const HELLO_UNIVERSAL_CONTRACT_ADDRESS = "0x61a184EB30D29eD0395d1ADF38CC7d2F966c4A82"; -``` - -Replace this with the address of your Hello contract deployed on ZetaChain -testnet. This address will be used as the `receiver` of the cross-chain call. - -### Build the Call Parameters - -```ts filename="frontend/src/MessageFlowCard.tsx" -const evmCallParams = { - receiver: helloUniversalContractAddress, - types: ["string"], - values: [stringValue], - revertOptions: { - callOnRevert: false, - revertAddress: ZeroAddress, - revertMessage: "", - abortAddress: ZeroAddress, - onRevertGasLimit: 1000000, - }, -}; - -const evmCallOptions = { - signer, - txOptions: { - gasLimit: 1000000, - }, -}; -``` - -Here you define the payload and execution options: - -- `receiver`: the Hello contract on ZetaChain. -- `types` / `values`: ABI-encoded arguments passed into `onCall` (a single - `string` in this example). -- `revertOptions`: optional instructions for how to handle reverts. -- `txOptions`: transaction settings such as gas limits. - -### Send the Cross-Chain Call - -```ts filename="frontend/src/MessageFlowCard.tsx" -const result = await evmCall(evmCallParams, evmCallOptions); -await result.wait(); - -setConnectedChainTxHash(result.hash); -``` - -The call is sent through the Gateway. `result.hash` is the transaction hash on -the source EVM chain, which the app stores for explorer links and for tracking -the cross-chain status. - -### Configure Networks and Explorers - -```ts filename="frontend/src/constants/chains.ts" -export const SUPPORTED_CHAINS = [ - { - explorerUrl: "https://sepolia.arbiscan.io/tx/", - name: "Arbitrum Sepolia", - chainId: 421614, - icon: "/logos/arbitrum-logo.svg", - colorHex: "#28446A", - }, -]; - -export const ZETACHAIN_ATHENS_BLOCKSCOUT_EXPLORER_URL = "https://zetachain-testnet.blockscout.com/tx/"; -``` - -The app maintains a list of supported networks and their explorer URLs. After -sending a call, it can display links to the source chain and to ZetaChain for -the corresponding transactions. - -### Poll for Cross-Chain Status - -```ts filename="frontend/src/MessageFlowCard.tsx" -const response = await fetch(`${CCTX_POLLING_URL}/${connectedChainTxHash}`); -if (response.ok) { - const data = (await response.json()) as CrossChainTxResponse; - const txHash = data.CrossChainTxs?.[0]?.outbound_params?.[0]?.hash; - if (txHash) setZetachainTxHash(txHash); -} -``` - -The app periodically queries ZetaChain’s public API using the source-chain -transaction hash. Once ZetaChain processes the call, the response contains the -ZetaChain transaction hash, which is shown in the UI. - -## End-to-End Flow in the UI - -The frontend guides the user through a simple but complete cross-chain flow: - -1. Connect a Wallet. The app detects EIP-6963 compatible wallets and connects - through a `WalletProvider`. The connected account is used to sign and send - transactions. -2. Select a Network. Users must choose a source chain from the predefined - `SUPPORTED_CHAINS`. Each chain includes its own name, ID, and explorer URL. -3. Enter a Message. A plain string message is entered into the UI. The app - enforces a byte-length limit so that the input can be safely encoded and sent - in the cross-chain call. -4. Send the Call. When the user clicks **Send**, the frontend executes - `evmCall`, passing the Hello contract address on ZetaChain as the receiver. - The resulting transaction hash on the source chain is saved for tracking. -5. Track the Result. The UI displays the source-chain transaction immediately, - then begins polling ZetaChain for the cross-chain transaction (CCTX). Once - available, the app shows links to both the source chain and ZetaChain - explorers. - -## Install and Start - -From the frontend directory, install dependencies and start the dev server: - -```bash -cd hello/frontend -yarn -yarn dev -``` - -This launches a Vite development server. By default, the app will be available -at `http://localhost:5173`. - -## Wallets - -By default, the frontend uses `@zetachain/wallet` powered by -[Dynamic](https://www.dynamic.xyz/), which supports EVM, Solana, Sui, and -Bitcoin. With a single toggle you can switch to an EIP-6963 wallet, which only -supports EVM chains. - -- Default: `USE_DYNAMIC_WALLET = true` -- EIP-6963: set `USE_DYNAMIC_WALLET = false` - -```ts filename="frontend/src/constants/wallets.ts" -export const USE_DYNAMIC_WALLET = true; -``` - -The root renders either directly or inside the EIP-6963 provider based on this -flag: - -```ts filename="frontend/src/main.tsx" -{ - USE_DYNAMIC_WALLET ? ( - - ) : ( - - - - ); -} -``` - -Both wallet modes provide a signer to the same message flow for EVM chains, so -the rest of this tutorial (sending `evmCall`, tracking CCTX, and showing -explorers) is the same. - -### Configure the Contract Address (optional) - -By default, the app points to a pre-set Hello contract address: - -```ts filename="frontend/src/constants/contracts.ts" -export const HELLO_UNIVERSAL_CONTRACT_ADDRESS = "0x61a184EB30D29eD0395d1ADF38CC7d2F966c4A82"; -``` - -If you’ve deployed your own Hello contract on ZetaChain testnet, replace this -value with your deployed address. Otherwise, you can use the default address to -test the flow. - -### Troubleshooting - -- Wrong network: Switch to a supported and connected EVM testnet. -- Invalid receiver: Ensure the ZetaChain Hello contract address is correct and - deployed. -- Toolkit/ethers bundling: Keep the `vite.config.ts` `optimizeDeps` and - `resolve.dedupe/alias` settings as shown. -- CCTX not found yet: It can take a moment for the cross-chain execution to - finalize; the app polls every 15s. - -## Conclusion - -With this frontend, you now have a complete end-to-end flow for the Hello World -Universal App: - -- A contract deployed on ZetaChain that responds to cross-chain calls. -- A React app that connects to a wallet, sends a message through the Gateway, - and tracks execution on ZetaChain. - -This simple example demonstrates the **core pattern of building Universal -Apps**: accept a call from any connected chain, process it on ZetaChain, and -provide clear visibility back to the user across explorers. - -From here, you can expand the app to: - -- Accept richer payloads (numbers, addresses, structs). -- Trigger state-changing logic in your Universal Contract. -- Build more advanced UIs for managing cross-chain assets and actions. - -ZetaChain’s toolkit and APIs make it straightforward to extend this Hello -example into real-world Universal Apps. diff --git a/src/pages/developers/tutorials/frontend.zh-CN.mdx b/src/pages/developers/tutorials/frontend.zh-CN.mdx deleted file mode 100644 index 2faf7929c..000000000 --- a/src/pages/developers/tutorials/frontend.zh-CN.mdx +++ /dev/null @@ -1,234 +0,0 @@ ---- -title: 构建 Web 应用 ---- - -在本教程中,你将为 **Hello World 全链应用** 添加一个基于 React 的前端。该应用会连接 EVM 测试网钱包,通过 ZetaChain Gateway 发送跨链调用,并追踪在 ZetaChain 上的执行结果。 - -你将学习如何: - -- 在 React 中引入并使用 ZetaChain Toolkit (`evmCall`) -- 配置网络与合约地址 -- 从连接的 EVM 链向 ZetaChain 上的 Hello 合约发送消息 -- 轮询 ZetaChain 获取跨链交易状态(CCTX),并展示源链与目标链的区块浏览器链接 - -![Web App](/img/docs/frontend.png) - -## 应用功能概览 - -Hello 前端提供一个简单 UI 展示完整跨链流程: - -1. 连接受支持的 EVM 测试网钱包(如 Arbitrum Sepolia)。 -2. 使用 `evmCall` 通过 ZetaChain Gateway 向部署在 ZetaChain 的 Hello 合约发送消息。 -3. 跟踪交易:保存源链交易哈希,轮询 ZetaChain 的跨链执行(CCTX),并展示双链区块浏览器链接。 - -## 前置条件 - -在开始之前,请先完成以下教程: - -- [全链应用简介](/start/app/) -- [ZetaChain 入门](/developers/tutorials/intro) -- [第一个全链应用](/developers/tutorials/hello) - -## 环境准备 - -如果你已经完成“第一个全链应用”教程,并拥有 Hello 项目,只需进入前端目录并安装依赖: - -```bash -cd hello/frontend -yarn -``` - -若尚未创建项目,可执行: - -```bash -npx zetachain@latest new --project hello -cd hello/frontend -yarn -``` - -## 工作原理 - -前端通过引入辅助函数、连接钱包、构造调用参数并轮询跨链结果来与 ZetaChain 集成。以下是关键步骤。 - -### 引入 Toolkit - -```ts filename="frontend/src/MessageFlowCard.tsx" -import { evmCall } from "@zetachain/toolkit/chains/evm"; -import { ethers, ZeroAddress } from "ethers"; -``` - -ZetaChain Toolkit 提供用于发送跨链交易的 `evmCall` 函数。应用同样使用 `ethers` 进行钱包与交易管理,并使用 `ZeroAddress` 配置回退选项。 - -### 从钱包获取 Signer - -```ts filename="frontend/src/MessageFlowCard.tsx" -const ethersProvider = new ethers.BrowserProvider(selectedProvider.provider); -const signer = (await ethersProvider.getSigner()) as ethers.AbstractSigner; -``` - -应用通过 [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) 标准连接钱包。Signer 用于授权并发送跨链调用。 - -### 指定 Hello 合约地址 - -```ts filename="frontend/src/constants/contracts.ts" -export const HELLO_UNIVERSAL_CONTRACT_ADDRESS = "0x61a184EB30D29eD0395d1ADF38CC7d2F966c4A82"; -``` - -将该地址替换为你在 ZetaChain 测试网上部署的 Hello 合约地址,作为跨链调用的 `receiver`。 - -### 构建调用参数 - -```ts filename="frontend/src/MessageFlowCard.tsx" -const evmCallParams = { - receiver: helloUniversalContractAddress, - types: ["string"], - values: [stringValue], - revertOptions: { - callOnRevert: false, - revertAddress: ZeroAddress, - revertMessage: "", - abortAddress: ZeroAddress, - onRevertGasLimit: 1000000, - }, -}; - -const evmCallOptions = { - signer, - txOptions: { - gasLimit: 1000000, - }, -}; -``` - -上述代码定义了载荷与执行选项: - -- `receiver`:ZetaChain 上的 Hello 合约。 -- `types` / `values`:传入 `onCall` 的 ABI 编码参数(此处为单个 `string`)。 -- `revertOptions`:可选的回退逻辑配置。 -- `txOptions`:交易参数(如 Gas 上限)。 - -### 发送跨链调用 - -```ts filename="frontend/src/MessageFlowCard.tsx" -const result = await evmCall(evmCallParams, evmCallOptions); -await result.wait(); - -setConnectedChainTxHash(result.hash); -``` - -调用通过 Gateway 发出。`result.hash` 为源链交易哈希,应用会保存以便展示区块浏览器链接并跟踪跨链状态。 - -### 配置网络与浏览器 - -```ts filename="frontend/src/constants/chains.ts" -export const SUPPORTED_CHAINS = [ - { - explorerUrl: "https://sepolia.arbiscan.io/tx/", - name: "Arbitrum Sepolia", - chainId: 421614, - icon: "/logos/arbitrum-logo.svg", - colorHex: "#28446A", - }, -]; - -export const ZETACHAIN_ATHENS_BLOCKSCOUT_EXPLORER_URL = "https://zetachain-testnet.blockscout.com/tx/"; -``` - -应用维护受支持网络及其浏览器链接,发送调用后即可展示源链与 ZetaChain 的对应交易。 - -### 轮询跨链状态 - -```ts filename="frontend/src/MessageFlowCard.tsx" -const response = await fetch(`${CCTX_POLLING_URL}/${connectedChainTxHash}`); -if (response.ok) { - const data = (await response.json()) as CrossChainTxResponse; - const txHash = data.CrossChainTxs?.[0]?.outbound_params?.[0]?.hash; - if (txHash) setZetachainTxHash(txHash); -} -``` - -应用定期向 ZetaChain 公共 API 发起请求,使用源链交易哈希进行查询。一旦 ZetaChain 完成处理,响应会包含目标链交易哈希,并显示在 UI 中。 - -## UI 端到端流程 - -前端引导用户完成一个完整的跨链流程: - -1. **连接钱包**:应用检测兼容 EIP-6963 的钱包,并通过 `WalletProvider` 连接,以便签名交易。 -2. **选择网络**:用户从预设的 `SUPPORTED_CHAINS` 中选择源链,每条链包含名称、ID 与浏览器链接。 -3. **输入消息**:输入纯文本字符串,应用会限制字节长度以确保编码后可安全发送。 -4. **发送调用**:点击 **Send** 时执行 `evmCall`,将 ZetaChain 上的 Hello 合约作为接收者,并保存源链交易哈希。 -5. **跟踪结果**:UI 立即展示源链交易,同时开始轮询 CCTX,一旦获取到,在界面上展示源链与 ZetaChain 的浏览器链接。 - -## 安装与运行 - -在前端目录安装依赖并启动开发服务器: - -```bash -cd hello/frontend -yarn -yarn dev -``` - -默认情况下,Vite 开发服务器会运行在 `http://localhost:5173`。 - -## 钱包 - -前端默认使用基于 [Dynamic](https://www.dynamic.xyz/) 的 `@zetachain/wallet`,支持 EVM、Solana、Sui、比特币。你也可以一键切换到仅支持 EVM 的 EIP-6963 钱包。 - -- 默认:`USE_DYNAMIC_WALLET = true` -- EIP-6963:将 `USE_DYNAMIC_WALLET` 设为 `false` - -```ts filename="frontend/src/constants/wallets.ts" -export const USE_DYNAMIC_WALLET = true; -``` - -根组件会根据该标志决定是否包裹在 EIP-6963 Provider 中: - -```ts filename="frontend/src/main.tsx" -{ - USE_DYNAMIC_WALLET ? ( - - ) : ( - - - - ); -} -``` - -无论使用哪种钱包模式,EVM 链都会提供 Signer,因此发送 `evmCall`、跟踪 CCTX 与展示浏览器链接的流程完全相同。 - -### 配置合约地址(可选) - -默认情况下,应用指向预设的 Hello 合约地址: - -```ts filename="frontend/src/constants/contracts.ts" -export const HELLO_UNIVERSAL_CONTRACT_ADDRESS = "0x61a184EB30D29eD0395d1ADF38CC7d2F966c4A82"; -``` - -如果你在 ZetaChain 测试网部署了自己的 Hello 合约,请将其替换为你的地址;否则可使用默认地址进行测试。 - -### 常见问题 - -- **网络不匹配**:切换到受支持且已连接的 EVM 测试网。 -- **接收者无效**:确认 ZetaChain Hello 合约地址正确且已部署。 -- **Toolkit/ethers 打包问题**:保持 `vite.config.ts` 中 `optimizeDeps` 与 `resolve.dedupe/alias` 设置。 -- **CCTX 未找到**:跨链执行可能需要时间,应用默认每 15 秒轮询一次。 - -## 总结 - -通过该前端,你已经完成 Hello World 全链应用的端到端体验: - -- 在 ZetaChain 上部署并响应跨链调用的合约。 -- 一个 React 前端,连接钱包,借助 Gateway 发送消息,并跟踪 ZetaChain 上的执行。 - -这一示例展示了 **构建全链应用的核心模式**:接受任意连接链的调用,在 ZetaChain 上处理,并向用户提供跨链可见性。 - -接下来,你可以扩展应用以: - -- 接受更丰富的载荷(数字、地址、结构体等) -- 在全链合约里执行更复杂的状态变更 -- 构建更高级的 UI 以管理跨链资产与操作 - -借助 ZetaChain 的工具与 API,你可以轻松将该示例扩展为真实的全链应用。 - diff --git a/src/pages/developers/tutorials/hello.en-US.mdx b/src/pages/developers/tutorials/hello.en-US.mdx deleted file mode 100644 index 25e19fe74..000000000 --- a/src/pages/developers/tutorials/hello.en-US.mdx +++ /dev/null @@ -1,343 +0,0 @@ -In this tutorial, you will create a simple Universal App on ZetaChain. This app -will emit an event when it receives a cross-chain call from a connected chain. - -
    - -
    - -By the end of this tutorial, you will understand how to: - -- Build a basic Universal App -- Deploy it on ZetaChain Localnet -- Use a Gateway on a connected chain to call your Universal App - - - -## Prerequisites - -Before you begin, make sure you've completed the following tutorials: - -- [Introduction to Universal Apps](/start/app/) -- [Getting Started with ZetaChain](/developers/tutorials/intro) - -## Set Up Your Environment - -To kickstart your ZetaChain project, begin by initializing a new project using -the ZetaChain CLI (command-line interface). This will set up the foundational -project structure. - -```bash -npx zetachain@latest new --project hello -cd hello -yarn -forge soldeer update -``` - -First, `npx zetachain@latest new --project hello` uses `npx` to execute the -latest version of the `zetachain` package, creating a new project directory -named `hello`. - -Then, `cd hello` navigates you into the newly created project directory. - -Next, `yarn` (or `npm install` if you prefer npm) installs all the necessary -project dependencies as defined in the `package.json` file. This ensures that -all required libraries and tools are available for your development environment. - -Finally, `foundry soldeer update` synchronizes and updates your Solidity -dependencies managed by Foundry’s Soldeer, ensuring that your contracts are -built against the latest compatible versions of external libraries. - -## Universal Contract - -A Universal App is a contract that implements the `UniversalContract` interface. - -```solidity filename="contracts/Universal.sol" -// SPDX-License-Identifier: MIT -pragma solidity 0.8.26; - -import "@zetachain/protocol-contracts/contracts/zevm/interfaces/UniversalContract.sol"; - -contract Universal is UniversalContract { - event HelloEvent(string, string); - - function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message - ) external override onlyGateway { - string memory name = abi.decode(message, (string)); - emit HelloEvent("Hello: ", name); - } -} -``` - -A universal contract must implement the `onCall` function. This function is -triggered when the contract receives a call from a connected chain via the -Gateway. The function processes incoming data, which includes: - -- `context`: A `MessageContext` struct containing: - - `chainID`: The chain ID of the connected chain that initiated the - cross-chain call. - - `sender`: The address (EOA or contract) that called the Gateway on the - connected chain. - - `origin`: Deprecated. -- `zrc20`: The address of the ZRC-20 token representing assets from the source - chain. -- `amount`: The amount of tokens transferred. -- `message`: The encoded payload data. - -In this example, `onCall` decodes the message into a string and emits an event. - -`onCall` should only be called by the Gateway to ensure that it is only called -as a response to a call on a connected chain and that you can trust the values -of the function parameters. This is enforced by the `onlyGateway` modifier, -which is inherited from `UniversalContract`. - -## Option 1: Deploy on Localnet - -This section guides you through the process of deploying and interacting with a -Universal Contract on ZetaChain [Localnet](/reference/localnet). Working with a -Localnet provides a safe and isolated environment for testing and development -without incurring real network fees or affecting live deployments. - -> For optimal workflow, it is highly recommended to use a split terminal or two -> separate terminal windows. This allows you to keep the localnet running -> continuously in one terminal while executing commands and interacting with -> your project in the other, streamlining your development process. - -The first step is to launch your local ZetaChain network. This will simulate a -complete ZetaChain environment on your machine. - -- Open a new terminal window dedicated to running the Localnet. -- In this terminal, execute the following command: - -``` -npx zetachain localnet start -``` - -This command will initiate the local ZetaChain network. It may take a moment for -all components to spin up. You'll know the localnet is ready when you see a -formatted table printed in the terminal. This table will display crucial -contract addresses for different chains, including ZETACHAIN, ETHEREUM, and BNB. -These addresses are essential for interacting with your local network. - -> **Do not close this terminal!** It is imperative that the localnet remains -> running throughout the subsequent steps. Closing this terminal will shut down -> your local network, and you'll need to restart it to continue. - -Once Localnet is active, the next step is to compile your smart contracts. This -process translates your human-readable Solidity code into bytecode that the -Ethereum Virtual Machine (EVM) can understand and execute. - -- Open a second terminal window (or split your existing terminal) dedicated to - your project commands. -- Navigate to your project directory (if you're not already there). -- Run the following command: - -``` -forge build -``` - -The `forge build` command tells Foundry to compile all Solidity smart contracts -within your project, ensuring you're working with the latest compiled versions. -Successful compilation will generate bytecode for your contracts. - -Fetch a private key with pre-funded tokens on the connected chain: - -``` -PRIVATE_KEY=$(jq -r '.private_keys[0]' ~/.zetachain/localnet/anvil.json) && echo $PRIVATE_KEY -``` - -Deploy the universal contract: - -``` -UNIVERSAL=$(forge create Universal \ - --rpc-url http://localhost:8545 \ - --private-key $PRIVATE_KEY \ - --evm-version paris \ - --broadcast \ - --json | jq -r .deployedTo) && echo $UNIVERSAL -``` - -### Make a Call to the Universal App - -To call the universal app deployed on ZetaChain from a connected chain, send a -transaction to the Gateway contract on the connected EVM chain. - -Fetch the Gateway address for the connected chain: - -``` -GATEWAY_EVM=$(jq -r '.["11155112"].contracts[] | select(.contractType == "gateway") | .address' ~/.zetachain/localnet/registry.json) && echo $GATEWAY_EVM -``` - -Alternatively, you can copy the Gateway address directly from the table printed -in the Localnet terminal output when Localnet starts. - -Execute the `call` method on the connected chain’s Gateway to send a message to -the universal contract deployed on ZetaChain. - -``` -npx zetachain evm call \ - --rpc http://localhost:8545 \ - --gateway $GATEWAY_EVM \ - --receiver $UNIVERSAL \ - --private-key $PRIVATE_KEY \ - --types string \ - --values hello -``` - -Once the transaction is processed, you’ll see an `[ZetaChain]: Event from onCall` log in the Localnet terminal. - -## Option 2: Deploy on Testnet - -### Wallet & Environment Setup - -To interact with and deploy smart contracts on ZetaChain, you'll need an -EVM-compatible private key and a secure way to manage it within your project -environment. - -An EVM-compatible private key is fundamental for signing transactions, which are -necessary for deploying and interacting with smart contracts on the ZetaChain -EVM. You have a couple of reliable options for generating this key: - -- Using MetaMask: MetaMask is a popular browser extension that serves as a - cryptocurrency wallet and a gateway to decentralized applications. You can - create a new wallet in MetaMask, and it will generate a private key for you. - Be sure to back up your seed phrase securely. -- Using cast CLI: For a quick and direct generation via the command line, you - can use the following command: - -``` -PRIVATE_KEY=$(cast wallet new --json | jq -r '.[0].private_key') && echo $PRIVATE_KEY -``` - -This command leverages Foundry’s `cast` utility to generate a new EVM wallet. -The `--json` flag outputs the wallet details in JSON format, and the `jq` query -extracts the `private_key` field, printing it as a 64-character hexadecimal -string. - -### Deploy the Contract on ZetaChain - -Deploy the contract to ZetaChain’s testnet: - -``` -UNIVERSAL=$(forge create Universal \ - --rpc-url https://zetachain-athens-evm.blockpi.network/v1/rpc/public \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json | jq -r .deployedTo) -``` - -### Call a Universal Contract from Base - -This section details the process of initiating a cross-chain transaction from a -connected testnet, specifically Base Sepolia, to interact with a universal -application deployed on ZetaChain. The process involves two primary steps: -making the initial transaction and then tracking its cross-chain status. - -To call the universal app on ZetaChain, a transaction must be sent to the -Gateway on Base Sepolia. This is achieved using the `npx zetachain evm call` -command, which facilitates the execution of an EVM (Ethereum Virtual Machine) -transaction. - -The command structure is as follows: - -``` -npx zetachain evm call \ - --chain-id 84532 \ - --receiver $UNIVERSAL \ - --private-key $PRIVATE_KEY \ - --types string \ - --values hello -``` - -Explanation of Parameters: - -- `--chain-id 84532`: This specifies the chain ID of Base Sepolia, the source - network for the transaction. -- `--receiver $UNIVERSAL`: This parameter designates the address of the - universal contract on ZetaChain that the transaction intends to interact with. - The `$UNIVERSAL` variable should be replaced with the actual contract address. -- `--private-key $PRIVATE_KEY`: This is the private key associated with the - sending wallet on Base Sepolia. It is crucial for signing the transaction. The - `$PRIVATE_KEY` variable must be replaced with the actual private key. -- `--types string`: This indicates the data type of the value being sent. In - this case, it's a string. -- `--values hello`: This is the actual value being passed to the universal - application. Here, the string "hello" is sent as a message to the universal - contract on ZetaChain. - -Upon successful execution of this command, a transaction hash is generated, -confirming the initiation of the transaction on Base Sepolia. - -``` -Transaction hash: 0x89308870b0863c5ae48dc783059277cbcf4296b1b343413ac543418262a4ccbc -``` - -You can verify the transaction on the Base Sepolia block explorer: - -https://sepolia.basescan.org/tx/0x89308870b0863c5ae48dc783059277cbcf4296b1b343413ac543418262a4ccbc - -### Tracking the Cross-Chain Transaction Status - -After the transaction is initiated on Base Sepolia, ZetaChain's protocol -facilitates its cross-chain transfer and execution on the destination chain -(ZetaChain). To monitor the status of this cross-chain transaction, the `npx zetachain query cctx` command is used, providing real-time updates on the -transaction's journey. - -The command for tracking is: - -``` -npx zetachain query cctx --hash 0x89308870b0863c5ae48dc783059277cbcf4296b1b343413ac543418262a4ccbc -``` - -- `--hash 0x89308870b0863c5ae48dc783059277cbcf4296b1b343413ac543418262a4ccbc`: - This refers to the transaction hash obtained from the initial transaction on - Base Sepolia. - -Example Output and Interpretation: - -``` -84532 → 7001 ✅ OutboundMined -CCTX: 0x56f9bc09dc646b13aa713b56348e8a53ea39759146afad61e66973791b752e3bTx -Tx Hash: 0x89308870b0863c5ae48dc783059277cbcf4296b1b343413ac543418262a4ccbc (on chain 84532) -Tx Hash: 0x34edd96c8a7b2bd9d530de0e49bb5e8625204a77b77cc79133814e1814f79ebc (on chain 7001) -Sender: 0x4955a3F38ff86ae92A914445099caa8eA2B9bA32 -Receiver: 0xFeb4F33d424D6685104624d985095dacab567151 -Message: 0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000 -``` - -Key Information from the Output: - -- `84532 → 7001`: This clearly indicates the cross-chain flow, from Base Sepolia - (chain ID 84532) to ZetaChain (chain ID 7001). The ✅ symbol signifies a - successful outbound mining of the cross-chain transaction. -- `OutboundMinedCCTX: 0x56f9bc09dc646b13aa713b56348e8a53ea39759146afad61e66973791b752e3b`: This is - the hash of the Cross-Chain Transaction (CCTX) on ZetaChain, representing the - internal identifier for this specific cross-chain operation. -- `Tx Hash: 0x89308870b0863c5ae48dc783059277cbcf4296b1b343413ac543418262a4ccbc (on chain 84532)`: This confirms the original transaction hash on the source - chain (Base Sepolia). -- `Tx Hash: 0x34edd96c8a7b2bd9d530de0e49bb5e8625204a77b77cc79133814e1814f79ebc (on chain 7001)`: This is the transaction hash of the execution on ZetaChain, - indicating that the universal application has been successfully called on the - destination chain. -- `Sender: 0x4955a3F38ff86ae92A914445099caa8eA2B9bA32`: The address of the - sender on the originating chain. -- `Receiver: 0xFeb4F33d424D6685104624d985095dacab567151`: The address of the - receiver contract on ZetaChain, which is the universal application in this - context. -- `Message: 0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000` diff --git a/src/pages/developers/tutorials/hello.zh-CN.mdx b/src/pages/developers/tutorials/hello.zh-CN.mdx deleted file mode 100644 index cd2604cca..000000000 --- a/src/pages/developers/tutorials/hello.zh-CN.mdx +++ /dev/null @@ -1,260 +0,0 @@ ---- -title: 第一个全链合约 ---- - -在本教程中,你将创建一个简单的 ZetaChain 全链应用。该应用在接收到来自连接链的跨链调用时会触发事件。 - -
    - -
    - -完成本教程后,你将学会: - -- 构建一个基础的全链应用 -- 将其部署到 ZetaChain Localnet -- 使用连接链上的 Gateway 调用你的全链应用 - - - -## 前置准备 - -开始之前,请先完成以下教程: - -- [全链应用简介](/start/app/) -- [ZetaChain 入门](/developers/tutorials/intro) - -## 环境初始化 - -首先使用 ZetaChain CLI 初始化项目,这会生成基础的项目结构: - -```bash -npx zetachain@latest new --project hello -cd hello -yarn -forge soldeer update -``` - -- `npx zetachain@latest new --project hello` 使用最新的 `zetachain` 包创建名为 `hello` 的项目目录。 -- `cd hello` 进入该目录。 -- `yarn`(或 `npm install`)安装 `package.json` 中声明的依赖。 -- `forge soldeer update` 同步并更新 Foundry Soldeer 管理的 Solidity 依赖,确保与你的合约兼容的最新版本。 - -## 全链合约 - -全链应用需要实现 `UniversalContract` 接口: - -```solidity filename="contracts/Universal.sol" -// SPDX-License-Identifier: MIT -pragma solidity 0.8.26; - -import "@zetachain/protocol-contracts/contracts/zevm/interfaces/UniversalContract.sol"; - -contract Universal is UniversalContract { - event HelloEvent(string, string); - - function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message - ) external override onlyGateway { - string memory name = abi.decode(message, (string)); - emit HelloEvent("Hello: ", name); - } -} -``` - -`onCall` 会在合约通过 Gateway 接收到来自连接链的调用时触发。参数包括: - -- `context`:`MessageContext` 结构体,其中 - - `chainID`:发起跨链调用的连接链 ID - - `sender`:在连接链上调用 Gateway 的地址(EOA 或合约) - - `origin`:已弃用 -- `zrc20`:源链资产在 ZetaChain 上对应的 ZRC-20 地址 -- `amount`:转入的代币数量 -- `message`:编码后的载荷数据 - -本示例中,`onCall` 会将消息解码为字符串并触发事件。 - -为保证只有连接链调用才能触发 `onCall`,函数使用了继承自 `UniversalContract` 的 `onlyGateway` 修饰器,从而可信任参数。 - -## 方案一:部署到 Localnet - -本节展示如何在 ZetaChain [Localnet](/reference/localnet) 部署并交互全链合约。Localnet 提供隔离、安全的测试环境,无需支付真实费用,也不会影响线上部署。 - -> 建议使用分屏终端或两个独立终端窗口:一个专门运行 Localnet,另一个用于执行项目命令,便于持续开发。 - -首先启动本地 ZetaChain 网络,模拟完整环境: - -1. 新开一个终端窗口用于运行 Localnet。 -2. 执行: - -``` -npx zetachain localnet start -``` - -等待所有组件启动后,终端会打印格式化表格,列出 ZETACHAIN、ETHEREUM、BNB 等链的关键合约地址。后续与本地网络交互需要这些地址。 - -> **不要关闭该终端!** Localnet 必须持续运行,关闭后需重新启动。 - -接下来编译智能合约,将 Solidity 代码转换为 EVM 可执行的字节码: - -1. 打开第二个终端(或在当前终端拆分窗口)。 -2. 切换至项目目录。 -3. 运行: - -``` -forge build -``` - -该命令会编译项目内所有合约,生成最新版字节码。 - -从连接链获取已预置资金的私钥: - -``` -PRIVATE_KEY=$(jq -r '.private_keys[0]' ~/.zetachain/localnet/anvil.json) && echo $PRIVATE_KEY -``` - -部署全链合约: - -``` -UNIVERSAL=$(forge create Universal \ - --rpc-url http://localhost:8545 \ - --private-key $PRIVATE_KEY \ - --evm-version paris \ - --broadcast \ - --json | jq -r .deployedTo) && echo $UNIVERSAL -``` - -### 调用全链应用 - -要从连接链调用部署在 ZetaChain 的全链应用,需要向该链的 Gateway 发送交易。 - -获取连接链的 Gateway 地址: - -``` -GATEWAY_EVM=$(jq -r '.["11155112"].contracts[] | select(.contractType == "gateway") | .address' ~/.zetachain/localnet/registry.json) && echo $GATEWAY_EVM -``` - -你也可以直接在 Localnet 启动时终端输出的表格中查找。 - -调用 Gateway 的 `call` 方法,将消息发送至部署在 ZetaChain 的全链合约: - -``` -npx zetachain evm call \ - --rpc http://localhost:8545 \ - --gateway $GATEWAY_EVM \ - --receiver $UNIVERSAL \ - --private-key $PRIVATE_KEY \ - --types string \ - --values hello -``` - -交易处理完成后,你将在 Localnet 终端看到 `[ZetaChain]: Event from onCall` 日志。 - -## 方案二:部署到测试网 - -### 钱包与环境配置 - -与 ZetaChain 交互并部署合约需要一个 EVM 兼容私钥,并在项目中安全管理。 - -私钥用于签名交易,可通过以下方式获取: - -- **MetaMask**:浏览器扩展,可创建新钱包并生成私钥,务必妥善备份助记词。 -- **cast CLI**:命令行快速生成: - -``` -PRIVATE_KEY=$(cast wallet new --json | jq -r '.[0].private_key') && echo $PRIVATE_KEY -``` - -该命令使用 Foundry 的 `cast` 工具生成新钱包,`--json` 输出 JSON,再用 `jq` 提取 `private_key` 字段。 - -### 部署合约到 ZetaChain - -将合约部署到 ZetaChain 测试网: - -``` -UNIVERSAL=$(forge create Universal \ - --rpc-url https://zetachain-athens-evm.blockpi.network/v1/rpc/public \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json | jq -r .deployedTo) -``` - -### 从 Base 调用全链合约 - -本节演示如何从连接测试网(Base Sepolia)发起跨链交易,与部署在 ZetaChain 的全链应用交互。主要步骤包括:发送初始交易,以及跟踪跨链执行状态。 - -调用 ZetaChain 上的全链应用,需要向 Base Sepolia 的 Gateway 发送交易,可使用 `npx zetachain evm call`: - -``` -npx zetachain evm call \ - --chain-id 84532 \ - --receiver $UNIVERSAL \ - --private-key $PRIVATE_KEY \ - --types string \ - --values hello -``` - -参数说明: - -- `--chain-id 84532`:Base Sepolia 的链 ID,表示交易来源。 -- `--receiver $UNIVERSAL`:ZetaChain 上全链合约的地址。 -- `--private-key $PRIVATE_KEY`:Base Sepolia 上发送方的钱包私钥。 -- `--types string`:传入数据类型为字符串。 -- `--values hello`:实际传递的字符串消息。 - -执行成功后将返回交易哈希,表示交易已在 Base Sepolia 发起: - -``` -Transaction hash: 0x89308870b0863c5ae48dc783059277cbcf4296b1b343413ac543418262a4ccbc -``` - -可在区块浏览器中查看: - -https://sepolia.basescan.org/tx/0x89308870b0863c5ae48dc783059277cbcf4296b1b343413ac543418262a4ccbc - -### 跟踪跨链交易状态 - -交易发起后,ZetaChain 协议会将其跨链输送并在目标链(ZetaChain)执行。可使用 `npx zetachain query cctx` 实时跟踪其状态: - -``` -npx zetachain query cctx --hash 0x89308870b0863c5ae48dc783059277cbcf4296b1b343413ac543418262a4ccbc -``` - -- `--hash` 参数使用之前获得的 Base Sepolia 交易哈希。 - -示例输出: - -``` -84532 → 7001 ✅ OutboundMined -CCTX: 0x56f9bc09dc646b13aa713b56348e8a53ea39759146afad61e66973791b752e3bTx -Tx Hash: 0x89308870b0863c5ae48dc783059277cbcf4296b1b343413ac543418262a4ccbc (on chain 84532) -Tx Hash: 0x34edd96c8a7b2bd9d530de0e49bb5e8625204a77b77cc79133814e1814f79ebc (on chain 7001) -Sender: 0x4955a3F38ff86ae92A914445099caa8eA2B9bA32 -Receiver: 0xFeb4F33d424D6685104624d985095dacab567151 -Message: 0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000 -``` - -关键信息: - -- `84532 → 7001`:跨链方向从 Base Sepolia(84532)到 ZetaChain(7001),✅ 表示出站交易已成功挖出。 -- `CCTX: ...`:跨链交易的内部哈希。 -- `Tx Hash` 行分别显示源链与目标链的交易哈希。 -- `Sender` 与 `Receiver`:源链发送地址与 ZetaChain 上接收的全链合约地址。 -- `Message`:传递给全链合约的 ABI 编码载荷(“hello”)。 - diff --git a/src/pages/developers/tutorials/intro.en-US.mdx b/src/pages/developers/tutorials/intro.en-US.mdx deleted file mode 100644 index be57723c5..000000000 --- a/src/pages/developers/tutorials/intro.en-US.mdx +++ /dev/null @@ -1,153 +0,0 @@ -On ZetaChain, you can build universal apps: smart contracts that can read, -write, and manage assets across multiple chains. Universal apps remove the -complexity of cross-chain development and let you create seamless user -experiences that work everywhere. - -This page will help you set up your environment, install the core tools, and -point you to the right tutorials depending on what you want to build. - -
    - -
    - -## Prerequisites - -Before you begin, make sure your system is set up with the following tools: - -- **[Node.js](https://nodejs.org/en) (v21 or later recommended):** Required to - run the ZetaChain CLI and manage JavaScript dependencies. -- **[Yarn](https://yarnpkg.com/) or npm:** Package managers used to install and - update project libraries. Either works, use whichever you prefer. -- **[Git](https://git-scm.com/):** Essential for managing your project source - code and collaborating with others. -- **[jq](https://jqlang.org/):** A lightweight command-line JSON processor, - useful for parsing Localnet output and writing shell scripts. -- **[Foundry](https://getfoundry.sh/):** A fast, modular toolkit for Ethereum - development. You’ll use it to compile contracts, manage dependencies, and run - Localnet. - -## Setting up Environment - -Install the ZetaChain CLI: - -```bash -npm install -g zetachain -``` - -The [ZetaChain CLI](/reference/cli/) is your primary tool for working with -ZetaChain. You’ll use it to make cross-chain calls, transfer tokens, track -cross-chain transactions, manage accounts across multiple networks, query -balances, and more. - -Try running: - -```bash -zetachain query chains list -``` - -This command prints all the chains currently connected to ZetaChain, a good way -to confirm your setup is working. - -For local development, we recommend running Localnet, a self-contained -environment that includes ZetaChain, EVM, Solana, Sui, and TON. Localnet is the -fastest way to build and test universal apps without relying on public testnets. - -To run Localnet, make sure you have [Foundry](https://getfoundry.sh/) installed. -Foundry provides the core tooling for EVM development and is required to start -the local network. - -If you want to include non-EVM chains in Localnet, check the prerequisites in -the [Localnet documentation](/reference/localnet/). - -## Tools & References - -With your environment ready, these resources will help you interact with and -build on ZetaChain. - -### Explorers - -ZetaChain is both a Cosmos chain and an EVM chain. You can use Cosmos explorers -to view blocks, validators, and governance activity, or EVM explorers to track -contracts and transactions. Links to both are available in the [Explorers -reference](/reference/explorers/). - -### Faucets - -Before deploying or testing on testnet, you’ll need tokens. The -[Faucet](/reference/faucet/) page lists all available faucets: for ZETA gas and -for tokens on connected chains. - -### Networks - -ZetaChain runs on mainnet and testnet. Tutorials focus on testnet, but you can -switch at any time. RPC endpoints, chain IDs, and other details are listed in -the [Networks reference](/developers/chains/list/). - -### RPCs - -To connect apps, wallets, or frameworks like Foundry and Hardhat, you’ll need -RPC endpoints. Public RPCs for both ZetaChain mainnet and testnet are listed in -the [RPC reference](/reference/network/api). - -### Contracts - -Core protocol contracts such as the Gateway, and other system contracts are -deployed on ZetaChain. Their addresses are listed in the [Protocol Contracts -reference](/reference/network/contracts/). - -### Tokens - -All whitelisted tokens available on ZetaChain are listed along with their ZRC-20 -contract addresses in the [Tokens reference](/developers/evm/zrc20/). - -### MCP - -Integrate ZetaChain's Model Context Protocol (MCP) server with Cursor or Claude -Code to run on-chain queries and actions directly from your editor. See the [MCP -reference](/reference/mcp/). - -## Where to Go Next - -Once your environment is set up, you can dive straight into building. Choose a -path based on what you want to create: - -### Learn the basics - -- [First Universal Contract](/developers/tutorials/hello/) (10 min) Build your - first universal contract and understand the foundation of ZetaChain - development. -- [Build a Web App](/developers/tutorials/frontend) (10 min) Connect a wallet, - send cross-chain calls, and track execution with a simple frontend. - -### Make calls to and from universal apps - -- [EVM](/developers/tutorials/call/) (30 min) Learn how to send and receive - calls between EVM chains and universal apps on ZetaChain. -- [Solana](/developers/tutorials/solana/) (60 min) Deposit assets and call - universal apps from Solana, or make outgoing calls to Solana. -- [Sui](/developers/tutorials/sui/) (60 min) Deposit assets and call universal - apps from Sui. -- [Sui Withdraw & Call](/developers/tutorials/sui-withdraw-and-call/) (60 min) - Withdraw assets and call contracts on Sui. - -### Cross-Chain Messaging - -- [Messaging](/developers/tutorials/messaging/) (30 min) Make cross-chain calls - directly between EVM networks without building a universal app. - -### Build real-world apps - -- [Universal NFT](/developers/standards/nft/) (45 min) Create NFTs that can move - seamlessly across multiple chains. -- [Universal Token](/developers/standards/token/) (45 min) Deploy a fungible - token that exists everywhere and can be transferred across chains. -- [Swap](/developers/tutorials/swap/) (30 min) Implement a universal swap app - compatible with chains like Ethereum, Solana, and Bitcoin. diff --git a/src/pages/developers/tutorials/intro.zh-CN.mdx b/src/pages/developers/tutorials/intro.zh-CN.mdx deleted file mode 100644 index 320109e40..000000000 --- a/src/pages/developers/tutorials/intro.zh-CN.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: 入门指南 ---- - -在 ZetaChain 上,你可以构建全链应用:这些智能合约能够跨多条区块链读取、写入并管理资产。全链应用极大降低了跨链开发复杂度,让你可以一次构建、处处运行,打造无缝的用户体验。 - -本页面将帮助你完成环境配置、安装核心工具,并根据你的目标指引合适的教程。 - -
    - -
    - -## 准备工作 - -开始之前,请确保系统已安装以下工具: - -- **[Node.js](https://nodejs.org/en)(建议 v21 及以上)**:用于运行 ZetaChain CLI 并管理 JavaScript 依赖。 -- **[Yarn](https://yarnpkg.com/) 或 npm**:项目依赖安装与更新的包管理器,两者任选其一。 -- **[Git](https://git-scm.com/)**:项目源码管理与协作的必备工具。 -- **[jq](https://jqlang.org/)**:轻量级命令行 JSON 处理器,便于解析 Localnet 输出与编写脚本。 -- **[Foundry](https://getfoundry.sh/)**:快速、模块化的以太坊开发工具包,用于编译合约、管理依赖并运行 Localnet。 - -## 设置环境 - -安装 ZetaChain CLI: - -```bash -npm install -g zetachain -``` - -[ZetaChain CLI](/reference/cli/) 是与你的主要交互工具。你将用它来发起跨链调用、转移代币、追踪跨链交易、在多网络间管理账户、查询余额等。 - -尝试运行: - -```bash -zetachain query chains list -``` - -该命令会输出当前已接入 ZetaChain 的所有区块链,是验证环境是否配置成功的便捷方式。 - -对于本地开发,推荐启动 Localnet——一个自包含环境,集成了 ZetaChain、EVM、Solana、Sui 与 TON。无需依赖公共测试网,就能以最快速度构建、测试全链应用。 - -要运行 Localnet,请确保已安装 [Foundry](https://getfoundry.sh/)。它提供核心的 EVM 工具链,也是启动本地网络的前提。 - -如需在 Localnet 中加入非 EVM 链,请参考 [Localnet 文档](/reference/localnet/) 中的额外先决条件。 - -## 工具与参考资料 - -环境就绪后,以下资源将帮助你与 ZetaChain 交互并开展开发工作。 - -### 区块浏览器 - -ZetaChain 同时兼具 Cosmos 链与 EVM 链的特性。你可以使用 Cosmos 浏览器查看区块、验证者与治理活动,也可以使用 EVM 浏览器追踪合约与交易。两类链接均整理在 [浏览器参考](/reference/explorers/) 中。 - -### 水龙头 - -在测试网部署或测试前,你需要获取代币。[水龙头页面](/reference/faucet/) 列出了所有可用水龙头,既提供 ZETA Gas,也提供连接链上的测试代币。 - -### 网络 - -ZetaChain 同时运行主网与测试网。本教程主要针对测试网,但你可随时切换。RPC、链 ID 等信息见 [网络参考](/developers/chains/list/)。 - -### RPC - -若需连接应用、钱包或 Foundry、Hardhat 等框架,需要使用 RPC 节点。ZetaChain 主网与测试网的公共 RPC 均列于 [RPC 参考](/reference/network/api)。 - -### 合约 - -Gateway 等核心协议合约已部署在 ZetaChain 上,其地址汇总在 [协议合约参考](/reference/network/contracts/)。 - -### 代币 - -所有已列入白名单的 ZRC-20 代币及其合约地址,均可在 [代币参考](/developers/evm/zrc20/) 中查看。 - -### MCP - -通过 ZetaChain 的 Model Context Protocol (MCP) 服务器,将 Cursor 或 Claude Code 与链上查询、操作相连接。详见 [MCP 参考](/reference/mcp/)。 - -## 下一步去哪儿 - -环境配置完成后,可直接开始构建。根据目标选择合适的路线: - -### 学习基础 - -- [第一个全链合约](/developers/tutorials/hello/)(10 分钟)构建你的首个全链合约,理解 ZetaChain 开发的基础。 -- [构建 Web 应用](/developers/tutorials/frontend)(10 分钟)连接钱包、发送跨链调用,并用简单前端追踪执行状态。 - -### 往返全链应用的调用 - -- [EVM](/developers/tutorials/call/)(30 分钟)学习如何在 EVM 链与 ZetaChain 全链应用之间发送与接收调用。 -- [Solana](/developers/tutorials/solana/)(60 分钟)从 Solana 存入资产并调用全链应用,或向 Solana 发起出站调用。 -- [Sui](/developers/tutorials/sui/)(60 分钟)从 Sui 存入资产并调用全链应用。 -- [Sui 提现与调用](/developers/tutorials/sui-withdraw-and-call/)(60 分钟)向 Sui 提现资产并调用合约。 - -### 跨链消息传递 - -- [跨链消息](/developers/tutorials/messaging/)(30 分钟)直接在 EVM 网络间发起跨链调用,无需构建全链应用。 - -### 构建真实场景应用 - -- [全链 NFT](/developers/standards/nft/)(45 分钟)创建可在多链间无缝流转的 NFT。 -- [全链代币](/developers/standards/token/)(45 分钟)部署可跨链存在并互转的同质化代币。 -- [跨链兑换](/developers/tutorials/swap/)(30 分钟)构建兼容以太坊、Solana、比特币等链的全链兑换应用。 - diff --git a/src/pages/developers/tutorials/messaging.en-US.mdx b/src/pages/developers/tutorials/messaging.en-US.mdx deleted file mode 100644 index 22637203c..000000000 --- a/src/pages/developers/tutorials/messaging.en-US.mdx +++ /dev/null @@ -1,402 +0,0 @@ -This tutorial shows how to send cross-chain messages between contracts on two -EVM chains using ZetaChain’s messaging infrastructure. - -Unlike universal apps deployed directly on ZetaChain, this approach allows you -to keep all contract logic on connected EVM chains. Messages are automatically -routed between them through ZetaChain, without requiring any contracts to be -deployed on ZetaChain itself. - -> Why use this pattern? Unlike universal apps deployed directly on ZetaChain, -> here all business logic stays on the connected EVM chains you already know. -> ZetaChain merely transports the payload, no contract code is deployed on -> ZetaChain itself. - -By the end of this tutorial, you will: - -- Deploy a messaging contract to two EVM testnets (Base and Ethereum Sepolia) -- Link them for cross-chain communication -- Send a message and token value from one to the other -- Track the cross-chain transaction from source to destination - -
    - -
    - -## Create a Project - -Create a new project using the `messaging` template: - -``` -npx zetachain new --project messaging -``` - -Install TypeSCcipt and Foundry dependencies: - -``` -cd messaging -yarn -forge soldeer update -``` - -Compile contracts: - -``` -forge build -``` - -Save your private key in an environment variable so shell scripts can read it: - -``` -PRIVATE_KEY=... -``` - -## Messaging Contract - -To enable cross-chain messaging, your contract must inherit from ZetaChain’s -`Messaging` base contract and implement a few required functions. - -Import the `Messaging.sol` contract from the ZetaChain standard contracts -package: - -```solidity -import "@zetachain/standard-contracts/contracts/messaging/contracts/Messaging.sol"; -``` - -Inherit from `Messaging` in your contract: - -```solidity -contract Example is Messaging { ... } -``` - -Initialize the contract with the required parameters in the constructor: - -```solidity -constructor( - address payable _gateway, - address owner, - address _router -) Messaging(_gateway, owner, _router) {} -``` - -The Messa`ging base contract provides built-in access to Gateway and Router, and -ensures your contract is correctly wired into ZetaChain’s cross-chain messaging -system. - -You must implement three core internal functions for handling message delivery -and fallback: - -#### onMessageReceive - -This is called automatically on the destination chain when a cross-chain message -arrives successfully. - -```solidity -function onMessageReceive( - bytes memory data, - bytes memory sender, - uint256 amount, - bytes memory asset -) internal override { - //... -} -``` - -Use this function to decode the message and execute logic like updating state, -triggering downstream calls, or transferring the received token value. - -### onMessageRevert - -This is triggered if the destination contract’s onMessageReceive fails (e.g., -due to invalid calldata or logic errors). - -```solidity -function onMessageRevert( - bytes memory data, - bytes memory sender, - uint256 amount, - bytes memory asset -) internal override { - //... -} -``` - -### onRevert - -This is called when a message fails during routing before reaching the -destination chain. It executes on the source chain. - -```solidity -function onRevert(RevertContext calldata context) - external - payable - override - onlyGateway -{ - if (context.sender != router) revert Unauthorized(); - //... -} -``` - -You can use this to refund the user, trigger compensation logic, or emit a -notification. - -### Sending a Message - -To initiate a cross-chain message, your contract must call the `depositAndCall` -function on the EVM Gateway. This function is what hands off your message and -optional token value to ZetaChain’s messaging layer for routing. - -Depending on whether you're sending native gas (like ETH) or ERC-20 tokens, -you’ll use one of the following two forms of `depositAndCall`. - -If you want to send a message with ETH as the value: - -```solidity -gateway.depositAndCall{value: msg.value}( - router, - message, - revertOptions -); -``` - -If you're sending supported ERC-20 tokens: - -```solidity -gateway.depositAndCall( - router, - amount, - asset, - message, - revertOptions -); -``` - -`asset` is the ERC-20 token address being sent (must be supported by ZetaChain). - -### What’s Inside the Message Payload? - -The `message` argument is a single `bytes` field. It is ABI-encoded and must -follow a structure that the Universal Router on ZetaChain understands. - -```solidity -abi.encode( - receiver, // bytes: destination contract address on the target chain - targetToken, // address: ZRC-20 address of the token to transfer to the destination contract - data, // bytes: message payload (e.g., ABI-encoded "hello") - gasLimit, // uint256: gas to forward for execution on the target chain - revertOptions // struct: defines what to do on failure -) -``` - -If you're sending the string `"hello"` to a contract on Ethereum Sepolia, you -might encode: - -```solidity -bytes memory data = abi.encode("hello"); -bytes memory message = abi.encode( - abi.encodePacked(receiver), // Destination contract address (as bytes) - targetToken, // Token to transfer on destination chain - data, // ABI-encoded message - 300_000, // Gas limit - revertOptions // Struct specifying fallback behavior -); -``` - -This message is then passed to `depositAndCall()` and routed through ZetaChain -to the destination chain, where it is decoded and passed into the destination -contract’s `onMessageReceive()`. - -### What Is the Universal Router? - -When you send a cross-chain message via `gateway.depositAndCall(...)`, the -actual logic that handles routing and execution on ZetaChain is implemented -inside a contract called the **Universal Router**. - -This contract runs on ZetaChain and acts as the **entry point for all -cross-chain messaging logic**. It is responsible for: - -- **Parsing the message payload** sent from the source chain -- **Swapping tokens** (if necessary) into: - - - The destination chain's **gas token** to cover execution fees - - The destination contract's **target token** to be delivered - -- **Forwarding the message** and token to the destination contract -- **Handling fallback logic** in case the destination call fails - -All contracts that use the Messaging base contract share the same Universal -Router. This shared router simplifies development, ensuring consistent behavior -across all messaging-based apps. - -The Universal Router ensures that your contract only needs to focus on sending -an encoded payload, everything else, from gas handling to token transfer to -delivery mechanics, is managed for you. - -You don’t need to interact with the Universal Router directly. Just encode your -message, call the Gateway, and ZetaChain will handle the rest. - -> 🔧 Advanced: If you need more control, for example, to customize how tokens -> are swapped, route to different contracts, or handle messages differently, you -> can deploy your own instance of a router and point your contracts to it by -> passing its address to the Messaging constructor. - -## Deploy Messaging Contracts - -Deploy to Base Sepolia: - -``` -MESSAGING_BASE=$(./commands/index.ts deploy --rpc https://sepolia.base.org --private-key $PRIVATE_KEY | jq -r .contractAddress) -``` - -Deploy to Ethereum Sepolia: - -``` -MESSAGING_ETHEREUM=$(./commands/index.ts deploy --rpc https://sepolia.drpc.org --private-key $PRIVATE_KEY | jq -r .contractAddress) -``` - -## Connect Two Contracts - -Before two contracts can communicate across chains, they need to explicitly -trust each other. This prevents malicious contracts from spoofing cross-chain -messages. In this step, you’ll establish a bidirectional link between the two -deployed messaging contracts. - -Each contract needs to know: - -- The address of the counterpart contract on the remote chain -- The chain ID of that remote chain - -This is done using the `setConnected()` function in the messaging contract. -ZetaChain’s cross-chain infrastructure will only deliver messages to a contract -if it has registered the sender as trusted. - -⚠️ If you skip this step or set the wrong address/chain ID, messages will be -rejected on the destination chain. - -``` -./commands/index.ts connect \ - --contract $MESSAGING_BASE \ - --target-contract $MESSAGING_ETHEREUM \ - --rpc https://sepolia.base.org \ - --target-chain-id 11155111 \ - --private-key $PRIVATE_KEY -``` - -``` -./commands/index.ts connect \ - --contract $MESSAGING_ETHEREUM \ - --target-contract $MESSAGING_BASE \ - --rpc https://sepolia.drpc.org \ - --target-chain-id 84532 \ - --private-key $PRIVATE_KEY -``` - -Once both directions are linked, the contracts can send and receive messages. - -## Send a Cross-Chain Message - -Now that your contracts are deployed and connected, you can send a message from -one to the other. - -This example sends the string "hello" from the contract on Base Sepolia to the -contract on Ethereum Sepolia, - -``` -./commands/index.ts message \ - --rpc https://sepolia.base.org \ - --private-key $PRIVATE_KEY \ - --contract $MESSAGING_BASE \ - --target-contract $MESSAGING_ETHEREUM \ - --types string \ - --values hello \ - --target-token 0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0 \ - --amount 0.005 -``` - -| Flag | Description | -| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `--rpc https://sepolia.base.org` | The RPC endpoint for the **source chain** (Base Sepolia). This is where the transaction will be sent. | -| `--private-key $PRIVATE_KEY` | The account that signs and funds the transaction on the source chain. It must hold the token being sent. | -| `--contract $MESSAGING_BASE` | Address of the messaging contract deployed on the source chain. This contract initiates the cross-chain call. | -| `--target-contract $MESSAGING_ETHEREUM` | The address of the contract on the **destination chain**. This is the final recipient of the message. | -| `--types string` | The ABI type of the message you’re sending. This can be a single type (like `string`) or a tuple (e.g., `string,uint256`). | -| `--values hello` | The actual value to encode and send across chains, in this case, just the string `"hello"`. | -| `--target-token 0x...` | The ZRC20 token address on ZetaChain that represents the destination chain’s token. This tells ZetaChain what asset to transfer to the target contract. | -| `--amount 0.005` | The total amount of tokens sent. A portion of this covers gas fees on the destination chain; the remainder is transferred to the destination contract. | - -### How Amount is Handled - -When you send a cross-chain message using `--amount`, you're not just -transferring tokens, you’re also prepaying for gas on the destination chain. -Here's what happens behind the scenes: - -1. You **supply tokens** on the source chain (e.g., Base ETH). This can be - native gas (like ETH) or any supported ERC-20. -2. You specify a **target token** via `--target-token`, which points to the - ZRC-20 representing the token you want to deliver on the destination chain - (e.g., Ethereum ETH). -3. On ZetaChain: - - - A **portion of the supplied amount** is automatically swapped into the - ZRC-20 version of the **gas token** for the destination chain (Ethereum ETH - in this example). This is used to cover the **execution cost** of the - message on the destination chain. - - The **remaining amount** is swapped into the **target token** (which might - be the same token) and forwarded to the destination contract. - -This makes the system fully automated: you don’t need to hold or acquire the -destination chain’s native token to interact with it. - -```json -{ - "contractAddress": "0xee2E8dfefd723e879CAa30A1DaD94046Fa3D24D4", - "targetContract": "0x7c9BbA0630c9452F726bc15D0a73cdF769438efE", - "targetToken": "0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0", - "message": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000", - "transactionHash": "0x939e230dd504efdf1fce31202a5980b4d0376430ddf535d080666256353c02c3", - "amount": "0.005" -} -``` - -## Track the Cross-Chain Transaction - -Use the transaction hash from the previous step to query its cross-chain status: - -``` -npx zetachain query cctx --hash 0x939e230dd504efdf1fce31202a5980b4d0376430ddf535d080666256353c02c3 -``` - -``` -84532 → 7001 ✅ OutboundMined -CCTX: 0xd88d92d0b9b0a2fde416bf6383e430b51de48114b0b03e7cc34e7f8d8df15cb7 -Tx Hash: 0x939e230dd504efdf1fce31202a5980b4d0376430ddf535d080666256353c02c3 (on chain 84532) -Tx Hash: 0x8c368f6a3cfc55950b5d2b0d98c63d1904a79300490ec7d1c258505f372054e3 (on chain 7001) -Sender: 0xee2E8dfefd723e879CAa30A1DaD94046Fa3D24D4 -Receiver: 0x5BD35697D4a62DE429247cbBDCc5c47F70477775 -Message: 00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000005ba149a7bd6dc1f937fa9046a9e05c05f3b18b000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000147c9bba0630c9452f726bc15d0a73cdf769438efe00000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000000000000000000000000000ee2e8dfefd723e879caa30a1dad94046fa3d24d40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000000 -Amount: 5000000000000000 Gas tokens - -7001 → 11155111 ✅ OutboundMined -CCTX: 0x8952c9f95dfb5673a9fbfa2196842b750f5530f4931a55088b1276599328fd64 -Tx Hash: 0xd88d92d0b9b0a2fde416bf6383e430b51de48114b0b03e7cc34e7f8d8df15cb7 (on chain 7001) -Tx Hash: 0xf30e4414087e8b5c81e257e8a97ac9105dde37cbbd6bb33a1691c4a30585507e (on chain 11155111) -Sender: 0x5BD35697D4a62DE429247cbBDCc5c47F70477775 -Receiver: 0x7c9BbA0630c9452F726bc15D0a73cdF769438efE -Message: 00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000009ad718280b1cf00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000014a34000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000568656c6c6f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014ee2e8dfefd723e879caa30a1dad94046fa3d24d40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -Amount: 1074034700777807 Gas tokens -``` - -This confirms that the message has successfully moved from Base Sepolia through -ZetaChain to Ethereum Sepolia. - -You can verify the destination chain transaction on Etherscan: - -https://sepolia.etherscan.io/tx/0xf30e4414087e8b5c81e257e8a97ac9105dde37cbbd6bb33a1691c4a30585507e diff --git a/src/pages/developers/tutorials/messaging.zh-CN.mdx b/src/pages/developers/tutorials/messaging.zh-CN.mdx deleted file mode 100644 index 5952ffc94..000000000 --- a/src/pages/developers/tutorials/messaging.zh-CN.mdx +++ /dev/null @@ -1,340 +0,0 @@ ---- -title: 跨链消息 ---- - -本教程演示如何使用 ZetaChain 的消息基础设施,在两条 EVM 链上的合约间发送跨链消息。 - -与部署在 ZetaChain 上的全链应用不同,此模式允许你将所有合约逻辑留在已有的连接 EVM 链上。ZetaChain 仅负责在它们之间路由消息,无需在 ZetaChain 部署任何合约。 - -> 为什么使用该模式?相比直接在 ZetaChain 部署全链应用,此方式可让全部业务逻辑保留在你熟悉的连接 EVM 链上。ZetaChain 只负责传输载荷,并不部署合约代码。 - -完成本教程后,你将: - -- 在两个 EVM 测试网(Base 与 Ethereum Sepolia)部署消息传递合约 -- 建立它们之间的跨链通信 -- 从一条链向另一条链发送消息与代币数量 -- 跟踪跨链交易从源链到目标链的状态 - -
    - -
    - -## 创建项目 - -使用 `messaging` 模板创建新项目: - -``` -npx zetachain new --project messaging -``` - -安装 TypeScript 与 Foundry 依赖: - -``` -cd messaging -yarn -forge soldeer update -``` - -编译合约: - -``` -forge build -``` - -为了让脚本读取,建议将私钥保存为环境变量: - -``` -PRIVATE_KEY=... -``` - -## Messaging 合约 - -要启用跨链消息传递,合约需继承 ZetaChain 的 `Messaging` 基类并实现必要函数。 - -从 ZetaChain 标准合约包引入 `Messaging.sol`: - -```solidity -import "@zetachain/standard-contracts/contracts/messaging/contracts/Messaging.sol"; -``` - -在合约中继承 `Messaging`: - -```solidity -contract Example is Messaging { ... } -``` - -在构造函数中按要求初始化参数: - -```solidity -constructor( - address payable _gateway, - address owner, - address _router -) Messaging(_gateway, owner, _router) {} -``` - -`Messaging` 基类会提供对 Gateway 与 Router 的访问,并确保合约正确接入 ZetaChain 的跨链消息系统。 - -你需要实现三个核心内部函数,用于处理消息投递与回退: - -#### onMessageReceive - -当跨链消息成功到达目标链时会自动触发: - -```solidity -function onMessageReceive( - bytes memory data, - bytes memory sender, - uint256 amount, - bytes memory asset -) internal override { - //... -} -``` - -在此解码消息,执行状态更新、触发下游调用或处理接收到的代币。 - -#### onMessageRevert - -当目标合约的 `onMessageReceive` 执行失败(如 calldata 无效或逻辑回退)时触发: - -```solidity -function onMessageRevert( - bytes memory data, - bytes memory sender, - uint256 amount, - bytes memory asset -) internal override { - //... -} -``` - -#### onRevert - -当消息在路由过程中未抵达目标链时触发,执行于源链: - -```solidity -function onRevert(RevertContext calldata context) - external - payable - override - onlyGateway -{ - if (context.sender != router) revert Unauthorized(); - //... -} -``` - -可在此执行退款、补偿逻辑或发出通知。 - -### 发送消息 - -要发起跨链消息,合约需调用 EVM Gateway 的 `depositAndCall`,该函数会将消息与可选代币交给 ZetaChain 的消息层进行路由。 - -根据是否发送原生 Gas(如 ETH)或 ERC-20,有两种形式: - -发送带 ETH 的消息: - -```solidity -gateway.depositAndCall{value: msg.value}( - router, - message, - revertOptions -); -``` - -发送受支持的 ERC-20: - -```solidity -gateway.depositAndCall( - router, - amount, - asset, - message, - revertOptions -); -``` - -其中 `asset` 为要发送的 ERC-20 地址,必须已被 ZetaChain 支持。 - -### 消息载荷结构 - -`message` 参数是单个 `bytes`,需按 Universal Router 可识别的结构进行 ABI 编码: - -```solidity -abi.encode( - receiver, // bytes:目标链合约地址 - targetToken, // address:目标链需接收的代币对应的 ZRC-20 - data, // bytes:消息载荷(如 ABI 编码的 "hello") - gasLimit, // uint256:目标链执行所需 Gas - revertOptions // struct:失败时的回退策略 -) -``` - -例如将字符串 `"hello"` 发送到 Ethereum Sepolia 的合约: - -```solidity -bytes memory data = abi.encode("hello"); -bytes memory message = abi.encode( - abi.encodePacked(receiver), - targetToken, - data, - 300_000, - revertOptions -); -``` - -随后将 `message` 传入 `depositAndCall()`,经过 ZetaChain 路由至目标链,并在目标合约的 `onMessageReceive()` 中解码使用。 - -### Universal Router 介绍 - -当你调用 `gateway.depositAndCall(...)` 发送跨链消息时,具体的路由与执行逻辑由 **Universal Router** 合约在 ZetaChain 上完成。它是所有跨链消息的入口,负责: - -- 解析源链传来的消息载荷 -- 将部分代币换成目标链 Gas 代币用于支付执行费用,将剩余部分换成目标链指定代币交给目标合约 -- 将消息与代币转发至目标合约 -- 在目标调用失败时进行回退处理 - -所有继承 Messaging 基类的合约共享同一个 Universal Router,这让开发体验更一致,无需重复实现。你只需专注于编码载荷并调用 Gateway,其余细节由 ZetaChain 代劳。 - -> 🔧 进阶:若需要更多自定义(如调整代币交换方式、改用自定义 Router 或变更消息处理逻辑),可部署自定义 Router,并在 Messaging 构造函数中传入对应地址。 - -## 部署消息合约 - -部署到 Base Sepolia: - -``` -MESSAGING_BASE=$(./commands/index.ts deploy --rpc https://sepolia.base.org --private-key $PRIVATE_KEY | jq -r .contractAddress) -``` - -部署到 Ethereum Sepolia: - -``` -MESSAGING_ETHEREUM=$(./commands/index.ts deploy --rpc https://sepolia.drpc.org --private-key $PRIVATE_KEY | jq -r .contractAddress) -``` - -## 互联合约 - -在跨链通信前,两份合约需显式彼此信任,以防恶意合约伪造跨链消息。此步骤将为两个合约建立双向链接。 - -每个合约需知晓: - -- 远程合约地址 -- 远程链 ID - -通过合约的 `setConnected()` 函数完成配置。ZetaChain 仅向已登记的可信合约传递消息。 - -⚠️ 若跳过此步骤或填写错误地址/链 ID,目标链会拒绝消息。 - -``` -./commands/index.ts connect \ - --contract $MESSAGING_BASE \ - --target-contract $MESSAGING_ETHEREUM \ - --rpc https://sepolia.base.org \ - --target-chain-id 11155111 \ - --private-key $PRIVATE_KEY -``` - -``` -./commands/index.ts connect \ - --contract $MESSAGING_ETHEREUM \ - --target-contract $MESSAGING_BASE \ - --rpc https://sepolia.drpc.org \ - --target-chain-id 84532 \ - --private-key $PRIVATE_KEY -``` - -完成双向连接后,双方即可互发消息。 - -## 发送跨链消息 - -一切部署就绪后,可从一条链向另一条链发送消息。 - -以下示例将字符串 `"hello"` 从 Base Sepolia 的合约发送至 Ethereum Sepolia 的合约: - -``` -./commands/index.ts message \ - --rpc https://sepolia.base.org \ - --private-key $PRIVATE_KEY \ - --contract $MESSAGING_BASE \ - --target-contract $MESSAGING_ETHEREUM \ - --types string \ - --values hello \ - --target-token 0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0 \ - --amount 0.005 -``` - -| 参数 | 说明 | -| --- | --- | -| `--rpc https://sepolia.base.org` | 源链(Base Sepolia)的 RPC,交易由此发出 | -| `--private-key $PRIVATE_KEY` | 源链上用于签名与支付的账户,需持有发送代币 | -| `--contract $MESSAGING_BASE` | 源链已部署的消息合约地址 | -| `--target-contract $MESSAGING_ETHEREUM` | 目标链合约地址 | -| `--types string` | 消息的 ABI 类型,可为单一类型或元组 | -| `--values hello` | 实际发送的值,即字符串 `"hello"` | -| `--target-token 0x...` | ZetaChain 上代表目标链代币的 ZRC-20 地址 | -| `--amount 0.005` | 总发送数量,其中一部分用于支付目标链 Gas,其余转给目标合约 | - -### 数量如何处理 - -使用 `--amount` 发送跨链消息时,你不仅转移代币,还预付目标链的 Gas: - -1. 在源链提供代币(如 Base ETH),可以是原生资产或受支持的 ERC-20。 -2. 通过 `--target-token` 指定 ZetaChain 上代表目标链代币的 ZRC-20。 -3. ZetaChain 会自动: - - 将部分金额兑换成目标链的 Gas 代币(ZRC-20 形式),用于支付执行成本。 - - 将剩余金额兑换成目标合约所需的目标代币,并转入目标合约。 - -这样你无需持有目标链原生代币,即可完成跨链调用。 - -```json -{ - "contractAddress": "0xee2E8dfefd723e879CAa30A1DaD94046Fa3D24D4", - "targetContract": "0x7c9BbA0630c9452F726bc15D0a73cdF769438efE", - "targetToken": "0x05BA149A7bd6dC1F937fA9046A9e05C05f3b18b0", - "message": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000", - "transactionHash": "0x939e230dd504efdf1fce31202a5980b4d0376430ddf535d080666256353c02c3", - "amount": "0.005" -} -``` - -## 跟踪跨链交易 - -使用上述交易哈希查询跨链状态: - -``` -npx zetachain query cctx --hash 0x939e230dd504efdf1fce31202a5980b4d0376430ddf535d080666256353c02c3 -``` - -``` -84532 → 7001 ✅ OutboundMined -CCTX: 0xd88d92d0b9b0a2fde416bf6383e430b51de48114b0b03e7cc34e7f8d8df15cb7 -Tx Hash: 0x939e230dd504efdf1fce31202a5980b4d0376430ddf535d080666256353c02c3 (on chain 84532) -Tx Hash: 0x8c368f6a3cfc55950b5d2b0d98c63d1904a79300490ec7d1c258505f372054e3 (on chain 7001) -Sender: 0xee2E8dfefd723e879CAa30A1DaD94046Fa3D24D4 -Receiver: 0x5BD35697D4a62DE429247cbBDCc5c47F70477775 -Message: ... - -7001 → 11155111 ✅ OutboundMined -CCTX: 0x8952c9f95dfb5673a9fbfa2196842b750f5530f4931a55088b1276599328fd64 -Tx Hash: 0xd88d92d0b9b0a2fde416bf6383e430b51de48114b0b03e7cc34e7f8d8df15cb7 (on chain 7001) -Tx Hash: 0xf30e4414087e8b5c81e257e8a97ac9105dde37cbbd6bb33a1691c4a30585507e (on chain 11155111) -Sender: 0x5BD35697D4a62DE429247cbBDCc5c47F70477775 -Receiver: 0x7c9BbA0630c9452F726bc15D0a73cdF769438efE -Message: ... -``` - -这表明消息已经从 Base Sepolia 经过 ZetaChain 成功抵达 Ethereum Sepolia。 - -可在 Etherscan 验证目标链交易: - -https://sepolia.etherscan.io/tx/0xf30e4414087e8b5c81e257e8a97ac9105dde37cbbd6bb33a1691c4a30585507e - diff --git a/src/pages/developers/tutorials/solana.en-US.mdx b/src/pages/developers/tutorials/solana.en-US.mdx deleted file mode 100644 index 5066f3e99..000000000 --- a/src/pages/developers/tutorials/solana.en-US.mdx +++ /dev/null @@ -1,189 +0,0 @@ -Building universal applications with ZetaChain and Solana is easy. You can -deposit SOL and SPL-20 tokens directly from Solana into accounts or smart -contracts on ZetaChain. Universal contracts on ZetaChain can handle these -deposits and execute contract calls initiated from the Solana blockchain. - -- In this tutorial, you'll: -- Set up a local development environment using localnet. -- Deploy a universal contract on ZetaChain. -- Deposit tokens (SOL and SPL-20) from Solana to ZetaChain. -- Execute deposit-and-call transactions, depositing tokens and calling a - universal app simultaneously. -- Withdraw tokens back to Solana, optionally calling Solana programs as part of - the withdrawal. - -Interactions with universal apps from Solana are handled by the Solana Gateway -program, [learn more about it in the docs](/developers/chains/solana). - -## Prerequisites - -Ensure you have installed and configured the following before starting: - -- [`solana` CLI](https://solana.com/docs/intro/installation) - -## Clone the Example Project - -Start by creating a project and installing the necessary dependencies: - -```bash -npx zetachain@latest new --project call -cd call -yarn -``` - -## Launch Localnet - -This command brings up the local development environment with ZetaChain and -Solana: - -```bash -yarn zetachain localnet start -``` - -Leave this running in one terminal window. - -## Compile and Deploy an Example Universal Contract - -In a new terminal window, compile and deploy the universal contract: - -```bash -npx hardhat compile --force -npx hardhat deploy --name Universal --network localhost --gateway 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 -``` - -You will see a confirmation with your contract address: - -``` -🚀 Successfully deployed "Universal" contract on localhost. -📜 Contract address: 0x8198f5d8F8CfFE8f9C413d98a0A55aEB8ab9FbB7 -``` - -Keep track of the contract address for later (in this example, -`0x8198f5d8F8CfFE8f9C413d98a0A55aEB8ab9FbB7`). - -## Deposit - -Deposit SOL tokens from Solana to ZetaChain: - -``` -npx hardhat localnet:solana-deposit \ - --receiver 0x8198f5d8F8CfFE8f9C413d98a0A55aEB8ab9FbB7 \ - --amount 0.1 -``` - ---receiver: Universal contract address on ZetaChain. - ---amount: Amount of SOL to deposit. - -## Deposit and Call - -Deposit tokens and simultaneously call the deployed universal contract: - -```bash -npx hardhat localnet:solana-deposit-and-call \ - --receiver 0x8198f5d8F8CfFE8f9C413d98a0A55aEB8ab9FbB7 \ - --amount 0.1 \ - --types '["string"]' hello -``` - -This command deposits tokens and triggers the universal contract function with -the argument "hello". - -## Withdraw Tokens to Solana - -Withdraw tokens from ZetaChain back to Solana: - -```bash -npx hardhat zetachain-withdraw \ - --gateway-zeta-chain 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 \ - --receiver DrexsvCMH9WWjgnjVbx1iFf3YZcKadupFmxnZLfSyotd \ - --network localhost \ - --zrc20 0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891 \ - --amount 0.1 -``` - -- `--gateway-zeta-chain`: Address of the ZetaChain gateway. -- `--receiver`: A Solana wallet address to receive the withdrawn tokens. -- `--zrc20`: The ZetaChain representation of the token you want to withdraw - (ZRC-20 address). -- `--amount`: The amount to withdraw. - -## Withdraw and Call a Program on Solana - -Beyond simply withdrawing tokens from ZetaChain back to Solana, you can also -execute a Solana program as part of the withdrawal process. This allows for more -complex interactions, such as triggering on-chain logic immediately upon -receiving funds. For example, you can withdraw SOL or SPL-20 tokens and call a -Solana program in a single transaction, enabling use cases like automatic -staking, swaps, or contract executions. - -The `solana` directory contains an example Solana program with an `on_call` -function, which can be invoked by a universal app on ZetaChain during the -withdrawal process. - -The following steps will guide you through setting up an example Solana program -and using the ZetaChain Gateway to perform a "withdraw and call". - -### Build and Set Up the Example Solana Program - -Set the SPL-20 USDC address. You can find this address in a table in the output -of `localnet`: - -```bash -USDC_SPL=3Kx5SY7SwzdUZSorLVSpPgxBL8DZFiu8mg4FWduu2tQp -``` - -```bash -cd solana && anchor build && npx ts-node setup/main.ts "$USDC_SPL" && cd - -``` - -After running this, you should see output indicating that the program was -successfully deployed, such as: - -``` -Connected program deployment output: Program Id: 9BjVGjn28E58LgSi547JYEpqpgRoo1TErkbyXiRSNDQy -``` - -### Withdraw SOL and Call the Solana Program - -Make a call to the ZetaChain Gateway to withdraw SOL and call a program on -Solana: - -```bash -npx hardhat zetachain-withdraw-and-call \ - --receiver 9BjVGjn28E58LgSi547JYEpqpgRoo1TErkbyXiRSNDQy \ - --gateway-zeta-chain 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 \ - --zrc20 0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891 \ - --amount 0.01 \ - --network localhost \ - --types '["bytes"]' $(npx ts-node solana/setup/encodeCallArgs.ts "sol" "$USDC_SPL") -``` - -- `--receiver`: The Solana program ID you want to call. -- `--types '["bytes"]'`: Specifies that the contract call argument is a bytes - array (the encoded Solana call data). -- `"$ENCODED_ACCOUNTS_AND_DATA"`: The encoded Solana program call arguments we - generated in the previous step. -- `--zrc20`: ZRC-20 address of SOL on ZetaChain. - -### Withdraw SPL-20 and Call the Solana Program - -Make a call to the ZetaChain Gateway to withdraw ZRC-20 SPL-20 USDC and call a -program on Solana: - -```bash -npx hardhat zetachain-withdraw-and-call \ - --receiver 9BjVGjn28E58LgSi547JYEpqpgRoo1TErkbyXiRSNDQy \ - --gateway-zeta-chain 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 \ - --zrc20 0x48f80608B672DC30DC7e3dbBd0343c5F02C738Eb \ - --amount 0.01 \ - --network localhost \ - --types '["bytes"]' $(npx ts-node solana/setup/encodeCallArgs.ts "spl" "$USDC_SPL") -``` - -- `--zrc20`: ZRC-20 address of SPL-20 USDC on ZetaChain. - -In this tutorial you’ve learned how to deploy a universal contract on ZetaChain, -deposit SOL and SPL-20 tokens from Solana, call contracts during deposits, -withdraw assets back to Solana, and even trigger Solana programs upon -withdrawal. diff --git a/src/pages/developers/tutorials/solana.zh-CN.mdx b/src/pages/developers/tutorials/solana.zh-CN.mdx deleted file mode 100644 index d4398ddf1..000000000 --- a/src/pages/developers/tutorials/solana.zh-CN.mdx +++ /dev/null @@ -1,167 +0,0 @@ ---- -title: 往返 Solana 的调用 ---- - -使用 ZetaChain 与 Solana 构建全链应用非常简单。你可以直接从 Solana 存入 SOL 与 SPL-20 代币到 ZetaChain 的账户或智能合约,ZetaChain 上的全链合约可以处理这些存入,并执行由 Solana 发起的合约调用。 - -本教程将引导你: - -- 使用 localnet 搭建本地开发环境 -- 在 ZetaChain 部署全链合约 -- 从 Solana 向 ZetaChain 存入代币(SOL 与 SPL-20) -- 执行 deposit-and-call 交易,在存入代币的同时调用全链应用 -- 将代币提现回 Solana,并在提现过程中可选调用 Solana 程序 - -与 Solana 的交互由 Solana Gateway 程序处理,详见[文档说明](/developers/chains/solana)。 - -## 前置条件 - -开始前请确保已安装并配置: - -- [`solana` CLI](https://solana.com/docs/intro/installation) - -## 克隆示例项目 - -创建项目并安装依赖: - -```bash -npx zetachain@latest new --project call -cd call -yarn -``` - -## 启动 Localnet - -运行以下命令启动包含 ZetaChain 与 Solana 的本地开发环境: - -```bash -yarn zetachain localnet start -``` - -请保持该终端运行。 - -## 编译并部署示例全链合约 - -在新终端窗口中编译并部署全链合约: - -```bash -npx hardhat compile --force -npx hardhat deploy --name Universal --network localhost --gateway 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 -``` - -执行后会输出合约部署成功的提示: - -``` -🚀 Successfully deployed "Universal" contract on localhost. -📜 Contract address: 0x8198f5d8F8CfFE8f9C413d98a0A55aEB8ab9FbB7 -``` - -请记录合约地址(此示例为 `0x8198f5d8F8CfFE8f9C413d98a0A55aEB8ab9FbB7`),后续会用到。 - -## 存入 SOL - -从 Solana 向 ZetaChain 存入 SOL: - -``` -npx hardhat localnet:solana-deposit \ - --receiver 0x8198f5d8F8CfFE8f9C413d98a0A55aEB8ab9FbB7 \ - --amount 0.1 -``` - -- `--receiver`:ZetaChain 上的全链合约地址 -- `--amount`:欲存入的 SOL 数量 - -## 存入并调用 - -在存入代币的同时调用已部署的全链合约: - -```bash -npx hardhat localnet:solana-deposit-and-call \ - --receiver 0x8198f5d8F8CfFE8f9C413d98a0A55aEB8ab9FbB7 \ - --amount 0.1 \ - --types '["string"]' hello -``` - -该命令会在存入代币的同时向合约传入字符串参数 `"hello"`。 - -## 提现至 Solana - -将代币从 ZetaChain 提现回 Solana: - -```bash -npx hardhat zetachain-withdraw \ - --gateway-zeta-chain 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 \ - --receiver DrexsvCMH9WWjgnjVbx1iFf3YZcKadupFmxnZLfSyotd \ - --network localhost \ - --zrc20 0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891 \ - --amount 0.1 -``` - -- `--gateway-zeta-chain`:ZetaChain Gateway 地址 -- `--receiver`:接收提现代币的 Solana 钱包地址 -- `--zrc20`:目标提现代币在 ZetaChain 上的 ZRC-20 地址 -- `--amount`:提现数量 - -## 提现并调用 Solana 程序 - -除了单纯提现外,还可以在提现过程中调用 Solana 程序,实现更复杂的操作,例如在收款时自动执行合约逻辑、质押或兑换。 - -项目 `solana` 目录中提供了示例程序,包含可由 ZetaChain 全链应用在提现时调用的 `on_call` 函数。 - -以下步骤展示如何构建示例程序,并通过 ZetaChain Gateway 执行 “withdraw and call”。 - -### 构建并配置示例 Solana 程序 - -设置 SPL-20 USDC 地址,可在 `localnet` 输出表格中找到: - -```bash -USDC_SPL=3Kx5SY7SwzdUZSorLVSpPgxBL8DZFiu8mg4FWduu2tQp -``` - -```bash -cd solana && anchor build && npx ts-node setup/main.ts "$USDC_SPL" && cd - -``` - -完成后会输出类似信息,表示程序部署成功: - -``` -Connected program deployment output: Program Id: 9BjVGjn28E58LgSi547JYEpqpgRoo1TErkbyXiRSNDQy -``` - -### 提现 SOL 并调用 Solana 程序 - -通过 ZetaChain Gateway 提现 SOL 并调用 Solana 程序: - -```bash -npx hardhat zetachain-withdraw-and-call \ - --receiver 9BjVGjn28E58LgSi547JYEpqpgRoo1TErkbyXiRSNDQy \ - --gateway-zeta-chain 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 \ - --zrc20 0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891 \ - --amount 0.01 \ - --network localhost \ - --types '["bytes"]' $(npx ts-node solana/setup/encodeCallArgs.ts "sol" "$USDC_SPL") -``` - -- `--receiver`:需要调用的 Solana 程序 ID -- `--types '["bytes"]'`:表示合约调用参数为字节数组(即编码后的 Solana 调用数据) -- 引号中的命令会生成编码后的账户与数据 -- `--zrc20`:ZetaChain 上 SOL 的 ZRC-20 地址 - -### 提现 SPL-20 并调用 Solana 程序 - -将 ZRC-20 形式的 SPL-20 USDC 提现同时调用 Solana 程序: - -```bash -npx hardhat zetachain-withdraw-and-call \ - --receiver 9BjVGjn28E58LgSi547JYEpqpgRoo1TErkbyXiRSNDQy \ - --gateway-zeta-chain 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 \ - --zrc20 0x48f80608B672DC30DC7e3dbBd0343c5F02C738Eb \ - --amount 0.01 \ - --network localhost \ - --types '["bytes"]' $(npx ts-node solana/setup/encodeCallArgs.ts "spl" "$USDC_SPL") -``` - -- `--zrc20`:ZetaChain 上 SPL-20 USDC 的 ZRC-20 地址 - -通过本教程,你已学会在 ZetaChain 部署全链合约、从 Solana 存入 SOL 与 SPL-20、在存入时调用合约、将资产提现回 Solana,并在提现时触发 Solana 程序,为跨链交互提供更多扩展玩法。 - diff --git a/src/pages/developers/tutorials/staking.en-US.mdx b/src/pages/developers/tutorials/staking.en-US.mdx deleted file mode 100644 index a40b4edab..000000000 --- a/src/pages/developers/tutorials/staking.en-US.mdx +++ /dev/null @@ -1,185 +0,0 @@ -ZetaChain is a proof-of-stake blockchain built with the Cosmos SDK, secured by -validators who stake the native ZETA token. Delegators (regular users) can -participate in securing the network by staking their ZETA with validators and, -in return, earn rewards. Because ZetaChain is also an EVM environment, smart -contracts can access Cosmos staking functionality directly through a special -staking precompile. This allows contracts, scripts, and frontends to delegate, -undelegate, claim rewards, and more, all using familiar EVM tooling. - -In this tutorial, we’ll use Foundry (`cast`) and curl to interact with the -staking precompile. The same functions can also be called from Solidity -contracts or web frontends. - -- Precompile address: `0x0000000000000000000000000000000000000800` -- Documentation: [Staking - Precompile](https://evm.cosmos.network/v0.4.x/documentation/smart-contracts/precompiles/staking) -- Interface: - [StakingI.sol](https://github.com/cosmos/evm/blob/v0.4.0/precompiles/staking/StakingI.sol) - -### Prerequisites - -- [Foundry](https://getfoundry.sh/) (includes `cast`) -- `jq` for JSON processing -- A funded testnet wallet private key with ZETA - -### Quick environment setup - -```bash -export RPC_URL="https://zetachain-athens-evm.blockpi.network/v1/rpc/public" -export PRIVATE_KEY="YOUR_PRIVATE_KEY_HEX" - -cast wallet address $PRIVATE_KEY -cast balance --rpc-url "$RPC_URL" $(cast wallet address $PRIVATE_KEY) - -export STAKING_PRECOMPILE=0x0000000000000000000000000000000000000800 -``` - -## Listing Validators - -Before delegating, you need to know which validators are available on ZetaChain. -Each validator has an operator address (`zetavaloper...`) that you’ll delegate -to. - -The Cosmos SDK exposes a REST API (LCD) that lists validators. For bonded -validators (actively participating in consensus): - -```bash -curl -s \ - "https://zetachain-athens.blockpi.network/lcd/v1/public/cosmos/staking/v1beta1/validators?status=BOND_STATUS_BONDED&pagination.limit=1000" \ -| jq -r '.validators[] | [ .operator_address, (.description.moniker) ] | @tsv' -``` - -Example output: - -``` -zetavaloper1qumrwnz9x2emzd5yjylp8pf9w2wh3my0gag27y LiveRaveN -zetavaloper1p3emgemv8q0fmtw70kfzwecmcvyd9ztqlzudwn RockX -zetavaloper1ymnrwg9e3xr9xkw42ygzjx34dyvwvtc24ct0t5 validator1-us-west-2 -zetavaloper1xkddnhcdy5j4auzefjqkt3kp56t6vq7sm5xlga BlockPI -... -``` - -This is the easiest way to fetch validator operator addresses for staking. - -You can also call the precompile’s `validators` function directly from a -contract or frontend if you prefer to fetch the data inside the EVM. - -Validators are also available on [ZetaChain -explorers](https://testnet.zetachain.exploreme.pro/validators). - -## Delegating - -Delegation sends your native ZETA to a validator to help secure the network and -earn staking rewards. With the staking precompile, you can do this straight from -EVM tools. - -- `amount` is in wei (1 ZETA = `1e18` wei). -- Send the same amount in `--value`, because delegation consumes native ZETA. - -```bash -cast send $STAKING_PRECOMPILE \ - "delegate(address,string,uint256)" \ - $(cast wallet address $PRIVATE_KEY) \ - "zetavaloper1ymnrwg9e3xr9xkw42ygzjx34dyvwvtc24ct0t5" \ - 1000000000000000000 \ - --rpc-url $RPC_URL \ - --private-key $PRIVATE_KEY -``` - -This transaction bonds 1 ZETA to the validator. - -### Verify your delegation - -You can check how much ZETA you’ve delegated to a validator using the -`delegation` function. It returns `(uint256 shares, (string denom, uint256 amount))`. - -```bash -cast call $STAKING_PRECOMPILE \ - "delegation(address,string)(uint256,(string,uint256))" \ - $(cast wallet address $PRIVATE_KEY) \ - "zetavaloper1ymnrwg9e3xr9xkw42ygzjx34dyvwvtc24ct0t5" \ - --rpc-url $RPC_URL -``` - -Example output: - -``` -(1000000000000000000, (azeta, 1000000000000000000)) -``` - -- shares: staking shares in the validator’s pool -- balance: your delegated amount in wei (denom is `azeta`) - -## Undelegating - -Undelegation starts the unbonding period: your staked ZETA stops earning rewards -and becomes withdrawable only after the unbonding time elapses. You can -undelegate partially or fully. - -- `amount` is in wei (1 ZETA = `1e18` wei). -- Use the same validator operator address you delegated to. -- Keep the `--value` equal to the `amount` for this precompile call pattern. - -```bash -cast send $STAKING_PRECOMPILE \ - "undelegate(address,string,uint256)" \ - $(cast wallet address $PRIVATE_KEY) \ - "zetavaloper1ymnrwg9e3xr9xkw42ygzjx34dyvwvtc24ct0t5" \ - 1000000000000000000 \ - --rpc-url $RPC_URL \ - --private-key $PRIVATE_KEY -``` - -This submits an undelegation of 1 ZETA from that validator. - -### Verify the change - -Your active delegation to that validator should decrease by the undelegated -amount: - -```bash -cast call $STAKING_PRECOMPILE \ - "delegation(address,string)(uint256,(string,uint256))" \ - $(cast wallet address $PRIVATE_KEY) \ - "zetavaloper1ymnrwg9e3xr9xkw42ygzjx34dyvwvtc24ct0t5" \ - --rpc-url $RPC_URL -``` - -Example (after undelegating 1 ZETA): - -``` -(0, (azeta, 0)) -``` - -or, if partially undelegated, a lower balance than before. - -### Notes - -- Unbonding period applies. The undelegated amount is locked until the unbonding - time completes. After that, it becomes liquid ZETA in your account. -- You can submit multiple undelegations (they create separate unbonding - entries). -- Trying to undelegate more than your active delegation will revert. - -## Conclusion - -By using the staking precompile, you can interact with ZetaChain’s -proof-of-stake system directly from the EVM. This means you don’t need separate -Cosmos tooling to delegate, undelegate, or query validator data, everything can -be done with the same `cast` commands, Solidity contracts, or frontend apps you -already use. - -You can also build universal contracts that handle incoming calls from connected -chains and stake ZETA on behalf of users. This opens the door to powerful -cross-chain apps such as: - -- Protocols that automatically stake rewards or idle balances from multiple - chains -- Yield strategies that combine cross-chain liquidity with staking -- Apps that give users a single interface to manage delegations without leaving - their home chain - -Staking is one of the simplest but most important features for securing the -network and earning rewards. From here, you can explore more advanced precompile -functions such as redelegation, querying unbonding entries, and reward -distribution. diff --git a/src/pages/developers/tutorials/staking.zh-CN.mdx b/src/pages/developers/tutorials/staking.zh-CN.mdx deleted file mode 100644 index c80201bd6..000000000 --- a/src/pages/developers/tutorials/staking.zh-CN.mdx +++ /dev/null @@ -1,150 +0,0 @@ ---- -title: 质押 ---- - -ZetaChain 是基于 Cosmos SDK 构建的权益证明(PoS)区块链,由质押原生代币 ZETA 的验证者守护。委托者(普通用户)可以将自己的 ZETA 质押给验证者以参与网络安全,并获得奖励。由于 ZetaChain 同时提供 EVM 环境,智能合约可通过专用的 Staking 预编译直接访问 Cosmos 质押功能,使合约、脚本与前端能够使用熟悉的 EVM 工具完成委托、解绑、领取奖励等操作。 - -本教程将使用 Foundry(`cast`)与 curl 与 staking 预编译交互。相同函数也可在 Solidity 合约或 Web 前端中调用。 - -- 预编译地址:`0x0000000000000000000000000000000000000800` -- 文档:[Staking Precompile](https://evm.cosmos.network/v0.4.x/documentation/smart-contracts/precompiles/staking) -- 接口:[StakingI.sol](https://github.com/cosmos/evm/blob/v0.4.0/precompiles/staking/StakingI.sol) - -### 前置条件 - -- [Foundry](https://getfoundry.sh/)(包含 `cast`) -- 用于 JSON 处理的 `jq` -- 持有测试网 ZETA 的私钥 - -### 快速环境配置 - -```bash -export RPC_URL="https://zetachain-athens-evm.blockpi.network/v1/rpc/public" -export PRIVATE_KEY="YOUR_PRIVATE_KEY_HEX" - -cast wallet address $PRIVATE_KEY -cast balance --rpc-url "$RPC_URL" $(cast wallet address $PRIVATE_KEY) - -export STAKING_PRECOMPILE=0x0000000000000000000000000000000000000800 -``` - -## 查询验证者 - -在委托前需要了解可选的验证者。每个验证者都有一个 operator 地址(`zetavaloper...`),委托时需指定。 - -Cosmos SDK 提供 REST API(LCD)列出验证者。获取处于 bonded 状态(参与共识)的验证者: - -```bash -curl -s \ - "https://zetachain-athens.blockpi.network/lcd/v1/public/cosmos/staking/v1beta1/validators?status=BOND_STATUS_BONDED&pagination.limit=1000" \ -| jq -r '.validators[] | [ .operator_address, (.description.moniker) ] | @tsv' -``` - -示例输出: - -``` -zetavaloper1qumrwnz9x2emzd5yjylp8pf9w2wh3my0gag27y LiveRaveN -zetavaloper1p3emgemv8q0fmtw70kfzwecmcvyd9ztqlzudwn RockX -... -``` - -这是获取验证者 operator 地址的最简单方式。也可以在合约或前端中直接调用预编译的 `validators` 函数在链上读取。验证者列表也可在 [ZetaChain 浏览器](https://testnet.zetachain.exploreme.pro/validators) 查看。 - -## 委托 - -委托操作会将你的 ZETA 质押给验证者,获得奖励。通过 staking 预编译,可直接使用 EVM 工具完成。 - -- `amount` 单位为 wei(1 ZETA = `1e18` wei) -- `--value` 需与 `amount` 相同,因为委托消耗原生 ZETA - -```bash -cast send $STAKING_PRECOMPILE \ - "delegate(address,string,uint256)" \ - $(cast wallet address $PRIVATE_KEY) \ - "zetavaloper1ymnrwg9e3xr9xkw42ygzjx34dyvwvtc24ct0t5" \ - 1000000000000000000 \ - --rpc-url $RPC_URL \ - --private-key $PRIVATE_KEY -``` - -此交易向验证者质押 1 ZETA。 - -### 验证委托情况 - -可通过 `delegation` 函数查询委托数量,返回 `(uint256 shares, (string denom, uint256 amount))`: - -```bash -cast call $STAKING_PRECOMPILE \ - "delegation(address,string)(uint256,(string,uint256))" \ - $(cast wallet address $PRIVATE_KEY) \ - "zetavaloper1ymnrwg9e3xr9xkw42ygzjx34dyvwvtc24ct0t5" \ - --rpc-url $RPC_URL -``` - -示例输出: - -``` -(1000000000000000000, (azeta, 1000000000000000000)) -``` - -- shares:你在该验证者池中的份额 -- balance:委托金额(wei),denom 为 `azeta` - -## 解绑委托 - -解绑会开启解锁期:解绑后的 ZETA 停止产生收益,需等解锁完成后才能取回。可以部分或全部解绑。 - -- `amount` 仍然以 wei 表示 -- 使用委托时的同一验证者地址 -- `--value` 与 `amount` 保持一致 - -```bash -cast send $STAKING_PRECOMPILE \ - "undelegate(address,string,uint256)" \ - $(cast wallet address $PRIVATE_KEY) \ - "zetavaloper1ymnrwg9e3xr9xkw42ygzjx34dyvwvtc24ct0t5" \ - 1000000000000000000 \ - --rpc-url $RPC_URL \ - --private-key $PRIVATE_KEY -``` - -该交易将从验证者解绑 1 ZETA。 - -### 确认变动 - -解绑后,再次查询委托余额会减少: - -```bash -cast call $STAKING_PRECOMPILE \ - "delegation(address,string)(uint256,(string,uint256))" \ - $(cast wallet address $PRIVATE_KEY) \ - "zetavaloper1ymnrwg9e3xr9xkw42ygzjx34dyvwvtc24ct0t5" \ - --rpc-url $RPC_URL -``` - -示例(解绑 1 ZETA 后): - -``` -(0, (azeta, 0)) -``` - -若部分解绑,则显示剩余金额。 - -### 注意事项 - -- 解锁期内,解绑金额处于锁定状态,待期满后才会返还为可用 ZETA。 -- 可多次提交解绑,每次会生成独立的 unbonding 条目。 -- 尝试解绑超过已委托数量将失败。 - -## 总结 - -借助 staking 预编译,你可以在 EVM 环境中直接操作 ZetaChain 的 PoS 系统——无需使用 Cosmos 工具,即可通过 `cast`、Solidity 合约或前端应用完成委托、解绑或查询验证者信息。 - -你还可以构建全链合约,代表连接链用户自动质押 ZETA,为以下跨链场景铺路: - -- 协议自动质押多链奖励或闲置资产 -- 结合跨链流动性与质押收益的策略 -- 用户无需离开主链即可管理委托的应用 - -质押是保障网络安全并获取奖励的基础能力。接下来可进一步探索预编译提供的高级函数,例如再委托、查询解锁条目、领取奖励等。*** - diff --git a/src/pages/developers/tutorials/sui-withdraw-and-call.en-US.mdx b/src/pages/developers/tutorials/sui-withdraw-and-call.en-US.mdx deleted file mode 100644 index 591ee5cac..000000000 --- a/src/pages/developers/tutorials/sui-withdraw-and-call.en-US.mdx +++ /dev/null @@ -1,226 +0,0 @@ -Interacting with ZetaChain universal apps from the Sui blockchain includes the -This tutorial demonstrates how to withdraw tokens to Sui while calling a Sui -contract in the same transaction—enabling seamless cross-chain operations and -powerful DeFi flows. - -You'll learn how to: - -- Set up a localnet environment with ZetaChain and Sui -- Deploy and configure a Sui contract that responds to ZetaChain calls -- Execute withdrawAndCall() to send tokens and trigger contract logic on Sui - -## Prerequisites - -Ensure you have installed and configured the following tools before starting: - -- [Sui CLI](https://docs.sui.io/references/cli): Required for starting a local - Sui node and interacting with it. -- [Foundry](https://getfoundry.sh/): Needed for encoding payload data using ABI. -- [jq](https://stedolan.github.io/jq/): Required for parsing JSON output from - Sui CLI. - -## Contract Overview - -The example contract demonstrates how to handle cross-chain interactions between -ZetaChain and Sui. The contract implements a `connected` module that: - -- Receives tokens from ZetaChain through the `on_call` function -- Performs a token swap using a mock Cetus DEX implementation -- Transfers the swapped tokens to a specified receiver address - -The Sui contract uses `0x2::coin` and a custom `token::TOKEN` type to represent -the transferred asset. - -## Clone the Example Project - -Begin by cloning the example contracts repository and installing its -dependencies: - -```bash -npx zetachain@next new --project call -cd call -yarn -``` - -## Launch Localnet - -Start your local development environment, which sets up instances of ZetaChain -and Sui: - -```bash -npx zetachain localnet start -``` - -Keep this terminal window open. You should see a table displaying the deployment -details, including Gateway module and object IDs. - -## Deploy a Contract on Sui - -Navigate to the Sui contract directory and deploy the contract: - -```bash -cd sui -``` - -``` -sui move build --force -``` - -Get some Sui tokens from the faucet: - -``` -sui client faucet -``` - -``` -PUBLISHED=$(sui client publish --skip-dependency-verification --json) -``` - -``` -PACKAGE=$(echo $PUBLISHED | jq -r '.objectChanges[] | select(.type == "published") | .packageId') && echo $PACKAGE -``` - -This will deploy the contract and store the package ID in the `$PACKAGE` -variable. - -## Set Up the Pool - -After deployment, you'll need to set up the pool by minting tokens and creating -the initial liquidity. - -Get the treasury cap: - -```bash -TREASURY=$(echo $PUBLISHED | jq -r --arg pkg "$PACKAGE" '.objectChanges[] | select(.type == "created" and .objectType == "0x2::coin::TreasuryCap<\($pkg)::token::TOKEN>") | .objectId') && echo $TREASURY -``` - -Get the pool ID: - -``` -POOL=$(echo $PUBLISHED | jq -r --arg pkg "$PACKAGE" '.objectChanges[] | select(.type == "created" and .objectType == "\($pkg)::cetusmock::Pool<0x2::sui::SUI, \($pkg)::token::TOKEN>") | .objectId') && echo $POOL -``` - -Mint tokens to your address: - -``` -RECIPIENT=$(sui client active-address) && echo $RECIPIENT -``` - -``` -sui client call \ - --package "$PACKAGE" \ - --module token \ - --function mint_and_transfer \ - --args "$TREASURY" 1000000 "$RECIPIENT" -``` - -Get the token ID: - -``` -TOKEN=$(sui client objects --json | jq -r --arg pkg "$PACKAGE" '.[].data | select(.type == "0x2::coin::Coin<\($pkg)::token::TOKEN>") | .objectId') && echo $TOKEN -``` - -Deposit tokens into the pool: - -``` -sui client call \ - --package "$PACKAGE" \ - --module cetusmock \ - --function deposit \ - --type-args "0x2::sui::SUI" "$PACKAGE::token::TOKEN" \ - --args "$POOL" "$TOKEN" -``` - -## Deposit SUI to Gateway - -To enable cross-chain operations, you need to deposit SUI tokens to the -ZetaChain gateway. First, get your SUI coin ID: - -``` -COIN=$(sui client gas --json | jq -r '.[0].gasCoinId') && echo $COIN -``` - -``` -ETH_ADDRESS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -GATEWAY_PACKAGE=0xa3ce10f68ed22d2cbbc31eaa709ee15e2e30348bfc6ff97b7d128d03b679c5c2 -GATEWAY_OBJECT=0xe925d4059435083b70bc504ce912202214edd06f693bdc3f9573a996292780c7 -``` - -Then, deposit SUI to the gateway using the gateway addresses from your localnet -output: - -``` -sui client call \ - --package "$GATEWAY_PACKAGE" \ - --module gateway \ - --function deposit \ - --type-args 0x2::sui::SUI \ - --args "$GATEWAY_OBJECT" "$COIN" "$ETH_ADDRESS" -``` - -> **Note**: Make sure to replace the `GATEWAY_PACKAGE` and `GATEWAY_OBJECT` -> values with the ones from your localnet output. These addresses are displayed -> in the table when you start the localnet. - -## Prepare Withdraw and Call - -Now you can execute the withdraw and call operation. This will withdraw tokens -from ZetaChain to Sui and simultaneously call a contract on Sui. - -Get the required contract IDs: - -```bash -CONFIG=$(echo $PUBLISHED | jq -r --arg pkg "$PACKAGE" '.objectChanges[] | select(.type == "created" and .objectType == "\($pkg)::cetusmock::GlobalConfig") | .objectId') && echo $CONFIG -``` - -``` -CLOCK=$(echo $PUBLISHED | jq -r --arg pkg "$PACKAGE" '.objectChanges[] | select(.type == "created" and .objectType == "\($pkg)::cetusmock::Clock") | .objectId') && echo $CLOCK -``` - -``` -PARTNER=$(echo $PUBLISHED | jq -r --arg pkg "$PACKAGE" '.objectChanges[] | select(.type == "created" and .objectType == "\($pkg)::cetusmock::Partner") | .objectId') && echo $PARTNER -``` - -Prepare the payload: - -``` -MESSAGE=$RECIPIENT -``` - -``` -TOKEN_TYPE="$PACKAGE::token::TOKEN" && echo $TOKEN_TYPE -``` - -``` -PAYLOAD=$(npx ts-node ./setup/encodeCallArgs.ts "$TOKEN_TYPE" "$CONFIG,$POOL,$PARTNER,$CLOCK" "$MESSAGE") && echo $PAYLOAD -``` - -## Execute the withdraw and call - -Approve Gateway to spend ZRC-20 Sui: - -``` -cast send 0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891 "approve(address,uint256)" 0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6 1000000000000000000000000 --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -``` - -Withdraw and call: - -``` -cast send 0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6 "withdrawAndCall(bytes,uint256,address,bytes,(uint256,bool),(address,bool,address,bytes,uint256))" \ - "$PACKAGE" \ - "1000000" \ - "0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891" \ - "$PAYLOAD" \ - "(10000,false)" \ - "(0xB0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,true,0xC0b86991c6218b36c1d19D4a2e9Eb0cE3606eB49,0xdeadbeef,50000)" \ - --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -``` - -This transaction will: - -1. Withdraw tokens from ZetaChain to Sui -2. Call a Sui contract with the specified parameters - -The operation demonstrates how to perform complex cross-chain operations that -combine asset withdrawals with contract calls, enabling sophisticated DeFi -interactions between ZetaChain and Sui. diff --git a/src/pages/developers/tutorials/sui-withdraw-and-call.zh-CN.mdx b/src/pages/developers/tutorials/sui-withdraw-and-call.zh-CN.mdx deleted file mode 100644 index 0a97e4be1..000000000 --- a/src/pages/developers/tutorials/sui-withdraw-and-call.zh-CN.mdx +++ /dev/null @@ -1,216 +0,0 @@ ---- -title: 调用 Sui ---- - -与 ZetaChain 全链应用进行交互时,Sui 区块链同样扮演关键角色。本教程展示如何在一次交易中将代币提现至 Sui,并同时调用 Sui 合约,从而实现无缝跨链操作与强大的 DeFi 流程。 - -你将学会: - -- 搭建包含 ZetaChain 与 Sui 的 localnet 环境 -- 部署并配置可响应 ZetaChain 调用的 Sui 合约 -- 执行 `withdrawAndCall()`,即同时发送代币并触发 Sui 上的合约逻辑 - -## 前置条件 - -开始前请确保已安装并配置以下工具: - -- [Sui CLI](https://docs.sui.io/references/cli):用于启动本地 Sui 节点并与之交互 -- [Foundry](https://getfoundry.sh/):借助 `cast` 编码 ABI 载荷 -- [jq](https://stedolan.github.io/jq/):解析 Sui CLI 的 JSON 输出 - -## 合约概览 - -示例合约演示如何在 ZetaChain 与 Sui 之间处理跨链交互。`connected` 模块负责: - -- 通过 `on_call` 接收来自 ZetaChain 的代币 -- 使用模拟的 Cetus DEX 实现代币兑换 -- 将兑换后的代币发送至指定接收地址 - -该 Sui 合约使用 `0x2::coin` 与自定义的 `token::TOKEN` 类型表示转移的资产。 - -## 克隆示例项目 - -首先克隆示例合约仓库并安装依赖: - -```bash -npx zetachain@next new --project call -cd call -yarn -``` - -## 启动 Localnet - -启动包含 ZetaChain 与 Sui 的本地开发环境: - -```bash -npx zetachain localnet start -``` - -保持终端打开。启动成功后会输出包含 Gateway 模块与对象 ID 的表格。 - -## 在 Sui 部署合约 - -进入 Sui 合约目录并部署: - -```bash -cd sui -``` - -```bash -sui move build --force -``` - -从水龙头获取测试 SUI: - -``` -sui client faucet -``` - -发布合约包: - -``` -PUBLISHED=$(sui client publish --skip-dependency-verification --json) -``` - -提取发布的包 ID: - -``` -PACKAGE=$(echo $PUBLISHED | jq -r '.objectChanges[] | select(.type == "published") | .packageId') && echo $PACKAGE -``` - -## 设置池子 - -部署完成后,需要初始化池子、铸造代币并注入初始流动性。 - -获取 Treasury Cap: - -```bash -TREASURY=$(echo $PUBLISHED | jq -r --arg pkg "$PACKAGE" '.objectChanges[] | select(.type == "created" and .objectType == "0x2::coin::TreasuryCap<\($pkg)::token::TOKEN>") | .objectId') && echo $TREASURY -``` - -获取池子 ID: - -``` -POOL=$(echo $PUBLISHED | jq -r --arg pkg "$PACKAGE" '.objectChanges[] | select(.type == "created" and .objectType == "\($pkg)::cetusmock::Pool<0x2::sui::SUI, \($pkg)::token::TOKEN>") | .objectId') && echo $POOL -``` - -铸造代币: - -``` -RECIPIENT=$(sui client active-address) && echo $RECIPIENT -``` - -``` -sui client call \ - --package "$PACKAGE" \ - --module token \ - --function mint_and_transfer \ - --args "$TREASURY" 1000000 "$RECIPIENT" -``` - -获取铸造后的代币对象 ID: - -``` -TOKEN=$(sui client objects --json | jq -r --arg pkg "$PACKAGE" '.[].data | select(.type == "0x2::coin::Coin<\($pkg)::token::TOKEN>") | .objectId') && echo $TOKEN -``` - -将代币存入池子: - -``` -sui client call \ - --package "$PACKAGE" \ - --module cetusmock \ - --function deposit \ - --type-args "0x2::sui::SUI" "$PACKAGE::token::TOKEN" \ - --args "$POOL" "$TOKEN" -``` - -## 向 Gateway 存入 SUI - -跨链操作前,需要向 ZetaChain Gateway 存入 SUI。先获取 Sui 代币 ID: - -``` -COIN=$(sui client gas --json | jq -r '.[0].gasCoinId') && echo $COIN -``` - -示例地址: - -``` -ETH_ADDRESS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -GATEWAY_PACKAGE=0xa3ce10f68ed22d2cbbc31eaa709ee15e2e30348bfc6ff97b7d128d03b679c5c2 -GATEWAY_OBJECT=0xe925d4059435083b70bc504ce912202214edd06f693bdc3f9573a996292780c7 -``` - -使用 localnet 输出中的 Gateway 地址执行存入: - -``` -sui client call \ - --package "$GATEWAY_PACKAGE" \ - --module gateway \ - --function deposit \ - --type-args 0x2::sui::SUI \ - --args "$GATEWAY_OBJECT" "$COIN" "$ETH_ADDRESS" -``` - -> **注意**:请将 `GATEWAY_PACKAGE`、`GATEWAY_OBJECT` 替换为实际 localnet 输出中的值。 - -## 准备 Withdraw and Call - -接下来执行 withdraw and call,将代币提现至 Sui 并同时调用 Sui 合约。 - -获取所需合约 ID: - -```bash -CONFIG=$(echo $PUBLISHED | jq -r --arg pkg "$PACKAGE" '.objectChanges[] | select(.type == "created" and .objectType == "\($pkg)::cetusmock::GlobalConfig") | .objectId') && echo $CONFIG -``` - -``` -CLOCK=$(echo $PUBLISHED | jq -r --arg pkg "$PACKAGE" '.objectChanges[] | select(.type == "created" and .objectType == "\($pkg)::cetusmock::Clock") | .objectId') && echo $CLOCK -``` - -``` -PARTNER=$(echo $PUBLISHED | jq -r --arg pkg "$PACKAGE" '.objectChanges[] | select(.type == "created" and .objectType == "\($pkg)::cetusmock::Partner") | .objectId') && echo $PARTNER -``` - -准备载荷: - -``` -MESSAGE=$RECIPIENT -``` - -``` -TOKEN_TYPE="$PACKAGE::token::TOKEN" && echo $TOKEN_TYPE -``` - -``` -PAYLOAD=$(npx ts-node ./setup/encodeCallArgs.ts "$TOKEN_TYPE" "$CONFIG,$POOL,$PARTNER,$CLOCK" "$MESSAGE") && echo $PAYLOAD -``` - -## 执行 Withdraw and Call - -首先授权 Gateway 消耗 ZRC-20 Sui: - -``` -cast send 0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891 "approve(address,uint256)" 0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6 1000000000000000000000000 --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -``` - -然后提现并调用: - -``` -cast send 0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6 "withdrawAndCall(bytes,uint256,address,bytes,(uint256,bool),(address,bool,address,bytes,uint256))" \ - "$PACKAGE" \ - "1000000" \ - "0xd97B1de3619ed2c6BEb3860147E30cA8A7dC9891" \ - "$PAYLOAD" \ - "(10000,false)" \ - "(0xB0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,true,0xC0b86991c6218b36c1d19D4a2e9Eb0cE3606eB49,0xdeadbeef,50000)" \ - --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 -``` - -该交易会: - -1. 将代币从 ZetaChain 提现至 Sui -2. 同时调用指定 Sui 合约并传入参数 - -此流程展示了如何将资产提现与合约调用结合,实现 ZetaChain 与 Sui 之间复杂的跨链 DeFi 交互。*** - diff --git a/src/pages/developers/tutorials/sui.en-US.mdx b/src/pages/developers/tutorials/sui.en-US.mdx deleted file mode 100644 index 6e41d97a3..000000000 --- a/src/pages/developers/tutorials/sui.en-US.mdx +++ /dev/null @@ -1,314 +0,0 @@ -ZetaChain enables Sui-based applications to interact directly with universal -smart contracts deployed on ZetaChain. Using ZetaChain’s universal -interoperability layer, Sui apps can: - -- Deposit SUI and supported fungible tokens to ZetaChain -- Make cross-chain calls to universal contracts -- Receive cross-chain calls and token transfers from universal contracts - -In this tutorial, you'll learn how to: - -- Set up a local development environment with both ZetaChain and Sui -- Deploy a universal contract on ZetaChain -- Deposit SUI tokens from a Sui address to ZetaChain -- Make a cross-chain call to trigger a function on a universal contract - -By the end, you’ll understand how to transfer assets and trigger logic on -ZetaChain from Sui, both from a client wallet and from a Sui smart contract. - -## Prerequisites - -Make sure the following tools are installed before you begin: - -| Tool | Purpose | -| --------------------------------------------- | ------------------------------------------------------------------------- | -| [Sui CLI](https://docs.sui.io/references/cli) | Run a local Sui validator, manage addresses and objects, deploy contracts | -| [Foundry](https://getfoundry.sh/) | Encode ABI payloads for cross-chain calls using `cast` | -| [Node.js](https://nodejs.org/en) | Run the ZetaChain CLI and JavaScript-based tooling | -| [Yarn](https://yarnpkg.com/) | Install and manage project dependencies | -| [jq](https://jqlang.org/) | Parse JSON output in shell scripts | - -## Clone the Example Project - -Start by generating a new project using the ZetaChain CLI: - -```bash -npx zetachain@latest new --project call -cd call -``` - -This sets up a ready-to-use example with Sui and ZetaChain contracts. - -Install dependencies: - -```bash -yarn -forge soldeer update -``` - -The project is now ready for local development and testing. - -## Launch Localnet - -Start a local development environment with both ZetaChain and Sui running side -by side: - -```bash -yarn zetachain localnet start --chains sui -``` - -This command boots up: - -- A local ZetaChain instance -- A local Sui validator -- Pre-deployed gateway contracts on both networks - -Leave this terminal open. Once started, you’ll see a table like this: - -``` -SUI -┌──────────────────┬──────────────────────────────────────────────────────────────────────────────────┐ -│ (index) │ Values │ -├──────────────────┼──────────────────────────────────────────────────────────────────────────────────┤ -│ gatewayPackageId │ '0x17360c15c10bbc4ebc57e9872f2993dc4376f7f0bb78920fe5fa9ad276ac7f86' │ -│ gatewayObjectId │ '0x9a26d6b6f413228bb120446977a8d8003eceb490cb7afd8921494815adc0a497' │ -│ userMnemonic │ 'grape subway rack mean march bubble carry avoid muffin consider thing street' │ -│ userAddress │ '0x2fec3fafe08d2928a6b8d9a6a77590856c458d984ae090ccbd4177ac13729e65' │ -│ tokenUSDC │ '6b0b8d1bbc40893a7f793f52c46aeea9db9f2f710c6a623c666bff712e26c94a::token::TOKEN' │ -└──────────────────┴──────────────────────────────────────────────────────────────────────────────────┘ -``` - -> 💡 Keep this output handy. You’ll reference the `gatewayObjectId`, -> `gatewayObjectId`, and `userMnemonic` in later steps. - -## Deploying a Universal Contract - -You’ll now deploy a universal smart contract to ZetaChain. - -First, grab the local Gateway address and a funded private key from your -localnet setup: - -```bash -GATEWAY_ZETACHAIN=$(jq -r '.["31337"].contracts[] | select(.contractType == "gateway") | .address' ~/.zetachain/localnet/registry.json) && echo $GATEWAY_ZETACHAIN -``` - -```bash -PRIVATE_KEY=$(jq -r '.private_keys[0]' ~/.zetachain/localnet/anvil.json) && echo $PRIVATE_KEY -``` - -Compile the contract: - -``` -forge build -``` - -Then deploy the `Universal` contract: - -```bash -UNIVERSAL=$(forge create Universal \ - --rpc-url http://localhost:8545 \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json \ - --constructor-args $GATEWAY_ZETACHAIN | jq -r .deployedTo) && echo $UNIVERSAL -``` - -## Deposit to ZetaChain - -Now that your universal contract is deployed on ZetaChain, you can deposit SUI -tokens from the Sui Gateway contract to that contract address. - -Use the following command to deposit tokens from Sui to your universal contract -on ZetaChain: - -```bash -npx zetachain sui deposit \ - --mnemonic "grape subway rack mean march bubble carry avoid muffin consider thing street" \ - --receiver $UNIVERSAL \ - --gateway-package 0x17360c15c10bbc4ebc57e9872f2993dc4376f7f0bb78920fe5fa9ad276ac7f86 \ - --gateway-object 0x9a26d6b6f413228bb120446977a8d8003eceb490cb7afd8921494815adc0a497 \ - --amount 0.001 \ - --chain-id 104 -``` - -> 🔎 Replace `--gateway-package` and `--gateway-object` with the values printed -> in your localnet output table. - -This command calls the deposit function on the Sui Gateway contract. ZetaChain -observes the deposit event and propagates the deposit to ZetaChain by minting -ZRC-20 SUI tokens and transferring them to your universal contract. - -## Deposit and Call - -In this step, you’ll deposit SUI tokens from Sui and simultaneously trigger a -function call on the universal contract deployed on ZetaChain. - -```bash -npx zetachain sui deposit-and-call \ - --mnemonic "grape subway rack mean march bubble carry avoid muffin consider thing street" \ - --receiver $UNIVERSAL \ - --gateway-package 0x17360c15c10bbc4ebc57e9872f2993dc4376f7f0bb78920fe5fa9ad276ac7f86 \ - --gateway-object 0x9a26d6b6f413228bb120446977a8d8003eceb490cb7afd8921494815adc0a497 \ - --amount 0.001 \ - --chain-id 104 \ - --types string \ - --values hello -``` - -This command calls the `deposit_and_call` function on the Sui Gateway contract, -transferring the specified SUI amount, encoding the payload (`"hello"`) using -the provided `--types` and `--values`, and triggering the `onCall` function on -the universal contract deployed on ZetaChain. - -## Build and Deploy a Sui Contract - -To complete the round trip, you can also deploy a Sui contract that initiates -deposits to ZetaChain from on-chain logic. - -Go to the Sui contract directory: - -```bash -cd sui -``` - -Check the `Move.toml`: - -```toml filename="sui/Move.toml" -[dependencies] -gateway = { local = "/usr/local/share/localnet/protocol-contracts-sui" } -``` - -This example project already imports the Gateway module from Localnet. When -using testnet or mainnet, the Gateway will be imported from a public source -instead. - -Build the Sui contract: - -```bash -sui move build --force -``` - -Publish the package to your local Sui instance: - -```bash -SUI_CONTRACT=$(sui client publish \ - --skip-dependency-verification \ - --json 2>/dev/null | jq -r '.objectChanges[] | select(.type == "published") | .packageId') && echo $SUI_CONTRACT -``` - -## Get Coins from the Faucet - -Your Sui account needs some SUI tokens to pay for transactions. - -To request tokens from the local faucet, run: - -```bash -sui client faucet -``` - -This sends a faucet request to the local validator and credits your active -address with test SUI. - -## Deposit And Call from a Sui Contract - -In Sui, calling a universal contract from a Move contract is done through a -Programmable Transaction Block (PTB). - -PTBs let you compose multiple actions into a single atomic transaction: you can -call a Move function, capture its return value, and feed that value into the -next call (such as Sui Gateway’s `deposit_and_call`). A client app (for example, -a web app) builds and signs the PTB, submits it to Sui, and Sui executes the -sequence as one transaction. - -In the created project, there’s a TypeScript command that builds such a PTB: -`commands/suiDepositAndCall.ts`. By default, it ABI‑encodes a payload and sends -it directly to the Sui Gateway. We’ll modify it to: - -1. Call our Sui contract first and get its return value. -2. Pass that returned value as the payload to the Sui Gateway. - -Open `commands/suiDepositAndCall.ts` and replace the payload construction: - -```ts filename="commands/suiDepositAndCall.ts" -// const payload = tx.pure.vector("u8", utils.arrayify(payloadABI)); - -const payload = tx.moveCall({ - target: `${options.connected}::connected::hello`, - arguments: [tx.pure.string(params.values[0] as string)], -}); -``` - -This calls your Sui module function `connected::hello` with the first provided -value (a string in this example). The returned value from the Move call becomes -the `payload` argument that is then forwarded to the Sui Gateway’s -`deposit_and_call` within the same PTB. - -Because a Sui contract can’t easily ABI‑encode data for EVM, we’ll update the -universal Solidity contract to accept raw bytes for the message payload. - -Update the universal contract’s `onCall` signature and logic to accept `bytes` -and interpret it as a UTF‑8 string: - -```solidity -function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message -) external override onlyGateway { - // string memory name = abi.decode(message, (string)); - emit HelloEvent("Hello on ZetaChain", string(message)); -} -``` - -Rebuild and deploy the contract on your local ZetaChain: - -```bash -forge build -``` - -```bash -UNIVERSAL=$(forge create Universal \ - --rpc-url http://localhost:8545 \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json \ - --constructor-args $GATEWAY_ZETACHAIN | jq -r .deployedTo) && echo $UNIVERSAL -``` - -Now execute the PTB that calls your Sui contract, takes its return value, and -passes it to the Sui Gateway, which then calls your universal contract on -ZetaChain: - -```bash -npx tsx commands deposit-and-call \ - --private-key suiprivkey1qrqtrevmd40vxlv3q6fcgmm09af5p8f8j67ezve0u3nhrs0psslgjnw3y5p \ - --receiver $UNIVERSAL \ - --gateway-package 0xc52d19fd2f0bcb94d0c285d480b6a8af515f5ec19d0cff8818fc9bf0d3731b85 \ - --gateway-object 0xa755a1106ae7039a25c10578b6f3c5b73963055e0d6fc40e8abcebea454a6389 \ - --amount 0.001 \ - --chain-id 104 \ - --types string \ - --values alice \ - --connected $SUI_CONTRACT -``` - -You should see an event emitted in the terminal similar to: - -``` -[ZetaChain] Event from onCall: {"_type":"log","address":"0xa6e99A4ED7498b3cdDCBB61a6A607a4925Faa1B7","blockHash":"0x694028003ddc35ab9da2a18c262f8df88f882f3a4c3db8d9935b6346ed9f9b7f","blockNumber":192,"data":"0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001248656c6c6f206f6e205a657461436861696e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b68656c6c6f20616c696365000000000000000000000000000000000000000000","index":2,"removed":false,"topics":["0x39f8c79736fed93bca390bb3d6ff7da07482edb61cd7dafcfba496821d6ab7a3"],"transactionHash":"0x82e7ed404b1c3bfb06677174b74d54d1bb5b1b6248433ead6bd48c0cda519777","transactionIndex":0} -``` - -To inspect it, you can decode the log data: - -```bash -cast abi-decode "data()(string,string)" \ - 0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000001248656c6c6f206f6e205a657461436861696e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b68656c6c6f20616c696365000000000000000000000000000000000000000000 -``` - -Expected output: - -``` -"Hello on ZetaChain" -"hello alice" -``` diff --git a/src/pages/developers/tutorials/sui.zh-CN.mdx b/src/pages/developers/tutorials/sui.zh-CN.mdx deleted file mode 100644 index b00391f7b..000000000 --- a/src/pages/developers/tutorials/sui.zh-CN.mdx +++ /dev/null @@ -1,280 +0,0 @@ ---- -title: 从 Sui 发起调用 ---- - -ZetaChain 让基于 Sui 的应用能够直接与部署在 ZetaChain 上的全链智能合约交互。借助 ZetaChain 的全链互操作层,Sui 应用可以: - -- 将 SUI 与受支持的同质化代币存入 ZetaChain -- 向全链合约发起跨链调用 -- 接收来自全链合约的跨链调用与代币转账 - -本教程将教你: - -- 同时运行 ZetaChain 与 Sui 的本地开发环境 -- 在 ZetaChain 部署全链合约 -- 将 SUI 代币从 Sui 地址存入 ZetaChain -- 通过跨链调用触发全链合约中的函数 - -完成后,你将掌握如何从 Sui 转移资产、触发 ZetaChain 逻辑,无论是通过客户端钱包还是 Sui 合约。 - -## 前置条件 - -开始前请安装以下工具: - -| 工具 | 用途 | -| --- | --- | -| [Sui CLI](https://docs.sui.io/references/cli) | 运行本地 Sui 验证节点、管理地址与对象、部署合约 | -| [Foundry](https://getfoundry.sh/) | 使用 `cast` 为跨链调用编码 ABI 载荷 | -| [Node.js](https://nodejs.org/en) | 运行 ZetaChain CLI 与基于 JavaScript 的工具 | -| [Yarn](https://yarnpkg.com/) | 安装与管理项目依赖 | -| [jq](https://jqlang.org/) | 在脚本中解析 JSON 输出 | - -## 克隆示例项目 - -使用 ZetaChain CLI 生成项目: - -```bash -npx zetachain@latest new --project call -cd call -``` - -该模板已包含 Sui 与 ZetaChain 合约示例。 - -安装依赖: - -```bash -yarn -forge soldeer update -``` - -环境现已可用于本地开发与测试。 - -## 启动 Localnet - -同时启动 ZetaChain 与 Sui 的本地环境: - -```bash -yarn zetachain localnet start --chains sui -``` - -该命令会启动: - -- 本地 ZetaChain 实例 -- 本地 Sui 验证节点 -- 两条网络上的预部署 Gateway 合约 - -请保持该终端运行。启动成功后会看到类似表格: - -``` -SUI -┌──────────────────┬──────────────────────────────────────────────────────────────────────────────────┐ -│ (index) │ Values │ -├──────────────────┼──────────────────────────────────────────────────────────────────────────────────┤ -│ gatewayPackageId │ '0x17360c15c10bbc4ebc57e9872f2993dc4376f7f0bb78920fe5fa9ad276ac7f86' │ -│ gatewayObjectId │ '0x9a26d6b6f413228bb120446977a8d8003eceb490cb7afd8921494815adc0a497' │ -│ userMnemonic │ 'grape subway rack mean march bubble carry avoid muffin consider thing street' │ -│ userAddress │ '0x2fec3fafe08d2928a6b8d9a6a77590856c458d984ae090ccbd4177ac13729e65' │ -│ tokenUSDC │ '6b0b8d1bbc40893a7f793f52c46aeea9db9f2f710c6a623c666bff712e26c94a::token::TOKEN' │ -└──────────────────┴──────────────────────────────────────────────────────────────────────────────────┘ -``` - -> 💡 请妥善保留 `gatewayPackageId`、`gatewayObjectId` 与 `userMnemonic`,后续步骤会用到。 - -## 部署全链合约 - -接下来部署 ZetaChain 上的全链合约。 - -首先从本地环境获取 Gateway 地址与预置私钥: - -```bash -GATEWAY_ZETACHAIN=$(jq -r '.["31337"].contracts[] | select(.contractType == "gateway") | .address' ~/.zetachain/localnet/registry.json) && echo $GATEWAY_ZETACHAIN -``` - -```bash -PRIVATE_KEY=$(jq -r '.private_keys[0]' ~/.zetachain/localnet/anvil.json) && echo $PRIVATE_KEY -``` - -编译合约: - -``` -forge build -``` - -部署 `Universal` 合约: - -```bash -UNIVERSAL=$(forge create Universal \ - --rpc-url http://localhost:8545 \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json \ - --constructor-args $GATEWAY_ZETACHAIN | jq -r .deployedTo) && echo $UNIVERSAL -``` - -## 存入 ZetaChain - -部署完成后,即可通过 Sui Gateway 合约将 SUI 存入 ZetaChain 上的全链合约。 - -使用以下命令从 Sui 存入代币: - -```bash -npx zetachain sui deposit \ - --mnemonic "grape subway rack mean march bubble carry avoid muffin consider thing street" \ - --receiver $UNIVERSAL \ - --gateway-package 0x17360c15c10bbc4ebc57e9872f2993dc4376f7f0bb78920fe5fa9ad276ac7f86 \ - --gateway-object 0x9a26d6b6f413228bb120446977a8d8003eceb490cb7afd8921494815adc0a497 \ - --amount 0.001 \ - --chain-id 104 -``` - -> 🔎 请将 `--gateway-package` 与 `--gateway-object` 替换为你本地输出中的实际值。 - -该命令会调用 Sui Gateway 的存入函数。ZetaChain 监听到存入事件后,会铸造等量 ZRC-20 SUI,并转入全链合约。 - -## 存入并调用 - -此步骤在存入 SUI 的同时调用全链合约: - -```bash -npx zetachain sui deposit-and-call \ - --mnemonic "grape subway rack mean march bubble carry avoid muffin consider thing street" \ - --receiver $UNIVERSAL \ - --gateway-package 0x17360c15c10bbc4ebc57e9872f2993dc4376f7f0bb78920fe5fa9ad276ac7f86 \ - --gateway-object 0x9a26d6b6f413228bb120446977a8d8003eceb490cb7afd8921494815adc0a497 \ - --amount 0.001 \ - --chain-id 104 \ - --types string \ - --values hello -``` - -命令会调用 Sui Gateway 的 `deposit_and_call`,将 SUI 与载荷(此处为 `"hello"`)一并发送到 ZetaChain,触发全链合约的 `onCall`。 - -## 构建并部署 Sui 合约 - -你还可以部署一个 Sui 合约,在链上逻辑中发起存入操作。 - -进入 Sui 合约目录: - -```bash -cd sui -``` - -查看 `Move.toml`: - -```toml filename="sui/Move.toml" -[dependencies] -gateway = { local = "/usr/local/share/localnet/protocol-contracts-sui" } -``` - -示例项目已引入 Localnet 的 Gateway 模块。若在测试网/主网使用,将引用公共地址。 - -构建 Sui 合约: - -```bash -sui move build --force -``` - -将包发布到本地 Sui: - -```bash -SUI_CONTRACT=$(sui client publish \ - --skip-dependency-verification \ - --json 2>/dev/null | jq -r '.objectChanges[] | select(.type == "published") | .packageId') && echo $SUI_CONTRACT -``` - -## 通过水龙头获取代币 - -你的 Sui 账户需要一些 SUI 支付交易费。通过本地水龙头获取: - -```bash -sui client faucet -``` - -## 从 Sui 合约发起存入并调用 - -在 Sui 中,可通过 Programmable Transaction Block(PTB)实现复杂交易:组合多步操作并作为单笔交易提交。客户端应用构建并签名 PTB,提交后由 Sui 一次性执行。 - -项目中已有 TypeScript 命令 `commands/suiDepositAndCall.ts`,默认直接构建 ABI 载荷并调用 Sui Gateway。我们将其修改为: - -1. 先调用自定义的 Sui 合约并获取返回值 -2. 将返回值作为载荷传递给 Sui Gateway - -打开 `commands/suiDepositAndCall.ts`,修改载荷构造: - -```ts filename="commands/suiDepositAndCall.ts" -// const payload = tx.pure.vector("u8", utils.arrayify(payloadABI)); - -const payload = tx.moveCall({ - target: `${options.connected}::connected::hello`, - arguments: [tx.pure.string(params.values[0] as string)], -}); -``` - -这会调用 `connected::hello`,返回值即作为载荷转发给 Gateway 的 `deposit_and_call`。 - -由于 Sui 合约不便直接编码 EVM 所需数据,我们将全链合约的 `onCall` 签名改为接收 `bytes` 并按 UTF-8 解读: - -```solidity -function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message -) external override onlyGateway { - // string memory name = abi.decode(message, (string)); - emit HelloEvent("Hello on ZetaChain", string(message)); -} -``` - -重新构建并部署合约: - -```bash -forge build -``` - -```bash -UNIVERSAL=$(forge create Universal \ - --rpc-url http://localhost:8545 \ - --private-key $PRIVATE_KEY \ - --broadcast \ - --json \ - --constructor-args $GATEWAY_ZETACHAIN | jq -r .deployedTo) && echo $UNIVERSAL -``` - -现在执行 PTB:调用 Sui 合约获取返回值,将其传给 Sui Gateway,再由 Gateway 调用 ZetaChain 上的全链合约: - -```bash -npx tsx commands deposit-and-call \ - --private-key suiprivkey1qrqtrevmd40vxlv3q6fcgmm09af5p8f8j67ezve0u3nhrs0psslgjnw3y5p \ - --receiver $UNIVERSAL \ - --gateway-package 0xc52d19fd2f0bcb94d0c285d480b6a8af515f5ec19d0cff8818fc9bf0d3731b85 \ - --gateway-object 0xa755a1106ae7039a25c10578b6f3c5b73963055e0d6fc40e8abcebea454a6389 \ - --amount 0.001 \ - --chain-id 104 \ - --types string \ - --values alice \ - --connected $SUI_CONTRACT -``` - -终端中应看到类似事件输出: - -``` -[ZetaChain] Event from onCall: {"_type":"log","address":"0xa6e99A4ED7498b3cdDCBB61a6A607a4925Faa1B7",...} -``` - -可通过解码日志验证: - -```bash -cast abi-decode "data()(string,string)" \ - 0x0000000000000000000000000000000000000000000000000000000000000040... -``` - -预期输出: - -``` -"Hello on ZetaChain" -"hello alice" -``` - -至此,你已完成从 Sui 合约到 ZetaChain 的跨链调用,并掌握了定制载荷与事件处理的流程。*** - diff --git a/src/pages/developers/tutorials/swap.en-US.mdx b/src/pages/developers/tutorials/swap.en-US.mdx deleted file mode 100644 index 0c59ca25d..000000000 --- a/src/pages/developers/tutorials/swap.en-US.mdx +++ /dev/null @@ -1,523 +0,0 @@ -## Introduction - -In this tutorial, you'll build a Universal App on ZetaChain that enables -seamless cross-chain token swaps. This app allows users to send native gas -tokens or ERC-20 tokens from a connected chain and receive a different token on -another chain, all in a single transaction. For example, a user can swap USDC on -Ethereum for BTC on Bitcoin, without interacting with bridges or centralized -exchanges. - -You’ll learn how to: - -- Create a Universal App that performs token swaps across chains -- Deploy it to ZetaChain -- Trigger a cross-chain swap from a connected EVM chain - -The swap logic is implemented as a smart contract deployed on ZetaChain, -conforming to the `UniversalContract` interface. This makes the contract -callable from any connected chain through the Gateway. When tokens are sent from -a connected chain, they arrive on ZetaChain as [ZRC-20](/developers/evm/zrc20) -tokens, a native representation of external assets. ZRC-20 tokens preserve the -original asset’s properties while enabling programmable behavior on ZetaChain, -including cross-chain withdrawals. - -The Swap contract performs the following steps: - -1. Receives a cross-chain call along with native or ERC-20 tokens from a - connected chain. -2. Decodes the message payload to extract: - - - The address of the target token (ZRC-20) - - The recipient’s address on the destination chain - -3. Queries the withdrawal gas fee required to send the target token back to the - destination chain. -4. If withdrawing to a connected chain, swaps a portion of the incoming tokens - for ZRC-20 gas tokens to cover the withdrawal fee using Uniswap v2 pools. -5. Swaps the remaining balance into the target token. -6. Withdraws the swapped tokens to the recipient on the destination chain. - -This approach allows users to initiate complex multi-chain operations with a -single transaction from any supported chain, abstracting away the complexity of -liquidity routing, gas payments, and execution across chains. - -> Note: This tutorial uses Uniswap v2 pools on ZetaChain. These pools are -> primarily used by ZetaChain to swap small amounts of tokens, for example, to -> obtain gas fees for a revert in a cross-chain transaction. They may not have -> sufficient liquidity for larger swaps. For real-world usage, consider using -> pools maintained by active DEXes such as [Beam](https://docs.beamdex.xyz/) or -> [Zuno](https://docs.zunodex.xyz/), or any other DEX deployed on ZetaChain. - -## Prerequisites - -Before you begin, make sure you've completed the following tutorials: - -- [Introduction to Universal Apps](/start/app/) -- [Getting Started with ZetaChain](/developers/tutorials/intro) -- [First Universal App](/developers/tutorials/hello) - -## Setting Up Your Environment - -Start by creating a new ZetaChain project using the CLI: - -```bash -zetachain new --project swap -``` - -Install dependencies: - -```bash -cd swap -yarn -``` - -Pull Solidity dependencies using Foundry’s package manager: - -```bash -forge soldeer update -``` - -Compile the contract: - -```bash -forge build -``` - -This will set up a working environment with Foundry and ZetaChain CLI support, -and prepare your project for local deployment and testing. - -## Understanding the Swap Contract - -The `Swap` contract is a Universal App deployed on ZetaChain. It enables users -to perform token swaps across blockchains with a single cross-chain call. Tokens -are received as ZRC-20s, optionally swapped using Uniswap v2 liquidity, and -withdrawn back to a connected chain. - -### Universal App entrypoint: onCall - -The contract is deployed on ZetaChain and implements `UniversalContract`, -exposing a single entrypoint. Cross-chain deliveries are executed only via the -Gateway, so the call surface stays minimal and trusted. - -```solidity -function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message -) external onlyGateway -``` - -- `onlyGateway` ensures `onCall` is invoked exclusively by the Gateway. -- `MessageContext` carries the origin chain (`context.chainID`) and the original - caller (`context.sender`). Treat this as the canonical source identity. - -### Asset model: ZRC-20 - -Assets arriving from connected chains are represented as ZRC-20s on ZetaChain. -In `onCall`, `zrc20` is the input token and `amount` is how much was delivered. -To send assets out to another chain, the contract approves the Gateway to spend -specific ZRC-20 amounts and then calls `withdraw`. - -Two interfaces are central: - -**Withdrawal gas quote** for the destination chain: - -```solidity -(address gasZRC20, uint256 gasFee) = IZRC20(targetToken).withdrawGasFee(); -``` - -- `gasZRC20` is the ZRC-20 that represents the destination chain’s gas token. -- `gasFee` is the amount required to execute on the destination chain. - -**Withdrawal** to a connected chain (burn ZRC-20, release native on the other -side): - -```solidity -IZRC20(gasZRC20).approve(address(gateway), gasFee); -IZRC20(params.target).approve(address(gateway), out); - -gateway.withdraw( - abi.encodePacked(params.to), // chain-agnostic recipient (bytes) - out, // amount of target token - params.target, // ZRC-20 to withdraw - revertOptions // failure handling -); -``` - -If the destination gas token (`gasZRC20`) is the same as the target token, the -contract approves a single combined allowance of `out + gasFee` for the Gateway -instead of two separate approvals. - -### Funding destination execution from the user’s input - -The app provisions destination gas out of the input, so users don’t need to -pre-hold gas on the target chain. - -Flow: - -1. Quote the destination gas requirement via `withdrawGasFee()`. -2. Verify the input covers it using a DEX quote: - - ```solidity - uint256 minInput = quoteMinInput(inputToken, targetToken); - if (amount < minInput) revert InsufficientAmount(...); - ``` - -3. If the input isn’t already `gasZRC20`, swap just enough to buy `gasFee`: - - ```solidity - inputForGas = SwapHelperLib.swapTokensForExactTokens( - uniswapRouter, inputToken, gasFee, gasZRC20, amount - ); - ``` - -4. Swap the remainder into the target token: - - ```solidity - out = SwapHelperLib.swapExactTokensForTokens( - uniswapRouter, inputToken, amount - inputForGas, targetToken, 0 - ); - ``` - -`quoteMinInput()` uses Uniswap v2 pricing (`getAmountsIn`) to determine the -minimum input necessary to cover the gas fee. - -### Chain-agnostic addresses - -Recipients (and senders in events) are carried as raw `bytes`, not `address`, so -the same contract can serve EVM, Bitcoin, Solana, etc. For cross-chain withdraw: -pass `bytes` directly to `gateway.withdraw`. - -### Decoding the message payload - -When a cross-chain call reaches your universal app, any extra parameters are -passed as an ABI-encoded payload. For the swap contract, this payload contains -three values: - -``` -(address targetToken, bytes recipient, bool withdrawFlag) -``` - -- `targetToken`: The ZRC-20 token address for the asset to deliver after the - swap. -- `recipient`: The destination address in raw `bytes` form, which works for any - supported chain (EVM, Solana, etc.). -- `withdrawFlag`: Controls whether the swapped tokens are sent to another chain - (`true`) or transferred locally on ZetaChain (`false`). - -Inside `onCall`, you decode the payload like this: - -```solidity -(address targetToken, bytes memory recipient, bool withdrawFlag) = - abi.decode(message, (address, bytes, bool)); -``` - -### Revert with `RevertOptions` and `onRevert` - -If the destination call/transfer fails, the Gateway triggers `onRevert` with a -`RevertContext`. The contract pre-encodes a small recovery message in -`revertMessage` (original sender and original input token), then executes a -deterministic refund: - -```solidity -function onRevert(RevertContext calldata context) external onlyGateway { - (bytes memory sender, address zrc20) = - abi.decode(context.revertMessage, (bytes, address)); - - (uint256 out,,) = handleGasAndSwap( - context.asset, context.amount, zrc20, true - ); - - gateway.withdraw( - sender, // chain-agnostic refund address - out, - zrc20, - RevertOptions({ - revertAddress: address(bytes20(sender)), // best-effort for EVM - callOnRevert: false, - abortAddress: address(0), - revertMessage: "", - onRevertGasLimit: gasLimit - }) - ); -} -``` - -The result is a consistent refund flow across chains, governed by the app. - -### Swapping using liquidity pools - -Universal contracts can route through any DEX/AMM available on ZetaChain. -Uniswap v2 is used here purely as an example via SwapHelperLib, which wraps -common router calls. - -```solidity -// Buy exact destination gas -SwapHelperLib.swapTokensForExactTokens( - uniswapRouter, inputToken, gasFee, gasZRC20, amount -); - -// Swap remainder to target -SwapHelperLib.swapExactTokensForTokens( - uniswapRouter, inputToken, swapAmount, targetToken, 0 -); -``` - -Note: If `inputToken == gasZRC20`, the contract uses `gasFee` directly (no swap -for gas is required) and only swaps the remaining balance to the target token. - -You’re free to replace uniswapRouter and the helper calls with any DEX interface -or custom routing logic—only the ZRC-20 token flow and the Gateway withdraw -semantics are assumed by the rest of the contract. - -## Option 1: Deploy on Testnet - -To deploy the Swap contract to ZetaChain testnet, run the following command: - -```bash -UNIVERSAL=$(npx tsx commands deploy --private-key $PRIVATE_KEY | jq -r .contractAddress) && echo $UNIVERSAL -``` - -This deploys the precompiled contract using the specified private key and -outputs the deployed address. - -The deployment script automatically uses the correct Gateway and Uniswap router -addresses for testnet. - -Once complete, the `UNIVERSAL` environment variable will contain the address of -your deployed Swap contract on testnet. You’ll reference this address when -triggering swaps from connected chains. - -Get your EVM sender address from the private key: - -```bash -RECIPIENT=$(cast wallet address $PRIVATE_KEY) && echo $RECIPIENT -``` - -Query the ZRC-20 address that represents ETH from Ethereum Sepolia: - -```bash -ZRC20_ETHEREUM_ETH=$(zetachain q tokens show --symbol sETH.SEPOLIA -f zrc20) && echo $ZRC20_ETHEREUM_ETH -``` - -## Swap from Base to Ethereum - -To initiate a swap from Base to Ethereum, run: - -```bash -npx zetachain evm deposit-and-call \ - --chain-id 84532 \ - --amount 0.001 \ - --types address bytes bool \ - --receiver $UNIVERSAL \ - --values $ZRC20_ETHEREUM_ETH $RECIPIENT true -``` - -This sends 0.001 ETH from Base Sepolia into ZetaChain. Under the hood, this -command invokes the `depositAndCall` function on the Base Gateway. The Gateway -wraps the incoming ETH as ZRC-20 Base ETH and delivers it to the universal swap -contract on ZetaChain along with the encoded payload. - -The contract receives the Base ETH as a ZRC-20 token, performs the swap to -ZRC-20 Ethereum ETH using Uniswap v2 liquidity on ZetaChain, and then withdraws -the swapped tokens to your address on Ethereum Sepolia. - -This entire flow is completed as a single cross-chain transaction. You don’t -need to pre-fund gas on the destination chain or interact with bridges or -routers—everything is orchestrated by the universal contract on ZetaChain. - -Transaction on Base: - -https://sepolia.basescan.org/tx/0x8def0ff44c0e45803f209bc864123a08a03e6e1fadc5ac6f28f4c17f1463aae9 - -You can inspect the full cross-chain context with: - -``` -zetachain query cctx --hash 0x8def0ff44c0e45803f209bc864123a08a03e6e1fadc5ac6f28f4c17f1463aae9 -``` - -This will show the inbound delivery from Base to ZetaChain, and the outbound -delivery from ZetaChain to Ethereum Sepolia, including transaction hashes, -sender and recipient addresses, and token amounts. - -``` -84532 → 7001 ✅ OutboundMined -CCTX: 0x11ff9e850f0974de3b23f5347feb8684a88c6124e972da725b854031a632ad37 -Tx Hash: 0x8def0ff44c0e45803f209bc864123a08a03e6e1fadc5ac6f28f4c17f1463aae9 (on chain 84532) -Tx Hash: 0xe5e5f72154140f63673d8260ed638c7dbb8c5b6901bc19b1e93651fdb35c6a00 (on chain 7001) -Sender: 0x4955a3F38ff86ae92A914445099caa8eA2B9bA32 -Receiver: 0x92ae647a9D8d09D58514037d6535ab93a2A8138f -Message: 00000000000000000000000005ba149a7bd6dc1f937fa9046a9e05c05f3b18b00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000144955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000 -Amount: 1000000000000000 Gas tokens - -7001 → 11155111 ✅ OutboundMined -CCTX: 0xfb6f6e1cb94e646fa7a8123082054aea08fa9a65a5f07e1e0dc48463ebfaf9dd -Tx Hash: 0x11ff9e850f0974de3b23f5347feb8684a88c6124e972da725b854031a632ad37 (on chain 7001) -Tx Hash: 0x285a47661b2216ff6d76cd811ca3e3de622b6927f9da94b1cb706f88ad86ef38 (on chain 11155111) -Sender: 0x92ae647a9D8d09D58514037d6535ab93a2A8138f -Receiver: 0x4955a3F38ff86ae92A914445099caa8eA2B9bA32 -Amount: 17091458311542 Gas tokens -``` - -## Swap from Solana to Ethereum - -To initiate a swap from Solana to Ethereum Sepolia, run: - -```bash -npx zetachain solana deposit-and-call \ - --recipient $UNIVERSAL \ - --types address bytes bool \ - --values $ZRC20_ETHEREUM_ETH $RECIPIENT true \ - --chain-id 901 \ - --private-key $SOLANA_PRIVATE_KEY \ - --amount 0.01 -``` - -This sends 0.01 SOL to the universal swap contract on ZetaChain. The Solana -Gateway locks the native SOL and delivers its ZRC-20 representation to the -contract along with the swap payload. - -The contract swaps the ZRC-20 SOL for ZRC-20 Ethereum ETH and withdraws the -resulting amount to the `RECIPIENT` on Ethereum Sepolia. The recipient address -is passed as raw bytes, which allows the same universal contract to serve -cross-chain swaps from both EVM and non-EVM chains like Solana. - -Transaction on Solana: - -https://solana.fm/tx/28xsic7NqafyxqDjmqfYL5f6RoHFYLrCKvjSA4UJCXyESmdCb1bVpW3dqT2QJrwV6KmfdWuHrwj8uW4txHZiXLxm?cluster=devnet-solana - -To inspect the full cross-chain context: - -```bash -npx zetachain query cctx --hash 28xsic7NqafyxqDjmqfYL5f6RoHFYLrCKvjSA4UJCXyESmdCb1bVpW3dqT2QJrwV6KmfdWuHrwj8uW4txHZiXLxm -``` - -``` -901 → 7001 ✅ OutboundMined -CCTX: 0xd6e73b3ce77bc16bfaf1b8449b46991476ea7a8cec7ab1f508cd14aaf972028b -Tx Hash: 28xsic7NqafyxqDjmqfYL5f6RoHFYLrCKvjSA4UJCXyESmdCb1bVpW3dqT2QJrwV6KmfdWuHrwj8uW4txHZiXLxm (on chain 901) -Tx Hash: 0x91001d6539c04bf3629d611543ccf8f819a9f7fdf1f1c76bfd695b7e46750bbe (on chain 7001) -Sender: AS48jKNQsDGkEdDvfwu1QpqjtqbCadrAq9nGXjFmdX3Z -Receiver: 0x92ae647a9D8d09D58514037d6535ab93a2A8138f -Message: 00000000000000000000000005ba149a7bd6dc1f937fa9046a9e05c05f3b18b00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000144955a3f38ff86ae92a914445099caa8ea2b9ba32000000000000000000000000 -Amount: 10000000 Gas tokens - -7001 → 11155111 ✅ OutboundMined -CCTX: 0xc718334a07bac99c6ac21bc8a69bf743eff5c391a3998d957bd51af6240b6d07 -Tx Hash: 0xd6e73b3ce77bc16bfaf1b8449b46991476ea7a8cec7ab1f508cd14aaf972028b (on chain 7001) -Tx Hash: 0x791aade1bb72cf516f9a4c6d774237f7736fbe49430aa669fb82b34b27623a85 (on chain 11155111) -Sender: 0x92ae647a9D8d09D58514037d6535ab93a2A8138f -Receiver: 0x4955a3F38ff86ae92A914445099caa8eA2B9bA32 -Amount: 8645129169842 Gas tokens -``` - -### Swap from Bitcoin to Ethereum - -You can also trigger the same swap flow from Bitcoin. This command sends 0.05 -BTC via inscription, delivers the ZRC-20 representation of BTC to your universal -contract on ZetaChain with the encoded payload, swaps to ZRC-20 Ethereum ETH, -and withdraws to your address on Ethereum Sepolia: - -Before running the command, set `PRIVATE_KEY_BTC` to your Bitcoin private key. - -```bash -zetachain bitcoin inscription deposit-and-call \ - --private-key $PRIVATE_KEY_BTC \ - --receiver $UNIVERSAL \ - --types address bytes bool \ - --values $ZRC20_ETHEREUM_ETH $RECIPIENT true \ - --amount 0.05 -``` - -Once the Bitcoin transaction is observed and processed, your contract executes -the swap and withdrawal in a single cross-chain flow. - -## Option 2: Deploy on Localnet - -Query the Uniswap router: - -```bash -UNISWAP_ROUTER=$(jq -r '.["31337"].contracts[] | select(.contractType == "uniswapRouterInstance") | .address' ~/.zetachain/localnet/registry.json) && echo $UNISWAP_ROUTER -``` - -Query the Gateway address: - -```bash -GATEWAY_ZETACHAIN=$(jq -r '.["31337"].contracts[] | select(.contractType == "gateway") | .address' ~/.zetachain/localnet/registry.json) && echo $GATEWAY_ZETACHAIN -``` - -Get the localnet private key: - -```bash -PRIVATE_KEY=$(jq -r '.private_keys[0]' ~/.zetachain/localnet/anvil.json) && echo $PRIVATE_KEY -``` - -Deploy the contract: - -```bash -UNIVERSAL=$(npx tsx commands/index.ts deploy \ - --private-key $PRIVATE_KEY \ - --rpc http://localhost:8545 \ - --gateway $GATEWAY_ZETACHAIN \ - --uniswap-router $UNISWAP_ROUTER | jq -r .contractAddress) && echo $UNIVERSAL -``` - -This will deploy the contract to your Localnet and store the deployed address in -`UNIVERSAL`. - -## Swap from Ethereum to BNB - -To perform a cross-chain swap from Ethereum to BNB on Localnet, first set the -relevant variables. - -Get the Gateway contract address for Ethereum: - -```bash -GATEWAY_ETHEREUM=$(jq -r '.["11155112"].contracts[] | select(.contractType == "gateway") | .address' ~/.zetachain/localnet/registry.json) && echo $GATEWAY_ETHEREUM -``` - -Get the ZRC-20 address that represents the BNB gas token: - -```bash -ZRC20_BNB=$(jq -r '."98".chainInfo.gasZRC20' ~/.zetachain/localnet/registry.json) && echo $ZRC20_BNB -``` - -Get your local sender address from the private key: - -```bash -RECIPIENT=$(cast wallet address $PRIVATE_KEY) && echo $RECIPIENT -``` - -Then trigger the swap: - -```bash -npx zetachain evm deposit-and-call \ - --rpc http://localhost:8545 \ - --chain-id 11155112 \ - --gateway $GATEWAY_ETHEREUM \ - --amount 0.001 \ - --types address bytes bool \ - --receiver $UNIVERSAL \ - --private-key $PRIVATE_KEY \ - --values $ZRC20_BNB $RECIPIENT true -``` - -This sends 0.001 ETH from Ethereum to ZetaChain on Localnet, where it will be -swapped for ZRC-20 BNB and then withdrawn to your address on the BNB localnet -chain. - -## Conclusion - -In this tutorial, you learned how to define a universal app contract that -performs cross-chain token swaps. You deployed the `Swap` contract to a local -development network and interacted with the contract by swapping tokens from a -connected EVM chain. You also understood the mechanics of handling gas fees and -token approvals in cross-chain swaps. - -## Source Code - -You can find the source code for the tutorial in the example contracts -repository: - -https://github.com/zeta-chain/example-contracts/tree/main/examples/swap diff --git a/src/pages/developers/tutorials/swap.zh-CN.mdx b/src/pages/developers/tutorials/swap.zh-CN.mdx deleted file mode 100644 index 3d45c397f..000000000 --- a/src/pages/developers/tutorials/swap.zh-CN.mdx +++ /dev/null @@ -1,398 +0,0 @@ ---- -title: 跨链兑换 ---- - -## 简介 - -本教程将带你构建一个 ZetaChain 全链应用,实现无缝的跨链代币兑换。用户可从连接链发送原生 Gas 代币或 ERC-20,并在另一条链上接收不同的代币,整个过程在一笔交易中完成。例如,用户可直接将以太坊上的 USDC 兑换为比特币上的 BTC,而无需使用跨链桥或中心化交易所。 - -你将学会: - -- 创建可在多链间执行代币兑换的全链应用 -- 将其部署到 ZetaChain -- 从连接的 EVM 链触发跨链兑换 - -兑换逻辑由部署在 ZetaChain 上的智能合约实现,符合 `UniversalContract` 接口。通过 Gateway,该合约可被任意连接链调用。当连接链发送代币时,会以 [ZRC-20](/developers/evm/zrc20) 形式进入 ZetaChain。ZRC-20 是外部资产在 ZetaChain 上的原生表示,既保留了原资产属性,又允许在 ZetaChain 上编程,包括跨链提现。 - -Swap 合约执行以下步骤: - -1. 接收来自连接链的跨链调用及原生或 ERC-20 代币。 -2. 解码消息载荷,获取: - - 目标代币(ZRC-20)地址 - - 目标链上的收款人地址 -3. 查询目标链提现该代币所需的 Gas 费用。 -4. 若需提现到连接链,使用 Uniswap v2 池将部分输入代币兑换为目标链 Gas 所需的 ZRC-20。 -5. 将剩余代币兑换为目标代币。 -6. 将兑换后的代币提现给目标链上的收款人。 - -这种方式让用户仅需一次交易即可发起复杂的多链操作,隐藏了流动性路由、Gas 支付与跨链执行等底层细节。 - -> 注意:本教程示例使用 ZetaChain 上的 Uniswap v2 池。这些池主要用于 ZetaChain 进行小额代币交换(例如在跨链交易回退时获取 Gas),可能没有足够流动性支持大额交易。生产环境建议使用活跃 DEX(如 [Beam](https://docs.beamdex.xyz/) 或 [Zuno](https://docs.zunodex.xyz/))的池,或部署其他 DEX。 - -## 前置条件 - -请先完成以下教程: - -- [全链应用简介](/start/app/) -- [ZetaChain 入门](/developers/tutorials/intro) -- [第一个全链应用](/developers/tutorials/hello) - -## 环境准备 - -使用 CLI 创建新项目: - -```bash -zetachain new --project swap -``` - -安装依赖: - -```bash -cd swap -yarn -``` - -通过 Foundry 的包管理器拉取 Solidity 依赖: - -```bash -forge soldeer update -``` - -编译合约: - -```bash -forge build -``` - -至此,你已拥有带 Foundry 与 ZetaChain CLI 支持的开发环境,可进行本地部署与测试。 - -## 了解 Swap 合约 - -`Swap` 合约是部署在 ZetaChain 的全链应用,允许用户通过一次跨链调用完成代币兑换。传入的代币会以 ZRC-20 形式接收,必要时通过 Uniswap v2 进行兑换,最终可提现到连接链。 - -### 全链入口:onCall - -合约部署在 ZetaChain,实现 `UniversalContract`,仅暴露一个入口函数。跨链调用只能经由 Gateway 触发,保证调用面可信且简洁。 - -```solidity -function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message -) external onlyGateway -``` - -- `onlyGateway` 保证 `onCall` 仅由 Gateway 调用。 -- `MessageContext` 包含源链 ID(`context.chainID`)与原始调用者(`context.sender`),可视为源的权威身份。 - -### 资产模型:ZRC-20 - -来自连接链的资产会在 ZetaChain 表示为 ZRC-20。在 `onCall` 中,`zrc20` 为输入代币,`amount` 为接收数量。若需向其他链发送资产,合约需批准 Gateway 消耗特定 ZRC-20 数量,然后调用 `withdraw`。 - -两个关键接口: - -**目标链提现 Gas 询价**: - -```solidity -(address gasZRC20, uint256 gasFee) = IZRC20(targetToken).withdrawGasFee(); -``` - -- `gasZRC20`:代表目标链 Gas 代币的 ZRC-20。 -- `gasFee`:在目标链执行所需的费用。 - -**向连接链提现**(销毁 ZRC-20,释放对端原生资产): - -```solidity -IZRC20(gasZRC20).approve(address(gateway), gasFee); -IZRC20(params.target).approve(address(gateway), out); - -gateway.withdraw( - abi.encodePacked(params.to), // 链无关的接收者(bytes) - out, // 提现数量 - params.target, // 待提现的 ZRC-20 - revertOptions // 失败处理 -); -``` - -若目标链 Gas 代币 (`gasZRC20`) 与目标代币相同,可合并批准 `out + gasFee`。 - -### 使用用户输入筹集目标链 Gas - -应用会从用户输入中扣除目标链 Gas,无需用户额外准备。 - -流程: - -1. 通过 `withdrawGasFee()` 获取目标链 Gas 需求。 -2. 使用 DEX 报价确认输入是否足够: - - ```solidity - uint256 minInput = quoteMinInput(inputToken, targetToken); - if (amount < minInput) revert InsufficientAmount(...); - ``` - -3. 若输入代币不是 `gasZRC20`,兑换足够金额以支付 Gas: - - ```solidity - inputForGas = SwapHelperLib.swapTokensForExactTokens( - uniswapRouter, inputToken, gasFee, gasZRC20, amount - ); - ``` - -4. 将剩余部分兑换为目标代币: - - ```solidity - out = SwapHelperLib.swapExactTokensForTokens( - uniswapRouter, inputToken, amount - inputForGas, targetToken, 0 - ); - ``` - -`quoteMinInput()` 使用 Uniswap v2 的 `getAmountsIn` 估算覆盖 Gas 所需的最小输入。 - -### 链无关地址 - -收款人(以及事件中的发送者)以原始 `bytes` 表示,而非 `address`,因此同一合约可同时服务 EVM、比特币、Solana 等链。跨链提现时,将 `bytes` 直接传给 `gateway.withdraw` 即可。 - -### 解码消息载荷 - -跨链调用可携带额外参数,作为 ABI 编码的载荷。Swap 合约中载荷包含三项: - -``` -(address targetToken, bytes recipient, bool withdrawFlag) -``` - -- `targetToken`:兑换后需交付的 ZRC-20 地址。 -- `recipient`:目标链收款地址(raw bytes),适用于任意链。 -- `withdrawFlag`:`true` 表示提现至其他链;`false` 表示留在 ZetaChain。 - -在 `onCall` 中解码: - -```solidity -(address targetToken, bytes memory recipient, bool withdrawFlag) = - abi.decode(message, (address, bytes, bool)); -``` - -### 回退处理:RevertOptions 与 onRevert - -若目标调用/转账失败,Gateway 会携带 `RevertContext` 调用 `onRevert`。合约会在 `revertMessage` 中编码原始发送者与输入代币,方便自动退款: - -```solidity -function onRevert(RevertContext calldata context) external onlyGateway { - (bytes memory sender, address zrc20) = - abi.decode(context.revertMessage, (bytes, address)); - - (uint256 out,,) = handleGasAndSwap( - context.asset, context.amount, zrc20, true - ); - - gateway.withdraw( - sender, - out, - zrc20, - RevertOptions({ - revertAddress: address(bytes20(sender)), - callOnRevert: false, - abortAddress: address(0), - revertMessage: "", - onRevertGasLimit: gasLimit - }) - ); -} -``` - -这样就能在任意链上执行一致的退款流程。 - -### 使用流动性池兑换 - -全链合约可使用 ZetaChain 上的任意 DEX/AMM。本示例通过 `SwapHelperLib` 调用 Uniswap v2: - -```solidity -SwapHelperLib.swapTokensForExactTokens( - uniswapRouter, inputToken, gasFee, gasZRC20, amount -); - -SwapHelperLib.swapExactTokensForTokens( - uniswapRouter, inputToken, swapAmount, targetToken, 0 -); -``` - -若 `inputToken == gasZRC20`,则直接使用 `gasFee`,无需兑换 Gas,仅需将剩余余额兑换为目标代币。 - -你可自由替换为其他 DEX 接口或自定义路由逻辑,只需保证 ZRC-20 资金流与 Gateway 提现语义正确。 - -## 方案一:部署到测试网 - -部署 Swap 合约到 ZetaChain 测试网: - -```bash -UNIVERSAL=$(npx tsx commands deploy --private-key $PRIVATE_KEY | jq -r .contractAddress) && echo $UNIVERSAL -``` - -脚本会自动使用测试网的 Gateway 与 Uniswap Router 地址。 - -部署成功后,`UNIVERSAL` 环境变量即为测试网上 Swap 合约地址。后续触发跨链兑换时会用到该地址。 - -获取 EVM 发送地址: - -```bash -RECIPIENT=$(cast wallet address $PRIVATE_KEY) && echo $RECIPIENT -``` - -查询 Ethereum Sepolia 上 ETH 对应的 ZRC-20 地址: - -```bash -ZRC20_ETHEREUM_ETH=$(zetachain q tokens show --symbol sETH.SEPOLIA -f zrc20) && echo $ZRC20_ETHEREUM_ETH -``` - -## 从 Base 兑换到 Ethereum - -发起 Base → Ethereum 兑换: - -```bash -npx zetachain evm deposit-and-call \ - --chain-id 84532 \ - --amount 0.001 \ - --types address bytes bool \ - --receiver $UNIVERSAL \ - --values $ZRC20_ETHEREUM_ETH $RECIPIENT true -``` - -该命令会向 Base Gateway 调用 `depositAndCall`,将 0.001 ETH 包装为 Base ETH 的 ZRC-20,并携带载荷发送至 ZetaChain 上的 Swap 合约。合约在 ZetaChain 使用 Uniswap v2 将 Base ETH 兑换为 Ethereum ETH 的 ZRC-20,并提现至 Ethereum Sepolia 上的 `RECIPIENT`。 - -整个流程在一笔跨链交易中完成,无需提前准备目标链 Gas,也不需手动使用桥或路由器。 - -Base 交易示例: - -https://sepolia.basescan.org/tx/0x8def0ff44c0e45803f209bc864123a08a03e6e1fadc5ac6f28f4c17f1463aae9 - -可通过: - -``` -zetachain query cctx --hash 0x8def0ff44c0e45803f209bc864123a08a03e6e1fadc5ac6f28f4c17f1463aae9 -``` - -查看完整跨链明细,包括 Base → ZetaChain 的入站与 ZetaChain → Ethereum Sepolia 的出站交易、哈希、地址与代币数量。 - -## 从 Solana 兑换到 Ethereum - -发起 Solana → Ethereum Sepolia 兑换: - -```bash -npx zetachain solana deposit-and-call \ - --recipient $UNIVERSAL \ - --types address bytes bool \ - --values $ZRC20_ETHEREUM_ETH $RECIPIENT true \ - --chain-id 901 \ - --private-key $SOLANA_PRIVATE_KEY \ - --amount 0.01 -``` - -该命令会在 Solana Gateway 锁定 0.01 SOL,并以 ZRC-20 SOL 形式连同载荷发送至 Swap 合约。合约再将其兑换为 Ethereum ETH 的 ZRC-20 并提现给 `RECIPIENT`。收款地址以 `bytes` 表示,让同一合约可同时处理 EVM 与非 EVM 链。 - -Solana 交易示例: - -https://solana.fm/tx/28xsic7NqafyxqDjmqfYL5f6RoHFYLrCKvjSA4UJCXyESmdCb1bVpW3dqT2QJrwV6KmfdWuHrwj8uW4txHZiXLxm?cluster=devnet-solana - -查看跨链详情: - -```bash -npx zetachain query cctx --hash 28xsic7NqafyxqDjmqfYL5f6RoHFYLrCKvjSA4UJCXyESmdCb1bVpW3dqT2QJrwV6KmfdWuHrwj8uW4txHZiXLxm -``` - -## 从 Bitcoin 兑换到 Ethereum - -同样可从比特币发起兑换。以下命令通过铭文发送 0.05 BTC: - -在执行前,将 `PRIVATE_KEY_BTC` 设置为你的比特币私钥。 - -```bash -zetachain bitcoin inscription deposit-and-call \ - --private-key $PRIVATE_KEY_BTC \ - --receiver $UNIVERSAL \ - --types address bytes bool \ - --values $ZRC20_ETHEREUM_ETH $RECIPIENT true \ - --amount 0.05 -``` - -比特币交易被观察并处理后,合约会在一条跨链流程中完成兑换与提现。 - -## 方案二:部署到 Localnet - -查询 Uniswap Router 地址: - -```bash -UNISWAP_ROUTER=$(jq -r '.["31337"].contracts[] | select(.contractType == "uniswapRouterInstance") | .address' ~/.zetachain/localnet/registry.json) && echo $UNISWAP_ROUTER -``` - -查询 Gateway 地址: - -```bash -GATEWAY_ZETACHAIN=$(jq -r '.["31337"].contracts[] | select(.contractType == "gateway") | .address' ~/.zetachain/localnet/registry.json) && echo $GATEWAY_ZETACHAIN -``` - -获取 Localnet 预置私钥: - -```bash -PRIVATE_KEY=$(jq -r '.private_keys[0]' ~/.zetachain/localnet/anvil.json) && echo $PRIVATE_KEY -``` - -部署合约: - -```bash -UNIVERSAL=$(npx tsx commands/index.ts deploy \ - --private-key $PRIVATE_KEY \ - --rpc http://localhost:8545 \ - --gateway $GATEWAY_ZETACHAIN \ - --uniswap-router $UNISWAP_ROUTER | jq -r .contractAddress) && echo $UNIVERSAL -``` - -部署完成后,`UNIVERSAL` 即为本地部署地址。 - -### Ethereum → BNB(Localnet) - -先准备变量。 - -获取 Ethereum 的 Gateway: - -```bash -GATEWAY_ETHEREUM=$(jq -r '.["11155112"].contracts[] | select(.contractType == "gateway") | .address' ~/.zetachain/localnet/registry.json) && echo $GATEWAY_ETHEREUM -``` - -查询 BNB Gas 代币对应的 ZRC-20: - -```bash -ZRC20_BNB=$(jq -r '."98".chainInfo.gasZRC20' ~/.zetachain/localnet/registry.json) && echo $ZRC20_BNB -``` - -获取本地私钥对应地址: - -```bash -RECIPIENT=$(cast wallet address $PRIVATE_KEY) && echo $RECIPIENT -``` - -触发兑换: - -```bash -npx zetachain evm deposit-and-call \ - --rpc http://localhost:8545 \ - --chain-id 11155112 \ - --gateway $GATEWAY_ETHEREUM \ - --amount 0.001 \ - --types address bytes bool \ - --receiver $UNIVERSAL \ - --private-key $PRIVATE_KEY \ - --values $ZRC20_BNB $RECIPIENT true -``` - -这会将 0.001 ETH 从本地 Ethereum 环境发送至 ZetaChain,转换为 ZRC-20 BNB,并提现到本地 BNB 链的地址。 - -## 总结 - -本教程展示了如何编写实现跨链代币兑换的全链应用,部署到本地或测试环境,并从连接 EVM 链触发代币兑换。同时,你也了解了在跨链兑换中处理 Gas 费用与代币授权的机制。 - -## 源码 - -教程示例可在示例合约仓库中找到: - -https://github.com/zeta-chain/example-contracts/tree/main/examples/swap - diff --git a/src/pages/developers/evm/zeta.en-US.mdx b/src/pages/developers/zeta.en-US.mdx similarity index 89% rename from src/pages/developers/evm/zeta.en-US.mdx rename to src/pages/developers/zeta.en-US.mdx index 64e5afcce..dddb0acad 100644 --- a/src/pages/developers/evm/zeta.en-US.mdx +++ b/src/pages/developers/zeta.en-US.mdx @@ -43,14 +43,14 @@ internal liquidity pools on ZetaChain paired with native gas tokens of connected blockchains (for example, sETH/WZETA pair). To wrap native ZETA and turn it into WZETA, send it to or use the `deposit` -method of the `zetaToken` [contract on ZetaChain](/reference/network/contracts). +method of the `zetaToken` contract on ZetaChain. ## ZETA on Connected Blockchains ZETA tokens on EVM-compatible connected blockchains (like Ethereum, Polygon and BSC) are implemented as [ERC-20](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/Zeta.eth.sol) -tokens. You can find the contract addresses of the `zetaToken` on a connected -blockchain on the [contracts page](/reference/network/contracts). +tokens. The contract addresses of the `zetaToken` on each connected blockchain +are listed below. diff --git a/src/pages/developers/evm/zeta.zh-CN.mdx b/src/pages/developers/zeta.zh-CN.mdx similarity index 86% rename from src/pages/developers/evm/zeta.zh-CN.mdx rename to src/pages/developers/zeta.zh-CN.mdx index cde835a64..8d172b365 100644 --- a/src/pages/developers/evm/zeta.zh-CN.mdx +++ b/src/pages/developers/zeta.zh-CN.mdx @@ -29,11 +29,11 @@ ZetaChain 的原生代币名为 ZETA,既是质押代币,也是交易手续 ZETA 可在 ZetaChain 上以 [WETH9](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/zevm/WZETA.sol) 形式被包装为 WZETA。包装过程会将原生代币(此处为 ZETA)锁定在合约中,并铸造等量的 WZETA。WZETA 与原生代币 1:1 锚定,可随时赎回原生 ZETA。由于 WZETA 兼容 ERC-20,可供依赖 ERC-20 交互的 dApp 使用。WZETA 主要用于 ZetaChain 内部流动性池,与连接链的原生 Gas 代币配对(例如 sETH/WZETA)。 -如需将原生 ZETA 包装为 WZETA,可向 `zetaToken` [ZetaChain 合约](/reference/network/contracts)发送代币或调用其 `deposit` 方法。 +如需将原生 ZETA 包装为 WZETA,可向 ZetaChain 上的 `zetaToken` 合约发送代币或调用其 `deposit` 方法。 ## 连接链上的 ZETA -在以太坊、Polygon、BSC 等 EVM 兼容连接链上,ZETA 以 [ERC-20 代币](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/Zeta.eth.sol) 形式存在。各链上 `zetaToken` 的合约地址可在[合约地址页面](/reference/network/contracts)查询。 +在以太坊、Polygon、BSC 等 EVM 兼容连接链上,ZETA 以 [ERC-20 代币](https://github.com/zeta-chain/protocol-contracts-evm/blob/main/contracts/evm/Zeta.eth.sol) 形式存在。各链上 `zetaToken` 的合约地址见下表。 diff --git a/src/pages/index.en-US.mdx b/src/pages/index.en-US.mdx index dbdb7dfdc..67c96f7dd 100644 --- a/src/pages/index.en-US.mdx +++ b/src/pages/index.en-US.mdx @@ -1,6 +1,6 @@ --- title: ZetaChain Documentation -description: ZetaChain is the only decentralized blockchain and smart contract platform built for omnichain interoperability. +description: ZetaChain is a decentralized blockchain and smart contract platform built for interoperability. --- import { HomePage } from "~/components/Home"; diff --git a/src/pages/index.zh-CN.mdx b/src/pages/index.zh-CN.mdx index 7d4d764df..27cd426fb 100644 --- a/src/pages/index.zh-CN.mdx +++ b/src/pages/index.zh-CN.mdx @@ -1,6 +1,6 @@ --- title: ZetaChain 文档 -description: ZetaChain 是唯一专为全链互操作性构建的去中心化区块链和智能合约平台。 +description: ZetaChain 是专为互操作性构建的去中心化区块链和智能合约平台。 --- import { HomePage } from "~/components/Home"; diff --git a/src/pages/reference/_meta.en-US.json b/src/pages/reference/_meta.en-US.json index f5d5960b4..9ad4ddb78 100644 --- a/src/pages/reference/_meta.en-US.json +++ b/src/pages/reference/_meta.en-US.json @@ -3,27 +3,20 @@ "title": "Tools", "description": "Useful articles to help you get up and running, work with the network, APIs or simply learn key terms." }, - "network": { - "title": "RPC & Contracts", - "description": "RPC/API endpoints and protocol contract addresses" + "details": { + "title": "Network Details", + "description": "ZetaChain testnet and mainnet details.", + "readTime": "5 min" }, - "cli": { - "title": "CLI", - "description": "Command line interface for building and interacting with universal apps" + "api": { + "title": "RPC/API Endpoints", + "description": "API endpoints that can be used to interact with ZetaChain.", + "readTime": "5 min" }, - "localnet": { - "title": "Localnet", - "readTime": "30 min", - "description": "Build and interact with your universal app in a local dev environment" - }, - "toolkit": { - "title": "Toolkit", - "readTime": "30 min", - "description": "TypeScript SDK for building universal apps" - }, - "registry": { - "title": "Contract Registry", - "description": "Registry of protocol contracts deployed on ZetaChain and connected chains" + "openapi": { + "title": "ZetaChain HTTP API", + "description": "Swagger documentation for the API of ZetaChain.", + "readTime": "15 min" }, "faucet": { "title": "Faucet", @@ -35,12 +28,8 @@ "title": "Explorers", "description": "Block explorers for ZetaChain mainnet and testnet" }, - "mcp": { - "title": "MCP", - "description": "Add ZetaChain MCP server to Cursor or Claude Code" - }, "tools": { "title": "More Tools", "description": "More useful tools and resources" } -} \ No newline at end of file +} diff --git a/src/pages/reference/_meta.zh-CN.json b/src/pages/reference/_meta.zh-CN.json index d456b3934..dc6eaafc6 100644 --- a/src/pages/reference/_meta.zh-CN.json +++ b/src/pages/reference/_meta.zh-CN.json @@ -2,20 +2,14 @@ "overview": { "title": "工具" }, - "network": { - "title": "RPC 与合约" + "details": { + "title": "网络详情" }, - "cli": { - "title": "CLI" + "api": { + "title": "RPC / API 端点" }, - "localnet": { - "title": "本地网络" - }, - "toolkit": { - "title": "工具包" - }, - "registry": { - "title": "合约注册表" + "openapi": { + "title": "ZetaChain HTTP API" }, "faucet": { "title": "水龙头" @@ -23,9 +17,6 @@ "explorers": { "title": "区块浏览器" }, - "mcp": { - "title": "MCP" - }, "tools": { "title": "更多工具" } diff --git a/src/pages/reference/network/api.en-US.mdx b/src/pages/reference/api.en-US.mdx similarity index 100% rename from src/pages/reference/network/api.en-US.mdx rename to src/pages/reference/api.en-US.mdx diff --git a/src/pages/reference/network/api.zh-CN.mdx b/src/pages/reference/api.zh-CN.mdx similarity index 100% rename from src/pages/reference/network/api.zh-CN.mdx rename to src/pages/reference/api.zh-CN.mdx diff --git a/src/pages/reference/cli.en-US.mdx b/src/pages/reference/cli.en-US.mdx deleted file mode 100644 index efc4b2d3d..000000000 --- a/src/pages/reference/cli.en-US.mdx +++ /dev/null @@ -1,1539 +0,0 @@ -# ZetaChain CLI - -A command-line interface for building and interacting with -[ZetaChain](https://www.zetachain.com) universal applications. Seamlessly -interact with EVM, Solana, Bitcoin, Sui, and TON, all from one CLI. - -## ✨ Features - -- Scaffold new ZetaChain universal apps from templates -- Spin up a local multi-chain development environment (EVM, Solana, etc.) in one - command -- Query cross-chain fees, contracts, balances, cross-chain transaction, tokens, - and more -- Make cross-chain calls between Solana, Sui, Bitcoin, TON, and universal apps - on ZetaChain -- Transfer supported tokens across connected chains - -## ✅ Prerequisites - -- Node.js ≥ 18 -- Git (for template cloning) -- (Optional) Docker ≥ 24 for `localnet` - -## 🚀 Quick Start - -Run without installing: - -```bash -npx zetachain@next new -``` - -Or install globally: - -```bash -npm install -g zetachain@latest -``` - -Use `zetachain@next` for bleeding-edge builds. - -## 📘 Examples - -Create a new project: - -```bash -zetachain new -``` - -Start localnet: - -```bash -zetachain localnet start -``` - -Query cross-chain balances: - -```bash -zetachain query balances -``` - -## 🤖 MCP Server Installation - -The ZetaChain CLI can be used as an MCP (Model Context Protocol) server, allowing AI assistants like Claude Code and Cursor to execute ZetaChain commands. - -### Local Installation (Recommended) - -Install locally for full access to your filesystem, accounts, and localnet: - -```bash -npm install -g zetachain -zetachain mcp install --client claude # for Claude Code -# or -zetachain mcp install --client cursor # for Cursor -``` - -Then restart your AI editor to activate the MCP server. - -**Check installation status:** -```bash -zetachain mcp list -``` - -**Remove:** -```bash -zetachain mcp remove --client claude -``` - -### Cloud Installation (Smithery) - -For quick setup without local installation, visit [Smithery](https://smithery.ai/server/@zeta-chain/cli) and click "One-Click Install". - -⚠️ **Note**: The cloud version runs on remote servers and cannot access your local files, accounts, or localnet. - -## 🧭 CLI Reference - -For full command documentation: - -```bash -zetachain docs -``` - -Or use `--help` with any command: - -```bash -zetachain accounts --help -``` - -## 🤝 Contributing - -We welcome contributions! Please open issues or submit pull requests. - -## 📚 Learn More - -- [ZetaChain Docs](https://www.zetachain.com/docs) -- [CLI Docs](https://www.zetachain.com/docs/reference/cli/) -- [Join Discord](https://discord.gg/zetachain) - -## zetachain new - -``` -Usage: zetachain new [options] - -Create a new universal contract project. - -Options: - --verbose Enable verbose logging - --output Specify custom output directory or name - --project Specify the example project to use and skip the - prompt - -h, --help display help for command - -``` - -## zetachain accounts - -``` -Usage: zetachain accounts [options] [command] - -Manages accounts for all connected chains in the ZetaChain CLI. Supports -creating new accounts, importing existing ones, listing all accounts, showing -details, and deleting accounts. - -Accounts are stored locally in the CLI's key management system and can be used -across all supported networks. - -Options: - -h, --help display help for command - -Commands: - create [options] Create a new account - delete [options] Delete an existing account - import [options] Import an existing account - list [options] List all stored accounts - show [options] View details of a specific account - -``` - -## zetachain accounts create - -``` -Usage: zetachain accounts create [options] - -Generates a new account for the specified chain type. - -You can name the account for easier identification; if no name is provided, it -defaults to default. - -Options: - --type Chain type (choices: "evm", "solana", "sui", "bitcoin", "ton") - --name Account name (default: "default") - -h, --help display help for command - -``` - -## zetachain accounts delete - -``` -Usage: zetachain accounts delete [options] - -Removes an account from the local key store. You must provide both the chain -type and account name. - -Options: - --type Chain type (choices: "evm", "solana", "sui", "bitcoin", "ton") - --name Account name - -h, --help display help for command - -``` - -## zetachain accounts import - -``` -Usage: zetachain accounts import [options] - -Adds an account to the local key store using a private key or mnemonic phrase. - -You can choose the chain type and give the account a name. - -Options: - --type Chain type (choices: "evm", "solana", "sui", "bitcoin", - "ton") - --name Account name (default: "default") - --private-key Private key in hex format - --mnemonic Mnemonic phrase - -h, --help display help for command - -``` - -## zetachain accounts list - -``` -Usage: zetachain accounts list [options] - -Display all accounts currently stored locally in the CLI key store - -Options: - --json Output in JSON format - -h, --help display help for command - -``` - -## zetachain accounts show - -``` -Usage: zetachain accounts show [options] - -Show the address, public key, and other details for a specific account. You must -provide the chain type and account name. - -Options: - --type Chain type (choices: "evm", "solana", "sui", "bitcoin", "ton") - --name Account name - -h, --help display help for command - -``` - -## zetachain query - -``` -Usage: zetachain query|q [options] [command] - -Provides a set of tools to fetch on-chain data from ZetaChain and its connected -chains. - -You can retrieve balances, token information, supported chain details, -cross-chain transaction status, and fee estimates for cross-chain operations. - -Options: - -h, --help display help for command - -Commands: - balances [options] Fetch native and ZRC-20 token balances - cctx [options] Track the status of a cross-chain transaction. - contracts Contract registry commands - fees Fees commands - tokens|t Work with tokens on ZetaChain - chains|c View connected chain information - -``` - -## zetachain query balances - -``` -Usage: zetachain query balances [options] - -Retrieve token balances across connected chains - -Options: - --evm
    Address on EVM chains - --solana
    Address on Solana - --bitcoin
    Address on Bitcoin - --sui
    Address on Sui - --ton
    Address on TON - --name Account name - --network Network to use (choices: "mainnet", "testnet", default: - "testnet") - --json Output balances as JSON - --show-zero Include zero balances in output (default: false) - -h, --help display help for command - -``` - -## zetachain query cctx - -``` -Usage: zetachain query cctx [options] - -Queries the real-time status of a cross-chain transaction by its inbound -transaction hash. You can control polling frequency, timeout, and target RPC -endpoint. - -Options: - --hash Inbound transaction hash - -r, --rpc RPC endpoint (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - -d, --delay Delay between polling rounds in milliseconds (default: - "2000") - -t, --timeout Timeout duration in milliseconds (default: indefinite) - (default: "0") - -h, --help display help for command - -``` - -## zetachain query contracts - -``` -Usage: zetachain query contracts [options] [command] - -Contract registry commands - -Options: - -h, --help display help for command - -Commands: - list|l [options] List protocol contracts on all connected chains - show|s [options] Show a protocol contract address on a specific chain - -``` - -## zetachain query contracts list - -``` -Usage: zetachain query contracts list|l [options] - -Options: - --rpc Custom RPC URL (default: - "https://zetachain-athens-evm.blockpi.network/v1/rpc/public") - --json Output contracts as JSON - --columns Additional columns to show (choices: "type", "address", - default: ["type","address"]) - -h, --help display help for command - -``` - -## zetachain query contracts show - -``` -Usage: zetachain query contracts show|s [options] - -Options: - --rpc Custom RPC URL (default: - "https://zetachain-athens-evm.blockpi.network/v1/rpc/public") - -c, --chain-id Chain ID - -t, --type Contract type - -h, --help display help for command - -``` - -## zetachain query fees - -``` -Usage: zetachain query fees [options] [command] - -Fees commands - -Options: - -h, --help display help for command - -Commands: - list [options] List withdraw gas fees - show [options] Show withdraw gas fee for a target ZRC-20, with optional - source conversion - -``` - -## zetachain query fees list - -``` -Usage: zetachain query fees list [options] - -List withdraw gas fees for all ZRC-20 tokens - -Options: - --api API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --rpc RPC endpoint URL (default: - "https://zetachain-athens-evm.blockpi.network/v1/rpc/public") - --gas-limit Gas limit for withdraw and call transactions - --json Output in JSON format - -h, --help display help for command - -``` - -## zetachain query fees show - -``` -Usage: zetachain query fees show [options] - -Show withdraw gas fee for a target ZRC-20, with optional source conversion - -Options: - --target
    Target ZRC-20 token address - --gas-limit Optional gas limit to compute withdraw fee with - --target-chain Target chain ID to auto-resolve gas token ZRC-20 - --source
    Source ZRC-20 token address - --source-chain Source chain ID to auto-resolve source ZRC-20 - --rpc RPC endpoint URL (default: - "https://zetachain-athens-evm.blockpi.network/v1/rpc/public") - --router
    UniswapV2 router address (default: - "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe") - --api API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --json Output results in JSON format - -h, --help display help for command - -``` - -## zetachain query tokens - -``` -Usage: zetachain query tokens|t [options] [command] - -Provides commands to list all available ZRC-20 tokens or view detailed -information about a specific token. Useful for discovering token metadata, -contract addresses, and supported chains. - -Options: - -h, --help display help for command - -Commands: - list|l [options] List all ZRC-20 tokens - show|s [options] Show details for a ZRC-20 token - -``` - -## zetachain query tokens list - -``` -Usage: zetachain query tokens list|l [options] - -Fetch and display all registered ZRC-20 tokens on ZetaChain - -Options: - --api API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --json Output in JSON format - --columns Additional columns to display (choices: "asset", - "type", "decimals", default: []) - -h, --help display help for command - -``` - -## zetachain query tokens show - -``` -Usage: zetachain query tokens show|s [options] - -Display detailed information about a specific ZRC-20 token by symbol; supports -returning a single field for scripting - -Options: - --api API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --symbol -s Token symbol (e.g., POL.AMOY, USDC.BSC) - --field -f Return only a specific field value. Use 'zrc20' as - shorthand for 'zrc20_contract_address' - --json Output in JSON format - -h, --help display help for command - -``` - -## zetachain query chains - -``` -Usage: zetachain query chains|c [options] [command] - -Provides commands to list all chains connected to ZetaChain or view details -about a specific chain by name or chain ID. - -Options: - -h, --help display help for command - -Commands: - list|l [options] List all connected chains - show|s [options] Show details for a connected chain - -``` - -## zetachain query chains list - -``` -Usage: zetachain query chains list|l [options] - -Retrieve a list of all supported chains connected to ZetaChain - -Options: - --api API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --json Output in JSON format - -h, --help display help for command - -``` - -## zetachain query chains show - -``` -Usage: zetachain query chains show|s [options] - -Fetches detailed information about a connected chain by name or chain ID. You -can query both testnet and mainnet endpoints, and optionally return only a -specific field for scripting. - -Options: - --api-testnet Testnet API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --api-mainnet Mainnet API endpoint URL (default: - "https://zetachain.blockpi.network/lcd/v1/public") - --chain-name Chain name - -c, --chain-id Chain ID - --field -f Return only a specific field value - --json Output in JSON format - -h, --help display help for command - -``` - -## zetachain faucet - -``` -Usage: zetachain faucet [options] - -Request testnet ZETA tokens from the faucet - -Options: - --address
    Recipient address. - --name Account name to use if address not provided (default: - "default") - -h, --help display help for command - -``` - -## zetachain zetachain - -``` -Usage: zetachain zetachain|z [options] [command] - -Provides commands to call contracts, withdraw tokens, or withdraw tokens and -call contracts on any connected chain from ZetaChain. Supports both pure -contract calls and calls with asset transfers, with full control over gas -limits, revert handling, and execution parameters. - -Options: - -h, --help display help for command - -Commands: - call [options] Call a contract on a connected chain from - ZetaChain - withdraw [options] Withdraw tokens from ZetaChain to a connected - chain - withdraw-and-call [options] Withdraw tokens and call a contract on a - connected chain - -``` - -## zetachain zetachain call - -``` -Usage: zetachain zetachain call [options] - -Executes a contract call from ZetaChain to a connected chain without -transferring tokens. You can specify the destination contract, function -signature, parameters, and advanced options like revert handling and gas -settings. - -Options: - --zrc20
    ZRC-20 token address to pay cross-chain fees - --receiver
    Receiver contract address on the connected - chain (non-hex strings will be encoded) - --name Account name (default: "default") - --chain-id Chain ID of the destination network - --private-key Private key for signing transactions - --rpc ZetaChain RPC URL - --gateway
    Gateway contract address on ZetaChain - --revert-address
    Address to receive tokens if the transaction - reverts (default: - "0x0000000000000000000000000000000000000000") - --abort-address
    Address to receive tokens if transaction is - aborted (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Call onRevert handler if the transaction - fails (default: false) - --on-revert-gas-limit Gas limit for the revert transaction - (default: "1000000") - --revert-message Message to include in the revert call - (default: "0x") - --tx-options-gas-limit Gas limit for the transaction (default: - "1000000") - --tx-options-gas-price Gas price for the transaction (default: - "10000000000") - --call-options-gas-limit Gas limit for the contract call on the - connected chain (default: "1000000") - --call-options-is-arbitrary-call Call any function (--function is required) - (default: false) - --yes Skip confirmation prompt (default: false) - --function Function signature to call (example: - "hello(string)") - --types List of parameter types (e.g. uint256 - address) - --values Parameter values for the function call - --data Raw data - -h, --help display help for command - -``` - -## zetachain zetachain withdraw - -``` -Usage: zetachain zetachain withdraw [options] - -Send tokens from ZetaChain to a connected chain without making a contract call. -Specify the receiver address, token amount, and advanced execution options. - -Options: - --zrc20
    ZRC-20 token address to pay cross-chain fees - --receiver
    Receiver contract address on the connected - chain (non-hex strings will be encoded) - --name Account name (default: "default") - --chain-id Chain ID of the destination network - --private-key Private key for signing transactions - --rpc ZetaChain RPC URL - --gateway
    Gateway contract address on ZetaChain - --revert-address
    Address to receive tokens if the transaction - reverts (default: - "0x0000000000000000000000000000000000000000") - --abort-address
    Address to receive tokens if transaction is - aborted (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Call onRevert handler if the transaction - fails (default: false) - --on-revert-gas-limit Gas limit for the revert transaction - (default: "1000000") - --revert-message Message to include in the revert call - (default: "0x") - --tx-options-gas-limit Gas limit for the transaction (default: - "1000000") - --tx-options-gas-price Gas price for the transaction (default: - "10000000000") - --call-options-gas-limit Gas limit for the contract call on the - connected chain (default: "1000000") - --call-options-is-arbitrary-call Call any function (--function is required) - (default: false) - --yes Skip confirmation prompt (default: false) - --amount The amount of tokens to withdraw - -h, --help display help for command - -``` - -## zetachain zetachain withdraw-and-call - -``` -Usage: zetachain zetachain withdraw-and-call [options] - -Combines token withdrawal from ZetaChain with a contract call on the connected -chain in a single transaction. Supports full control over function parameters, -gas settings, and revert handling. - -Options: - --zrc20
    ZRC-20 token address to pay cross-chain fees - --receiver
    Receiver contract address on the connected - chain (non-hex strings will be encoded) - --name Account name (default: "default") - --chain-id Chain ID of the destination network - --private-key Private key for signing transactions - --rpc ZetaChain RPC URL - --gateway
    Gateway contract address on ZetaChain - --revert-address
    Address to receive tokens if the transaction - reverts (default: - "0x0000000000000000000000000000000000000000") - --abort-address
    Address to receive tokens if transaction is - aborted (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Call onRevert handler if the transaction - fails (default: false) - --on-revert-gas-limit Gas limit for the revert transaction - (default: "1000000") - --revert-message Message to include in the revert call - (default: "0x") - --tx-options-gas-limit Gas limit for the transaction (default: - "1000000") - --tx-options-gas-price Gas price for the transaction (default: - "10000000000") - --call-options-gas-limit Gas limit for the contract call on the - connected chain (default: "1000000") - --call-options-is-arbitrary-call Call any function (--function is required) - (default: false) - --yes Skip confirmation prompt (default: false) - --amount The amount of tokens to withdraw - --function Function signature to call (example: - "hello(string)") - --types List of parameter types (e.g. uint256 - address) - --values Parameter values for the function call - --data Raw data for non-EVM chains like Solana - -h, --help display help for command - -``` - -## zetachain evm - -``` -Usage: zetachain evm [options] [command] - -Interact from EVM chains: call contracts on ZetaChain or deposit tokens (with or -without a call). - -Options: - -h, --help display help for command - -Commands: - call [options] Call a contract on ZetaChain from an - EVM-compatible chain - deposit-and-call [options] Deposit tokens and call a contract on ZetaChain - from an EVM-compatible chain - deposit [options] Deposit tokens to ZetaChain from an EVM-compatible - chain - -``` - -## zetachain evm call - -``` -Usage: zetachain evm call [options] - -Call a contract on ZetaChain from an EVM-compatible chain - -Options: - --chain-id Chain ID of the network - --receiver
    Receiver address on ZetaChain - --name Account name (default: "default") - --private-key Private key for signing transactions - --rpc RPC URL for the source chain - --gateway
    EVM Gateway address - --revert-address
    Address to revert to in case of failure - (default: signer address) - --abort-address
    Address to receive funds if aborted (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Whether to call revert address on failure - (default: false) - --on-revert-gas-limit Gas limit for revert operation (default: - "200000") - --revert-message Message to include in revert (default: "") - --gas-limit Gas limit for the transaction - --gas-price Gas price for the transaction - --yes Skip confirmation prompt (default: false) - --types List of parameter types (e.g. uint256 address) - --values Parameter values for the function call - -h, --help display help for command - -``` - -## zetachain evm deposit-and-call - -``` -Usage: zetachain evm deposit-and-call [options] - -Deposit tokens and call a contract on ZetaChain from an EVM-compatible chain - -Options: - --chain-id Chain ID of the network - --receiver
    Receiver address on ZetaChain - --name Account name (default: "default") - --private-key Private key for signing transactions - --rpc RPC URL for the source chain - --gateway
    EVM Gateway address - --revert-address
    Address to revert to in case of failure - (default: signer address) - --abort-address
    Address to receive funds if aborted (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Whether to call revert address on failure - (default: false) - --on-revert-gas-limit Gas limit for revert operation (default: - "200000") - --revert-message Message to include in revert (default: "") - --gas-limit Gas limit for the transaction - --gas-price Gas price for the transaction - --yes Skip confirmation prompt (default: false) - --amount Amount of tokens to deposit - --erc20
    ERC20 token address (optional for native token - deposits) - --types List of parameter types (e.g. uint256 address) - --values Parameter values for the function call - -h, --help display help for command - -``` - -## zetachain evm deposit - -``` -Usage: zetachain evm deposit [options] - -Deposit tokens to ZetaChain from an EVM-compatible chain - -Options: - --chain-id Chain ID of the network - --receiver
    Receiver address on ZetaChain - --name Account name (default: "default") - --private-key Private key for signing transactions - --rpc RPC URL for the source chain - --gateway
    EVM Gateway address - --revert-address
    Address to revert to in case of failure - (default: signer address) - --abort-address
    Address to receive funds if aborted (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Whether to call revert address on failure - (default: false) - --on-revert-gas-limit Gas limit for revert operation (default: - "200000") - --revert-message Message to include in revert (default: "") - --gas-limit Gas limit for the transaction - --gas-price Gas price for the transaction - --yes Skip confirmation prompt (default: false) - --amount Amount of tokens to deposit - --erc20
    ERC20 token address (optional for native token - deposits) - -h, --help display help for command - -``` - -## zetachain solana - -``` -Usage: zetachain solana [options] [command] - -Interact from Solana: call contracts on ZetaChain or deposit tokens (with or -without a call). - -Options: - -h, --help display help for command - -Commands: - call [options] Call a contract on ZetaChain from Solana - deposit-and-call [options] Deposit tokens from Solana and call a contract on - ZetaChain - deposit [options] Deposit tokens from Solana - encode [options] Encode payload data for Solana - -``` - -## zetachain solana call - -``` -Usage: zetachain solana call [options] - -Call a universal contract on ZetaChain from Solana - -Options: - --receiver EOA or contract address on ZetaChain - --mnemonic Mnemonic - --name Name of the wallet (default: "default") - --private-key Private key in base58 or hex format (with optional 0x prefix) - --chain-id Chain ID of the network - --revert-address Revert address - --abort-address Abort address (default: "0x0000000000000000000000000000000000000000") - --call-on-revert Call on revert (default: false) - --revert-message Revert message (default: "") - --on-revert-gas-limit On revert gas limit (default: "0") - --types List of parameter types (e.g. uint256 address) - --values Parameter values for the function call - -h, --help display help for command - -``` - -## zetachain solana deposit-and-call - -``` -Usage: zetachain solana deposit-and-call [options] - -Deposit tokens from Solana and call a universal contract on ZetaChain - -Options: - --receiver EOA or contract address on ZetaChain - --mnemonic Mnemonic - --name Name of the wallet (default: "default") - --private-key Private key in base58 or hex format (with optional 0x prefix) - --chain-id Chain ID of the network - --revert-address Revert address - --abort-address Abort address (default: "0x0000000000000000000000000000000000000000") - --call-on-revert Call on revert (default: false) - --revert-message Revert message (default: "") - --on-revert-gas-limit On revert gas limit (default: "0") - --amount Amount of tokens to deposit - --token-program Token program (default: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA") - --types List of parameter types (e.g. uint256 address) - --values Parameter values for the function call - --mint SPL token mint address - -h, --help display help for command - -``` - -## zetachain solana deposit - -``` -Usage: zetachain solana deposit [options] - -Options: - --receiver EOA or contract address on ZetaChain - --mnemonic Mnemonic - --name Name of the wallet (default: "default") - --private-key Private key in base58 or hex format (with optional 0x prefix) - --chain-id Chain ID of the network - --revert-address Revert address - --abort-address Abort address (default: "0x0000000000000000000000000000000000000000") - --call-on-revert Call on revert (default: false) - --revert-message Revert message (default: "") - --on-revert-gas-limit On revert gas limit (default: "0") - --amount Amount of tokens to deposit - --token-program Token program (default: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA") - --mint SPL token mint address - -h, --help display help for command - -``` - -## zetachain solana encode - -``` -Usage: zetachain solana encode [options] - -Options: - --connected
    Connected program address - --data Data to encode - --gateway
    Gateway program address - --mint
    Mint address for SPL token operations - --accounts Additional accounts in format 'address:isWritable' - -h, --help display help for command - -``` - -## zetachain sui - -``` -Usage: zetachain sui [options] [command] - -Interact from Sui: deposit tokens to ZetaChain or deposit and call contracts - -Options: - -h, --help display help for command - -Commands: - deposit-and-call [options] Deposit tokens from Sui and call a contract on - ZetaChain - deposit [options] Deposit tokens from Sui - encode [options] Encode payload data for SUI - -``` - -## zetachain sui deposit-and-call - -``` -Usage: zetachain sui deposit-and-call [options] - -Options: - --mnemonic Mnemonic for the account - --private-key Private key for the account - --gateway-object Gateway object ID - --gateway-package Gateway package ID - --receiver Receiver address on ZetaChain - --amount Amount to deposit in decimal format - --chain-id Chain ID - --coin-type Coin type to deposit (default: - "0x2::sui::SUI") - --gas-budget Gas budget in MIST (default: "10000000") - --name Account name (default: "default") - --decimals Number of decimals for the coin type - (default: "9") - --values Parameter values for the function call - --types List of parameter types (e.g. uint256 - address) - -h, --help display help for command - -``` - -## zetachain sui deposit - -``` -Usage: zetachain sui deposit [options] - -Options: - --mnemonic Mnemonic for the account - --private-key Private key for the account - --gateway-object Gateway object ID - --gateway-package Gateway package ID - --receiver Receiver address on ZetaChain - --amount Amount to deposit in decimal format - --chain-id Chain ID - --coin-type Coin type to deposit (default: - "0x2::sui::SUI") - --gas-budget Gas budget in MIST (default: "10000000") - --name Account name (default: "default") - --decimals Number of decimals for the coin type - (default: "9") - -h, --help display help for command - -``` - -## zetachain sui encode - -``` -Usage: zetachain sui encode [options] - -Options: - --data Data to encode - --type-arguments Type arguments for the encoding - --objects Objects to include in the encoding - (comma-separated) - -h, --help display help for command - -``` - -## zetachain ton - -``` -Usage: zetachain ton [options] [command] - -Interact from TON: deposit TON to ZetaChain or deposit and call contracts - -Options: - -h, --help display help for command - -Commands: - deposit-and-call [options] Deposit TON and call a contract on ZetaChain - deposit [options] Deposit tokens from TON - -``` - -## zetachain ton deposit-and-call - -``` -Usage: zetachain ton deposit-and-call [options] - -Deposit TON and call a universal contract on ZetaChain - -Options: - --mnemonic Mnemonic for the account - --name Name of the account (default: "default") - --gateway Gateway contract address (default: testnet) - --receiver Receiver address - --rpc RPC endpoint (default: testnet) (default: - "https://testnet.toncenter.com/api/v2/jsonRPC") - --api-key API key - --chain-id Chain ID - --amount Amount in TON - --types ABI types - --values Values corresponding to types - --data Data to call the contract with - -h, --help display help for command - -``` - -## zetachain ton deposit - -``` -Usage: zetachain ton deposit [options] - -Deposit tokens to an EOA or a contract on ZetaChain - -Options: - --mnemonic Mnemonic for the account - --name Name of the account (default: "default") - --gateway Gateway contract address (default: testnet) - --receiver Receiver address - --rpc RPC endpoint (default: testnet) (default: - "https://testnet.toncenter.com/api/v2/jsonRPC") - --api-key API key - --chain-id Chain ID - --amount Amount in TON - -h, --help display help for command - -``` - -## zetachain bitcoin - -``` -Usage: zetachain bitcoin|b [options] [command] - -Work with Bitcoin to deposit BTC to ZetaChain or call contracts using -inscriptions or OP_RETURN memo. - -Options: - -h, --help display help for command - -Commands: - inscription|i Make a transaction using inscriptions - memo|m Make a transaction using a memo (OP_RETURN) - -``` - -## zetachain bitcoin inscription - -``` -Usage: zetachain bitcoin inscription|i [options] [command] - -Use Bitcoin inscriptions to deposit BTC to ZetaChain or call contracts - -Options: - -h, --help display help for command - -Commands: - call [options] Call a contract on ZetaChain - deposit-and-call [options] Deposit BTC and call a contract on ZetaChain - deposit [options] Deposit BTC to ZetaChain - encode [options] Encode data for Bitcoin transactions using ABI - encoding - -``` - -## zetachain bitcoin inscription call - -``` -Usage: zetachain bitcoin inscription call [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - --revert-address
    Revert address - --abort-address
    Abort address - --revert-message Revert message - --network Network (choices: "signet", "mainnet", default: - "signet") - --format Encoding format (choices: "ABI", "CompactLong", - "CompactShort", default: "ABI") - --data Pass raw data - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -t, --types ABI types - -v, --values Values corresponding to types - -h, --help display help for command - -``` - -## zetachain bitcoin inscription deposit-and-call - -``` -Usage: zetachain bitcoin inscription deposit-and-call [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - --revert-address
    Revert address - --abort-address
    Abort address - --revert-message Revert message - --network Network (choices: "signet", "mainnet", default: - "signet") - --format Encoding format (choices: "ABI", "CompactLong", - "CompactShort", default: "ABI") - --data Pass raw data - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -t, --types ABI types - -v, --values Values corresponding to types - -a, --amount BTC amount to send (in BTC) - -h, --help display help for command - -``` - -## zetachain bitcoin inscription deposit - -``` -Usage: zetachain bitcoin inscription deposit [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - --revert-address
    Revert address - --abort-address
    Abort address - --revert-message Revert message - --network Network (choices: "signet", "mainnet", default: - "signet") - --format Encoding format (choices: "ABI", "CompactLong", - "CompactShort", default: "ABI") - --data Pass raw data - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -a, --amount BTC amount to send (in BTC) - -h, --help display help for command - -``` - -## zetachain bitcoin inscription encode - -``` -Usage: zetachain bitcoin inscription encode [options] - -Options: - -r, --receiver
    Receiver address - -t, --types ABI types (e.g. string uint256) (default: []) - -v, --values Values corresponding to types (default: []) - -a, --revert-address
    Bitcoin revert address - -o, --op-code Operation code (choices: "Call", "Deposit", - "DepositAndCall", "Invalid", default: - "DepositAndCall") - -f, --format Encoding format (choices: "ABI", - "CompactLong", "CompactShort", default: "ABI") - -h, --help display help for command - -``` - -## zetachain bitcoin memo - -``` -Usage: zetachain bitcoin memo|m [options] [command] - -Use OP_RETURN memo to deposit BTC to ZetaChain or call contracts - -Options: - -h, --help display help for command - -Commands: - call [options] Call a contract on ZetaChain - deposit-and-call [options] Deposit BTC and call a contract on ZetaChain - deposit [options] Deposit BTC to ZetaChain - -``` - -## zetachain bitcoin memo call - -``` -Usage: zetachain bitcoin memo call [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - -d, --data Pass raw data - --network-fee Network fee (in sats) (default: "1750") - --network Network (choices: "signet", "mainnet", default: - "signet") - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -h, --help display help for command - -``` - -## zetachain bitcoin memo deposit-and-call - -``` -Usage: zetachain bitcoin memo deposit-and-call [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - -d, --data Pass raw data - --network-fee Network fee (in sats) (default: "1750") - --network Network (choices: "signet", "mainnet", default: - "signet") - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -a, --amount BTC amount to send (in BTC) - -h, --help display help for command - -``` - -## zetachain bitcoin memo deposit - -``` -Usage: zetachain bitcoin memo deposit [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - -d, --data Pass raw data - --network-fee Network fee (in sats) (default: "1750") - --network Network (choices: "signet", "mainnet", default: - "signet") - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -a, --amount BTC amount to send (in BTC) - -h, --help display help for command - -``` - -## zetachain localnet - -``` -Usage: zetachain localnet [options] [command] - -Local development environment - -Options: - -h, --help display help for command - -Commands: - start [options] Start localnet - stop Stop localnet - check [options] Check if localnet is running - ton TON commands - -``` - -## zetachain localnet start - -``` -Usage: zetachain localnet start [options] - -Start localnet - -Options: - -p, --port Port to run anvil on (default: "8545") - -a, --anvil Additional arguments to pass to anvil (default: "-q") - -f, --force-kill Force kill any process on the port without prompting - (default: false) - -s, --stop-after-init Stop the localnet after successful initialization - (default: false) - -e, --exit-on-error Exit with an error if a call is reverted (default: - false) - -v, --verbosity Logger verbosity level (choices: "emerg", "alert", - "crit", "error", "warning", "notice", "info", - "debug", default: "info") - --chains [chains...] Chains to launch when starting localnet (choices: - "ton", "solana", "sui", default: []) - -h, --help display help for command - -``` - -## zetachain localnet stop - -``` -Usage: zetachain localnet stop [options] - -Stop localnet - -Options: - -h, --help display help for command - -``` - -## zetachain localnet check - -``` -Usage: zetachain localnet check [options] - -Check if localnet is running - -Options: - -d, --delay Seconds to wait before checking localnet (default: "3") - -h, --help display help for command - -``` - -## zetachain localnet ton - -``` -Usage: zetachain localnet ton [options] [command] - -TON commands - -Options: - -h, --help display help for command - -Commands: - balance [options] Show balance by address - faucet [options] Request TON from faucet - wallet [options] Create & fund a wallet - withdraw [options] Withdraw TON from gateway - help [command] display help for command - -``` - -## zetachain localnet ton balance - -``` -Usage: zetachain localnet ton balance [options] - -Show balance by address - -Options: - -a, --address
    Address - -h, --help display help for command - -``` - -## zetachain localnet ton faucet - -``` -Usage: zetachain localnet ton faucet [options] - -Request TON from faucet - -Options: - -a, --address
    Address - -m, --amount Amount in TON (default: "100") - -h, --help display help for command - -``` - -## zetachain localnet ton wallet - -``` -Usage: zetachain localnet ton wallet [options] - -Create & fund a wallet - -Options: - -m, --amount Amount to topup in TON (default: "100") - -h, --help display help for command - -``` - -## zetachain localnet ton withdraw - -``` -Usage: zetachain localnet ton withdraw [options] - -Withdraw TON from gateway - -Options: - -a, --address
    Recipient - -m, --amount Amount in TON (default: "1") - -k, --private-key Sender's private key on Zeta - -g, --gateway Gateway address on ZEVM - -t, --token TON.TON token address on ZEVM - -p, --port Anvil port (default: "8545") - -h, --help display help for command - -``` - -## zetachain mcp - -``` -Usage: zetachain mcp [options] [command] - -MCP server management commands - -Options: - -h, --help display help for command - -Commands: - install [options] Install ZetaChain MCP server for your AI editor - remove [options] Remove ZetaChain MCP server from your AI editor (removes - from all projects if applicable) - list List MCP server installation status for all supported - clients - -``` - -## zetachain mcp install - -``` -Usage: zetachain mcp install [options] - -Install ZetaChain MCP server for your AI editor - -Options: - -c, --client AI client to install for (choices: "claude", "cursor") - -h, --help display help for command - -``` - -## zetachain mcp remove - -``` -Usage: zetachain mcp remove [options] - -Remove ZetaChain MCP server from your AI editor (removes from all projects if -applicable) - -Options: - -c, --client AI client to remove from (choices: "claude", "cursor") - -h, --help display help for command - -``` - -## zetachain mcp list - -``` -Usage: zetachain mcp list [options] - -List MCP server installation status for all supported clients - -Options: - -h, --help display help for command - -``` - -## zetachain docs - -``` -Usage: zetachain docs [options] - -Display help information for all available commands and their subcommands - -Options: - --json Output documentation as JSON (tools schema) - -h, --help display help for command - -``` - -## zetachain ask - -``` -Usage: zetachain ask [options] [prompt...] - -Chat with ZetaChain Docs AI - -Arguments: - prompt Prompt to send to AI - -Options: - -h, --help display help for command - -``` diff --git a/src/pages/reference/cli.zh-CN.mdx b/src/pages/reference/cli.zh-CN.mdx deleted file mode 100644 index ae95ce567..000000000 --- a/src/pages/reference/cli.zh-CN.mdx +++ /dev/null @@ -1,1265 +0,0 @@ -# ZetaChain CLI - -一个用于构建与交互 [ZetaChain](https://www.zetachain.com) 全链应用的命令行工具。通过同一个 CLI 即可无缝操作 EVM、Solana、Bitcoin、Sui 与 TON。 - -## ✨ 功能 - -- 基于模板快速搭建新的 ZetaChain 全链应用 -- 一条命令启动涵盖 EVM、Solana 等多链的本地开发环境 -- 查询跨链手续费、合约、余额、跨链交易、代币等信息 -- 在 Solana、Sui、Bitcoin、TON 与 ZetaChain 全链应用之间发起跨链调用 -- 在已连接的链之间转移受支持的代币 - -## ✅ 前置条件 - -- Node.js ≥ 18 -- Git(用于克隆模板) -- (可选)Docker ≥ 24,用于 `localnet` - -## 🚀 快速开始 - -免安装运行: - -```bash -npx zetachain@next new -``` - -或全局安装: - -```bash -npm install -g zetachain@latest -``` - -若需体验最新功能,请使用 `zetachain@next`。 - -## 📘 示例 - -创建新项目: - -```bash -zetachain new -``` - -启动本地网络: - -```bash -zetachain localnet start -``` - -查询跨链余额: - -```bash -zetachain query balances -``` - -## 🧭 CLI 参考 - -查看完整命令文档: - -```bash -zetachain docs -``` - -也可以在任意命令后使用 `--help`: - -```bash -zetachain accounts --help -``` - -## 🤝 参与贡献 - -欢迎贡献代码或反馈问题,随时提交 Issue 或 Pull Request。 - -## 📚 延伸阅读 - -- [ZetaChain 文档](https://www.zetachain.com/docs) -- [CLI 文档](https://www.zetachain.com/docs/reference/cli/) -- [加入 Discord](https://discord.gg/zetachain) - -## zetachain new - -``` -Usage: zetachain new [options] - -Create a new universal contract project. - -Options: - --verbose Enable verbose logging - --output Specify custom output directory or name - --project Specify the example project to use and skip the - prompt - -h, --help display help for command - -``` - -## zetachain accounts - -``` -Usage: zetachain accounts [options] [command] - -Options: - -h, --help display help for command - -Commands: - create [options] Create a new account - delete [options] Delete an existing account - import [options] Import an existing account using either a private key or a - mnemonic - list [options] List all available accounts - show [options] Show details of an existing account - -``` - -## zetachain accounts create - -``` -Usage: zetachain accounts create [options] - -Options: - --type Account type (choices: "evm", "solana", "sui", "bitcoin", - "ton") - --name Account name (default: "default") - -h, --help display help for command - -``` - -## zetachain accounts delete - -``` -Usage: zetachain accounts delete [options] - -Options: - --type Account type (choices: "evm", "solana", "sui", "bitcoin", - "ton") - --name Account name - -h, --help display help for command - -``` - -## zetachain accounts import - -``` -Usage: zetachain accounts import [options] - -Import an existing account using either a private key or a mnemonic - -Options: - --type Account type (choices: "evm", "solana", "sui", "bitcoin", - "ton") - --name Account name (default: "default") - --private-key Private key in hex format - --mnemonic Mnemonic phrase - -h, --help display help for command - -``` - -## zetachain accounts list - -``` -Usage: zetachain accounts list [options] - -Options: - --json Output in JSON format - -h, --help display help for command - -``` - -## zetachain accounts show - -``` -Usage: zetachain accounts show [options] - -Options: - --type Account type (choices: "evm", "solana", "sui", "bitcoin", - "ton") - --name Account name - -h, --help display help for command - -``` - -## zetachain query - -``` -Usage: zetachain query|q [options] [command] - -Options: - -h, --help display help for command - -Commands: - balances [options] Fetch native and ZETA token balances - cctx [options] Query cross-chain transaction data in real-time - fees [options] Fetch omnichain and cross-chain messaging fees - tokens|t ZRC-20 token commands - chains|c Supported chains commands - -``` - -## zetachain query balances - -``` -Usage: zetachain query balances [options] - -Options: - --evm
    Fetch balances for a specific EVM address - --solana
    Fetch balances for a specific Solana address - --bitcoin
    Fetch balances for a specific Bitcoin address - --sui
    Fetch balances for a specific Sui address - --ton
    Fetch balances for a specific TON address - --name Account name - --network Network to use (choices: "mainnet", "testnet", default: - "testnet") - --json Output balances as JSON - --show-zero Include zero balances (default: false) - -h, --help display help for command - -``` - -## zetachain query cctx - -``` -Usage: zetachain query cctx [options] - -Query cross-chain transaction data in real-time - -Options: - -h, --hash Inbound transaction hash - -r, --rpc RPC endpoint (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - -d, --delay Delay between polling rounds in milliseconds (default: - "2000") - -t, --timeout Timeout duration in milliseconds (default: indefinite) - (default: "0") - --help display help for command - -``` - -## zetachain query fees - -``` -Usage: zetachain query fees [options] - -Fetch omnichain and cross-chain messaging fees - -Options: - --api API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --rpc RPC endpoint URL (default: - "https://zetachain-athens-evm.blockpi.network/v1/rpc/public") - --gas-limit Gas limit for withdraw and call - --json Output results in JSON format - -h, --help display help for command - -``` - -## zetachain query tokens - -``` -Usage: zetachain query tokens|t [options] [command] - -ZRC-20 token commands - -Options: - -h, --help display help for command - -Commands: - list|l [options] List all ZRC-20 tokens - show|s [options] Show detailed information for a specific ZRC-20 token - -``` - -## zetachain query tokens list - -``` -Usage: zetachain query tokens list|l [options] - -List all ZRC-20 tokens - -Options: - --api API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --json Output tokens as JSON - --columns Additional columns to show (choices: "asset", "type", - "decimals", default: []) - -h, --help display help for command - -``` - -## zetachain query tokens show - -``` -Usage: zetachain query tokens show|s [options] - -Show detailed information for a specific ZRC-20 token - -Options: - --api API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --symbol -s Token symbol (e.g., POL.AMOY, USDC.BSC) - --field -f Return specific field value (for scripting). Use 'zrc20' - as shorthand for 'zrc20_contract_address' - --json Output token as JSON - -h, --help display help for command - -``` - -## zetachain query chains - -``` -Usage: zetachain query chains|c [options] [command] - -Supported chains commands - -Options: - -h, --help display help for command - -Commands: - list|l [options] List all supported chains - show|s [options] Show detailed information for a specific chain (by chain - name or chain ID) - -``` - -## zetachain query chains list - -``` -Usage: zetachain query chains list|l [options] - -List all supported chains - -Options: - --api API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --json Output chains as JSON - -h, --help display help for command - -``` - -## zetachain query chains show - -``` -Usage: zetachain query chains show|s [options] - -Show detailed information for a specific chain (by chain name or chain ID) - -Options: - --api-testnet Testnet API endpoint URL (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public") - --api-mainnet Mainnet API endpoint URL (default: - "https://zetachain.blockpi.network/lcd/v1/public") - --chain-name Chain name - -c, --chain-id Chain ID - --field -f Return specific field value (for scripting) - --json Output chain as JSON - -h, --help display help for command - -``` - -## zetachain faucet - -``` -Usage: zetachain faucet [options] - -Request testnet ZETA tokens from the faucet. - -Options: - --address
    Recipient address. - --name Account name to use if address not provided (default: - "default") - -h, --help display help for command - -``` - -## zetachain zetachain - -``` -Usage: zetachain zetachain|z [options] [command] - -Options: - -h, --help display help for command - -Commands: - call [options] Call a contract on a connected chain from - ZetaChain - withdraw [options] Withdraw tokens from ZetaChain to a connected - chain - withdraw-and-call [options] Withdraw tokens from ZetaChain and call a - contract on a connected chain - -``` - -## zetachain zetachain call - -``` -Usage: zetachain zetachain call [options] - -Options: - --zrc20
    The address of ZRC-20 to pay fees - --receiver
    The address of the receiver contract on a - connected chain. Non-hex strings will be - automatically encoded to hex. - --name Account name (default: "default") - --chain-id Chain ID of the network - --private-key Private key for signing transactions - --rpc RPC URL of the network - --gateway
    Gateway contract address on ZetaChain - --revert-address
    Revert address (default: - "0x0000000000000000000000000000000000000000") - --abort-address
    Abort address (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Whether to call on revert (default: false) - --on-revert-gas-limit Gas limit for the revert transaction - (default: "1000000") - --revert-message Revert message (default: "0x") - --tx-options-gas-limit Gas limit for the transaction (default: - "1000000") - --tx-options-gas-price Gas price for the transaction (default: - "10000000000") - --call-options-gas-limit Gas limit for the call (default: "1000000") - --call-options-is-arbitrary-call Call any function (default: false) - --yes Skip confirmation prompt (default: false) - --function Function to call (example: "hello(string)") - --types List of parameter types (e.g. uint256 - address) - --values Parameter values for the function call - --data Raw data for non-EVM chains like Solana - -h, --help display help for command - -``` - -## zetachain zetachain withdraw - -``` -Usage: zetachain zetachain withdraw [options] - -Options: - --zrc20
    The address of ZRC-20 to pay fees - --receiver
    The address of the receiver contract on a - connected chain. Non-hex strings will be - automatically encoded to hex. - --name Account name (default: "default") - --chain-id Chain ID of the network - --private-key Private key for signing transactions - --rpc RPC URL of the network - --gateway
    Gateway contract address on ZetaChain - --revert-address
    Revert address (default: - "0x0000000000000000000000000000000000000000") - --abort-address
    Abort address (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Whether to call on revert (default: false) - --on-revert-gas-limit Gas limit for the revert transaction - (default: "1000000") - --revert-message Revert message (default: "0x") - --tx-options-gas-limit Gas limit for the transaction (default: - "1000000") - --tx-options-gas-price Gas price for the transaction (default: - "10000000000") - --call-options-gas-limit Gas limit for the call (default: "1000000") - --call-options-is-arbitrary-call Call any function (default: false) - --yes Skip confirmation prompt (default: false) - --amount The amount of tokens to withdraw - -h, --help display help for command - -``` - -## zetachain zetachain withdraw-and-call - -``` -Usage: zetachain zetachain withdraw-and-call [options] - -Options: - --zrc20
    The address of ZRC-20 to pay fees - --receiver
    The address of the receiver contract on a - connected chain. Non-hex strings will be - automatically encoded to hex. - --name Account name (default: "default") - --chain-id Chain ID of the network - --private-key Private key for signing transactions - --rpc RPC URL of the network - --gateway
    Gateway contract address on ZetaChain - --revert-address
    Revert address (default: - "0x0000000000000000000000000000000000000000") - --abort-address
    Abort address (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Whether to call on revert (default: false) - --on-revert-gas-limit Gas limit for the revert transaction - (default: "1000000") - --revert-message Revert message (default: "0x") - --tx-options-gas-limit Gas limit for the transaction (default: - "1000000") - --tx-options-gas-price Gas price for the transaction (default: - "10000000000") - --call-options-gas-limit Gas limit for the call (default: "1000000") - --call-options-is-arbitrary-call Call any function (default: false) - --yes Skip confirmation prompt (default: false) - --amount The amount of tokens to withdraw - --function Function to call (example: "hello(string)") - --types List of parameter types (e.g. uint256 - address) - --values Parameter values for the function call - --data Raw data for non-EVM chains like Solana - -h, --help display help for command - -``` - -## zetachain evm - -``` -Usage: zetachain evm [options] [command] - -Options: - -h, --help display help for command - -Commands: - call [options] Call a contract on ZetaChain from an - EVM-compatible chain - deposit-and-call [options] Deposit tokens and call a contract on ZetaChain - from an EVM-compatible chain - deposit [options] Deposit tokens to ZetaChain from an EVM-compatible - chain - -``` - -## zetachain evm call - -``` -Usage: zetachain evm call [options] - -Options: - --chain-id Chain ID of the network - --receiver
    Receiver address on ZetaChain - --name Account name (default: "default") - --private-key Private key for signing transactions - --rpc RPC URL for the source chain - --gateway
    EVM Gateway address - --revert-address
    Address to revert to in case of failure - (default: signer address) - --abort-address
    Address to receive funds if aborted (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Whether to call revert address on failure - (default: false) - --on-revert-gas-limit Gas limit for revert operation (default: - "200000") - --revert-message Message to include in revert (default: "") - --gas-limit Gas limit for the transaction - --gas-price Gas price for the transaction - --yes Skip confirmation prompt (default: false) - --types List of parameter types (e.g. uint256 address) - --values Parameter values for the function call - -h, --help display help for command - -``` - -## zetachain evm deposit-and-call - -``` -Usage: zetachain evm deposit-and-call [options] - -Options: - --chain-id Chain ID of the network - --receiver
    Receiver address on ZetaChain - --name Account name (default: "default") - --private-key Private key for signing transactions - --rpc RPC URL for the source chain - --gateway
    EVM Gateway address - --revert-address
    Address to revert to in case of failure - (default: signer address) - --abort-address
    Address to receive funds if aborted (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Whether to call revert address on failure - (default: false) - --on-revert-gas-limit Gas limit for revert operation (default: - "200000") - --revert-message Message to include in revert (default: "") - --gas-limit Gas limit for the transaction - --gas-price Gas price for the transaction - --yes Skip confirmation prompt (default: false) - --amount Amount of tokens to deposit - --erc20
    ERC20 token address (optional for native token - deposits) - --types List of parameter types (e.g. uint256 address) - --values Parameter values for the function call - -h, --help display help for command - -``` - -## zetachain evm deposit - -``` -Usage: zetachain evm deposit [options] - -Options: - --chain-id Chain ID of the network - --receiver
    Receiver address on ZetaChain - --name Account name (default: "default") - --private-key Private key for signing transactions - --rpc RPC URL for the source chain - --gateway
    EVM Gateway address - --revert-address
    Address to revert to in case of failure - (default: signer address) - --abort-address
    Address to receive funds if aborted (default: - "0x0000000000000000000000000000000000000000") - --call-on-revert Whether to call revert address on failure - (default: false) - --on-revert-gas-limit Gas limit for revert operation (default: - "200000") - --revert-message Message to include in revert (default: "") - --gas-limit Gas limit for the transaction - --gas-price Gas price for the transaction - --yes Skip confirmation prompt (default: false) - --amount Amount of tokens to deposit - --erc20
    ERC20 token address (optional for native token - deposits) - -h, --help display help for command - -``` - -## zetachain solana - -``` -Usage: zetachain solana [options] [command] - -Options: - -h, --help display help for command - -Commands: - call [options] Call a universal contract on ZetaChain - deposit-and-call [options] Deposit tokens from Solana and call a universal - contract on ZetaChain - deposit [options] Deposit tokens from Solana - encode [options] Encode payload data for Solana - -``` - -## zetachain solana call - -``` -Usage: zetachain solana call [options] - -Call a universal contract on ZetaChain - -Options: - --recipient EOA or contract address on ZetaChain - --mnemonic Mnemonic - --name Name of the wallet (default: "default") - --private-key Private key in base58 or hex format (with optional 0x prefix) - --chain-id Chain ID of the network - --revert-address Revert address - --abort-address Abort address (default: "0x0000000000000000000000000000000000000000") - --call-on-revert Call on revert (default: false) - --revert-message Revert message (default: "") - --on-revert-gas-limit On revert gas limit (default: "0") - --types List of parameter types (e.g. uint256 address) - --values Parameter values for the function call - -h, --help display help for command - -``` - -## zetachain solana deposit-and-call - -``` -Usage: zetachain solana deposit-and-call [options] - -Deposit tokens from Solana and call a universal contract on ZetaChain - -Options: - --recipient EOA or contract address on ZetaChain - --mnemonic Mnemonic - --name Name of the wallet (default: "default") - --private-key Private key in base58 or hex format (with optional 0x prefix) - --chain-id Chain ID of the network - --revert-address Revert address - --abort-address Abort address (default: "0x0000000000000000000000000000000000000000") - --call-on-revert Call on revert (default: false) - --revert-message Revert message (default: "") - --on-revert-gas-limit On revert gas limit (default: "0") - --amount Amount of tokens to deposit - --token-program Token program (default: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA") - --types List of parameter types (e.g. uint256 address) - --values Parameter values for the function call - --mint SPL token mint address - -h, --help display help for command - -``` - -## zetachain solana deposit - -``` -Usage: zetachain solana deposit [options] - -Options: - --recipient EOA or contract address on ZetaChain - --mnemonic Mnemonic - --name Name of the wallet (default: "default") - --private-key Private key in base58 or hex format (with optional 0x prefix) - --chain-id Chain ID of the network - --revert-address Revert address - --abort-address Abort address (default: "0x0000000000000000000000000000000000000000") - --call-on-revert Call on revert (default: false) - --revert-message Revert message (default: "") - --on-revert-gas-limit On revert gas limit (default: "0") - --amount Amount of tokens to deposit - --token-program Token program (default: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA") - --mint SPL token mint address - -h, --help display help for command - -``` - -## zetachain solana encode - -``` -Usage: zetachain solana encode [options] - -Options: - --connected
    Connected PDA account address - --data Data to encode - --gateway
    Gateway program address - --mint
    Mint address for SPL token operations - --accounts Additional accounts in format 'address:isWritable' - -h, --help display help for command - -``` - -## zetachain sui - -``` -Usage: zetachain sui [options] [command] - -Options: - -h, --help display help for command - -Commands: - deposit-and-call [options] Deposit tokens from Sui and call a contract on - ZetaChain - deposit [options] Deposit tokens from Sui - encode [options] Encode payload data for SUI - -``` - -## zetachain sui deposit-and-call - -``` -Usage: zetachain sui deposit-and-call [options] - -Options: - --mnemonic Mnemonic for the account - --private-key Private key for the account - --gateway-object Gateway object ID - --gateway-package Gateway package ID - --receiver Receiver address on ZetaChain - --amount Amount to deposit in decimal format - --chain-id Chain ID - --coin-type Coin type to deposit (default: - "0x2::sui::SUI") - --gas-budget Gas budget in MIST (default: "10000000") - --name Account name (default: "default") - --decimals Number of decimals for the coin type - (default: "9") - --values Parameter values for the function call - --types List of parameter types (e.g. uint256 - address) - -h, --help display help for command - -``` - -## zetachain sui deposit - -``` -Usage: zetachain sui deposit [options] - -Options: - --mnemonic Mnemonic for the account - --private-key Private key for the account - --gateway-object Gateway object ID - --gateway-package Gateway package ID - --receiver Receiver address on ZetaChain - --amount Amount to deposit in decimal format - --chain-id Chain ID - --coin-type Coin type to deposit (default: - "0x2::sui::SUI") - --gas-budget Gas budget in MIST (default: "10000000") - --name Account name (default: "default") - --decimals Number of decimals for the coin type - (default: "9") - -h, --help display help for command - -``` - -## zetachain sui encode - -``` -Usage: zetachain sui encode [options] - -Options: - --data Data to encode - --type-arguments Type arguments for the encoding - --objects Objects to include in the encoding - (comma-separated) - -h, --help display help for command - -``` - -## zetachain ton - -``` -Usage: zetachain ton [options] [command] - -TON commands - -Options: - -h, --help display help for command - -Commands: - deposit-and-call [options] Deposit TON and call a universal contract on - ZetaChain - deposit [options] Deposit TON to an EOA or a contract on ZetaChain - -``` - -## zetachain ton deposit-and-call - -``` -Usage: zetachain ton deposit-and-call [options] - -Deposit TON and call a universal contract on ZetaChain - -Options: - --mnemonic Mnemonic for the account - --name Name of the account (default: "default") - --gateway Gateway contract address (default: testnet) - --receiver Receiver address - --rpc RPC endpoint (default: testnet) (default: - "https://testnet.toncenter.com/api/v2/jsonRPC") - --api-key API key - --chain-id Chain ID - --amount Amount in TON - --types ABI types - --values Values corresponding to types - --data Data to call the contract with - -h, --help display help for command - -``` - -## zetachain ton deposit - -``` -Usage: zetachain ton deposit [options] - -Deposit TON to an EOA or a contract on ZetaChain - -Options: - --mnemonic Mnemonic for the account - --name Name of the account (default: "default") - --gateway Gateway contract address (default: testnet) - --receiver Receiver address - --rpc RPC endpoint (default: testnet) (default: - "https://testnet.toncenter.com/api/v2/jsonRPC") - --api-key API key - --chain-id Chain ID - --amount Amount in TON - -h, --help display help for command - -``` - -## zetachain bitcoin - -``` -Usage: zetachain bitcoin|b [options] [command] - -Bitcoin-related commands - -Options: - -h, --help display help for command - -Commands: - inscription|i Make a transaction using inscriptions - memo|m Make a transaction using a memo (OP_RETURN) - -``` - -## zetachain bitcoin inscription - -``` -Usage: zetachain bitcoin inscription|i [options] [command] - -Options: - -h, --help display help for command - -Commands: - call [options] Call a contract on ZetaChain - deposit-and-call [options] Deposit BTC and call a contract on ZetaChain - deposit [options] Deposit BTC to ZetaChain - encode [options] Encode data for Bitcoin transactions using ABI - encoding - -``` - -## zetachain bitcoin inscription call - -``` -Usage: zetachain bitcoin inscription call [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - --revert-address
    Revert address - --network Network (choices: "signet", "mainnet", default: - "signet") - --format Encoding format (choices: "ABI", "CompactLong", - "CompactShort", default: "ABI") - --data Pass raw data - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -t, --types ABI types - -v, --values Values corresponding to types - -h, --help display help for command - -``` - -## zetachain bitcoin inscription deposit-and-call - -``` -Usage: zetachain bitcoin inscription deposit-and-call [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - --revert-address
    Revert address - --network Network (choices: "signet", "mainnet", default: - "signet") - --format Encoding format (choices: "ABI", "CompactLong", - "CompactShort", default: "ABI") - --data Pass raw data - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -t, --types ABI types - -v, --values Values corresponding to types - -a, --amount BTC amount to send (in BTC) - -h, --help display help for command - -``` - -## zetachain bitcoin inscription deposit - -``` -Usage: zetachain bitcoin inscription deposit [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - --revert-address
    Revert address - --network Network (choices: "signet", "mainnet", default: - "signet") - --format Encoding format (choices: "ABI", "CompactLong", - "CompactShort", default: "ABI") - --data Pass raw data - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -a, --amount BTC amount to send (in BTC) - -h, --help display help for command - -``` - -## zetachain bitcoin inscription encode - -``` -Usage: zetachain bitcoin inscription encode [options] - -Options: - -r, --receiver
    Receiver address - -t, --types ABI types (e.g. string uint256) (default: []) - -v, --values Values corresponding to types (default: []) - -a, --revert-address
    Bitcoin revert address - -o, --op-code Operation code (choices: "Call", "Deposit", - "DepositAndCall", "Invalid", default: - "DepositAndCall") - -f, --format Encoding format (choices: "ABI", - "CompactLong", "CompactShort", default: "ABI") - -h, --help display help for command - -``` - -## zetachain bitcoin memo - -``` -Usage: zetachain bitcoin memo|m [options] [command] - -Options: - -h, --help display help for command - -Commands: - call [options] Call a contract on ZetaChain - deposit-and-call [options] Deposit BTC and call a contract on ZetaChain - deposit [options] Deposit BTC to ZetaChain - -``` - -## zetachain bitcoin memo call - -``` -Usage: zetachain bitcoin memo call [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - -d, --data Pass raw data - --network-fee Network fee (in sats) (default: "1750") - --network Network (choices: "signet", "mainnet", default: - "signet") - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -h, --help display help for command - -``` - -## zetachain bitcoin memo deposit-and-call - -``` -Usage: zetachain bitcoin memo deposit-and-call [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - -d, --data Pass raw data - --network-fee Network fee (in sats) (default: "1750") - --network Network (choices: "signet", "mainnet", default: - "signet") - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -a, --amount BTC amount to send (in BTC) - -h, --help display help for command - -``` - -## zetachain bitcoin memo deposit - -``` -Usage: zetachain bitcoin memo deposit [options] - -Options: - --yes Skip confirmation prompt (default: false) - -r, --receiver
    ZetaChain receiver address - --commit-fee Commit fee (in sats) (default: "15000") - -g, --gateway
    Bitcoin gateway (TSS) address (default: - "tb1qy9pqmk2pd9sv63g27jt8r657wy0d9ueeh0nqur") - --private-key Bitcoin private key - --name Account name (default: "default") - -d, --data Pass raw data - --network-fee Network fee (in sats) (default: "1750") - --network Network (choices: "signet", "mainnet", default: - "signet") - --bitcoin-api Bitcoin API (default: - "https://mempool.space/signet/api") - --gas-price-api ZetaChain API (default: - "https://zetachain-athens.blockpi.network/lcd/v1/public/zeta-chain/crosschain/gasPrice/18333") - -a, --amount BTC amount to send (in BTC) - -h, --help display help for command - -``` - -## zetachain localnet - -``` -Usage: zetachain localnet [options] [command] - -Local development environment - -Options: - -h, --help display help for command - -Commands: - start [options] Start localnet - stop Stop localnet - check [options] Check if localnet is running - ton TON commands - -``` - -## zetachain localnet start - -``` -Usage: zetachain localnet start [options] - -Start localnet - -Options: - -p, --port Port to run anvil on (default: "8545") - -a, --anvil Additional arguments to pass to anvil (default: "-q") - -f, --force-kill Force kill any process on the port without prompting - (default: false) - -s, --stop-after-init Stop the localnet after successful initialization - (default: false) - -e, --exit-on-error Exit with an error if a call is reverted (default: - false) - -v, --verbosity Logger verbosity level (choices: "emerg", "alert", - "crit", "error", "warning", "notice", "info", - "debug", default: "info") - --chains [chains...] Chains to launch when starting localnet (choices: - "ton", "solana", "sui", default: []) - -h, --help display help for command - -``` - -## zetachain localnet stop - -``` -Usage: zetachain localnet stop [options] - -Stop localnet - -Options: - -h, --help display help for command - -``` - -## zetachain localnet check - -``` -Usage: zetachain localnet check [options] - -Check if localnet is running - -Options: - -d, --delay Seconds to wait before checking localnet (default: "3") - -h, --help display help for command - -``` - -## zetachain localnet ton - -``` -Usage: zetachain localnet ton [options] [command] - -TON commands - -Options: - -h, --help display help for command - -Commands: - balance [options] Show balance by address - faucet [options] Request TON from faucet - wallet [options] Create & fund a wallet - withdraw [options] Withdraw TON from gateway - help [command] display help for command - -``` - -## zetachain localnet ton balance - -``` -Usage: zetachain localnet ton balance [options] - -Show balance by address - -Options: - -a, --address
    Address - -h, --help display help for command - -``` - -## zetachain localnet ton faucet - -``` -Usage: zetachain localnet ton faucet [options] - -Request TON from faucet - -Options: - -a, --address
    Address - -m, --amount Amount in TON (default: "100") - -h, --help display help for command - -``` - -## zetachain localnet ton wallet - -``` -Usage: zetachain localnet ton wallet [options] - -Create & fund a wallet - -Options: - -m, --amount Amount to topup in TON (default: "100") - -h, --help display help for command - -``` - -## zetachain localnet ton withdraw - -``` -Usage: zetachain localnet ton withdraw [options] - -Withdraw TON from gateway - -Options: - -a, --address
    Recipient - -m, --amount Amount in TON (default: "1") - -k, --private-key Sender's private key on Zeta - -g, --gateway Gateway address on ZEVM - -t, --token TON.TON token address on ZEVM - -p, --port Anvil port (default: "8545") - -h, --help display help for command - -``` - -## zetachain docs - -``` -Usage: zetachain docs [options] - -Display help information for all available commands and their subcommands - -Options: - -h, --help display help for command - -``` - -## zetachain ask - -``` -Usage: zetachain ask [options] [prompt...] - -Chat with ZetaChain Docs AI - -Arguments: - prompt Prompt to send to AI - -Options: - -h, --help display help for command - -``` - diff --git a/src/pages/reference/network/details.en-US.mdx b/src/pages/reference/details.en-US.mdx similarity index 85% rename from src/pages/reference/network/details.en-US.mdx rename to src/pages/reference/details.en-US.mdx index 05504e993..10b28c54c 100644 --- a/src/pages/reference/network/details.en-US.mdx +++ b/src/pages/reference/details.en-US.mdx @@ -7,7 +7,7 @@ import { NetworkDetails } from "~/components/Docs"; For additional EVM RPC endpoints, see the [API/RPC -endpoints](/reference/network/api) page. +endpoints](/reference/api) page. For additional explorers, see the [Services and Providers](/reference/explorers/) page. diff --git a/src/pages/reference/network/details.zh-CN.mdx b/src/pages/reference/details.zh-CN.mdx similarity index 93% rename from src/pages/reference/network/details.zh-CN.mdx rename to src/pages/reference/details.zh-CN.mdx index 91a1c1022..eed270938 100644 --- a/src/pages/reference/network/details.zh-CN.mdx +++ b/src/pages/reference/details.zh-CN.mdx @@ -6,6 +6,6 @@ import { NetworkDetails } from "~/components/Docs"; -更多 EVM RPC 端点请参阅 [API / RPC 端点](/zh/reference/network/api)。 +更多 EVM RPC 端点请参阅 [API / RPC 端点](/zh/reference/api)。 更多区块浏览器可查看[服务与提供方](/zh/reference/explorers/)页面。 diff --git a/src/pages/reference/explorers.en-US.mdx b/src/pages/reference/explorers.en-US.mdx index 1a74c787d..11d532478 100644 --- a/src/pages/reference/explorers.en-US.mdx +++ b/src/pages/reference/explorers.en-US.mdx @@ -1,6 +1,6 @@ | Name | Mainnet | Testnet | Description | | ------------------ | ------------------------------------------------------ | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Blockscout | [Mainnet](https://zetachain.blockscout.com/) | [Testnet](https://zetachain-testnet.blockscout.com/) | EVM block explorer that lets you search transactions, addresses, and tokens, verify and interact with smart contracts, track cross-chain activity, and access data through HTTP and GraphQL APIs. [Pro API](https://docs.blockscout.com/devs/pro-api) offers higher rate limits, custom endpoints, and multichain support. | +| Blockscout | [Mainnet](https://zetachain.blockscout.com/) | [Testnet](https://zetachain-testnet.blockscout.com/) | EVM block explorer that lets you search transactions, addresses, and tokens, verify and interact with smart contracts, track activity across connected chains, and access data through HTTP and GraphQL APIs. [Pro API](https://docs.blockscout.com/devs/pro-api) offers higher rate limits, custom endpoints, and multichain support. | | ExploreMe | [Mainnet](https://zetachain.exploreme.pro/) | [Testnet](https://testnet.zetachain.exploreme.pro/) | EVM and Cosmos explorer with blocks, transactions, top accounts, contracts, tokens/NFTs, validators, proposals, params/uptime/API. | | Mintscan | [Mainnet](https://www.mintscan.io/zeta) | — | Cosmos explorer with blocks, transactions, accounts, validators & staking, governance proposals, and params. | | Nodejumper | [Mainnet](https://app.nodejumper.io/zetachain) | — | Node operator dashboard with chain indicators and APIs, and utilities. | diff --git a/src/pages/reference/explorers.zh-CN.mdx b/src/pages/reference/explorers.zh-CN.mdx index 779cf8a83..e6c5cb408 100644 --- a/src/pages/reference/explorers.zh-CN.mdx +++ b/src/pages/reference/explorers.zh-CN.mdx @@ -1,6 +1,6 @@ | 名称 | 主网 | 测试网 | 说明 | | ---- | ---- | ---- | ---- | -| Blockscout | [Mainnet](https://zetachain.blockscout.com/) | [Testnet](https://zetachain-testnet.blockscout.com/) | EVM 区块浏览器,可搜索交易、地址、代币,验证并交互智能合约,追踪跨链活动,并通过 HTTP 与 GraphQL API 获取数据。[Pro API](https://docs.blockscout.com/devs/pro-api) 提供更高速率限制、自定义端点及多链支持。 | +| Blockscout | [Mainnet](https://zetachain.blockscout.com/) | [Testnet](https://zetachain-testnet.blockscout.com/) | EVM 区块浏览器,可搜索交易、地址、代币,验证并交互智能合约,追踪连接链之间的活动,并通过 HTTP 与 GraphQL API 获取数据。[Pro API](https://docs.blockscout.com/devs/pro-api) 提供更高速率限制、自定义端点及多链支持。 | | ExploreMe | [Mainnet](https://zetachain.exploreme.pro/) | [Testnet](https://testnet.zetachain.exploreme.pro/) | 同时支持 EVM 与 Cosmos 的浏览器,提供区块、交易、热门账户、合约、代币/NFT、验证人、提案、参数/在线率/API 等数据。 | | Mintscan | [Mainnet](https://www.mintscan.io/zeta) | — | Cosmos 浏览器,包含区块、交易、账户、验证人与质押、治理提案及链上参数。 | | Nodejumper | [Mainnet](https://app.nodejumper.io/zetachain) | — | 面向节点运营者的仪表盘,提供链路指标、API 以及各类工具。 | diff --git a/src/pages/reference/localnet.en-US.mdx b/src/pages/reference/localnet.en-US.mdx deleted file mode 100644 index eb14387c5..000000000 --- a/src/pages/reference/localnet.en-US.mdx +++ /dev/null @@ -1,95 +0,0 @@ -Localnet is ZetaChain’s **all‑in‑one local development environment** for -building, testing, and debugging universal applications. It bootstraps a -fully‑featured multi‑chain laboratory on your machine—spinning up nodes for -multiple chains (EVM, Solana, Sui, TON) and pre‑deploys the core ZetaChain -protocol contracts, ZRC‑20 tokens, and Uniswap v2 & v3 pools. Think of Localnet -as ‘ZetaChain on localhost’ — fast, predictable, and ideal for rapid iteration. - -**Why use Localnet?** - -🔄 Iterate on cross‑chain logic in seconds — no more waiting for public testnets. - -🧪 Reproduce complex multi‑chain flows with one command. - -🐞 Step‑through debug every contract call at the EVM level. - -🚀 Deploy to testnet/mainnet with confidence once flows are green locally. - -## ✨ Features - -- **One‑shot bootstrap** – `npx zetachain@latest localnet start` spins up - everything. -- **Multi‑chain simulation** – EVM, Solana, Sui, and TON. -- **Pre‑deployed contracts** - - ZetaChain Gateway contracts on all supported chains. - - ZRC‑20 tokens (`ETH`, `USDC`, ...) - - Uniswap v2 + v3 factories, routers, and initial liquidity pools. -- **Configurable** – Pass arbitrary flags (block time, fork URL, ...). - -## 🚀 Quick Start - -Install prerequisites: - -| Tool | Purpose | Install | -| ------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------ | -| **Node ≥ 18** | CLI wrapper & scripts | [https://nodejs.org](https://nodejs.org) | -| **Foundry (Anvil)** | Local EVM | [https://book.getfoundry.sh/getting-started/installation](https://book.getfoundry.sh/getting-started/installation) | - -Fire up Localnet: - -```bash -npx zetachain@latest localnet start -``` - -Within seconds you should see output similar to: - -``` -ZETACHAIN -┌──────────────────────────┬──────────────────────────────────────────────┐ -│ (index) │ Values │ -├──────────────────────────┼──────────────────────────────────────────────┤ -│ gatewayZEVM │ '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6' │ -│ uniswapFactoryInstance │ '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0' │ -│ uniswapRouterInstance │ '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9' │ -│ ... │ │ -└──────────────────────────┴──────────────────────────────────────────────┘ -``` - -## 🧩 Deep Dive - -What happens under the hood? - -1. **Anvil node** starts on default port. -2. **Protocol deploy script** publishes all core contracts. -3. **Chain simulators** for Solana/Sui/TON register with the Connector. -4. **Tokens & pools** are minted and seeded with liquidity. -5. Funded dev accounts are printed for convenience. - -## 🧪 Useful Examples - -Pass custom anvil flags: - -```bash -npx zetachain@latest localnet start \ - --anvil "--block-time 1 --gas-limit 120000000" \ - --port 9000 -``` - -Use this to simulate faster block times or test high-throughput contracts by -increasing the gas limit and adjusting chain behavior. - -Run a lean EVM-only instance of Localnet: - -```bash -npx zetachain@latest localnet start -``` - -Use this when your app doesn't need Solana, Sui, or TON—startup is faster and -resource usage is lower. - -## 🛠️ Open Source - -Localnet is [open-source and available on -GitHub](https://github.com/zeta-chain/localnet). Clone or contribute to explore -how it works under the hood, customize behaviors, or extend it for your -development needs. diff --git a/src/pages/reference/localnet.zh-CN.mdx b/src/pages/reference/localnet.zh-CN.mdx deleted file mode 100644 index 23b1a36f6..000000000 --- a/src/pages/reference/localnet.zh-CN.mdx +++ /dev/null @@ -1,82 +0,0 @@ -Localnet 是 ZetaChain 的**一体化本地开发环境**,用于构建、测试与调试全链应用。它会在本机启动多条链(EVM、Solana、Sui、TON)的节点,并预部署核心协议合约、ZRC-20 代币、Uniswap v2/v3 池等组件,相当于一套“本地版 ZetaChain”,便于快速迭代。 - -**为什么使用 Localnet?** - -🔄 在几秒内迭代跨链逻辑——无需再等待公共测试网确认。 -🧪 一条命令重现复杂多链流程。 -🐞 在 EVM 层面逐步调试每次合约调用。 -🚀 本地验证通过后,再部署到测试网/主网更有把握。 - -## ✨ 功能 - -- **一键启动**:`npx zetachain@latest localnet start` 即可拉起完整环境。 -- **多链模拟**:同时支持 EVM、Solana、Sui 与 TON。 -- **预部署合约**: - - 全部链上的 ZetaChain Gateway 合约。 - - 常见 ZRC-20 代币(如 `ETH`、`USDC` 等)。 - - Uniswap v2 + v3 工厂、路由器与初始流动池。 -- **可配置**:可自定义区块时间、fork URL 等参数。 - -## 🚀 快速开始 - -安装依赖: - -| 工具 | 用途 | 安装 | -| ---- | ---- | ---- | -| **Node ≥ 18** | CLI 包装与脚本 | [https://nodejs.org](https://nodejs.org) | -| **Foundry (Anvil)** | 本地 EVM | [安装指南](https://book.getfoundry.sh/getting-started/installation) | - -启动 Localnet: - -```bash -npx zetachain@latest localnet start -``` - -片刻之后,你会看到类似输出: - -``` -ZETACHAIN -┌──────────────────────────┬──────────────────────────────────────────────┐ -│ (index) │ Values │ -├──────────────────────────┼──────────────────────────────────────────────┤ -│ gatewayZEVM │ '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6' │ -│ uniswapFactoryInstance │ '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0' │ -│ uniswapRouterInstance │ '0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9' │ -│ ... │ │ -└──────────────────────────┴──────────────────────────────────────────────┘ -``` - -## 🧩 深入了解 - -Localnet 背后做了什么? - -1. **Anvil 节点**在默认端口启动。 -2. **协议部署脚本**发布所有核心合约。 -3. **链模拟器**(Solana/Sui/TON)向 Connector 注册。 -4. **代币与流动池**被铸造并注入初始资金。 -5. 输出内置开发账户,方便直接使用。 - -## 🧪 实用示例 - -传入自定义 anvil 参数: - -```bash -npx zetachain@latest localnet start \ - --anvil "--block-time 1 --gas-limit 120000000" \ - --port 9000 -``` - -可用于模拟更快的区块时间或更高吞吐场景。 - -仅运行精简版(仅 EVM): - -```bash -npx zetachain@latest localnet start -``` - -当应用无需 Solana、Sui、TON 时可选此模式,启动更快、资源占用更低。 - -## 🛠️ 开源 - -Localnet [已开源,代码托管在 GitHub](https://github.com/zeta-chain/localnet)。可自行克隆或贡献,了解其实现方式、定制行为,或扩展以满足研发需求。 - diff --git a/src/pages/reference/mcp.en-US.mdx b/src/pages/reference/mcp.en-US.mdx deleted file mode 100644 index 3f70a5282..000000000 --- a/src/pages/reference/mcp.en-US.mdx +++ /dev/null @@ -1,94 +0,0 @@ -# Model Context Protocol (MCP) - -Model Context Protocol (MCP) is an open standard that allows AI assistants to -securely connect to external tools and data sources through local or remote -servers. - -The ZetaChain MCP server extends your AI coding environment, such as Cursor or -Claude Code, with direct access to on-chain data and CLI-powered actions. This -means you can query balances, estimate cross-chain fees, execute contract calls, -and track transactions across chains, all without leaving your editor or chat -interface. - -## Install the ZetaChain CLI - -Install the latest version of the ZetaChain CLI globally: - -```bash -npm install -g zetachain@latest -``` - -This includes everything needed to run the MCP server locally (recommended for -best performance and security). - -Note: MCP support is available starting in `zetachain` v7.1.1. Check your -version: - -```bash -zetachain --version -``` - -If your version is older than v7.1.1, update to the latest release: - -```bash -npm install -g zetachain@latest -``` - -## Connect MCP to Cursor or Claude Code - -Install the ZetaChain MCP integration for your preferred AI client: - -```bash -zetachain mcp install --client cursor -# or -zetachain mcp install --client claude -``` - -Once installed, your AI tool will be able to access ZetaChain data and perform -on-chain operations directly through the MCP interface. - -Note: The `--client claude` option refers to the Claude Code client. Claude -Desktop is not currently supported. - -## Verify Installation - -List all available MCP integrations to confirm that ZetaChain is active: - -```bash -zetachain mcp list -``` - -You should see an entry for the ZetaChain MCP server. - -## Test the Integration - -After verifying installation, try a simple prompt in your AI editor: - -> “Query all chains connected to ZetaChain.” - -Your editor should automatically run: - -```bash -zetachain query chains -``` - -and display a table of all connected chains. If you see this output, the -ZetaChain MCP server is working correctly. - -## Remove the Integration - -If you ever need to remove the MCP integration: - -```bash -zetachain mcp remove --client cursor -# or -zetachain mcp remove --client claude -``` - -## Alternative: Run via Smithery - -If you don’t want to run the MCP server locally, you can use the hosted version -on Smithery. This is ideal for quick trials or environments where local setup -isn’t possible. - -👉 [ZetaChain MCP on Smithery](https://smithery.ai/server/@zeta-chain/cli) diff --git a/src/pages/reference/mcp.zh-CN.mdx b/src/pages/reference/mcp.zh-CN.mdx deleted file mode 100644 index 054f37b80..000000000 --- a/src/pages/reference/mcp.zh-CN.mdx +++ /dev/null @@ -1,82 +0,0 @@ -# Model Context Protocol (MCP) - -Model Context Protocol(MCP)是一项开放标准,可让 AI 助手通过本地或远程服务器安全地连接外部工具与数据源。 - -ZetaChain MCP 服务器可扩展你的 AI 编码环境(如 Cursor 或 Claude Code),让其直接访问链上数据并执行 CLI 动作。你可以在编辑器或聊天界面内查询余额、估算跨链费用、执行合约调用、追踪跨链交易等,无需跳出当前工作区。 - -## 安装 ZetaChain CLI - -全局安装最新版本的 ZetaChain CLI: - -```bash -npm install -g zetachain@latest -``` - -此安装包包含本地运行 MCP 服务器所需的一切(推荐本地运行以获得最佳性能与安全性)。 - -注意:MCP 支持从 `zetachain` v7.1.1 起提供。可通过以下命令检查版本: - -```bash -zetachain --version -``` - -如果版本低于 v7.1.1,请升级至最新版本: - -```bash -npm install -g zetachain@latest -``` - -## 将 MCP 接入 Cursor 或 Claude Code - -为你使用的 AI 客户端安装 ZetaChain MCP 集成: - -```bash -zetachain mcp install --client cursor -# 或 -zetachain mcp install --client claude -``` - -安装完成后,AI 工具即可通过 MCP 接口访问 ZetaChain 数据并执行链上操作。 - -注意:`--client claude` 指的是 Claude Code 客户端,目前不支持 Claude Desktop。 - -## 验证安装 - -列出所有可用 MCP 集成,确认 ZetaChain 已启用: - -```bash -zetachain mcp list -``` - -输出中应出现 ZetaChain MCP 服务器的条目。 - -## 测试集成 - -完成安装后,可在 AI 编辑器中尝试以下提示: - -> “Query all chains connected to ZetaChain.” - -编辑器会自动执行: - -```bash -zetachain query chains -``` - -并展示所有已连接链的列表。如果看到该输出,说明 ZetaChain MCP 服务器工作正常。 - -## 移除集成 - -如需移除 MCP 集成: - -```bash -zetachain mcp remove --client cursor -# 或 -zetachain mcp remove --client claude -``` - -## 备选方案:通过 Smithery 运行 - -若不想在本地运行 MCP 服务器,可使用 Smithery 提供的托管版本,适合快速试用或无法进行本地配置的环境。 - -👉 [ZetaChain MCP on Smithery](https://smithery.ai/server/@zeta-chain/cli) - diff --git a/src/pages/reference/network/_meta.en-US.json b/src/pages/reference/network/_meta.en-US.json deleted file mode 100644 index 1001f7f5e..000000000 --- a/src/pages/reference/network/_meta.en-US.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "details": { - "title": "Network Details", - "description": "ZetaChain testnet and mainnet details.", - "readTime": "5 min" - }, - "api": { - "title": "RPC/API Endpoints", - "description": "API endpoints that can be used to interact with ZetaChain.", - "readTime": "5 min" - }, - "contracts": { - "title": "Contract Addresses", - "description": "A list of contract addresses for ZetaChain.", - "readTime": "5 min" - }, - "openapi": { - "title": "ZetaChain HTTP API", - "description": "Swagger documentation for the API of ZetaChain.", - "readTime": "15 min" - } -} \ No newline at end of file diff --git a/src/pages/reference/network/_meta.zh-CN.json b/src/pages/reference/network/_meta.zh-CN.json deleted file mode 100644 index ac48882ae..000000000 --- a/src/pages/reference/network/_meta.zh-CN.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "details": { - "title": "网络详情" - }, - "api": { - "title": "RPC / API 端点" - }, - "contracts": { - "title": "合约地址" - }, - "openapi": { - "title": "ZetaChain HTTP API" - } -} diff --git a/src/pages/reference/network/contracts.en-US.mdx b/src/pages/reference/network/contracts.en-US.mdx deleted file mode 100644 index dae262587..000000000 --- a/src/pages/reference/network/contracts.en-US.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Contract Addresses ---- - -import { ContractAddresses } from "~/components/Docs"; -import { Alert } from "~/components/shared"; - -For a list of RPC endpoints, refer to the [API endpoints page](/reference/network/api). - - diff --git a/src/pages/reference/network/contracts.zh-CN.mdx b/src/pages/reference/network/contracts.zh-CN.mdx deleted file mode 100644 index 754751292..000000000 --- a/src/pages/reference/network/contracts.zh-CN.mdx +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: 合约地址 ---- - -import { ContractAddresses } from "~/components/Docs"; -import { Alert } from "~/components/shared"; - -如需 RPC 端点列表,请查看 [API 端点页面](/zh/reference/network/api)。 - - - diff --git a/src/pages/reference/network/openapi.en-US.mdx b/src/pages/reference/openapi.en-US.mdx similarity index 100% rename from src/pages/reference/network/openapi.en-US.mdx rename to src/pages/reference/openapi.en-US.mdx diff --git a/src/pages/reference/network/openapi.zh-CN.mdx b/src/pages/reference/openapi.zh-CN.mdx similarity index 100% rename from src/pages/reference/network/openapi.zh-CN.mdx rename to src/pages/reference/openapi.zh-CN.mdx diff --git a/src/pages/reference/registry.en-US.mdx b/src/pages/reference/registry.en-US.mdx deleted file mode 100644 index cf0fc35fc..000000000 --- a/src/pages/reference/registry.en-US.mdx +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: Contract Registry -description: Query protocol contract addresses using ZetaChain's on-chain contract registry. ---- - -import { ContractRegistryChains } from "~/components/Docs"; - -## What you can do - -The Contract Registry is the single source of truth for protocol contract -addresses, ZRC-20 tokens, and chain configuration used by ZetaChain and all -connected chains. You can use it to find canonical addresses for system -contracts like `gateway`, `erc20Custody`, ZRC-20, and more - -## Query from the CLI - -List all registered contracts: - -```bash -zetachain query contracts list -``` - -Get a specific contract by type and chain ID (example: Ethereum Sepolia -`11155111` gateway): - -```bash -zetachain query contracts show --type gateway --chain-id 11155111 -``` - -See the full table of protocol contract addresses on the [contract addresses -page](/reference/network/contracts). - -## Use in Universal Contracts - -The registry returns whether an entry is active and an ABI-encoded payload you -can decode. - -Read the Gateway address on Ethereum Sepolia (chain ID `11155111`): - -```solidity -(bool active, bytes memory gatewayAddressBytes) = registry.getContractInfo(11155111, "gateway"); -address gateway = address(uint160(bytes20(gatewayAddressBytes))); -``` - -Read Uniswap V2 Router on ZetaChain testnet (chain ID `7001`): - -```solidity -(bool active, bytes memory uniswapRouterBytes) = registry.getContractInfo(7001, "uniswapV2Router02"); -address uniswapRouter = address(uint160(bytes20(uniswapRouterBytes))); -``` - -All universal contracts inherit a `registry` reference from the abstract -universal contract, so you can call `registry.getContractInfo(...)` directly -without manual address wiring. - -## Deployment Addresses - -The registry is deployed on ZetaChain and on some connected chains. It is -currently available on EVM-connected chains; deployments to additional chain -types are planned. - -The registry contract address on ZetaChain is the same on mainnet, testnet, and -localnet: - -```bash -0x7CCE3Eb018bf23e1FE2a32692f2C77592D110394 -``` - -The registry deployed on ZetaChain is the canonical source of truth for protocol -contract addresses. Registries on connected chains are mirrors for local reads. - -Implementation note: the Contract Registry is a universal app. When contracts -are added or updated on ZetaChain, that information is propagated to registry -contracts on connected chains. - -Addresses of the contract registry contracts: - - - -## Access Control - -The Contract Registry is maintained by the ZetaChain core team. - -You can verify the on-chain roles directly on the contract by querying `admin` -and `registryManager` addresses. - -## Source - -- Core registry contract source code: - [CoreRegistry.sol](https://github.com/zeta-chain/protocol-contracts-evm/blob/develop/contracts/zevm/CoreRegistry.sol) -- Contract addresses as JSON fetched automatically from the registry: - [zeta-chain/contract-addresses](https://github.com/zeta-chain/contract-addresses) diff --git a/src/pages/reference/registry.zh-CN.mdx b/src/pages/reference/registry.zh-CN.mdx deleted file mode 100644 index 058843cde..000000000 --- a/src/pages/reference/registry.zh-CN.mdx +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: 合约注册表 -description: 通过 ZetaChain 链上注册表查询协议合约地址。 ---- - -import { ContractRegistryChains } from "~/components/Docs"; - -## 能够做什么 - -合约注册表是协议合约地址、ZRC-20 代币与链配置的唯一可信来源,适用于 ZetaChain 及所有连接链。你可以利用它查询系统合约的标准地址,例如 `gateway`、`erc20Custody`、ZRC-20 等。 - -## 通过 CLI 查询 - -列出所有已注册合约: - -```bash -zetachain query contracts list -``` - -按合约类型与链 ID 获取特定合约(示例:以太坊 Sepolia `11155111` 上的 gateway): - -```bash -zetachain query contracts show --type gateway --chain-id 11155111 -``` - -更多协议合约地址可参考[合约地址页面](/reference/network/contracts)。 - -## 在全链合约中使用 - -注册表会返回条目是否生效,以及可供解码的 ABI 编码负载。 - -读取以太坊 Sepolia(链 ID `11155111`)上的 Gateway 地址: - -```solidity -(bool active, bytes memory gatewayAddressBytes) = registry.getContractInfo(11155111, "gateway"); -address gateway = address(uint160(bytes20(gatewayAddressBytes))); -``` - -读取 ZetaChain 测试网(链 ID `7001`)上的 Uniswap V2 Router: - -```solidity -(bool active, bytes memory uniswapRouterBytes) = registry.getContractInfo(7001, "uniswapV2Router02"); -address uniswapRouter = address(uint160(bytes20(uniswapRouterBytes))); -``` - -所有全链合约都会从抽象基类继承 `registry` 引用,因此可直接调用 `registry.getContractInfo(...)`,无需手动配置地址。 - -## 部署地址 - -注册表部署在 ZetaChain 及部分连接链上,目前已覆盖所有 EVM 连接链,未来将支持更多链类型。 - -在 ZetaChain 上的注册表地址在主网、测试网与本地网络保持一致: - -```bash -0x7CCE3Eb018bf23e1FE2a32692f2C77592D110394 -``` - -ZetaChain 上的注册表是协议合约地址的权威来源。连接链上的注册表作为镜像,便于本地读取。 - -实现说明:合约注册表本身是一份全链应用。当在 ZetaChain 上新增或更新合约时,相关信息会同步到连接链上的注册表。 - -各链上的注册表地址如下: - - - -## 访问控制 - -合约注册表由 ZetaChain 核心团队维护。你可以直接在链上查询 `admin` 与 `registryManager` 地址以验证角色。 - -## 源码 - -- 核心注册表合约源码: - [CoreRegistry.sol](https://github.com/zeta-chain/protocol-contracts-evm/blob/develop/contracts/zevm/CoreRegistry.sol) -- 从注册表自动获取的 JSON 地址集合: - [zeta-chain/contract-addresses](https://github.com/zeta-chain/contract-addresses) - diff --git a/src/pages/reference/toolkit.en-US.mdx b/src/pages/reference/toolkit.en-US.mdx deleted file mode 100644 index 9f2363edf..000000000 --- a/src/pages/reference/toolkit.en-US.mdx +++ /dev/null @@ -1,1144 +0,0 @@ ---- -title: Toolkit ---- - -# ZetaChain Toolkit - -ZetaChain Toolkit is a TypeScript SDK for building universal apps that transfer -tokens, invoke contracts, and track transactions across any chain connected to -ZetaChain. - -## ✨ Features - -- Cross-chain asset transfers: deposit gas and fungible tokens from any - supported chain to ZetaChain and withdraw them back. -- Cross-chain contract execution: make incoming calls to universal contracts on - ZetaChain or trigger outgoing calls to contracts on connected chains. -- Real-time transaction tracking: monitor the full lifecycle of cross-chain - transactions as they propagate across networks. -- Built-in multi-chain support: works out of the box with EVM chains, Solana, - Sui, Bitcoin, and TON. - -## 📦 Installation - -```bash -npm i @zetachain/toolkit -``` - -## 🚀 Quick start - -```ts -import { evmDeposit, zetachainCall } from "@zetachain/toolkit"; - -// Deposit USDC from Ethereum to ZetaChain -await evmDeposit( - { - amount: "1.0", - receiver: "0xReceiverOnZetaChain", // EOA or contract on ZetaChain - token: "0xUSDC", // ERC-20 on the origin chain - }, - { signer: ethersSigner } -); - -// Ping a contract on Ethereum from ZetaChain -await zetachainCall( - { - receiver: "0xRecevierContract", // contract on a connected chain - function: "hello(string)", - types: ["string"], - values: ["alice"], - zrc20: "0xZRC20", - }, - { signer: ethersSigner } -); -``` - -All Toolkit capabilities are also exposed through [`zetachain` -CLI](https://github.com/zeta-chain/cli). - -## Functions - -### evmCall() - -> **evmCall**(`params`, `options`): `Promise`\<`ContractTransactionResponse`\> - -Makes a cross-chain call from an EVM chain to a universal contract on ZetaChain. - -This function allows you to call a contract function on a destination EVM chain -without transferring any tokens. It's useful for executing contract logic -across different chains. - -#### Parameters - -##### params - -The call parameters including receiver address, function types/values, and revert options - -###### receiver - -`string` = `...` - -###### revertOptions - -\{ `abortAddress?`: `string`; `callOnRevert`: `boolean`; `onRevertGasLimit?`: `string` \| `number` \| `bigint`; `revertAddress?`: `string`; `revertMessage`: `string`; \} = `revertOptionsSchema` - -###### revertOptions.abortAddress? - -`string` = `...` - -###### revertOptions.callOnRevert - -`boolean` = `...` - -###### revertOptions.onRevertGasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### revertOptions.revertAddress? - -`string` = `...` - -###### revertOptions.revertMessage - -`string` = `...` - -###### types - -`string`[] = `...` - -###### values - -(`string` \| `bigint` \| `boolean`)[] = `...` - -##### options - -Configuration options including signer and optional gateway address - -###### gateway? - -`string` = `...` - -###### signer - -`AbstractSigner`\<`Provider` \| `null`\> = `...` - -###### txOptions? - -\{ `gasLimit?`: `string` \| `number` \| `bigint`; `gasPrice?`: `string` \| `number` \| `bigint`; `value?`: `string` \| `number` \| `bigint`; \} = `...` - -###### txOptions.gasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.gasPrice? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.value? - -`string` \| `number` \| `bigint` = `...` - -#### Returns - -`Promise`\<`ContractTransactionResponse`\> - -Promise that resolves to the transaction receipt - -*** - -### evmDeposit() - -> **evmDeposit**(`params`, `options`): `Promise`\<`ContractTransactionResponse`\> - -Deposits tokens from an EVM chain to ZetaChain. - -This function allows you to transfer tokens from an EVM chain to ZetaChain. -It supports both native tokens (ETH, BNB, AVAX, etc.) and ERC20 tokens. -For ERC20 tokens, it automatically handles token approval before deposit. - -#### Parameters - -##### params - -The deposit parameters including amount, receiver, token address, and revert options - -###### amount - -`string` = `...` - -###### receiver - -`string` = `...` - -###### revertOptions - -\{ `abortAddress?`: `string`; `callOnRevert`: `boolean`; `onRevertGasLimit?`: `string` \| `number` \| `bigint`; `revertAddress?`: `string`; `revertMessage`: `string`; \} = `revertOptionsSchema` - -###### revertOptions.abortAddress? - -`string` = `...` - -###### revertOptions.callOnRevert - -`boolean` = `...` - -###### revertOptions.onRevertGasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### revertOptions.revertAddress? - -`string` = `...` - -###### revertOptions.revertMessage - -`string` = `...` - -###### token? - -`string` = `...` - -##### options - -Configuration options including signer and optional gateway address - -###### gateway? - -`string` = `...` - -###### signer - -`AbstractSigner`\<`Provider` \| `null`\> = `...` - -###### txOptions? - -\{ `gasLimit?`: `string` \| `number` \| `bigint`; `gasPrice?`: `string` \| `number` \| `bigint`; `value?`: `string` \| `number` \| `bigint`; \} = `...` - -###### txOptions.gasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.gasPrice? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.value? - -`string` \| `number` \| `bigint` = `...` - -#### Returns - -`Promise`\<`ContractTransactionResponse`\> - -Promise that resolves to the transaction receipt - -*** - -### evmDepositAndCall() - -> **evmDepositAndCall**(`params`, `options`): `Promise`\<`ContractTransactionResponse`\> - -Deposits tokens and makes a cross-chain call from an EVM chain to a universal contract on ZetaChain. - -This function combines token deposit with a contract call in a single transaction. -It allows you to transfer tokens from an EVM chain to ZetaChain and immediately -execute a function call on the universal contract. Supports both native tokens -and ERC20 tokens. - -#### Parameters - -##### params - -The deposit and call parameters including amount, receiver, token address, function types/values, and revert options - -###### amount - -`string` = `...` - -###### receiver - -`string` = `...` - -###### revertOptions - -\{ `abortAddress?`: `string`; `callOnRevert`: `boolean`; `onRevertGasLimit?`: `string` \| `number` \| `bigint`; `revertAddress?`: `string`; `revertMessage`: `string`; \} = `revertOptionsSchema` - -###### revertOptions.abortAddress? - -`string` = `...` - -###### revertOptions.callOnRevert - -`boolean` = `...` - -###### revertOptions.onRevertGasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### revertOptions.revertAddress? - -`string` = `...` - -###### revertOptions.revertMessage - -`string` = `...` - -###### token? - -`string` = `...` - -###### types - -`string`[] = `...` - -###### values - -(`string` \| `bigint` \| `boolean`)[] = `...` - -##### options - -Configuration options including signer and optional gateway address - -###### gateway? - -`string` = `...` - -###### signer - -`AbstractSigner`\<`Provider` \| `null`\> = `...` - -###### txOptions? - -\{ `gasLimit?`: `string` \| `number` \| `bigint`; `gasPrice?`: `string` \| `number` \| `bigint`; `value?`: `string` \| `number` \| `bigint`; \} = `...` - -###### txOptions.gasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.gasPrice? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.value? - -`string` \| `number` \| `bigint` = `...` - -#### Returns - -`Promise`\<`ContractTransactionResponse`\> - -Promise that resolves to the transaction receipt - -*** - -### solanaCall() - -> **solanaCall**(`params`, `options`): `Promise`\<`string`\> - -Makes a cross-chain call from Solana to a universal contract on ZetaChain. - -This function allows you to call a contract function on a universal contract -from Solana without transferring any tokens. It's useful for executing -contract logic across different chains. - -#### Parameters - -##### params - -The call parameters including receiver address, function types/values, and revert options - -###### receiver - -`string` = `...` - -###### revertOptions - -\{ `abortAddress?`: `string`; `callOnRevert`: `boolean`; `onRevertGasLimit?`: `string` \| `number` \| `bigint`; `revertAddress?`: `string`; `revertMessage`: `string`; \} = `revertOptionsSchema` - -###### revertOptions.abortAddress? - -`string` = `...` - -###### revertOptions.callOnRevert - -`boolean` = `...` - -###### revertOptions.onRevertGasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### revertOptions.revertAddress? - -`string` = `...` - -###### revertOptions.revertMessage - -`string` = `...` - -###### types - -`string`[] = `...` - -###### values - -(`string` \| `bigint` \| `boolean`)[] = `...` - -##### options - -Configuration options including chain ID and signer keypair - -###### chainId - -`string` = `...` - -###### signer - -`WalletAdapter` \| `Keypair` = `solanaSignerSchema` - -#### Returns - -`Promise`\<`string`\> - -Promise that resolves to the transaction signature - -*** - -### solanaDeposit() - -> **solanaDeposit**(`params`, `options`): `Promise`\<`string`\> - -Deposits tokens from Solana to ZetaChain. - -This function allows you to transfer tokens from Solana to ZetaChain. -It supports both native SOL and SPL tokens. For SPL tokens, it automatically -handles token account creation and token transfer. - -#### Parameters - -##### params - -The deposit parameters including amount, receiver, token mint address, and revert options - -###### amount - -`string` = `...` - -###### receiver - -`string` = `...` - -###### revertOptions - -\{ `abortAddress?`: `string`; `callOnRevert`: `boolean`; `onRevertGasLimit?`: `string` \| `number` \| `bigint`; `revertAddress?`: `string`; `revertMessage`: `string`; \} = `revertOptionsSchema` - -###### revertOptions.abortAddress? - -`string` = `...` - -###### revertOptions.callOnRevert - -`boolean` = `...` - -###### revertOptions.onRevertGasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### revertOptions.revertAddress? - -`string` = `...` - -###### revertOptions.revertMessage - -`string` = `...` - -###### token? - -`string` = `...` - -##### options - -Configuration options including chain ID and signer keypair - -###### chainId - -`string` = `...` - -###### signer - -`WalletAdapter` \| `Keypair` = `solanaSignerSchema` - -#### Returns - -`Promise`\<`string`\> - -Promise that resolves to the transaction signature - -*** - -### solanaDepositAndCall() - -> **solanaDepositAndCall**(`params`, `options`): `Promise`\<`string`\> - -Deposits tokens and makes a cross-chain call from Solana to a universal contract on ZetaChain. - -This function combines token deposit with a contract call in a single transaction. -It allows you to transfer tokens from Solana to ZetaChain and immediately -execute a function call on the universal contract. Supports both native SOL -and SPL tokens. - -#### Parameters - -##### params - -The deposit and call parameters including amount, receiver, token mint address, function types/values, and revert options - -###### amount - -`string` = `...` - -###### receiver - -`string` = `...` - -###### revertOptions - -\{ `abortAddress?`: `string`; `callOnRevert`: `boolean`; `onRevertGasLimit?`: `string` \| `number` \| `bigint`; `revertAddress?`: `string`; `revertMessage`: `string`; \} = `revertOptionsSchema` - -###### revertOptions.abortAddress? - -`string` = `...` - -###### revertOptions.callOnRevert - -`boolean` = `...` - -###### revertOptions.onRevertGasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### revertOptions.revertAddress? - -`string` = `...` - -###### revertOptions.revertMessage - -`string` = `...` - -###### token? - -`string` = `...` - -###### types - -`string`[] = `...` - -###### values - -(`string` \| `bigint` \| `boolean`)[] = `...` - -##### options - -Configuration options including chain ID and signer keypair - -###### chainId - -`string` = `...` - -###### signer - -`WalletAdapter` \| `Keypair` = `solanaSignerSchema` - -#### Returns - -`Promise`\<`string`\> - -Promise that resolves to the transaction signature - -*** - -### suiDeposit() - -> **suiDeposit**(`params`, `options`): `Promise`\<`void`\> - -Deposits tokens from Sui to ZetaChain. - -This function allows you to transfer tokens from Sui to ZetaChain. -It supports both native SUI and other coin types. The function automatically -handles coin splitting and transaction construction. - -#### Parameters - -##### params - -The deposit parameters including amount, receiver, and optional coin type - -###### amount - -`string` = `...` - -###### receiver - -`string` = `...` - -###### token? - -`string` = `...` - -##### options - -Configuration options including chain ID, gas limit, gateway settings, and signer - -###### chainId - -`"105"` \| `"103"` \| `"104"` = `...` - -###### gasLimit? - -`string` = `...` - -###### gatewayObject? - -`string` = `...` - -###### gatewayPackage? - -`string` = `...` - -###### signer - -`Ed25519Keypair` = `...` - -#### Returns - -`Promise`\<`void`\> - -Promise that resolves when the transaction is executed - -*** - -### suiDepositAndCall() - -> **suiDepositAndCall**(`params`, `options`): `Promise`\<`void`\> - -Deposits tokens and makes a cross-chain call from Sui to a universal contract on ZetaChain. - -This function combines token deposit with a contract call in a single transaction. -It allows you to transfer tokens from Sui to ZetaChain and immediately -execute a function call on the universal contract. Supports both native SUI -and other coin types. - -#### Parameters - -##### params - -The deposit and call parameters including amount, receiver, coin type, function types/values - -###### amount - -`string` = `...` - -###### receiver - -`string` = `...` - -###### token? - -`string` = `...` - -###### types - -`string`[] = `...` - -###### values - -(`string` \| `bigint` \| `boolean`)[] = `...` - -##### options - -Configuration options including chain ID, gas limit, gateway settings, and signer - -###### chainId - -`"105"` \| `"103"` \| `"104"` = `...` - -###### gasLimit? - -`string` = `...` - -###### gatewayObject? - -`string` = `...` - -###### gatewayPackage? - -`string` = `...` - -###### signer - -`Ed25519Keypair` = `...` - -#### Returns - -`Promise`\<`void`\> - -Promise that resolves when the transaction is executed - -*** - -### tonDeposit() - -> **tonDeposit**(`params`, `options`): `Promise`\<`void`\> - -Deposits tokens from TON to ZetaChain. - -This function allows you to transfer TON tokens from TON blockchain to ZetaChain. -It automatically handles wallet connection and transaction signing. - -#### Parameters - -##### params - -The deposit parameters including amount and receiver address - -###### amount - -`string` = `...` - -###### receiver - -`string` = `...` - -##### options - -Configuration options including chain ID, RPC endpoint, wallet, and API key - -###### apiKey? - -`string` = `...` - -###### chainId - -`string` = `...` - -###### gateway? - -`string` = `...` - -###### keyPair? - -`KeyPair` = `...` - -###### rpc - -`string` = `...` - -###### signer? - -`string` = `...` - -###### wallet? - -`WalletContractV4` = `...` - -#### Returns - -`Promise`\<`void`\> - -Promise that resolves when the transaction is sent - -*** - -### tonDepositAndCall() - -> **tonDepositAndCall**(`params`, `options`): `Promise`\<`void`\> - -Deposits tokens and makes a cross-chain call from TON to a universal contract on ZetaChain. - -This function combines token deposit with a contract call in a single transaction. -It allows you to transfer TON tokens from TON blockchain to ZetaChain and immediately -execute a function call on the universal contract. - -You can provide either: -- `data`: Raw data string for non-EVM chains -- `types` and `values`: For EVM chains, to encode function parameters - -#### Parameters - -##### params - -The deposit and call parameters including amount, receiver, and call data - -###### amount - -`string` = `...` - -###### data? - -`string` = `...` - -###### receiver - -`string` = `...` - -###### types? - -`string`[] = `...` - -###### values? - -(`string` \| `bigint` \| `boolean`)[] = `...` - -##### options - -Configuration options including chain ID, RPC endpoint, wallet, and API key - -###### apiKey? - -`string` = `...` - -###### chainId - -`string` = `...` - -###### gateway? - -`string` = `...` - -###### keyPair? - -`KeyPair` = `...` - -###### rpc - -`string` = `...` - -###### signer? - -`string` = `...` - -###### wallet? - -`WalletContractV4` = `...` - -#### Returns - -`Promise`\<`void`\> - -Promise that resolves when the transaction is sent - -*** - -### zetachainCall() - -> **zetachainCall**(`params`, `options`): `Promise`\<\{ `gasFee`: `bigint`; `gasZRC20`: `string`; `tx`: `ContractTransactionResponse`; \}\> - -Makes a cross-chain call from ZetaChain to another chain - -This function allows you to call a contract on a destination chain -from a universal contract on ZetaChain without transferring any tokens. -It automatically handles gas fee calculation and approval using the specified ZRC20 token. - -#### Parameters - -##### params - -The call parameters including receiver address, call data, gas options, and ZRC20 token - -###### callOptions - -\{ `gasLimit`: `string` \| `number` \| `bigint`; `isArbitraryCall`: `boolean`; \} = `callOptionsSchema` - -###### callOptions.gasLimit - -`string` \| `number` \| `bigint` = `bigNumberishSchema` - -###### callOptions.isArbitraryCall - -`boolean` = `...` - -###### data? - -`string` = `...` - -###### function? - -`string` = `...` - -###### receiver - -`string` = `...` - -###### revertOptions - -\{ `abortAddress?`: `string`; `callOnRevert`: `boolean`; `onRevertGasLimit?`: `string` \| `number` \| `bigint`; `revertAddress?`: `string`; `revertMessage`: `string`; \} = `revertOptionsSchema` - -###### revertOptions.abortAddress? - -`string` = `...` - -###### revertOptions.callOnRevert - -`boolean` = `...` - -###### revertOptions.onRevertGasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### revertOptions.revertAddress? - -`string` = `...` - -###### revertOptions.revertMessage - -`string` = `...` - -###### types? - -`string`[] = `...` - -###### values? - -(`string` \| `bigint` \| `boolean`)[] = `...` - -###### zrc20 - -`string` = `evmAddressSchema` - -##### options - -Configuration options including signer and optional gateway address - -###### gateway? - -`string` = `...` - -###### signer - -`Wallet` = `...` - -###### txOptions? - -\{ `gasLimit?`: `string` \| `number` \| `bigint`; `gasPrice?`: `string` \| `number` \| `bigint`; `value?`: `string` \| `number` \| `bigint`; \} = `...` - -###### txOptions.gasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.gasPrice? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.value? - -`string` \| `number` \| `bigint` = `...` - -#### Returns - -`Promise`\<\{ `gasFee`: `bigint`; `gasZRC20`: `string`; `tx`: `ContractTransactionResponse`; \}\> - -Promise that resolves to an object containing gas fee, gas ZRC20 address, and transaction receipt - -*** - -### zetachainWithdraw() - -> **zetachainWithdraw**(`params`, `options`): `Promise`\<\{ `gasFee`: `bigint`; `gasZRC20`: `string`; `tx`: `ContractTransactionResponse`; \}\> - -Withdraws tokens from ZetaChain to a destination chain - -This function allows you to transfer ZRC20 tokens from ZetaChain to a destination chain. -It automatically handles gas fee calculation and approval. If the withdrawal token -is the same as the gas token, it combines the approvals into a single transaction. - -#### Parameters - -##### params - -The withdrawal parameters including amount, receiver address, ZRC20 token, and revert options - -###### amount - -`string` = `...` - -###### receiver - -`string` = `...` - -###### revertOptions - -\{ `abortAddress?`: `string`; `callOnRevert`: `boolean`; `onRevertGasLimit?`: `string` \| `number` \| `bigint`; `revertAddress?`: `string`; `revertMessage`: `string`; \} = `revertOptionsSchema` - -###### revertOptions.abortAddress? - -`string` = `...` - -###### revertOptions.callOnRevert - -`boolean` = `...` - -###### revertOptions.onRevertGasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### revertOptions.revertAddress? - -`string` = `...` - -###### revertOptions.revertMessage - -`string` = `...` - -###### zrc20 - -`string` = `evmAddressSchema` - -##### options - -Configuration options including signer and optional gateway address - -###### gateway? - -`string` = `...` - -###### signer - -`Wallet` = `...` - -###### txOptions? - -\{ `gasLimit?`: `string` \| `number` \| `bigint`; `gasPrice?`: `string` \| `number` \| `bigint`; `value?`: `string` \| `number` \| `bigint`; \} = `...` - -###### txOptions.gasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.gasPrice? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.value? - -`string` \| `number` \| `bigint` = `...` - -#### Returns - -`Promise`\<\{ `gasFee`: `bigint`; `gasZRC20`: `string`; `tx`: `ContractTransactionResponse`; \}\> - -Promise that resolves to an object containing gas fee, gas ZRC20 address, and transaction receipt - -*** - -### zetachainWithdrawAndCall() - -> **zetachainWithdrawAndCall**(`params`, `options`): `Promise`\<\{ `gasFee`: `bigint`; `gasZRC20`: `string`; `tx`: `ContractTransactionResponse`; \}\> - -Withdraws tokens and makes a cross-chain call from ZetaChain to a destination chain - -This function combines token withdrawal with a contract call in a single transaction. -It allows you to transfer ZRC20 tokens from ZetaChain to a destination chain and -immediately execute a function call on that chain. It automatically handles gas -fee calculation and approval. - -#### Parameters - -##### params - -The withdrawal and call parameters including amount, receiver address, call data, gas options, and ZRC20 token - -###### amount - -`string` = `...` - -###### callOptions - -\{ `gasLimit`: `string` \| `number` \| `bigint`; `isArbitraryCall`: `boolean`; \} = `callOptionsSchema` - -###### callOptions.gasLimit - -`string` \| `number` \| `bigint` = `bigNumberishSchema` - -###### callOptions.isArbitraryCall - -`boolean` = `...` - -###### data? - -`string` = `...` - -###### function? - -`string` = `...` - -###### receiver - -`string` = `...` - -###### revertOptions - -\{ `abortAddress?`: `string`; `callOnRevert`: `boolean`; `onRevertGasLimit?`: `string` \| `number` \| `bigint`; `revertAddress?`: `string`; `revertMessage`: `string`; \} = `revertOptionsSchema` - -###### revertOptions.abortAddress? - -`string` = `...` - -###### revertOptions.callOnRevert - -`boolean` = `...` - -###### revertOptions.onRevertGasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### revertOptions.revertAddress? - -`string` = `...` - -###### revertOptions.revertMessage - -`string` = `...` - -###### types? - -`string`[] = `...` - -###### values? - -(`string` \| `bigint` \| `boolean`)[] = `...` - -###### zrc20 - -`string` = `evmAddressSchema` - -##### options - -Configuration options including signer and optional gateway address - -###### gateway? - -`string` = `...` - -###### signer - -`Wallet` = `...` - -###### txOptions? - -\{ `gasLimit?`: `string` \| `number` \| `bigint`; `gasPrice?`: `string` \| `number` \| `bigint`; `value?`: `string` \| `number` \| `bigint`; \} = `...` - -###### txOptions.gasLimit? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.gasPrice? - -`string` \| `number` \| `bigint` = `...` - -###### txOptions.value? - -`string` \| `number` \| `bigint` = `...` - -#### Returns - -`Promise`\<\{ `gasFee`: `bigint`; `gasZRC20`: `string`; `tx`: `ContractTransactionResponse`; \}\> - -Promise that resolves to an object containing gas fee, gas ZRC20 address, and transaction receipt diff --git a/src/pages/reference/toolkit.zh-CN.mdx b/src/pages/reference/toolkit.zh-CN.mdx deleted file mode 100644 index df9d89998..000000000 --- a/src/pages/reference/toolkit.zh-CN.mdx +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: 工具包 ---- - -# ZetaChain Toolkit - -ZetaChain Toolkit 是一套 TypeScript SDK,可帮助你构建能够在任意连接链之间转移代币、调用合约、追踪交易的全链应用。 - -## ✨ 功能 - -- 跨链资产转移:从任意受支持的链向 ZetaChain 存入 Gas 与同质化代币,并随时提回。 -- 跨链合约执行:在 ZetaChain 上的全链合约接收外部调用,或主动向连接链合约发起调用。 -- 实时交易追踪:监控跨链交易在各网络间传播的完整生命周期。 -- 内建多链支持:开箱即用,覆盖 EVM 链、Solana、Sui、Bitcoin 与 TON。 - -## 📦 安装 - -```bash -npm i @zetachain/toolkit -``` - -## 🚀 快速上手 - -```ts -import { evmDeposit, zetachainCall } from "@zetachain/toolkit"; - -// 从以太坊向 ZetaChain 存入 USDC -await evmDeposit( - { - amount: "1.0", - receiver: "0xReceiverOnZetaChain", // ZetaChain 上的 EOA 或合约 - token: "0xUSDC", // 源链上的 ERC-20 - }, - { signer: ethersSigner } -); - -// 从 ZetaChain 向以太坊上的合约发送调用 -await zetachainCall( - { - receiver: "0xRecevierContract", // 连接链上的目标合约 - function: "hello(string)", - types: ["string"], - values: ["alice"], - zrc20: "0xZRC20", - }, - { signer: ethersSigner } -); -``` - -Toolkit 的全部功能也可以通过 [`zetachain` CLI](https://github.com/zeta-chain/cli) 调用。 - ---- - -以下函数 API 文档保留原始格式,便于查阅具体参数与返回值。如需详细说明,可直接参考官方英文注释。 - -## Functions - -### evmCall() - -> **evmCall**(`params`, `options`): `Promise`\<`ContractTransactionResponse`\> - -... - -(其余函数说明与原文一致。) - diff --git a/src/pages/reference/tools/address-converter.en-US.mdx b/src/pages/reference/tools/address-converter.en-US.mdx index 0429ad4fc..b17e21a6d 100644 --- a/src/pages/reference/tools/address-converter.en-US.mdx +++ b/src/pages/reference/tools/address-converter.en-US.mdx @@ -7,4 +7,4 @@ To convert between bech32 and EVM addresses, you can use the following tool: Converting between bech32 and EVM addresses is an off-chain operation and can be implemented in any programming language, for example, [in TypeScript](https://github.com/zeta-chain/docs/blob/main/src/components/Docs/components/AddressConverter/AddressConverter.utils.ts). -On the CLI you can also use [`zetacored debug addr`](/developers/architecture/zetacored#zetacored-debug-addr) command. +On the CLI you can also use the `zetacored debug addr` command. diff --git a/src/pages/reference/tools/address-converter.zh-CN.mdx b/src/pages/reference/tools/address-converter.zh-CN.mdx index c6bec1304..1a16c758e 100644 --- a/src/pages/reference/tools/address-converter.zh-CN.mdx +++ b/src/pages/reference/tools/address-converter.zh-CN.mdx @@ -4,5 +4,5 @@ import { AddressConverter } from "~/components/Docs"; -bech32 与 EVM 地址互转属于链下操作,可用任意编程语言实现,例如[TypeScript 示例](https://github.com/zeta-chain/docs/blob/main/src/components/Docs/components/AddressConverter/AddressConverter.utils.ts)。在 CLI 中也可以使用 [`zetacored debug addr`](/developers/architecture/zetacored#zetacored-debug-addr) 命令完成转换。 +bech32 与 EVM 地址互转属于链下操作,可用任意编程语言实现,例如[TypeScript 示例](https://github.com/zeta-chain/docs/blob/main/src/components/Docs/components/AddressConverter/AddressConverter.utils.ts)。在 CLI 中也可以使用 `zetacored debug addr` 命令完成转换。 diff --git a/src/pages/start/_meta.en-US.json b/src/pages/start/_meta.en-US.json index 6a6b03db2..2df1596d4 100644 --- a/src/pages/start/_meta.en-US.json +++ b/src/pages/start/_meta.en-US.json @@ -4,14 +4,14 @@ }, "zetachain": { "title": "What is ZetaChain?", - "description": "The Universal Layer for AI and Web3 — build apps that run across chains and models, keep memory private, and monetize without infrastructure." + "description": "ZetaChain is an EVM-compatible Layer 1 blockchain built on Cosmos SDK and CometBFT." }, "build": { - "title": "Why Build on ZetaChain?", - "description": "Chain orchestration, cross-chain native token transfers, gasless execution environment." + "title": "Build on ZetaChain", + "description": "Deploy EVM smart contracts on ZetaChain using Hardhat, Foundry, or any standard EVM toolchain." }, "app": { - "title": "Universal Apps", - "description": "Apps that seamlessly interact with multiple blockchains, including Ethereum, Bitcoin, Solana, and more." + "title": "Smart Contracts", + "description": "Deploy and interact with EVM smart contracts on ZetaChain." } -} \ No newline at end of file +} diff --git a/src/pages/start/_meta.zh-CN.json b/src/pages/start/_meta.zh-CN.json index 5922dcef2..4c832a90b 100644 --- a/src/pages/start/_meta.zh-CN.json +++ b/src/pages/start/_meta.zh-CN.json @@ -6,9 +6,9 @@ "title": "什么是 ZetaChain?" }, "build": { - "title": "为什么要在 ZetaChain 上构建?" + "title": "在 ZetaChain 上构建" }, "app": { - "title": "通用应用" + "title": "智能合约" } -} \ No newline at end of file +} diff --git a/src/pages/start/app.en-US.mdx b/src/pages/start/app.en-US.mdx index f57644821..41ef3b5b1 100644 --- a/src/pages/start/app.en-US.mdx +++ b/src/pages/start/app.en-US.mdx @@ -1,147 +1,16 @@ --- -title: Universal Apps +title: Smart Contracts +description: Deploy and interact with EVM smart contracts on ZetaChain. --- -import { Alert } from "~/components/shared"; +ZetaChain runs the Ethereum Virtual Machine. Solidity contracts deploy without +modification, and standard tooling — Hardhat, Foundry, ethers, viem — works +unchanged. -## Overview +Point your existing EVM workflow at a ZetaChain RPC endpoint to deploy. Chain +IDs, public RPCs, and the testnet faucet are documented in +[Network Details](/reference/details), [RPC/API Endpoints](/reference/api), +and [Faucet](/reference/faucet). -A universal app is a smart contract on ZetaChain that is natively connected to -other blockchains like Ethereum, BNB and Bitcoin. - -Unlike a regular contract, a universal app can accept contract calls, messages -and token transfers from any connected chain. It can also trigger contract -calls, and make token transfers on connected chains. These abilities enable -universal apps to orchestrate complex multi-step transactions that span across -chains. - -For example, a Bitcoin user can interact with a universal app to send USDC to a -recipient on Ethereum. An Ethereum user can buy an NFT on ZetaChain and send it -to to their account on the BNB chain. - -Universal apps are deployed on ZetaChain's universal EVM, which extends the EVM -with omnichain interoperability features. This means your existing contracts -will work out of the box on ZetaChain, and with some modifications, they can -gain powerful omnichain capabilities. - -Here's an example universal app: - -```solidity -pragma solidity 0.8.26; - -import "@zetachain/protocol-contracts/contracts/zevm/interfaces/UniversalContract.sol"; - -contract UniversalApp is UniversalContract { - function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message - ) external virtual override { - // ... - } -} -``` - -## Calling Universal Apps - -Users can call universal apps by interacting with a **Gateway contract** on a -connected chain. Each connected chain has a single Gateway contract that exposes -methods to deposit tokens to and call universal apps. Users can pass both data -and tokens when calling universal apps. - -In this example an Ethereum user sends 1 ETH and a message "hello" to a -universal app: - - - -A call to a universal app triggers an `onCall` method. - -A universal app receives: - -- a message (in this example, `"hello"`) containing arbitrary data. A message - can include recipient address, a token address, properties of an NFT to be - minted, etc. -- tokens represented as ZRC-20 (in this example, 1 ZRC-20 ETH). - -Each native gas and supported ERC-20 token from connected chains has a -corresponding ZRC-20 token on ZetaChain. ZRC-20 tokens are ERC-20-compatible and -can be permissionlessly transferred back (withdrawn) to their original chain -(ZRC-20 ETH on ZetaChain becomes ETH on Ethereum). - -`onCall` also has access to additional context information such as the original -sender address and chain ID. - -Universal apps can also initiate token transfers and contract calls to connected -chains. - -In this example a universal app: - -- accepts 6 ETH and "I want BNB" (bytes that represent the destination token) - from Ethereum -- swaps 6 ZRC-20 ETH for ZRC-20 BNB using a decentralized exchange on ZetaChain -- calls the Gateway contract to withdraw ZRC-20 BNB and call a contract on the - BNB chain - -Of course, a single universal app call can trigger more than one call to -different chains. - - - -With a universal app a complex sequence of transactions and value transfers that -span multiple blockchains can be triggered by a single user-signed transaction. - -## Bitcoin Support - -Universal apps are fully-compatible with Bitcoin. The same universal app -contract can receive calls from any connected chain. - -Users can call universal apps from the Bitcoin network by sending BTC and data -to the **Gateway address**. To make a call to a universal app a Bitcoin user -only needs to sign a single transaction using their wallet of choice. Universal -apps offer gas abstraction, so end-user are not required to have an account on -chains other than Bitcoin or acquire gas tokens. - -## Gas Abstraction - -Incoming calls to universal apps from connected chains do not incur additional -gas costs aside from the initial interaction with the Gateway contract. - -Outgoing calls from universal apps (like contract calls and token withdrawals) -to connected chains require gas. Universal EVM offers tools to query gas, and -it's up to each universal app to make sure that the contract has the right -amount of ZRC-20 gas token to cover the gas fees. - -In practice it means that a universal app would swap a fraction of the incoming -ZRC-20 token to the ZRC-20 of the gas token of the chain to which an outgoing -call is made. When an outgoing call or withdrawal is made, a required amount of -ZRC-20 gas token is deducted to cover the gas fees on the destination chain. - -For end user this system abstracts away the complexities of cross-chain gas. As -long as the user provides a sufficient amount as input (in the token of their -choosing), the gas fees will be covered. - -## Summary - -- Universal apps: - - can receive contract calls and tokens from users and contracts on connected - chains - - can trigger contract calls and token transfers to connected chains - - can automatically handle gas for cross-chain transactions - - are fully compatible with EVM chains (like Ethereum, BNB, and Polygon), - Bitcoin, Solana, TON, Sui. Support for Cosmos (through IBC) and other chains - is coming soon. -- Native gas and supported ERC-20 tokens are represented as ZRC-20 tokens. A - ZRC-20 token can be permissionlessly withdrawn back to its original chain. +For working with addresses across both bech32 Cosmos and hex EVM formats, see +[Account Addresses](/developers/addresses). diff --git a/src/pages/start/app.zh-CN.mdx b/src/pages/start/app.zh-CN.mdx index 6344005c3..41ef3b5b1 100644 --- a/src/pages/start/app.zh-CN.mdx +++ b/src/pages/start/app.zh-CN.mdx @@ -1,114 +1,16 @@ --- -title: 通用应用 +title: Smart Contracts +description: Deploy and interact with EVM smart contracts on ZetaChain. --- -# 通用应用(Universal Apps) +ZetaChain runs the Ethereum Virtual Machine. Solidity contracts deploy without +modification, and standard tooling — Hardhat, Foundry, ethers, viem — works +unchanged. -## 概述 +Point your existing EVM workflow at a ZetaChain RPC endpoint to deploy. Chain +IDs, public RPCs, and the testnet faucet are documented in +[Network Details](/reference/details), [RPC/API Endpoints](/reference/api), +and [Faucet](/reference/faucet). -通用应用是部署在 ZetaChain 上、能够原生连接其他区块链(如 -Ethereum、BNB、Bitcoin)的智能合约。 - -与普通合约不同,通用应用可以接收来自任意已连接链的合约调用、消息和代币转账。它也 -可以向其他链发起合约调用和代币转账。这些能力使通用应用能够编排跨链的多步骤复杂交 -易。 - -例如,Bitcoin 用户可以与通用应用交互,将 USDC 发送到 Ethereum 上的收件 -人。Ethereum 用户可以在 ZetaChain 上购买 NFT 并将其发送到 BNB 链上的账户。 - -通用应用部署在 ZetaChain 的 Universal EVM 上,它在 EVM 的基础上扩展了全链互操作 -功能。这意味着你现有的合约可以直接在 ZetaChain 上运行,只需少量修改即可获得强大 -的全链能力。 - -以下是一个通用应用示例: - -```solidity -pragma solidity 0.8.26; - -import "@zetachain/protocol-contracts/contracts/zevm/interfaces/UniversalContract.sol"; - -contract UniversalApp is UniversalContract { - function onCall( - MessageContext calldata context, - address zrc20, - uint256 amount, - bytes calldata message - ) external virtual override { - // ... - } -} -``` - -## 调用通用应用 - -用户可以通过已连接链上的 **Gateway 合约** 来调用通用应用。每条连接链都有一个 -Gateway,它提供向通用应用存入代币并调用其方法的接口。用户在调用时可以同时传递数 -据和代币。 - -例如,一个 Ethereum 用户发送 1 ETH 和消息 `"hello"` 给一个通用应用: - -(Figma 嵌入图略) - -一次对通用应用的调用会触发 `onCall` 方法。 - -通用应用会接收到: - -- 一条消息(例如 `"hello"`),可以包含任意数据,如收件人地址、代币地址、NFT 属性 - 等 -- ZRC-20 形式的代币(例如 1 个 ZRC-20 ETH) - -每种来自连接链的原生 gas 代币和受支持的 ERC-20 都在 ZetaChain 上有一个对应的 -ZRC-20。ZRC-20 是 ERC-20 兼容的,并且可以无许可地提回原链(例如 ZRC-20 ETH 可提 -回为 Ethereum 上的 ETH)。 - -`onCall` 还可以访问上下文信息,例如原始发送者地址和链 ID。 - -通用应用也可以向连接链发起代币转账和合约调用。 - -例如,某通用应用会: - -- 接收来自 Ethereum 的 6 ETH 和消息 `"I want BNB"`(表示目标代币) -- 使用 ZetaChain 上的 DEX 将 6 个 ZRC-20 ETH 交换成 ZRC-20 BNB -- 然后调用 Gateway 将 ZRC-20 BNB 提回并调用 BNB 链上的合约 - -单次调用可以触发对多条链的调用。 - -(Figma 嵌入图略) - -通过通用应用,跨多链的复杂交易和价值流可以由用户的一次签名交易完成。 - -## Bitcoin 支持 - -通用应用完全兼容 Bitcoin。相同的通用应用合约可以接收来自任意连接链的调用。 - -Bitcoin 用户可以向 Gateway 地址发送 BTC 和数据来调用通用应用。整个过程只需要用户 -在他们的 BTC 钱包中签一次交易。通用应用还提供 gas 抽象机制,因此用户不需要在其他 -链上创建账户或获取 gas 代币。 - -## Gas 抽象 - -来自连接链的调用(如从 Gateway 进入通用应用)不会产生除初始 Gateway 交互之外的额 -外 gas 成本。 - -从通用应用发出的跨链调用(例如合约调用和提币)需要 gas。Universal EVM 提供接口查 -询 gas,通用应用需要确保合约持有足够的 ZRC-20 gas 代币(对应目标链的 gas)。 - -通常做法是通用应用会将收到的代币的一小部分兑换成目标链的 gas 代币(ZRC-20 版 -本)。当触发提币或跨链调用时,会扣除相应数量的 ZRC-20 gas 代币来支付目标链的费 -用。 - -对于用户而言,这套系统隐藏了跨链 gas 的复杂性。只要用户提供足够的输入代币(任何 -代币都可以),gas 都会得到覆盖。 - -## 总结 - -- 通用应用: - - - 可以接收来自已连接链上用户和合约的调用及代币 - - 可以向已连接链发起合约调用和代币转账 - - 可以自动处理跨链交易的 gas - - 完全兼容 EVM 链(如 Ethereum、BNB、Polygon)、Bitcoin、Solana、TON、Sui 对 - Cosmos(通过 IBC)等更多链的支持即将推出 - -- 原生 gas 和受支持的 ERC-20 代币会以 ZRC-20 形式存在。ZRC-20 可以无许可地提回原 - 链。 +For working with addresses across both bech32 Cosmos and hex EVM formats, see +[Account Addresses](/developers/addresses). diff --git a/src/pages/start/build.en-US.mdx b/src/pages/start/build.en-US.mdx index 0e966a5e7..209c69db9 100644 --- a/src/pages/start/build.en-US.mdx +++ b/src/pages/start/build.en-US.mdx @@ -1,132 +1,18 @@ -ZetaChain is a platform that empowers developers to create universal -applications capable of seamlessly interacting with any blockchain. Whether your -application needs to operate on Ethereum, BNB Chain, Solana, TON, or even -non-smart contract blockchains like Bitcoin, ZetaChain provides the -infrastructure to make this possible with minimal friction. ZetaChain unifies diverse blockchain ecosystems under a single development framework, -enabling your apps to function across all of them effortlessly. +--- +title: Build on ZetaChain +description: Deploy EVM smart contracts on ZetaChain using Hardhat, Foundry, or any standard EVM toolchain. +--- -## Chain Orchestration +ZetaChain is EVM-compatible. Standard Solidity contracts deploy unchanged, and +the usual EVM tooling — Hardhat, Foundry, ethers, viem, MetaMask, WalletConnect — +works out of the box. -![https://excalidraw.com/#json=H_5eUXC-4m4FnbNoPIDoC,WqRygXYCYvAmlbTTqhc3Bg](/img/docs/why-orchestration.png) +## What you need -One of the standout features of ZetaChain is its ability to orchestrate complex -transactions across multiple blockchains from a single smart contract. Universal -apps built on ZetaChain can manage incoming token transfers and contract calls -from different blockchains and initiate outgoing transactions to connected -networks—all within a unified framework. +- An EVM wallet with the ZetaChain network added. See [Network Details](/reference/details). +- Testnet ZETA from the [faucet](/reference/faucet) if you're deploying to testnet. +- A public or private [RPC endpoint](/reference/api). -For example, consider an application that needs to interact with both -Ethereum and Solana. Traditionally, this would require separate codebases -and management of intricate communication protocols between the two chains. -With ZetaChain, your universal app seamlessly handles these operations, -coordinating transactions across chains without multiple contracts -or complex interoperability solutions. +## Token standards -This chain orchestration capability simplifies the development process, reduces -the potential for errors, and ensures that your application can scale as it -integrates with more blockchains. - -## Forward Compatibility - -When you deploy an app on ZetaChain, it automatically connects to all -networks in the ZetaChain ecosystem. As new blockchains are added, -your universal app gains compatibility with these networks without -any additional effort or modifications to your contract's source code. -This forward compatibility is a significant advantage, as it future-proofs your -application. You don't have to anticipate which blockchains might become popular -or widely adopted in the future; your app will be ready to interact with them as -soon as they are integrated into ZetaChain. This not only saves development time -but also ensures that your app remains relevant and accessible to users across -different blockchain networks. - -This feature simplifies maintenance, as you don't need to update your contracts -or redeploy your application whenever a new blockchain is connected. Your app -can continue to operate smoothly, providing a consistent user experience even as -the underlying blockchain landscape evolves. - -## Transfer Native Tokens - -![https://excalidraw.com/#json=xico4ELR7yTlLxR4kDK25,6GRqZsXB_gDM4wFvb_fSpA](/img/docs/why-custody.png) - -One of the core capabilities of universal apps on ZetaChain is the ability to -transfer value using native tokens across all connected chains. This means users -can perform transactions involving the actual native assets of each blockchain, -rather than wrapped or synthetic versions. - -For example, users can send native USDC from Ethereum directly to Polygon, or -swap native BTC from the Bitcoin network for PEPE tokens on Ethereum. This -cross-chain token transfer functionality enhances liquidity and provides a -seamless experience, eliminating the need for intermediaries or -complex token wrapping mechanisms. - -To facilitate these transfers, universal apps have access to unified liquidity -pools on ZetaChain. These pools aggregate liquidity from all connected chains, -containing tokens that have been transferred to ZetaChain from their respective -networks. - -Adding liquidity to these unified pools involves transferring tokens to the -custody of ZetaChain validators on the connected chains. For instance, ZetaChain -validators hold custody of ETH, USDC, and other tokens on Ethereum. This custody -mechanism is secured through robust consensus protocols and validator -incentives, ensuring the safety of the assets. - -This system allows users to send tokens to and from universal apps, as well as -directly between connected chains, without the need for centralized exchanges or -third-party bridges. It streamlines the user experience and reduces the risks -associated with cross-chain transactions, such as double-spending or transaction -failures. - -By using native tokens, users benefit from the inherent properties of those -assets, including their security features, consensus mechanisms, and existing -network effects. This enhances trust and reliability in cross-chain operations -conducted through ZetaChain-powered universal apps. - -## Familiar Developer Experience - -ZetaChain runs smart contracts on its Universal Ethereum Virtual Machine (UEVM), -which is fully compatible with Ethereum's EVM. This means developers can write -smart contracts in Solidity or other EVM-compatible languages, leveraging their -existing knowledge and expertise. - -The platform supports popular development tools like Foundry, Hardhat, Slither, -and Ethers.js right out of the box. This compatibility allows developers to use -familiar workflows, debugging tools, and testing frameworks, making the process -of building universal apps more efficient and less error-prone. - -For instance, if you're accustomed to using Hardhat for compiling and deploying -smart contracts on Ethereum, you can continue to use it seamlessly with -ZetaChain. This reduces the learning curve and accelerates the development -process, enabling you to focus on building innovative features rather than -grappling with new tooling or languages. - -## Gasless EVM Execution Environment - -Another compelling feature of ZetaChain is its Gasless EVM Execution -Environment. Universal apps run on ZetaChain's EVM and can be called by users -and contracts from all connected chains. When a universal app is called from a -connected chain, it requires gas payment only on that connected chain. Execution -on ZetaChain does not impose any additional fees, making ZetaChain a -cost-effective, gasless environment for deploying contracts. This significantly -reduces expenses for end-users and enhances the accessibility of your -applications. - -For end-users, the gasless execution environment means they can interact with -your universal app without worrying about incurring high transaction fees on -multiple chains. - -Traditional message-passing solutions often lack a dedicated execution -environment, meaning every contract call requires gas payments on both ends. -This not only increases costs but also adds layers of complexity to transaction -handling. ZetaChain's gasless environment eliminates these hurdles, providing a -smoother and more efficient pathway for cross-chain contract execution. - -## Conclusion - -ZetaChain provides a comprehensive solution for developing universal -applications capable of interacting with any blockchain. Powerful chain -orchestration, forward compatibility, native token transfers, and gasless -execution environment significantly reduce the technical and financial barriers -typically associated with cross-chain app development. By offering a familiar -developer experience and ensuring seamless scalability as new blockchains are -added, ZetaChain future-proofs applications, making them accessible, efficient, -and ready for widespread adoption. +ERC-20, ERC-721, and ERC-1155 are supported. See [ERC-20 on ZetaChain](/developers/erc20) and the [ZETA token](/developers/zeta) reference. diff --git a/src/pages/start/build.zh-CN.mdx b/src/pages/start/build.zh-CN.mdx index 48a39de95..209c69db9 100644 --- a/src/pages/start/build.zh-CN.mdx +++ b/src/pages/start/build.zh-CN.mdx @@ -1,95 +1,18 @@ --- -title: 为什么要在 ZetaChain 上构建? +title: Build on ZetaChain +description: Deploy EVM smart contracts on ZetaChain using Hardhat, Foundry, or any standard EVM toolchain. --- -ZetaChain 是一个平台,帮助开发者构建能够与任何区块链无缝交互的通用应用。无论你的 -应用需要在 Ethereum、BNB Chain、Solana、TON,还是在 Bitcoin 等缺乏智能合约功能的 -链上运作,ZetaChain 都提供最小阻力的基础设施来实现这一切。ZetaChain 将多样的区块 -链生态统一到一个开发框架之下,让你的应用轻松在所有网络上运行。 +ZetaChain is EVM-compatible. Standard Solidity contracts deploy unchanged, and +the usual EVM tooling — Hardhat, Foundry, ethers, viem, MetaMask, WalletConnect — +works out of the box. -## 链编排 +## What you need -![https://excalidraw.com/#json=H_5eUXC-4m4FnbNoPIDoC,WqRygXYCYvAmlbTTqhc3Bg](/img/docs/why-orchestration.png) +- An EVM wallet with the ZetaChain network added. See [Network Details](/reference/details). +- Testnet ZETA from the [faucet](/reference/faucet) if you're deploying to testnet. +- A public or private [RPC endpoint](/reference/api). -ZetaChain 的一大亮点是能够从单个智能合约编排跨多个区块链的复杂交易。构建在 -ZetaChain 上的通用应用可以在统一框架内管理来自不同链的代币转账和合约调用,并向已 -连接网络发起外部交易。 +## Token standards -例如,一个需要同时与 Ethereum 和 Solana 交互的应用,传统上需要分别维护两个代码 -库,并处理两条链之间复杂的通信协议。有了 ZetaChain,通用应用可以无缝处理这些操 -作,在无需多个合约或复杂互操作解决方案的情况下协调跨链交易。 - -这种链编排能力简化了开发流程,降低了出错概率,并确保你的应用在整合更多区块链时仍 -能扩展。 - -## 面向未来的兼容性 - -当你在 ZetaChain 上部署应用时,它会自动连接到 ZetaChain 生态中的所有网络。随着新 -的区块链加入,你的通用应用无需额外工作或修改合约源码,就能立即兼容这些网络。 - -这种前向兼容是一大优势:它让你的应用具备面向未来的能力。你不必预判哪些区块链会在 -未来流行;一旦它们集成到 ZetaChain,你的应用就可以与之交互。这不仅节省开发时间, -还保证你的应用在不同区块链用户之间保持相关性和可访问性。 - -这一特性也简化了维护工作,你无需在连接新链时更新合约或重新部署应用。你的应用可以 -持续稳定运行,即使底层的区块链版图不断演进,也能提供一致的用户体验。 - -## 转移原生代币 - -![https://excalidraw.com/#json=xico4ELR7yTlLxR4kDK25,6GRqZsXB_gDM4wFvb_fSpA](/img/docs/why-custody.png) - -通用应用在 ZetaChain 上的一项核心能力,是能够跨所有连接链以原生代币完成价值传 -递。这意味着用户可以使用各自区块链的原生资产进行交易,而不是依赖包装代币或合成资 -产。 - -例如,用户可以将 Ethereum 上的原生 USDC 直接发送到 Polygon,或者将 Bitcoin 网络 -上的原生 BTC 兑换为 Ethereum 上的 PEPE 代币。这种跨链代币转账增强了流动性,提供 -无缝体验,免去了中间方或复杂包裹机制的需求。 - -为了实现这些转账,通用应用可以访问 ZetaChain 上的统一流动性池。这些流动性池汇集 -了来自所有连接链的流动性,包含已经从各自网络转移到 ZetaChain 的代币。 - -向统一流动性池添加流动性需要将代币转移到连接链上 ZetaChain 验证者的托管之下。例 -如,ZetaChain 验证者在 Ethereum 上托管 ETH、USDC 等代币。该托管机制依靠稳健的共 -识协议和激励机制来确保资产安全。 - -这套系统让用户可以向通用应用发送代币,也可以在连接链之间直接转账,而不需要中心化 -交易所或第三方跨链桥。它简化了用户体验,并降低跨链交易常见的风险,例如双花或交易 -失败。 - -通过使用原生代币,用户能够享受原生资产所具备的安全性、共识机制以及既有的网络效 -应。这增强了通过 ZetaChain 驱动的跨链操作的信任度与可靠性。 - -## 熟悉的开发者体验 - -ZetaChain 在其通用以太坊虚拟机(UEVM)上运行智能合约,完全兼容 Ethereum 的 EVM。 -这意味着开发者可以用 Solidity 或其他兼容 EVM 的语言编写智能合约,充分利用现有的 -知识与经验。 - -该平台原生支持 Foundry、Hardhat、Slither、Ethers.js 等常用开发工具。开发者可以沿 -用熟悉的工作流、调试工具和测试框架,使构建通用应用的过程更高效、更少出错。 - -例如,如果你习惯使用 Hardhat 来在 Ethereum 上编译和部署合约,那么在 ZetaChain 上 -也可以无缝继续使用。这样能够降低学习成本,加速开发,让你可以把精力集中在构建创新 -功能上,而不是适应全新的工具或语言。 - -## 免 Gas 的 EVM 执行环境 - -ZetaChain 的另一项亮点是免 Gas 的 EVM 执行环境。通用应用运行在 ZetaChain 的 EVM -上,并可以被所有连接链上的用户与合约调用。当通用应用从连接链被调用时,用户只需在 -该连接链支付 gas。ZetaChain 上的执行不收取额外费用,使其成为部署合约的高性价比、 -免 Gas 环境,大幅降低终端用户成本并提升应用可访问性。 - -对于终端用户而言,免 Gas 的执行环境意味着他们可以与通用应用交互,而无需担心在多 -条链上产生高昂的交易费用。 - -传统的信息传递方案通常缺乏专门的执行环境,每一次合约调用都需要在两端支付 gas。这 -不仅增加成本,还为交易处理带来额外复杂性。ZetaChain 的免 Gas 环境消除了这些阻 -碍,为跨链合约执行提供更顺畅、更高效的路径。 - -## 总结 - -ZetaChain 为构建能够与任何区块链交互的通用应用提供全面解决方案。强大的链编排、前 -向兼容性、原生代币转账以及免 Gas 执行环境,显著降低了跨链应用开发常见的技术和资 -金门槛。凭借熟悉的开发者体验,并确保在新增区块链时依旧可以无缝扩展,ZetaChain 为 -应用提供面向未来的保障,让它们更加易用、高效,并随时准备迎接广泛采用。 +ERC-20, ERC-721, and ERC-1155 are supported. See [ERC-20 on ZetaChain](/developers/erc20) and the [ZETA token](/developers/zeta) reference. diff --git a/src/pages/start/zetachain.en-US.mdx b/src/pages/start/zetachain.en-US.mdx index 96b0bde37..5a2ed428e 100644 --- a/src/pages/start/zetachain.en-US.mdx +++ b/src/pages/start/zetachain.en-US.mdx @@ -1,87 +1,24 @@ --- title: What is ZetaChain? -description: Description +description: ZetaChain is an EVM-compatible Layer 1 blockchain built on Cosmos SDK and CometBFT. --- -ZetaChain is the Universal Layer for AI and Web3 — a platform where apps run -across chains and models, memory stays private, and monetization works without -infrastructure. +ZetaChain is a Proof of Stake Layer 1 blockchain built with the +[Cosmos SDK](https://docs.cosmos.network/) and the +[CometBFT](https://docs.cometbft.com/) consensus engine, with EVM compatibility +provided by [Cosmos EVM](https://evm.cosmos.network/). -## The Future We See +## Network properties -The next wave of applications will span blockchains and AI models. But today, -developers face fragmented ecosystems: different chains, different providers, -different integration patterns. Users are trapped in silos where their data and -context don't follow them. And builders must stand up servers, billing systems, -and account flows just to monetize. +- Full EVM compatibility — Ethereum smart contracts and tooling work without modification. +- ~5 second block time with instant finality. +- EIP-1559 fee market. +- Native token: ZETA, used for staking, gas, and governance. On-chain denom is `azeta` (1 ZETA = 10¹⁸ azeta). +- Two address formats: bech32 Cosmos addresses (`zeta` prefix) and hex EVM addresses derived from the same public key. -At ZetaChain, we envision a future where apps work natively across every chain -and every model. Where users own their memory and control who can access it. -Where developers can monetize usage, context, and execution globally — without -infrastructure overhead. This is the Universal Layer. +## Next steps -## Universal Blockchain - -ZetaChain is the first ever Universal Blockchain to enable native connection -across all blockchain ecosystems. - -Zetachain brings programmability to non-smart contract chains such as Bitcoin -and Dogecoin, opening up unprecedented possibilities for developers to create -truly interoperable applications without sacrificing security or user -experience. - -### Universal PoS - -ZetaChain's Proof of Stake system, built on Cosmos SDK and Comet BFT, secures -efficient cross-chain operations with: - -- 5-Second Finality -- Core Validators and Observer-Signer Validators to ensure network and - cross-chain security -- Incentive mechanisms that prioritize security across all connected chains - -### Universal EVM - -Universal EVM is an execution environment that can be called from any chain, -allowing developers to: - -- Manage and interact with native assets, contracts, and wallets across - connected chains -- Create applications with built-in cross-chain capabilities within a familiar - EVM environment - -### Universal Smart Contract - -Universal Smart Contract is deployed natively on ZetaChain and can read and -write to any connected chains. It streamlines cross-chain development by: - -- Orchestrating complex multi-chain actions -- Accessing liquidity across different networks -- Delivering unified, cross-chain user experiences -- Extending functionality with additional chain-specific contracts when needed - -## Solutions - -### Bitcoin: Unlocking New Possibilities - -ZetaChain brings programmability to Bitcoin, enabling native DeFi interactions -without intermediaries. Developers can create new yield opportunities for -Bitcoin and bring Bitcoin in the broader crypto economy securely. - -### DeFi: Unifying Multi-Chain Liquidity - -ZetaChain forms a unified liquidity and execution hub for DeFi applications to -build across different networks effortlessly: DEXs, yield aggregators, -stablecoins, money markets, and more. - -### Social, Gaming, NFT: Universal Digital Ownership - -Mint, trade, and manage digital assets and data across any blockchain -ecosystems, enabling simple interoperability and interactions for creators, -collectors, and players. - -### Infrastructure: Institutional-Grade Credibility - -Built on a decentralized, secure foundation and supported by industry-leading -validators, ZetaChain provides an institutional-grade platform for Universal -Solutions. +- [Build on ZetaChain](/start/build) +- [Run a node](/nodes) +- [Use ZetaChain](/users) +- [RPC and contract addresses](/reference) diff --git a/src/pages/start/zetachain.zh-CN.mdx b/src/pages/start/zetachain.zh-CN.mdx index b0941731c..5a2ed428e 100644 --- a/src/pages/start/zetachain.zh-CN.mdx +++ b/src/pages/start/zetachain.zh-CN.mdx @@ -1,61 +1,24 @@ --- -title: 什么是 ZetaChain? -description: 概述 +title: What is ZetaChain? +description: ZetaChain is an EVM-compatible Layer 1 blockchain built on Cosmos SDK and CometBFT. --- -ZetaChain 是 AI 与 Web3 的通用层——一个让应用跨链跨模型运行、内存保持私密、无需基础设施即可变现的平台。 +ZetaChain is a Proof of Stake Layer 1 blockchain built with the +[Cosmos SDK](https://docs.cosmos.network/) and the +[CometBFT](https://docs.cometbft.com/) consensus engine, with EVM compatibility +provided by [Cosmos EVM](https://evm.cosmos.network/). -## 我们眼中的未来 +## Network properties -下一波应用将横跨区块链和 AI 模型。但今天,开发者面对的是碎片化的生态:不同的链、不同的服务商、不同的集成方式。用户被困在数据和上下文无法跟随的孤岛中。而构建者仅仅为了变现,就必须搭建服务器、计费系统和账户流程。 +- Full EVM compatibility — Ethereum smart contracts and tooling work without modification. +- ~5 second block time with instant finality. +- EIP-1559 fee market. +- Native token: ZETA, used for staking, gas, and governance. On-chain denom is `azeta` (1 ZETA = 10¹⁸ azeta). +- Two address formats: bech32 Cosmos addresses (`zeta` prefix) and hex EVM addresses derived from the same public key. -在 ZetaChain,我们期待一个未来——应用原生运行在每一条链、每一个模型之上。用户拥有自己的记忆,并控制谁可以访问。开发者可以在全球范围内对使用、上下文和执行进行变现——无需基础设施开销。这就是通用层。 - -## 通用区块链 - -ZetaChain 是首个实现所有区块链生态原生互联的通用区块链。 - -ZetaChain 为缺乏智能合约能力的链(如 Bitcoin 和 Dogecoin)带来可编程性,为开发者创造真正互操作的应用提供了前所未有的可能,同时不牺牲安全性或用户体验。 - -### 通用 PoS - -ZetaChain 基于 Cosmos SDK 和 Comet BFT 构建的权益证明系统,为跨链操作提供安全与高效保障: - -- 5 秒最终性 -- 核心验证者与观察者-签名者验证者共同维护网络和跨链安全 -- 激励机制优先保障所有连接链的安全性 - -### 通用 EVM - -通用 EVM 是一个可以被任何链调用的执行环境,让开发者能够: - -- 管理并与连接链上的原生资产、合约和钱包交互 -- 在熟悉的 EVM 环境中构建内置跨链能力的应用 - -### 通用智能合约 - -通用智能合约原生部署在 ZetaChain 上,可以读写任意连接链。它为跨链开发带来简化体验: - -- 编排复杂的多链操作 -- 访问不同网络的流动性 -- 提供统一的跨链用户体验 -- 在需要时通过附加的链上特定合约扩展功能 - -## 解决方案 - -### 比特币:解锁新可能 - -ZetaChain 为 Bitcoin 引入可编程性,让其能够原生参与 DeFi,而无需中介。开发者可以为 Bitcoin 创建新的收益机会,并安全地将 Bitcoin 引入更广阔的加密经济。 - -### DeFi:统一多链流动性 - -ZetaChain 为 DeFi 应用构建统一的流动性与执行枢纽,让它们能够轻松地跨不同网络构建:DEX、收益聚合、稳定币、货币市场等。 - -### 社交、游戏、NFT:通用数字所有权 - -在任意区块链生态之间铸造、交易和管理数字资产与数据,为创作者、收藏者和玩家提供简单的互操作性与交互体验。 - -### 基础设施:机构级可信 - -ZetaChain 建立在去中心化、安全的基础之上,并由行业领先的验证者提供支持,为通用解决方案提供机构级平台。 +## Next steps +- [Build on ZetaChain](/start/build) +- [Run a node](/nodes) +- [Use ZetaChain](/users) +- [RPC and contract addresses](/reference) diff --git a/src/pages/support.mdx b/src/pages/support.en-US.mdx similarity index 100% rename from src/pages/support.mdx rename to src/pages/support.en-US.mdx diff --git a/src/pages/support.zh-CN.mdx b/src/pages/support.zh-CN.mdx new file mode 100644 index 000000000..c1d24c750 --- /dev/null +++ b/src/pages/support.zh-CN.mdx @@ -0,0 +1,13 @@ +--- +title: 支持 +description: 在构建、运行验证节点和使用 ZetaChain 产品过程中获取所需支持。 +heroImgUrl: /img/pages/support.svg +heroImgWidth: 506 +--- + +import { GetSupport, ShareFeedbackOrDiscoveries } from "~/components/Support"; + +
    + + +
    diff --git a/src/pages/users/_meta.en-US.json b/src/pages/users/_meta.en-US.json index 9c7247505..d0680a55c 100644 --- a/src/pages/users/_meta.en-US.json +++ b/src/pages/users/_meta.en-US.json @@ -1,7 +1,7 @@ { "overview": { "title": "Use", - "description": "Learn more about connecting to, using and troubleshooting ZetaChain products for your omnichain needs." + "description": "Learn more about connecting to, using and troubleshooting ZetaChain products." }, "zetahub": { "title": "ZetaHub", diff --git a/src/pages/users/cli/balances.en-US.mdx b/src/pages/users/cli/balances.en-US.mdx index cede6b470..1e0fe11a8 100644 --- a/src/pages/users/cli/balances.en-US.mdx +++ b/src/pages/users/cli/balances.en-US.mdx @@ -16,7 +16,7 @@ zetacored q bank balances $(zetacored keys show alice -a) --node https://zetacha ``` Provide a valid node RPC URL with the `--node` flag. You can use one of the -available RPCs [listed in the docs](/reference/network/api) labeled "Tendermint +available RPCs [listed in the docs](/reference/api) labeled "Tendermint RPC". Please, note that you need to specify the port number in the URL. If the protocol scheme is `https://`, the port is 443, unless specified otherwise. diff --git a/src/pages/users/cli/balances.zh-CN.mdx b/src/pages/users/cli/balances.zh-CN.mdx index c6af361f7..0d7defccf 100644 --- a/src/pages/users/cli/balances.zh-CN.mdx +++ b/src/pages/users/cli/balances.zh-CN.mdx @@ -14,7 +14,7 @@ title: 查询余额 zetacored q bank balances $(zetacored keys show alice -a) --node https://zetachain-athens.blockpi.network:443/rpc/v1/public ``` -使用 `--node` 指定有效的节点 RPC URL,可选择文档中标注为 “Tendermint RPC” 的[公共端点](/zh/reference/network/api)。注意需在 URL 中显式包含端口,使用 `https://` 协议时端口默认为 443(除非另行说明)。 +使用 `--node` 指定有效的节点 RPC URL,可选择文档中标注为 “Tendermint RPC” 的[公共端点](/zh/reference/api)。注意需在 URL 中显式包含端口,使用 `https://` 协议时端口默认为 443(除非另行说明)。 ```yml balances: diff --git a/src/pages/users/cli/setup.en-US.mdx b/src/pages/users/cli/setup.en-US.mdx index 58b643253..a898c9bfd 100644 --- a/src/pages/users/cli/setup.en-US.mdx +++ b/src/pages/users/cli/setup.en-US.mdx @@ -50,11 +50,8 @@ Usage: Available Commands: add-genesis-account Add a genesis account to genesis.json - add-observer-list Add a list of observers to the observer mapper ,default path is ~/.zetacored/os_info/observer_info.json addr-conversion convert a zeta1xxx address to validator operator address zetavaloper1xxx collect-gentxs Collect genesis txs and output a genesis.json file - collect-observer-info collect observer info from a folder , default path is ~/.zetacored/os_info/ - config Create or query an application CLI configuration file debug Tool for helping with debugging your application export Export state to JSON diff --git a/src/pages/users/cli/setup.zh-CN.mdx b/src/pages/users/cli/setup.zh-CN.mdx index 54b59fe45..f1aa23d5e 100644 --- a/src/pages/users/cli/setup.zh-CN.mdx +++ b/src/pages/users/cli/setup.zh-CN.mdx @@ -49,11 +49,8 @@ Usage: Available Commands: add-genesis-account Add a genesis account to genesis.json - add-observer-list Add a list of observers to the observer mapper ,default path is ~/.zetacored/os_info/observer_info.json addr-conversion convert a zeta1xxx address to validator operator address zetavaloper1xxx collect-gentxs Collect genesis txs and output a genesis.json file - collect-observer-info collect observer info from a folder , default path is ~/.zetacored/os_info/ - config Create or query an application CLI configuration file debug Tool for helping with debugging your application export Export state to JSON diff --git a/src/pages/users/overview.en-US.mdx b/src/pages/users/overview.en-US.mdx index 229ff5f4e..5d7a706d7 100644 --- a/src/pages/users/overview.en-US.mdx +++ b/src/pages/users/overview.en-US.mdx @@ -1,6 +1,6 @@ --- title: Use -description: Learn more about connecting to, using and troubleshooting ZetaChain products for your omnichain needs. +description: Learn more about connecting to, using and troubleshooting ZetaChain products. heroImgUrl: /img/pages/use.svg heroImgWidth: 664 --- diff --git a/src/pages/users/overview.zh-CN.mdx b/src/pages/users/overview.zh-CN.mdx index da03e041d..2ef1e6410 100644 --- a/src/pages/users/overview.zh-CN.mdx +++ b/src/pages/users/overview.zh-CN.mdx @@ -1,6 +1,6 @@ --- title: 使用指南 -description: 了解如何连接、使用并排查 ZetaChain 产品,满足全链需求。 +description: 了解如何连接、使用并排查 ZetaChain 产品。 heroImgUrl: /img/pages/use.svg heroImgWidth: 664 --- diff --git a/src/pages/users/zetahub/_meta.en-US.json b/src/pages/users/zetahub/_meta.en-US.json index 4dc183161..b1398263a 100644 --- a/src/pages/users/zetahub/_meta.en-US.json +++ b/src/pages/users/zetahub/_meta.en-US.json @@ -19,14 +19,6 @@ "title": "Delegate/Stake ZETA", "description": "Explore ZetaChain validators and delegate ZETA." }, - "enroll-zeta-xp": { - "title": "Enroll in Zeta XP", - "description": "Enroll in the XP program to earn experience points by engaging with the ZetaChain ecosystem, level up through various tiers, and unlock rewards and perks for consistent participation." - }, - "earn-zeta-xp": { - "title": "Earn Zeta XP", - "description": "Participate in activities to earn XP, including staking, trading, and engaging with apps across DeFi, Gaming, Social, NFTs, and more." - }, "send": { "title": "Send Assets", "description": "The Send page allows you to move your assets in and out of the ZetaChain network." diff --git a/src/pages/users/zetahub/_meta.zh-CN.json b/src/pages/users/zetahub/_meta.zh-CN.json index 62f465201..c581c2d62 100644 --- a/src/pages/users/zetahub/_meta.zh-CN.json +++ b/src/pages/users/zetahub/_meta.zh-CN.json @@ -14,12 +14,6 @@ "stake": { "title": "委托 / 质押 ZETA" }, - "enroll-zeta-xp": { - "title": "报名 Zeta XP" - }, - "earn-zeta-xp": { - "title": "赚取 Zeta XP" - }, "send": { "title": "发送资产" } diff --git a/src/pages/users/zetahub/earn-zeta-xp.en-US.mdx b/src/pages/users/zetahub/earn-zeta-xp.en-US.mdx deleted file mode 100644 index dbbcaaa08..000000000 --- a/src/pages/users/zetahub/earn-zeta-xp.en-US.mdx +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Earn Zeta XP ---- - -The Activities and Featured sections on ZetaHub provide a dynamic marketplace -for apps and activities on ZetaChain, spanning various sectors such as DeFi, -Gaming, Social, NFTs, and more. The activities come with updated point -assignments and transaction minimums, ensuring they align with current -real-world applications and utility. - -To participate, choose an activity you like and click "Try". - -![XP Dashboard](/img/docs/zetahub/xp-earn-6.png) - -This activity, for example, encourages you to stake ZETA tokens on ZetaHub to -receive an XP reward. Click on "Try" to participate in the activity! [Learn more -about staking ZETA](/users/zetahub/stake) - -![XP Dashboard](/img/docs/zetahub/xp-earn-7.png) - -These activities are not just static tasks; they are thoughtfully crafted by -projects within the ZetaChain ecosystem. Each project has the flexibility to -design activities that align with their unique features, user growth strategies, -and overall objectives. For example, a decentralized exchange (DEX) app might -set a minimum trade amount to foster higher trading volumes and active user -participation. - -ZetaHub collaborates with the community and app developers to establish a fair -and comprehensive system for determining XP allocation for each activity. This -system takes into account various factors, including the cost and time required -to complete an activity, the period it is featured, and the specific ZetaChain -features involved. This ensures that the activities are not only rewarding and -engaging for users, but also align with the overarching goals of the ZetaChain -ecosystem. diff --git a/src/pages/users/zetahub/earn-zeta-xp.zh-CN.mdx b/src/pages/users/zetahub/earn-zeta-xp.zh-CN.mdx deleted file mode 100644 index ab0fb777a..000000000 --- a/src/pages/users/zetahub/earn-zeta-xp.zh-CN.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: 赚取 Zeta XP ---- - -ZetaHub 的 Activities 与 Featured 模块汇集了 ZetaChain 上的各类应用与活动,包括 DeFi、游戏、社交、NFT 等。活动会动态更新积分配置与最低交易门槛,确保与真实用例匹配。 - -选择感兴趣的活动并点击 “Try”: - -![XP Dashboard](/img/docs/zetahub/xp-earn-6.png) - -例如,此活动鼓励你在 ZetaHub 质押 ZETA 以获取 XP 奖励。点击 “Try” 即可参与。[了解更多质押指南](/zh/users/zetahub/stake) - -![XP Dashboard](/img/docs/zetahub/xp-earn-7.png) - -这些活动并非固定任务,而是由生态项目精心设计,可结合自身特色、增长策略及目标来定制。例如某去中心化交易所可能设置最低交易额,以提升交易量和活跃度。 - -ZetaHub 会与社区及开发者合作,为每个活动制定公平合理的 XP 分配体系,综合考量完成活动的成本与时间、活动展示时长、涉及的 ZetaChain 功能等因素,确保活动既有趣奖励又符合生态发展方向。*** End Patch*** - diff --git a/src/pages/users/zetahub/enroll-zeta-xp.en-US.mdx b/src/pages/users/zetahub/enroll-zeta-xp.en-US.mdx deleted file mode 100644 index fe2c81f68..000000000 --- a/src/pages/users/zetahub/enroll-zeta-xp.en-US.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: Enroll in Zeta XP ---- - -ZetaHub XP program offers an opportunity to engage with and explore the -ZetaChain ecosystem. This program allows you to earn experience points (XP) by -performing activities on ZetaChain, enabling you to level up and unlock rewards. -These rewards can be used for future perks, live events, and other app-based -incentives. - -## Enroll in XP - -To join the XP program, go to the XP section of ZetaHub and click on "Enroll for free". -free". - -![XP Dashboard](/img/docs/zetahub/xp-enroll-1.png) - -The XP is tracked on chain, so you will be prompted to sign a transaction to -enroll in the program. Don't worry, you can get some ZETA for transaction fees -using the Fuel program. Confirm the transaction in your wallet: - -![XP Dashboard](/img/docs/zetahub/xp-enroll-2.png) - -Next, wait for your enrollment to be validated by ZetaHub, this shouldn't take -more than a minute. - -![XP Dashboard](/img/docs/zetahub/xp-enroll-3.png) - -Once you have joined the XP program, you will see your initial Status tier. -Users start at the Silver level and can progress through Rose Gold, Black, and -finally Green, which is currently the highest level. These XP Status tiers help -apps assign perks and rewards to real and valuable users, determining -eligibility for specific rewards. It's important to note that the ranking system -may change periodically based on community feedback and ecosystem needs. - -![XP Dashboard](/img/docs/zetahub/xp-enroll-4.png) - -On this page, you can track your XP progress and see how close you are to -reaching the next tier. - -To maintain an "Active" status each week, you must meet a minimum active threshold of XP. -This requirement encourages consistent engagement and provides -apps with greater confidence when designing rewards. Certain rewards may only be -available to users who are enrolled, active, and/or have maintained a minimum -active streak, adding an extra dimension to the XP tracking system. diff --git a/src/pages/users/zetahub/enroll-zeta-xp.zh-CN.mdx b/src/pages/users/zetahub/enroll-zeta-xp.zh-CN.mdx deleted file mode 100644 index 7b52273d4..000000000 --- a/src/pages/users/zetahub/enroll-zeta-xp.zh-CN.mdx +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: 报名 Zeta XP ---- - -ZetaHub XP 计划鼓励用户探索 ZetaChain 生态。通过在链上完成任务可获取 XP,逐步升级并解锁奖励,用于未来福利、线下活动及各类应用激励。 - -## 报名流程 - -进入 ZetaHub 的 XP 页面,点击 “Enroll for free”: - -![XP Dashboard](/img/docs/zetahub/xp-enroll-1.png) - -XP 记录在链上,因此需要签名交易才能加入。可通过 Fuel 计划领取少量 ZETA 支付手续费。在钱包中确认交易: - -![XP Dashboard](/img/docs/zetahub/xp-enroll-2.png) - -随后等待 ZetaHub 验证报名,通常不超过一分钟: - -![XP Dashboard](/img/docs/zetahub/xp-enroll-3.png) - -加入成功后会看到自己的初始等级。所有用户从 Silver 起步,可依次晋升至 Rose Gold、Black,最终是当前最高等级 Green。等级有助于应用判定真实且活跃的用户,并按此发放奖励。排名体系可能根据社区反馈或生态需求进行调整。 - -![XP Dashboard](/img/docs/zetahub/xp-enroll-4.png) - -在此页面可以追踪 XP 进度,了解距下一等级的差距。 - -为保持每周 “Active” 状态,需要满足最低活跃 XP 阈值。这鼓励持续参与,也让应用在设计激励时更有信心。有些奖励可能要求用户已报名、保持活跃或达到一定连续活跃周期,为 XP 体系增添更多层次。*** End Patch*** - diff --git a/src/pages/users/zetahub/pool.en-US.mdx b/src/pages/users/zetahub/pool.en-US.mdx index f83b76d6e..fc697b519 100644 --- a/src/pages/users/zetahub/pool.en-US.mdx +++ b/src/pages/users/zetahub/pool.en-US.mdx @@ -3,7 +3,7 @@ title: Pool ZETA --- Liquidity pools on ZetaHub are pools of assets in Automated Market Maker (AMM) -decentralized exchanges (DEXs) that power ZetaChain and its omnichain +decentralized exchanges (DEXs) that power ZetaChain and its interoperability functionality. ZetaHub provides an interface to deposit assets into these pools, allowing you to earn a share of the fees generated by the pools. diff --git a/src/pages/users/zetahub/pool.zh-CN.mdx b/src/pages/users/zetahub/pool.zh-CN.mdx index 92de3a5bd..19b6a3350 100644 --- a/src/pages/users/zetahub/pool.zh-CN.mdx +++ b/src/pages/users/zetahub/pool.zh-CN.mdx @@ -2,7 +2,7 @@ title: 提供流动性 --- -ZetaHub 的流动性池基于自动做市商(AMM)机制,为 ZetaChain 的全链功能提供支持。通过界面可向池中存入资产,按比例分享手续费。 +ZetaHub 的流动性池基于自动做市商(AMM)机制,为 ZetaChain 的互操作功能提供支持。通过界面可向池中存入资产,按比例分享手续费。 首先在 Pool 页面浏览所有流动性池并选择一项。 @@ -16,7 +16,7 @@ ZetaHub 的流动性池基于自动做市商(AMM)机制,为 ZetaChain 的 ![](/img/docs/zetahub/pool-2.png) -若余额不足,可点击错误提示下方的 “Get more assets”,系统会引导你跨链转入资产或通过交易所购买。 +若余额不足,可点击错误提示下方的 “Get more assets”,系统会引导你从其他链转入资产或通过交易所购买。 确认额度后点击 “Allow deposit”,并在钱包中批准授权交易。 diff --git a/yarn.lock b/yarn.lock index b49795e92..b3491c588 100644 --- a/yarn.lock +++ b/yarn.lock @@ -33,45 +33,6 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@ardatan/relay-compiler@12.0.0": - version "12.0.0" - resolved "https://registry.yarnpkg.com/@ardatan/relay-compiler/-/relay-compiler-12.0.0.tgz#2e4cca43088e807adc63450e8cab037020e91106" - integrity sha512-9anThAaj1dQr6IGmzBMcfzOQKTa5artjuPmw8NYK/fiGEMjADbSguBY2FMDykt+QhilR3wc9VA/3yVju7JHg7Q== - dependencies: - "@babel/core" "^7.14.0" - "@babel/generator" "^7.14.0" - "@babel/parser" "^7.14.0" - "@babel/runtime" "^7.0.0" - "@babel/traverse" "^7.14.0" - "@babel/types" "^7.0.0" - babel-preset-fbjs "^3.4.0" - chalk "^4.0.0" - fb-watchman "^2.0.0" - fbjs "^3.0.0" - glob "^7.1.1" - immutable "~3.7.6" - invariant "^2.2.4" - nullthrows "^1.1.1" - relay-runtime "12.0.0" - signedsource "^1.0.0" - yargs "^15.3.1" - -"@ardatan/relay-compiler@^12.0.3": - version "12.0.3" - resolved "https://registry.yarnpkg.com/@ardatan/relay-compiler/-/relay-compiler-12.0.3.tgz#a60824672da7f7cef2a3879ed833b120d292fa08" - integrity sha512-mBDFOGvAoVlWaWqs3hm1AciGHSQE1rqFc/liZTyYz/Oek9yZdT5H26pH2zAFuEiTiBVPPyMuqf5VjOFPI2DGsQ== - dependencies: - "@babel/generator" "^7.26.10" - "@babel/parser" "^7.26.10" - "@babel/runtime" "^7.26.10" - chalk "^4.0.0" - fb-watchman "^2.0.0" - immutable "~3.7.6" - invariant "^2.2.4" - nullthrows "^1.1.1" - relay-runtime "12.0.0" - signedsource "^1.0.0" - "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.27.1": version "7.27.1" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz#200f715e66d52a23b221a9435534a91cc13ad5be" @@ -81,11 +42,6 @@ js-tokens "^4.0.0" picocolors "^1.1.1" -"@babel/compat-data@^7.20.5": - version "7.27.7" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.27.7.tgz#7fd698e531050cce432b073ab64857b99e0f3804" - integrity sha512-xgu/ySj2mTiUFmdE9yCMfBxLp4DHd5DwmbbD05YAuICfodYT3VvRxbrh81LGQ/8UpSdtMdfKMn3KouYDX59DGQ== - "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.23.5", "@babel/compat-data@^7.27.2": version "7.27.2" resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.2.tgz#4183f9e642fd84e74e3eea7ffa93a412e3b102c9" @@ -112,27 +68,6 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/core@^7.14.0", "@babel/core@^7.26.10": - version "7.27.7" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.27.7.tgz#0ddeab1e7b17317dad8c3c3a887716f66b5c4428" - integrity sha512-BU2f9tlKQ5CAthiMIgpzAh4eDTLWo1mqi9jqE2OxMG0E/OM199VJt2q8BztTxpnSW0i1ymdwLXRJnYzvDM5r2w== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.27.1" - "@babel/generator" "^7.27.5" - "@babel/helper-compilation-targets" "^7.27.2" - "@babel/helper-module-transforms" "^7.27.3" - "@babel/helpers" "^7.27.6" - "@babel/parser" "^7.27.7" - "@babel/template" "^7.27.2" - "@babel/traverse" "^7.27.7" - "@babel/types" "^7.27.7" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - "@babel/core@^7.19.6": version "7.27.1" resolved "https://registry.npmjs.org/@babel/core/-/core-7.27.1.tgz#89de51e86bd12246003e3524704c49541b16c3e6" @@ -154,17 +89,6 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.14.0", "@babel/generator@^7.18.13", "@babel/generator@^7.26.10", "@babel/generator@^7.27.5": - version "7.27.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.27.5.tgz#3eb01866b345ba261b04911020cbe22dd4be8c8c" - integrity sha512-ZGhA37l0e/g2s1Cnzdix0O3aLYm66eF8aufiVteOgnwxgnRP8GoyMj7VWsgWnQbVKXyge7hqrFh2K2TQM6t1Hw== - dependencies: - "@babel/parser" "^7.27.5" - "@babel/types" "^7.27.3" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^3.0.2" - "@babel/generator@^7.23.6", "@babel/generator@^7.27.1": version "7.27.1" resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.27.1.tgz#862d4fad858f7208edd487c28b58144036b76230" @@ -183,14 +107,7 @@ dependencies: "@babel/types" "^7.27.1" -"@babel/helper-annotate-as-pure@^7.27.3": - version "7.27.3" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.3.tgz#f31fd86b915fc4daf1f3ac6976c59be7084ed9c5" - integrity sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg== - dependencies: - "@babel/types" "^7.27.3" - -"@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.23.6", "@babel/helper-compilation-targets@^7.27.1", "@babel/helper-compilation-targets@^7.27.2": +"@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.23.6", "@babel/helper-compilation-targets@^7.27.1", "@babel/helper-compilation-targets@^7.27.2": version "7.27.2" resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.27.2.tgz#46a0f6efab808d51d29ce96858dd10ce8732733d" integrity sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ== @@ -201,7 +118,7 @@ lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.27.1": +"@babel/helper-create-class-features-plugin@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.1.tgz#5bee4262a6ea5ddc852d0806199eb17ca3de9281" integrity sha512-QwGAmuvM17btKU5VqXfb+Giw4JcN0hjuufz3DYnpeVDvZLAObloM77bhMXiqry3Iio+Ai4phVRDwl6WU10+r5A== @@ -281,15 +198,6 @@ "@babel/helper-validator-identifier" "^7.27.1" "@babel/traverse" "^7.27.1" -"@babel/helper-module-transforms@^7.27.3": - version "7.27.3" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.27.3.tgz#db0bbcfba5802f9ef7870705a7ef8788508ede02" - integrity sha512-dSOvYwvyLsWBeIRyOeHXp5vPj5l1I011r52FM1+r1jCERv+aFXYk4whgQccYEGYxK2H3ZAIA8nuPkQ0HaUo3qg== - dependencies: - "@babel/helper-module-imports" "^7.27.1" - "@babel/helper-validator-identifier" "^7.27.1" - "@babel/traverse" "^7.27.3" - "@babel/helper-optimise-call-expression@^7.27.1": version "7.27.1" resolved "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz#c65221b61a643f3e62705e5dd2b5f115e35f9200" @@ -297,7 +205,7 @@ dependencies: "@babel/types" "^7.27.1" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.27.1", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.27.1", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.27.1" resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.27.1.tgz#ddb2f876534ff8013e6c2b299bf4d39b3c51d44c" integrity sha512-1gn1Up5YXka3YYAHGKpbideQ5Yjf1tDa9qYcgysz+cNCXukyLl6DjPXhD3VRwSb8c0J9tA4b2+rHEZtc6R0tlw== @@ -360,21 +268,6 @@ "@babel/template" "^7.27.1" "@babel/types" "^7.27.1" -"@babel/helpers@^7.27.6": - version "7.27.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.27.6.tgz#6456fed15b2cb669d2d1fabe84b66b34991d812c" - integrity sha512-muE8Tt8M22638HU31A3CgfSUciwz1fhATfoVai05aPXGor//CdWDCbnlY1yvBPo07njuVOCNGCSp/GTt12lIug== - dependencies: - "@babel/template" "^7.27.2" - "@babel/types" "^7.27.6" - -"@babel/parser@^7.14.0", "@babel/parser@^7.26.10", "@babel/parser@^7.27.5", "@babel/parser@^7.27.7": - version "7.27.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.27.7.tgz#1687f5294b45039c159730e3b9c1f1b242e425e9" - integrity sha512-qnzXzDXdr/po3bOTbTIQZ7+TxNKxpkN5IifVLXS+r7qwynkZfPyjZfE7hCXbo7IoO9TNcSyibgONsf2HauUd3Q== - dependencies: - "@babel/types" "^7.27.7" - "@babel/parser@^7.23.6", "@babel/parser@^7.27.1", "@babel/parser@^7.27.2": version "7.27.2" resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.27.2.tgz#577518bedb17a2ce4212afd052e01f7df0941127" @@ -421,25 +314,6 @@ "@babel/helper-plugin-utils" "^7.27.1" "@babel/traverse" "^7.27.1" -"@babel/plugin-proposal-class-properties@^7.0.0": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" - integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-proposal-object-rest-spread@^7.0.0": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" - integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== - dependencies: - "@babel/compat-data" "^7.20.5" - "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.20.7" - "@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2": version "7.21.0-placeholder-for-preset-env.2" resolved "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz#7844f9289546efa9febac2de4cfe358a050bd703" @@ -460,7 +334,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.0.0", "@babel/plugin-syntax-class-properties@^7.12.13": +"@babel/plugin-syntax-class-properties@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== @@ -488,14 +362,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-flow@^7.0.0", "@babel/plugin-syntax-flow@^7.27.1": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.27.1.tgz#6c83cf0d7d635b716827284b7ecd5aead9237662" - integrity sha512-p9OkPbZ5G7UT1MofwYFigGebnrzGJacoBSQM0/6bi/PUMVE+qlWDD/OalvQKbwgQzU6dl0xAv6r4X7Jme0RYxA== - dependencies: - "@babel/helper-plugin-utils" "^7.27.1" - -"@babel/plugin-syntax-import-assertions@^7.23.3", "@babel/plugin-syntax-import-assertions@^7.26.0", "@babel/plugin-syntax-import-assertions@^7.27.1": +"@babel/plugin-syntax-import-assertions@^7.23.3", "@babel/plugin-syntax-import-assertions@^7.27.1": version "7.27.1" resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.27.1.tgz#88894aefd2b03b5ee6ad1562a7c8e1587496aecd" integrity sha512-UT/Jrhw57xg4ILHLFnzFpPDlMbcdEicaAtjPQpbj9wa8T4r5KVWCimHcL/460g8Ht0DMxDyjsLgiWSkVjnwPFg== @@ -523,7 +390,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-jsx@^7.0.0", "@babel/plugin-syntax-jsx@^7.17.12", "@babel/plugin-syntax-jsx@^7.23.3", "@babel/plugin-syntax-jsx@^7.27.1": +"@babel/plugin-syntax-jsx@^7.17.12", "@babel/plugin-syntax-jsx@^7.23.3", "@babel/plugin-syntax-jsx@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.27.1.tgz#2f9beb5eff30fa507c5532d107daac7b888fa34c" integrity sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w== @@ -551,7 +418,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.8.3": +"@babel/plugin-syntax-object-rest-spread@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== @@ -608,7 +475,7 @@ "@babel/helper-create-regexp-features-plugin" "^7.18.6" "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-arrow-functions@^7.0.0", "@babel/plugin-transform-arrow-functions@^7.23.3", "@babel/plugin-transform-arrow-functions@^7.27.1": +"@babel/plugin-transform-arrow-functions@^7.23.3", "@babel/plugin-transform-arrow-functions@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.27.1.tgz#6e2061067ba3ab0266d834a9f94811196f2aba9a" integrity sha512-8Z4TGic6xW70FKThA5HYEKKyBpOOsucTOD1DjU3fZxDg+K3zBJcXMFnt/4yQiZnf5+MiOMSXQ9PaEK/Ilh1DeA== @@ -633,20 +500,13 @@ "@babel/helper-plugin-utils" "^7.27.1" "@babel/helper-remap-async-to-generator" "^7.27.1" -"@babel/plugin-transform-block-scoped-functions@^7.0.0", "@babel/plugin-transform-block-scoped-functions@^7.23.3", "@babel/plugin-transform-block-scoped-functions@^7.27.1": +"@babel/plugin-transform-block-scoped-functions@^7.23.3", "@babel/plugin-transform-block-scoped-functions@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.27.1.tgz#558a9d6e24cf72802dd3b62a4b51e0d62c0f57f9" integrity sha512-cnqkuOtZLapWYZUYM5rVIdv1nXYuFVIltZ6ZJ7nIj585QsjKM5dhL2Fu/lICXZ1OyIAFc7Qy+bvDAtTXqGrlhg== dependencies: "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-block-scoping@^7.0.0": - version "7.27.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.27.5.tgz#98c37485d815533623d992fd149af3e7b3140157" - integrity sha512-JF6uE2s67f0y2RZcm2kpAUEbD50vH62TyWVebxwHAlbSdM49VqPz8t4a1uIjp4NIOIZ4xzLfjY5emt/RCyC7TQ== - dependencies: - "@babel/helper-plugin-utils" "^7.27.1" - "@babel/plugin-transform-block-scoping@^7.23.4", "@babel/plugin-transform-block-scoping@^7.27.1": version "7.27.1" resolved "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.27.1.tgz#bc0dbe8ac6de5602981ba58ef68c6df8ef9bfbb3" @@ -670,18 +530,6 @@ "@babel/helper-create-class-features-plugin" "^7.27.1" "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-classes@^7.0.0": - version "7.27.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.27.7.tgz#038af7e7c346821cc74aff1036c1f762308cd2d6" - integrity sha512-CuLkokN1PEZ0Fsjtq+001aog/C2drDK9nTfK/NRK0n6rBin6cBrvM+zfQjDE+UllhR6/J4a6w8Xq9i4yi3mQrw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.27.3" - "@babel/helper-compilation-targets" "^7.27.2" - "@babel/helper-plugin-utils" "^7.27.1" - "@babel/helper-replace-supers" "^7.27.1" - "@babel/traverse" "^7.27.7" - globals "^11.1.0" - "@babel/plugin-transform-classes@^7.23.8", "@babel/plugin-transform-classes@^7.27.1": version "7.27.1" resolved "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.27.1.tgz#03bb04bea2c7b2f711f0db7304a8da46a85cced4" @@ -694,7 +542,7 @@ "@babel/traverse" "^7.27.1" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.0.0", "@babel/plugin-transform-computed-properties@^7.23.3", "@babel/plugin-transform-computed-properties@^7.27.1": +"@babel/plugin-transform-computed-properties@^7.23.3", "@babel/plugin-transform-computed-properties@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.27.1.tgz#81662e78bf5e734a97982c2b7f0a793288ef3caa" integrity sha512-lj9PGWvMTVksbWiDT2tW68zGS/cyo4AkZ/QTp0sQT0mjPopCmrSkzxeXkznjqBxzDI6TclZhOJbBmbBLjuOZUw== @@ -702,14 +550,6 @@ "@babel/helper-plugin-utils" "^7.27.1" "@babel/template" "^7.27.1" -"@babel/plugin-transform-destructuring@^7.0.0": - version "7.27.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.27.7.tgz#c5356982d29d5c70e0396c933f07a94c31bb385c" - integrity sha512-pg3ZLdIKWCP0CrJm0O4jYjVthyBeioVfvz9nwt6o5paUxsgJ/8GucSMAIaj6M7xA4WY+SrvtGu2LijzkdyecWQ== - dependencies: - "@babel/helper-plugin-utils" "^7.27.1" - "@babel/traverse" "^7.27.7" - "@babel/plugin-transform-destructuring@^7.23.3", "@babel/plugin-transform-destructuring@^7.27.1": version "7.27.1" resolved "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.27.1.tgz#d5916ef7089cb254df0418ae524533c1b72ba656" @@ -761,15 +601,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-flow-strip-types@^7.0.0": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.27.1.tgz#5def3e1e7730f008d683144fb79b724f92c5cdf9" - integrity sha512-G5eDKsu50udECw7DL2AcsysXiQyB7Nfg521t2OAJ4tbfTJ27doHLeF/vlI1NZGlLdbb/v+ibvtL1YBQqYOwJGg== - dependencies: - "@babel/helper-plugin-utils" "^7.27.1" - "@babel/plugin-syntax-flow" "^7.27.1" - -"@babel/plugin-transform-for-of@^7.0.0", "@babel/plugin-transform-for-of@^7.23.6", "@babel/plugin-transform-for-of@^7.27.1": +"@babel/plugin-transform-for-of@^7.23.6", "@babel/plugin-transform-for-of@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.27.1.tgz#bc24f7080e9ff721b63a70ac7b2564ca15b6c40a" integrity sha512-BfbWFFEJFQzLCQ5N8VocnCtA8J1CLkNTe2Ms2wocj75dd6VpiqS5Z5quTYcUoo4Yq+DN0rtikODccuv7RU81sw== @@ -777,7 +609,7 @@ "@babel/helper-plugin-utils" "^7.27.1" "@babel/helper-skip-transparent-expression-wrappers" "^7.27.1" -"@babel/plugin-transform-function-name@^7.0.0", "@babel/plugin-transform-function-name@^7.23.3", "@babel/plugin-transform-function-name@^7.27.1": +"@babel/plugin-transform-function-name@^7.23.3", "@babel/plugin-transform-function-name@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.27.1.tgz#4d0bf307720e4dce6d7c30fcb1fd6ca77bdeb3a7" integrity sha512-1bQeydJF9Nr1eBCMMbC+hdwmRlsv5XYOMu03YSWFwNs0HsAmtSxxF1fyuYPqemVldVyFmlCU7w8UE14LupUSZQ== @@ -793,7 +625,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-literals@^7.0.0", "@babel/plugin-transform-literals@^7.23.3", "@babel/plugin-transform-literals@^7.27.1": +"@babel/plugin-transform-literals@^7.23.3", "@babel/plugin-transform-literals@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.27.1.tgz#baaefa4d10a1d4206f9dcdda50d7d5827bb70b24" integrity sha512-0HCFSepIpLTkLcsi86GG3mTUzxV5jpmbv97hTETW3yzrAij8aqlD36toB1D0daVFJM8NK6GvKO0gslVQmm+zZA== @@ -807,7 +639,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-member-expression-literals@^7.0.0", "@babel/plugin-transform-member-expression-literals@^7.23.3", "@babel/plugin-transform-member-expression-literals@^7.27.1": +"@babel/plugin-transform-member-expression-literals@^7.23.3", "@babel/plugin-transform-member-expression-literals@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.27.1.tgz#37b88ba594d852418e99536f5612f795f23aeaf9" integrity sha512-hqoBX4dcZ1I33jCSWcXrP+1Ku7kdqXf1oeah7ooKOIiAdKQ+uqftgCFNOSzA5AMS2XIHEYeGFg4cKRCdpxzVOQ== @@ -822,7 +654,7 @@ "@babel/helper-module-transforms" "^7.27.1" "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-modules-commonjs@^7.0.0", "@babel/plugin-transform-modules-commonjs@^7.23.3", "@babel/plugin-transform-modules-commonjs@^7.27.1": +"@babel/plugin-transform-modules-commonjs@^7.23.3", "@babel/plugin-transform-modules-commonjs@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.27.1.tgz#8e44ed37c2787ecc23bdc367f49977476614e832" integrity sha512-OJguuwlTYlN0gBZFRPqwOGNWssZjfIUdS7HMYtN8c1KmwpwHFBwTeFZrg9XZa+DFTitWOW5iTAG7tyCUPsCCyw== @@ -887,7 +719,7 @@ "@babel/plugin-transform-destructuring" "^7.27.1" "@babel/plugin-transform-parameters" "^7.27.1" -"@babel/plugin-transform-object-super@^7.0.0", "@babel/plugin-transform-object-super@^7.23.3", "@babel/plugin-transform-object-super@^7.27.1": +"@babel/plugin-transform-object-super@^7.23.3", "@babel/plugin-transform-object-super@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.27.1.tgz#1c932cd27bf3874c43a5cac4f43ebf970c9871b5" integrity sha512-SFy8S9plRPbIcxlJ8A6mT/CxFdJx/c04JEctz4jf8YZaVS2px34j7NXRrlGlHkN/M2gnpL37ZpGRGVFLd3l8Ng== @@ -910,13 +742,6 @@ "@babel/helper-plugin-utils" "^7.27.1" "@babel/helper-skip-transparent-expression-wrappers" "^7.27.1" -"@babel/plugin-transform-parameters@^7.0.0", "@babel/plugin-transform-parameters@^7.20.7": - version "7.27.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.27.7.tgz#1fd2febb7c74e7d21cf3b05f7aebc907940af53a" - integrity sha512-qBkYTYCb76RRxUM6CcZA5KRu8K4SM8ajzVeUgVdMVO9NN9uI/GaVmBg/WKJJGnNokV9SY8FxNOVWGXzqzUidBg== - dependencies: - "@babel/helper-plugin-utils" "^7.27.1" - "@babel/plugin-transform-parameters@^7.23.3", "@babel/plugin-transform-parameters@^7.27.1": version "7.27.1" resolved "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.27.1.tgz#80334b54b9b1ac5244155a0c8304a187a618d5a7" @@ -941,7 +766,7 @@ "@babel/helper-create-class-features-plugin" "^7.27.1" "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-property-literals@^7.0.0", "@babel/plugin-transform-property-literals@^7.23.3", "@babel/plugin-transform-property-literals@^7.27.1": +"@babel/plugin-transform-property-literals@^7.23.3", "@babel/plugin-transform-property-literals@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.27.1.tgz#07eafd618800591e88073a0af1b940d9a42c6424" integrity sha512-oThy3BCuCha8kDZ8ZkgOg2exvPYUlprMukKQXI1r1pJ47NCvxfkEy8vK+r/hT9nF0Aa4H1WUPZZjHTFtAhGfmQ== @@ -955,7 +780,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-react-display-name@^7.0.0", "@babel/plugin-transform-react-display-name@^7.27.1": +"@babel/plugin-transform-react-display-name@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.27.1.tgz#43af31362d71f7848cfac0cbc212882b1a16e80f" integrity sha512-p9+Vl3yuHPmkirRrg021XiP+EETmPMQTLr6Ayjj85RLNEbb3Eya/4VI0vAdzQG9SEAl2Lnt7fy5lZyMzjYoZQQ== @@ -980,7 +805,7 @@ "@babel/plugin-syntax-jsx" "^7.23.3" "@babel/types" "^7.23.4" -"@babel/plugin-transform-react-jsx@^7.0.0", "@babel/plugin-transform-react-jsx@^7.27.1": +"@babel/plugin-transform-react-jsx@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.27.1.tgz#1023bc94b78b0a2d68c82b5e96aed573bcfb9db0" integrity sha512-2KH4LWGSrJIkVf5tSiBFYuXDAoWRq2MMwgivCf+93dd0GQi8RXLjKA/0EvRnVV5G0hrHczsquXuD01L8s6dmBw== @@ -1021,14 +846,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-shorthand-properties@^7.0.0", "@babel/plugin-transform-shorthand-properties@^7.23.3", "@babel/plugin-transform-shorthand-properties@^7.27.1": +"@babel/plugin-transform-shorthand-properties@^7.23.3", "@babel/plugin-transform-shorthand-properties@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.27.1.tgz#532abdacdec87bfee1e0ef8e2fcdee543fe32b90" integrity sha512-N/wH1vcn4oYawbJ13Y/FxcQrWk63jhfNa7jef0ih7PHSIHX2LB7GWE1rkPrOnka9kwMxb6hMl19p7lidA+EHmQ== dependencies: "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-spread@^7.0.0", "@babel/plugin-transform-spread@^7.23.3", "@babel/plugin-transform-spread@^7.27.1": +"@babel/plugin-transform-spread@^7.23.3", "@babel/plugin-transform-spread@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.27.1.tgz#1a264d5fc12750918f50e3fe3e24e437178abb08" integrity sha512-kpb3HUqaILBJcRFVhFUs6Trdd4mkrzcGXss+6/mxUd273PfbWqSDHRzMT2234gIg2QYfAjvXLSquP1xECSg09Q== @@ -1043,7 +868,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.27.1" -"@babel/plugin-transform-template-literals@^7.0.0", "@babel/plugin-transform-template-literals@^7.23.3", "@babel/plugin-transform-template-literals@^7.27.1": +"@babel/plugin-transform-template-literals@^7.23.3", "@babel/plugin-transform-template-literals@^7.27.1": version "7.27.1" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.27.1.tgz#1a0eb35d8bb3e6efc06c9fd40eb0bcef548328b8" integrity sha512-fBJKiV7F2DxZUkg5EtHKXQdbsbURW3DZKQUWphDum0uRP6eHGGa/He9mc0mypL680pb+e/lDIthRohlv8NCHkg== @@ -1310,11 +1135,6 @@ dependencies: core-js-pure "^3.30.2" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.21.0", "@babel/runtime@^7.26.10": - version "7.27.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.6.tgz#ec4070a04d76bae8ddbb10770ba55714a417b7c6" - integrity sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q== - "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.3", "@babel/runtime@^7.23.8", "@babel/runtime@^7.23.9", "@babel/runtime@^7.27.1", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.27.1" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.1.tgz#9fce313d12c9a77507f264de74626e87fd0dc541" @@ -1325,7 +1145,7 @@ resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.2.tgz#2ae5a9d51cc583bd1f5673b3bb70d6d819682473" integrity sha512-KHp2IflsnGywDjBWDkR9iEqiWSpc8GIi0lgTT3mOElT0PP1tG26P4tmFI2YvAdzgq9RGyoHZQEIEdZy6Ec5xCA== -"@babel/template@^7.18.10", "@babel/template@^7.22.15", "@babel/template@^7.27.1", "@babel/template@^7.27.2": +"@babel/template@^7.18.10", "@babel/template@^7.22.15", "@babel/template@^7.27.1": version "7.27.2" resolved "https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz#fa78ceed3c4e7b63ebf6cb39e5852fca45f6809d" integrity sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw== @@ -1334,19 +1154,6 @@ "@babel/parser" "^7.27.2" "@babel/types" "^7.27.1" -"@babel/traverse@^7.14.0", "@babel/traverse@^7.26.10", "@babel/traverse@^7.27.3", "@babel/traverse@^7.27.7": - version "7.27.7" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.27.7.tgz#8355c39be6818362eace058cf7f3e25ac2ec3b55" - integrity sha512-X6ZlfR/O/s5EQ/SnUSLzr+6kGnkg8HXGMzpgsMsrJVcfDtH1vIp6ctCN4eZ1LS5c0+te5Cb6Y514fASjMRJ1nw== - dependencies: - "@babel/code-frame" "^7.27.1" - "@babel/generator" "^7.27.5" - "@babel/parser" "^7.27.7" - "@babel/template" "^7.27.2" - "@babel/types" "^7.27.7" - debug "^4.3.1" - globals "^11.1.0" - "@babel/traverse@^7.23.7", "@babel/traverse@^7.27.1": version "7.27.1" resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.1.tgz#4db772902b133bbddd1c4f7a7ee47761c1b9f291" @@ -1360,14 +1167,6 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.13", "@babel/types@^7.26.10", "@babel/types@^7.27.3", "@babel/types@^7.27.6", "@babel/types@^7.27.7": - version "7.27.7" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.27.7.tgz#40eabd562049b2ee1a205fa589e629f945dce20f" - integrity sha512-8OLQgDScAOHXnAz2cV+RfzzNMipuLVBz2biuAJFMV9bfkNf393je3VM8CLkjQodW5+iWsSJdSgSWT6rsZoXHPw== - dependencies: - "@babel/helper-string-parser" "^7.27.1" - "@babel/helper-validator-identifier" "^7.27.1" - "@babel/types@^7.20.0", "@babel/types@^7.23.4", "@babel/types@^7.23.6", "@babel/types@^7.27.1", "@babel/types@^7.4.4": version "7.27.1" resolved "https://registry.npmjs.org/@babel/types/-/types-7.27.1.tgz#9defc53c16fc899e46941fc6901a9eea1c9d8560" @@ -1386,19 +1185,6 @@ resolved "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-6.0.4.tgz#923ca57e173c6b232bbbb07347b1be982f03e783" integrity sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A== -"@contentful/content-source-maps@^0.11.8": - version "0.11.21" - resolved "https://registry.yarnpkg.com/@contentful/content-source-maps/-/content-source-maps-0.11.21.tgz#266224c799454a066be8f9ed93d581370d91269a" - integrity sha512-2BXZUDGjVBPwtQDoLc6K9mT2BhxrDlmm3rHge7tkeYT+EBrtkKgi7wA0dDnjVDkv0GE+a1OEP4GascPCFX4kag== - dependencies: - "@vercel/stega" "^0.1.2" - json-pointer "^0.6.2" - -"@contentful/rich-text-types@^16.6.1": - version "16.8.5" - resolved "https://registry.yarnpkg.com/@contentful/rich-text-types/-/rich-text-types-16.8.5.tgz#832c8b428612f5181908bc1033c6ef9f48f1ce83" - integrity sha512-q18RJuJCOuYveGiCIjE5xLCQc5lZ3L2Qgxrlg/H2YEobDFqdtmklazRi1XwEWaK3tMg6yVXBzKKkQfLB4qW14A== - "@coral-xyz/anchor-errors@^0.30.1": version "0.30.1" resolved "https://registry.npmjs.org/@coral-xyz/anchor-errors/-/anchor-errors-0.30.1.tgz#bdfd3a353131345244546876eb4afc0e125bec30" @@ -1682,32 +1468,6 @@ resolved "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz#5e13fac887f08c44f76b0ccaf3370eb00fec9bb6" integrity sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg== -"@envelop/core@^5.2.3": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@envelop/core/-/core-5.3.0.tgz#ee666caa94dc2fdcb00c9659cfc06775ff95faa1" - integrity sha512-xvUkOWXI8JsG2OOnqiI2tOkEc52wbmIqWORr7yGc8B8E53Oh1MMGGGck4mbR80s25LnHVzfNIiIlNkuDgZRuuA== - dependencies: - "@envelop/instrumentation" "^1.0.0" - "@envelop/types" "^5.2.1" - "@whatwg-node/promise-helpers" "^1.2.4" - tslib "^2.5.0" - -"@envelop/instrumentation@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@envelop/instrumentation/-/instrumentation-1.0.0.tgz#43268392e065d8ba975cacbdf4fc297dfe3e11e5" - integrity sha512-cxgkB66RQB95H3X27jlnxCRNTmPuSTgmBAq6/4n2Dtv4hsk4yz8FadA1ggmd0uZzvKqWD6CR+WFgTjhDqg7eyw== - dependencies: - "@whatwg-node/promise-helpers" "^1.2.1" - tslib "^2.5.0" - -"@envelop/types@^5.2.1": - version "5.2.1" - resolved "https://registry.yarnpkg.com/@envelop/types/-/types-5.2.1.tgz#6bc9713f2aea56d7de3ea39e8bb70035c0475b36" - integrity sha512-CsFmA3u3c2QoLDTfEpGr4t25fjMU31nyvse7IzWTvb0ZycuPjMjb0fjlheh+PbhBYb9YLugnT2uY6Mwcg1o+Zg== - dependencies: - "@whatwg-node/promise-helpers" "^1.0.0" - tslib "^2.5.0" - "@eslint-community/eslint-utils@^4.1.2", "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.7.0" resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz#607084630c6c033992a082de6e6fbc1a8b52175a" @@ -2372,11 +2132,6 @@ resolved "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== -"@fastify/busboy@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-3.1.1.tgz#af3aea7f1e52ec916d8b5c9dcc0f09d4c060a3fc" - integrity sha512-5DGmA8FTdB2XbDeEwc/5ZXBl6UbBAyBOOLlPuBnZ/N1SwdH9Ii+cOX3tBROlDgcTXxjOYnLMVoKk9+FXAw0CJw== - "@floating-ui/core@^1.7.0": version "1.7.0" resolved "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.0.tgz#1aff27a993ea1b254a586318c29c3b16ea0f4d0a" @@ -2420,496 +2175,7 @@ dependencies: "@0no-co/graphql.web" "^1.0.5" -"@graphql-codegen/add@5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@graphql-codegen/add/-/add-5.0.0.tgz#578ebaf4fa87c1e934c381cd679bcedcf79feaba" - integrity sha512-ynWDOsK2yxtFHwcJTB9shoSkUd7YXd6ZE57f0nk7W5cu/nAgxZZpEsnTPEpZB/Mjf14YRGe2uJHQ7AfElHjqUQ== - dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.0" - tslib "~2.5.0" - -"@graphql-codegen/cli@5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@graphql-codegen/cli/-/cli-5.0.0.tgz#761dcf08cfee88bbdd9cdf8097b2343445ec6f0a" - integrity sha512-A7J7+be/a6e+/ul2KI5sfJlpoqeqwX8EzktaKCeduyVKgOLA6W5t+NUGf6QumBDXU8PEOqXk3o3F+RAwCWOiqA== - dependencies: - "@babel/generator" "^7.18.13" - "@babel/template" "^7.18.10" - "@babel/types" "^7.18.13" - "@graphql-codegen/core" "^4.0.0" - "@graphql-codegen/plugin-helpers" "^5.0.1" - "@graphql-tools/apollo-engine-loader" "^8.0.0" - "@graphql-tools/code-file-loader" "^8.0.0" - "@graphql-tools/git-loader" "^8.0.0" - "@graphql-tools/github-loader" "^8.0.0" - "@graphql-tools/graphql-file-loader" "^8.0.0" - "@graphql-tools/json-file-loader" "^8.0.0" - "@graphql-tools/load" "^8.0.0" - "@graphql-tools/prisma-loader" "^8.0.0" - "@graphql-tools/url-loader" "^8.0.0" - "@graphql-tools/utils" "^10.0.0" - "@whatwg-node/fetch" "^0.8.0" - chalk "^4.1.0" - cosmiconfig "^8.1.3" - debounce "^1.2.0" - detect-indent "^6.0.0" - graphql-config "^5.0.2" - inquirer "^8.0.0" - is-glob "^4.0.1" - jiti "^1.17.1" - json-to-pretty-yaml "^1.2.2" - listr2 "^4.0.5" - log-symbols "^4.0.0" - micromatch "^4.0.5" - shell-quote "^1.7.3" - string-env-interpolation "^1.0.1" - ts-log "^2.2.3" - tslib "^2.4.0" - yaml "^2.3.1" - yargs "^17.0.0" - -"@graphql-codegen/core@^4.0.0": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@graphql-codegen/core/-/core-4.0.2.tgz#7e6ec266276f54bbf02f60599d9e518f4a59d85e" - integrity sha512-IZbpkhwVqgizcjNiaVzNAzm/xbWT6YnGgeOLwVjm4KbJn3V2jchVtuzHH09G5/WkkLSk2wgbXNdwjM41JxO6Eg== - dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.3" - "@graphql-tools/schema" "^10.0.0" - "@graphql-tools/utils" "^10.0.0" - tslib "~2.6.0" - -"@graphql-codegen/plugin-helpers@^3.0.0", "@graphql-codegen/plugin-helpers@^3.1.2": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-3.1.2.tgz#69a2e91178f478ea6849846ade0a59a844d34389" - integrity sha512-emOQiHyIliVOIjKVKdsI5MXj312zmRDwmHpyUTZMjfpvxq/UVAHUJIVdVf+lnjjrI+LXBTgMlTWTgHQfmICxjg== - dependencies: - "@graphql-tools/utils" "^9.0.0" - change-case-all "1.0.15" - common-tags "1.8.2" - import-from "4.0.0" - lodash "~4.17.0" - tslib "~2.4.0" - -"@graphql-codegen/plugin-helpers@^5.0.0", "@graphql-codegen/plugin-helpers@^5.0.1", "@graphql-codegen/plugin-helpers@^5.0.3", "@graphql-codegen/plugin-helpers@^5.1.0": - version "5.1.1" - resolved "https://registry.yarnpkg.com/@graphql-codegen/plugin-helpers/-/plugin-helpers-5.1.1.tgz#b7c744c8826367c3002c346112de3cd1b0f99b16" - integrity sha512-28GHODK2HY1NhdyRcPP3sCz0Kqxyfiz7boIZ8qIxFYmpLYnlDgiYok5fhFLVSZihyOpCs4Fa37gVHf/Q4I2FEg== - dependencies: - "@graphql-tools/utils" "^10.0.0" - change-case-all "1.0.15" - common-tags "1.8.2" - import-from "4.0.0" - lodash "~4.17.0" - tslib "~2.6.0" - -"@graphql-codegen/schema-ast@^4.0.0", "@graphql-codegen/schema-ast@^4.0.2": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@graphql-codegen/schema-ast/-/schema-ast-4.1.0.tgz#a1e71f99346495b9272161a9ed07756e82648726" - integrity sha512-kZVn0z+th9SvqxfKYgztA6PM7mhnSZaj4fiuBWvMTqA+QqQ9BBed6Pz41KuD/jr0gJtnlr2A4++/0VlpVbCTmQ== - dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.3" - "@graphql-tools/utils" "^10.0.0" - tslib "~2.6.0" - -"@graphql-codegen/typescript-graphql-request@6.3.0": - version "6.3.0" - resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-graphql-request/-/typescript-graphql-request-6.3.0.tgz#8de6246edef0a114e2e7b5203215c98490ace95e" - integrity sha512-IX42XakdcbGosIQo0jkH/4Tj5hk5smDmACYHMJbuSAA9vlcJNHkl3LGyG1Ggy2qVSI20nmNMaxpTg74SSyb4Yg== - dependencies: - "@graphql-codegen/plugin-helpers" "^3.0.0" - "@graphql-codegen/visitor-plugin-common" "2.13.8" - auto-bind "~4.0.0" - tslib "^2.8.1" - -"@graphql-codegen/typescript-operations@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript-operations/-/typescript-operations-4.0.1.tgz#930af3e2d2ae8ff06de696291be28fe7046a2fef" - integrity sha512-GpUWWdBVUec/Zqo23aFLBMrXYxN2irypHqDcKjN78JclDPdreasAEPcIpMfqf4MClvpmvDLy4ql+djVAwmkjbw== - dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.0" - "@graphql-codegen/typescript" "^4.0.1" - "@graphql-codegen/visitor-plugin-common" "4.0.1" - auto-bind "~4.0.0" - tslib "~2.5.0" - -"@graphql-codegen/typescript@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-4.0.1.tgz#7481d68f59bea802dd10e278dce73c8a1552b2a4" - integrity sha512-3YziQ21dCVdnHb+Us1uDb3pA6eG5Chjv0uTK+bt9dXeMlwYBU8MbtzvQTo4qvzWVC1AxSOKj0rgfNu1xCXqJyA== - dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.0" - "@graphql-codegen/schema-ast" "^4.0.0" - "@graphql-codegen/visitor-plugin-common" "4.0.1" - auto-bind "~4.0.0" - tslib "~2.5.0" - -"@graphql-codegen/typescript@^4.0.1": - version "4.1.6" - resolved "https://registry.yarnpkg.com/@graphql-codegen/typescript/-/typescript-4.1.6.tgz#f3481ccc1656e96892d629671fb2cff5dabc458b" - integrity sha512-vpw3sfwf9A7S+kIUjyFxuvrywGxd4lmwmyYnnDVjVE4kSQ6Td3DpqaPTy8aNQ6O96vFoi/bxbZS2BW49PwSUUA== - dependencies: - "@graphql-codegen/plugin-helpers" "^5.1.0" - "@graphql-codegen/schema-ast" "^4.0.2" - "@graphql-codegen/visitor-plugin-common" "5.8.0" - auto-bind "~4.0.0" - tslib "~2.6.0" - -"@graphql-codegen/visitor-plugin-common@2.13.8": - version "2.13.8" - resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-2.13.8.tgz#09bc6317b227e5a278f394f4cef0d6c2d1910597" - integrity sha512-IQWu99YV4wt8hGxIbBQPtqRuaWZhkQRG2IZKbMoSvh0vGeWb3dB0n0hSgKaOOxDY+tljtOf9MTcUYvJslQucMQ== - dependencies: - "@graphql-codegen/plugin-helpers" "^3.1.2" - "@graphql-tools/optimize" "^1.3.0" - "@graphql-tools/relay-operation-optimizer" "^6.5.0" - "@graphql-tools/utils" "^9.0.0" - auto-bind "~4.0.0" - change-case-all "1.0.15" - dependency-graph "^0.11.0" - graphql-tag "^2.11.0" - parse-filepath "^1.0.2" - tslib "~2.4.0" - -"@graphql-codegen/visitor-plugin-common@4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-4.0.1.tgz#64e293728b3c186f6767141e41fcdb310e50d367" - integrity sha512-Bi/1z0nHg4QMsAqAJhds+ForyLtk7A3HQOlkrZNm3xEkY7lcBzPtiOTLBtvziwopBsXUxqeSwVjOOFPLS5Yw1Q== - dependencies: - "@graphql-codegen/plugin-helpers" "^5.0.0" - "@graphql-tools/optimize" "^2.0.0" - "@graphql-tools/relay-operation-optimizer" "^7.0.0" - "@graphql-tools/utils" "^10.0.0" - auto-bind "~4.0.0" - change-case-all "1.0.15" - dependency-graph "^0.11.0" - graphql-tag "^2.11.0" - parse-filepath "^1.0.2" - tslib "~2.5.0" - -"@graphql-codegen/visitor-plugin-common@5.8.0": - version "5.8.0" - resolved "https://registry.yarnpkg.com/@graphql-codegen/visitor-plugin-common/-/visitor-plugin-common-5.8.0.tgz#1b796453eb96d8e6ad5d4d3acff304e4672781a0" - integrity sha512-lC1E1Kmuzi3WZUlYlqB4fP6+CvbKH9J+haU1iWmgsBx5/sO2ROeXJG4Dmt8gP03bI2BwjiwV5WxCEMlyeuzLnA== - dependencies: - "@graphql-codegen/plugin-helpers" "^5.1.0" - "@graphql-tools/optimize" "^2.0.0" - "@graphql-tools/relay-operation-optimizer" "^7.0.0" - "@graphql-tools/utils" "^10.0.0" - auto-bind "~4.0.0" - change-case-all "1.0.15" - dependency-graph "^0.11.0" - graphql-tag "^2.11.0" - parse-filepath "^1.0.2" - tslib "~2.6.0" - -"@graphql-hive/signal@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@graphql-hive/signal/-/signal-1.0.0.tgz#6e2193660a47c925abadbe72293dfc9430e24f8f" - integrity sha512-RiwLMc89lTjvyLEivZ/qxAC5nBHoS2CtsWFSOsN35sxG9zoo5Z+JsFHM8MlvmO9yt+MJNIyC5MLE1rsbOphlag== - -"@graphql-tools/apollo-engine-loader@^8.0.0": - version "8.0.20" - resolved "https://registry.yarnpkg.com/@graphql-tools/apollo-engine-loader/-/apollo-engine-loader-8.0.20.tgz#dbb7d294a3fbf01ecb05004bd6e34a01029718cd" - integrity sha512-m5k9nXSyjq31yNsEqDXLyykEjjn3K3Mo73oOKI+Xjy8cpnsgbT4myeUJIYYQdLrp7fr9Y9p7ZgwT5YcnwmnAbA== - dependencies: - "@graphql-tools/utils" "^10.8.6" - "@whatwg-node/fetch" "^0.10.0" - sync-fetch "0.6.0-2" - tslib "^2.4.0" - -"@graphql-tools/batch-execute@^9.0.17": - version "9.0.17" - resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-9.0.17.tgz#c2ef12e6c2b2e09f5e6116c20a2229bfaecd399c" - integrity sha512-i7BqBkUP2+ex8zrQrCQTEt6nYHQmIey9qg7CMRRa1hXCY2X8ZCVjxsvbsi7gOLwyI/R3NHxSRDxmzZevE2cPLg== - dependencies: - "@graphql-tools/utils" "^10.8.1" - "@whatwg-node/promise-helpers" "^1.3.0" - dataloader "^2.2.3" - tslib "^2.8.1" - -"@graphql-tools/code-file-loader@^8.0.0": - version "8.1.20" - resolved "https://registry.yarnpkg.com/@graphql-tools/code-file-loader/-/code-file-loader-8.1.20.tgz#83f1af7b051e0e2a91d9f6412e368a536eabb86c" - integrity sha512-GzIbjjWJIc04KWnEr8VKuPe0FA2vDTlkaeub5p4lLimljnJ6C0QSkOyCUnFmsB9jetQcHm0Wfmn/akMnFUG+wA== - dependencies: - "@graphql-tools/graphql-tag-pluck" "8.3.19" - "@graphql-tools/utils" "^10.8.6" - globby "^11.0.3" - tslib "^2.4.0" - unixify "^1.0.0" - -"@graphql-tools/delegate@^10.2.20": - version "10.2.20" - resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-10.2.20.tgz#10270de5f61cc4a7c57a43047c9af54376aad75c" - integrity sha512-vURrChtc3zPyD4XZv7eZj43mIkvuJH8IDDYy7q/AL10N4AJN0dKplWOUA9HSNPSPe3+5dnIUeTno8PX0tV99QA== - dependencies: - "@graphql-tools/batch-execute" "^9.0.17" - "@graphql-tools/executor" "^1.4.7" - "@graphql-tools/schema" "^10.0.11" - "@graphql-tools/utils" "^10.8.1" - "@repeaterjs/repeater" "^3.0.6" - "@whatwg-node/promise-helpers" "^1.3.0" - dataloader "^2.2.3" - dset "^3.1.2" - tslib "^2.8.1" - -"@graphql-tools/executor-common@^0.0.4": - version "0.0.4" - resolved "https://registry.yarnpkg.com/@graphql-tools/executor-common/-/executor-common-0.0.4.tgz#763603a6d7a22bb09d67ce682e84a0d730ff2bf9" - integrity sha512-SEH/OWR+sHbknqZyROCFHcRrbZeUAyjCsgpVWCRjqjqRbiJiXq6TxNIIOmpXgkrXWW/2Ev4Wms6YSGJXjdCs6Q== - dependencies: - "@envelop/core" "^5.2.3" - "@graphql-tools/utils" "^10.8.1" - -"@graphql-tools/executor-graphql-ws@^2.0.1": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@graphql-tools/executor-graphql-ws/-/executor-graphql-ws-2.0.5.tgz#4e58fc96c2f080338ee5b9afaee8d5e26681d732" - integrity sha512-gI/D9VUzI1Jt1G28GYpvm5ckupgJ5O8mi5Y657UyuUozX34ErfVdZ81g6oVcKFQZ60LhCzk7jJeykK48gaLhDw== - dependencies: - "@graphql-tools/executor-common" "^0.0.4" - "@graphql-tools/utils" "^10.8.1" - "@whatwg-node/disposablestack" "^0.0.6" - graphql-ws "^6.0.3" - isomorphic-ws "^5.0.0" - tslib "^2.8.1" - ws "^8.17.1" - -"@graphql-tools/executor-http@^1.1.9": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@graphql-tools/executor-http/-/executor-http-1.3.3.tgz#057de79ebc90edbd242259cccb1268d37ee6c579" - integrity sha512-LIy+l08/Ivl8f8sMiHW2ebyck59JzyzO/yF9SFS4NH6MJZUezA1xThUXCDIKhHiD56h/gPojbkpcFvM2CbNE7A== - dependencies: - "@graphql-hive/signal" "^1.0.0" - "@graphql-tools/executor-common" "^0.0.4" - "@graphql-tools/utils" "^10.8.1" - "@repeaterjs/repeater" "^3.0.4" - "@whatwg-node/disposablestack" "^0.0.6" - "@whatwg-node/fetch" "^0.10.4" - "@whatwg-node/promise-helpers" "^1.3.0" - meros "^1.2.1" - tslib "^2.8.1" - -"@graphql-tools/executor-legacy-ws@^1.1.17": - version "1.1.17" - resolved "https://registry.yarnpkg.com/@graphql-tools/executor-legacy-ws/-/executor-legacy-ws-1.1.17.tgz#55cf369866fff0b268963daf94041bc8621bb345" - integrity sha512-TvltY6eL4DY1Vt66Z8kt9jVmNcI+WkvVPQZrPbMCM3rv2Jw/sWvSwzUBezRuWX0sIckMifYVh23VPcGBUKX/wg== - dependencies: - "@graphql-tools/utils" "^10.8.6" - "@types/ws" "^8.0.0" - isomorphic-ws "^5.0.0" - tslib "^2.4.0" - ws "^8.17.1" - -"@graphql-tools/executor@^1.4.7": - version "1.4.7" - resolved "https://registry.yarnpkg.com/@graphql-tools/executor/-/executor-1.4.7.tgz#86bf0b26f2add5b686ec96e866ee22d1b81f9b6b" - integrity sha512-U0nK9jzJRP9/9Izf1+0Gggd6K6RNRsheFo1gC/VWzfnsr0qjcOSS9qTjY0OTC5iTPt4tQ+W5Zpw/uc7mebI6aA== - dependencies: - "@graphql-tools/utils" "^10.8.6" - "@graphql-typed-document-node/core" "^3.2.0" - "@repeaterjs/repeater" "^3.0.4" - "@whatwg-node/disposablestack" "^0.0.6" - "@whatwg-node/promise-helpers" "^1.0.0" - tslib "^2.4.0" - -"@graphql-tools/git-loader@^8.0.0": - version "8.0.24" - resolved "https://registry.yarnpkg.com/@graphql-tools/git-loader/-/git-loader-8.0.24.tgz#ced686e8264ca36ad510b1967804238aa4f04858" - integrity sha512-ypLC9N2bKNC0QNbrEBTbWKwbV607f7vK2rSGi9uFeGr8E29tWplo6or9V/+TM0ZfIkUsNp/4QX/zKTgo8SbwQg== - dependencies: - "@graphql-tools/graphql-tag-pluck" "8.3.19" - "@graphql-tools/utils" "^10.8.6" - is-glob "4.0.3" - micromatch "^4.0.8" - tslib "^2.4.0" - unixify "^1.0.0" - -"@graphql-tools/github-loader@^8.0.0": - version "8.0.20" - resolved "https://registry.yarnpkg.com/@graphql-tools/github-loader/-/github-loader-8.0.20.tgz#769717828c47f751f5c1a25b44ec270cdcd222be" - integrity sha512-Icch8bKZ1iP3zXCB9I0ded1hda9NPskSSalw7ZM21kXvLiOR5nZhdqPF65gCFkIKo+O4NR4Bp51MkKj+wl+vpg== - dependencies: - "@graphql-tools/executor-http" "^1.1.9" - "@graphql-tools/graphql-tag-pluck" "^8.3.19" - "@graphql-tools/utils" "^10.8.6" - "@whatwg-node/fetch" "^0.10.0" - "@whatwg-node/promise-helpers" "^1.0.0" - sync-fetch "0.6.0-2" - tslib "^2.4.0" - -"@graphql-tools/graphql-file-loader@^8.0.0": - version "8.0.20" - resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-file-loader/-/graphql-file-loader-8.0.20.tgz#da6eb29970c191bd5b16432f15f9192478c4abab" - integrity sha512-inds4My+JJxmg5mxKWYtMIJNRxa7MtX+XIYqqD/nu6G4LzQ5KGaBJg6wEl103KxXli7qNOWeVAUmEjZeYhwNEg== - dependencies: - "@graphql-tools/import" "7.0.19" - "@graphql-tools/utils" "^10.8.6" - globby "^11.0.3" - tslib "^2.4.0" - unixify "^1.0.0" - -"@graphql-tools/graphql-tag-pluck@8.3.19", "@graphql-tools/graphql-tag-pluck@^8.3.19": - version "8.3.19" - resolved "https://registry.yarnpkg.com/@graphql-tools/graphql-tag-pluck/-/graphql-tag-pluck-8.3.19.tgz#a64da149742e63717b409003ac2f1f596605e529" - integrity sha512-LEw/6IYOUz48HjbWntZXDCzSXsOIM1AyWZrlLoJOrA8QAlhFd8h5Tny7opCypj8FO9VvpPFugWoNDh5InPOEQA== - dependencies: - "@babel/core" "^7.26.10" - "@babel/parser" "^7.26.10" - "@babel/plugin-syntax-import-assertions" "^7.26.0" - "@babel/traverse" "^7.26.10" - "@babel/types" "^7.26.10" - "@graphql-tools/utils" "^10.8.6" - tslib "^2.4.0" - -"@graphql-tools/import@7.0.19": - version "7.0.19" - resolved "https://registry.yarnpkg.com/@graphql-tools/import/-/import-7.0.19.tgz#4d8a3dc5e830273d62e472a4f0dc02170c59beea" - integrity sha512-Xtku8G4bxnrr6I3hVf8RrBFGYIbQ1OYVjl7jgcy092aBkNZvy1T6EDmXmYXn5F+oLd9Bks3K3WaMm8gma/nM/Q== - dependencies: - "@graphql-tools/utils" "^10.8.6" - resolve-from "5.0.0" - tslib "^2.4.0" - -"@graphql-tools/json-file-loader@^8.0.0": - version "8.0.18" - resolved "https://registry.yarnpkg.com/@graphql-tools/json-file-loader/-/json-file-loader-8.0.18.tgz#f89438c1463db75f97f419c17be234d9525bef5d" - integrity sha512-JjjIxxewgk8HeMR3npR3YbOkB7fxmdgmqB9kZLWdkRKBxrRXVzhryyq+mhmI0Evzt6pNoHIc3vqwmSctG2sddg== - dependencies: - "@graphql-tools/utils" "^10.8.6" - globby "^11.0.3" - tslib "^2.4.0" - unixify "^1.0.0" - -"@graphql-tools/load@^8.0.0", "@graphql-tools/load@^8.1.0": - version "8.1.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/load/-/load-8.1.0.tgz#4aa03f071a8777e314b10289b7d6097daaaf8783" - integrity sha512-OGfOm09VyXdNGJS/rLqZ6ztCiG2g6AMxhwtET8GZXTbnjptFc17GtKwJ3Jv5w7mjJ8dn0BHydvIuEKEUK4ciYw== - dependencies: - "@graphql-tools/schema" "^10.0.23" - "@graphql-tools/utils" "^10.8.6" - p-limit "3.1.0" - tslib "^2.4.0" - -"@graphql-tools/merge@^9.0.0", "@graphql-tools/merge@^9.0.24": - version "9.0.24" - resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-9.0.24.tgz#1f366e85588894cb496bd1c332be7665db143df2" - integrity sha512-NzWx/Afl/1qHT3Nm1bghGG2l4jub28AdvtG11PoUlmjcIjnFBJMv4vqL0qnxWe8A82peWo4/TkVdjJRLXwgGEw== - dependencies: - "@graphql-tools/utils" "^10.8.6" - tslib "^2.4.0" - -"@graphql-tools/optimize@^1.3.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/optimize/-/optimize-1.4.0.tgz#20d6a9efa185ef8fc4af4fd409963e0907c6e112" - integrity sha512-dJs/2XvZp+wgHH8T5J2TqptT9/6uVzIYvA6uFACha+ufvdMBedkfR4b4GbT8jAKLRARiqRTxy3dctnwkTM2tdw== - dependencies: - tslib "^2.4.0" - -"@graphql-tools/optimize@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@graphql-tools/optimize/-/optimize-2.0.0.tgz#7a9779d180824511248a50c5a241eff6e7a2d906" - integrity sha512-nhdT+CRGDZ+bk68ic+Jw1OZ99YCDIKYA5AlVAnBHJvMawSx9YQqQAIj4refNc1/LRieGiuWvhbG3jvPVYho0Dg== - dependencies: - tslib "^2.4.0" - -"@graphql-tools/prisma-loader@^8.0.0": - version "8.0.17" - resolved "https://registry.yarnpkg.com/@graphql-tools/prisma-loader/-/prisma-loader-8.0.17.tgz#bc7efddb579fb85800540dd35284380e9df851a2" - integrity sha512-fnuTLeQhqRbA156pAyzJYN0KxCjKYRU5bz1q/SKOwElSnAU4k7/G1kyVsWLh7fneY78LoMNH5n+KlFV8iQlnyg== - dependencies: - "@graphql-tools/url-loader" "^8.0.15" - "@graphql-tools/utils" "^10.5.6" - "@types/js-yaml" "^4.0.0" - "@whatwg-node/fetch" "^0.10.0" - chalk "^4.1.0" - debug "^4.3.1" - dotenv "^16.0.0" - graphql-request "^6.0.0" - http-proxy-agent "^7.0.0" - https-proxy-agent "^7.0.0" - jose "^5.0.0" - js-yaml "^4.0.0" - lodash "^4.17.20" - scuid "^1.1.0" - tslib "^2.4.0" - yaml-ast-parser "^0.0.43" - -"@graphql-tools/relay-operation-optimizer@^6.5.0": - version "6.5.18" - resolved "https://registry.yarnpkg.com/@graphql-tools/relay-operation-optimizer/-/relay-operation-optimizer-6.5.18.tgz#a1b74a8e0a5d0c795b8a4d19629b654cf66aa5ab" - integrity sha512-mc5VPyTeV+LwiM+DNvoDQfPqwQYhPV/cl5jOBjTgSniyaq8/86aODfMkrE2OduhQ5E00hqrkuL2Fdrgk0w1QJg== - dependencies: - "@ardatan/relay-compiler" "12.0.0" - "@graphql-tools/utils" "^9.2.1" - tslib "^2.4.0" - -"@graphql-tools/relay-operation-optimizer@^7.0.0": - version "7.0.19" - resolved "https://registry.yarnpkg.com/@graphql-tools/relay-operation-optimizer/-/relay-operation-optimizer-7.0.19.tgz#f04bd099877dc470b9ed4c65a5375a1a3e2335f1" - integrity sha512-xnjLpfzw63yIX1bo+BVh4j1attSwqEkUbpJ+HAhdiSUa3FOQFfpWgijRju+3i87CwhjBANqdTZbcsqLT1hEXig== - dependencies: - "@ardatan/relay-compiler" "^12.0.3" - "@graphql-tools/utils" "^10.8.6" - tslib "^2.4.0" - -"@graphql-tools/schema@^10.0.0", "@graphql-tools/schema@^10.0.11", "@graphql-tools/schema@^10.0.23": - version "10.0.23" - resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-10.0.23.tgz#d8865e96f37a04ca43303d7024add7edbe0c5ed4" - integrity sha512-aEGVpd1PCuGEwqTXCStpEkmheTHNdMayiIKH1xDWqYp9i8yKv9FRDgkGrY4RD8TNxnf7iII+6KOBGaJ3ygH95A== - dependencies: - "@graphql-tools/merge" "^9.0.24" - "@graphql-tools/utils" "^10.8.6" - tslib "^2.4.0" - -"@graphql-tools/url-loader@^8.0.0", "@graphql-tools/url-loader@^8.0.15": - version "8.0.31" - resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-8.0.31.tgz#75cd36b8b45c87993b4dd2149a83fa9ad3cd2a67" - integrity sha512-QGP3py6DAdKERHO5D38Oi+6j+v0O3rkBbnLpyOo87rmIRbwE6sOkL5JeHegHs7EEJ279fBX6lMt8ry0wBMGtyA== - dependencies: - "@graphql-tools/executor-graphql-ws" "^2.0.1" - "@graphql-tools/executor-http" "^1.1.9" - "@graphql-tools/executor-legacy-ws" "^1.1.17" - "@graphql-tools/utils" "^10.8.6" - "@graphql-tools/wrap" "^10.0.16" - "@types/ws" "^8.0.0" - "@whatwg-node/fetch" "^0.10.0" - "@whatwg-node/promise-helpers" "^1.0.0" - isomorphic-ws "^5.0.0" - sync-fetch "0.6.0-2" - tslib "^2.4.0" - ws "^8.17.1" - -"@graphql-tools/utils@^10.0.0", "@graphql-tools/utils@^10.5.6", "@graphql-tools/utils@^10.8.1", "@graphql-tools/utils@^10.8.6": - version "10.8.6" - resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-10.8.6.tgz#69ef29e408a27919108b2b2227fe8b465acf9e5c" - integrity sha512-Alc9Vyg0oOsGhRapfL3xvqh1zV8nKoFUdtLhXX7Ki4nClaIJXckrA86j+uxEuG3ic6j4jlM1nvcWXRn/71AVLQ== - dependencies: - "@graphql-typed-document-node/core" "^3.1.1" - "@whatwg-node/promise-helpers" "^1.0.0" - cross-inspect "1.0.1" - dset "^3.1.4" - tslib "^2.4.0" - -"@graphql-tools/utils@^9.0.0", "@graphql-tools/utils@^9.2.1": - version "9.2.1" - resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-9.2.1.tgz#1b3df0ef166cfa3eae706e3518b17d5922721c57" - integrity sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A== - dependencies: - "@graphql-typed-document-node/core" "^3.1.1" - tslib "^2.4.0" - -"@graphql-tools/wrap@^10.0.16": - version "10.1.1" - resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-10.1.1.tgz#d6e6da70166fe90b563be39b52fc416555287808" - integrity sha512-vNtnot0QMGSpCZeSvmd2pmpnMjpPHhUMD2d7sVy6vIzRx6lPV/zc9TKMeWGLlHgVx3oKg3RefB9dv19/QAPbog== - dependencies: - "@graphql-tools/delegate" "^10.2.20" - "@graphql-tools/schema" "^10.0.11" - "@graphql-tools/utils" "^10.8.1" - "@whatwg-node/promise-helpers" "^1.3.0" - tslib "^2.8.1" - -"@graphql-typed-document-node/core@^3.1.1", "@graphql-typed-document-node/core@^3.2.0": +"@graphql-typed-document-node/core@^3.2.0": version "3.2.0" resolved "https://registry.yarnpkg.com/@graphql-typed-document-node/core/-/core-3.2.0.tgz#5f3d96ec6b2354ad6d8a28bf216a1d97b5426861" integrity sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ== @@ -3110,11 +2376,6 @@ dependencies: mute-stream "^1.0.0" -"@ioredis/commands@^1.1.1": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@ioredis/commands/-/commands-1.2.0.tgz#6d61b3097470af1fdbbe622795b8921d42018e11" - integrity sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg== - "@isaacs/cliui@^8.0.2": version "8.0.2" resolved "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" @@ -3820,7 +3081,7 @@ resolved "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.4.0.tgz#177594bdb2d86c71f5d1052fe40cb4edb95fb20f" integrity sha512-eCYgWnLg6WO+X52I16TZt8uEjbtdkgLC0SUX/xnAksjjrQI4Xfn4iBRoI5j55dmlOhDv1Y7BoR3cU7e3WWhC6A== -"@peculiar/asn1-schema@^2.3.13", "@peculiar/asn1-schema@^2.3.8": +"@peculiar/asn1-schema@^2.3.13": version "2.3.15" resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.3.15.tgz#e926bfdeed51945a06f38be703499e7d8341a5d3" integrity sha512-QPeD8UA8axQREpgR5UTAfu2mqQmm97oUqahDtNdBcfj3qAnoXzFdQW+aNf/tD2WVXF8Fhmftxoj0eMIT++gX2w== @@ -3829,24 +3090,6 @@ pvtsutils "^1.3.6" tslib "^2.8.1" -"@peculiar/json-schema@^1.1.12": - version "1.1.12" - resolved "https://registry.yarnpkg.com/@peculiar/json-schema/-/json-schema-1.1.12.tgz#fe61e85259e3b5ba5ad566cb62ca75b3d3cd5339" - integrity sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w== - dependencies: - tslib "^2.0.0" - -"@peculiar/webcrypto@^1.4.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@peculiar/webcrypto/-/webcrypto-1.5.0.tgz#9e57174c02c1291051c553600347e12b81469e10" - integrity sha512-BRs5XUAwiyCDQMsVA9IDvDa7UBR9gAvPHgugOeGng3YN6vJ9JYonyDc0lNczErgtCWtucjR5N7VtaonboD/ezg== - dependencies: - "@peculiar/asn1-schema" "^2.3.8" - "@peculiar/json-schema" "^1.1.12" - pvtsutils "^1.3.5" - tslib "^2.6.2" - webcrypto-core "^1.8.0" - "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" @@ -3884,16 +3127,6 @@ redux-thunk "^2.4.2" reselect "^4.1.8" -"@repeaterjs/repeater@^3.0.4", "@repeaterjs/repeater@^3.0.6": - version "3.0.6" - resolved "https://registry.yarnpkg.com/@repeaterjs/repeater/-/repeater-3.0.6.tgz#be23df0143ceec3c69f8b6c2517971a5578fdaa2" - integrity sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA== - -"@rollup/rollup-linux-x64-gnu@^4.18.0": - version "4.44.1" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.44.1.tgz#4b211e6fd57edd6a134740f4f8e8ea61972ff2c5" - integrity sha512-EtnsrmZGomz9WxK1bR5079zee3+7a+AdFlghyd6VbAjgRJDbTANJ9dcPIPAi76uG05micpEL+gPGmAKYTschQw== - "@rtsao/scc@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" @@ -5156,13 +4389,6 @@ dependencies: "@types/node" "*" -"@types/cors@2.8.17": - version "2.8.17" - resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.17.tgz#5d718a5e494a8166f569d986794e49c48b216b2b" - integrity sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA== - dependencies: - "@types/node" "*" - "@types/d3-scale-chromatic@^3.0.0": version "3.1.0" resolved "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz#dc6d4f9a98376f18ea50bad6c39537f1b5463c39" @@ -5214,13 +4440,6 @@ resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz#4158d3105276773d5b7695cd4834b1722e4f37a8" integrity sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ== -"@types/graphql@14.5.0": - version "14.5.0" - resolved "https://registry.yarnpkg.com/@types/graphql/-/graphql-14.5.0.tgz#a545fb3bc8013a3547cf2f07f5e13a33642b75d6" - integrity sha512-MOkzsEp1Jk5bXuAsHsUi6BVv0zCO+7/2PTiZMXWDSsMXvNU6w/PLMQT2vHn8hy2i0JqojPz1Sz6rsFjHtsU0lA== - dependencies: - graphql "*" - "@types/hast@^2.0.0": version "2.3.10" resolved "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz#5c9d9e0b304bbb8879b857225c5ebab2d81d7643" @@ -5248,7 +4467,7 @@ resolved "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-2.2.7.tgz#226a9e31680835a6188e887f3988e60c04d3f6a3" integrity sha512-aLkWa0C0vO5b4Sr798E26QgOkss68Un0bLjs7u9qxzPT5CG+8DuNTffWES58YzJs3hrVAOs1wonycqEBqNJubA== -"@types/js-yaml@^4.0.0": +"@types/js-yaml@^4.0.9": version "4.0.9" resolved "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz#cd82382c4f902fed9691a2ed79ec68c5898af4c2" integrity sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg== @@ -5474,7 +4693,7 @@ dependencies: "@types/node" "*" -"@types/ws@^8.0.0", "@types/ws@^8.2.2", "@types/ws@^8.5.10": +"@types/ws@^8.2.2", "@types/ws@^8.5.10": version "8.18.1" resolved "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz#48464e4bf2ddfd17db13d845467f6070ffea4aa9" integrity sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg== @@ -5775,11 +4994,6 @@ dependencies: "@upstash/redis" "^1.31.3" -"@vercel/stega@^0.1.2": - version "0.1.2" - resolved "https://registry.yarnpkg.com/@vercel/stega/-/stega-0.1.2.tgz#0c20c5c9419c4288b1de58a64b5f9f26c763b25f" - integrity sha512-P7mafQXjkrsoyTRppnt0N21udKS9wUmLXHRyP9saLXLHw32j/FgUJ3FscSWgvSqRs4cj7wKZtwqJEvWJ2jbGmA== - "@wallet-standard/app@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@wallet-standard/app/-/app-1.1.0.tgz#2ca32e4675536224ebe55a00ad533b7923d7380a" @@ -5825,66 +5039,6 @@ dependencies: "@wallet-standard/base" "^1.1.0" -"@whatwg-node/disposablestack@^0.0.6": - version "0.0.6" - resolved "https://registry.yarnpkg.com/@whatwg-node/disposablestack/-/disposablestack-0.0.6.tgz#2064a1425ea66194def6df0c7a1851b6939c82bb" - integrity sha512-LOtTn+JgJvX8WfBVJtF08TGrdjuFzGJc4mkP8EdDI8ADbvO7kiexYep1o8dwnt0okb0jYclCDXF13xU7Ge4zSw== - dependencies: - "@whatwg-node/promise-helpers" "^1.0.0" - tslib "^2.6.3" - -"@whatwg-node/events@^0.0.3": - version "0.0.3" - resolved "https://registry.yarnpkg.com/@whatwg-node/events/-/events-0.0.3.tgz#13a65dd4f5893f55280f766e29ae48074927acad" - integrity sha512-IqnKIDWfXBJkvy/k6tzskWTc2NK3LcqHlb+KHGCrjOCH4jfQckRX0NAiIcC/vIqQkzLYw2r2CTSwAxcrtcD6lA== - -"@whatwg-node/fetch@^0.10.0", "@whatwg-node/fetch@^0.10.4": - version "0.10.8" - resolved "https://registry.yarnpkg.com/@whatwg-node/fetch/-/fetch-0.10.8.tgz#1467f9505826fa7271c67dfaf0d7251ab8c2b9cc" - integrity sha512-Rw9z3ctmeEj8QIB9MavkNJqekiu9usBCSMZa+uuAvM0lF3v70oQVCXNppMIqaV6OTZbdaHF1M2HLow58DEw+wg== - dependencies: - "@whatwg-node/node-fetch" "^0.7.21" - urlpattern-polyfill "^10.0.0" - -"@whatwg-node/fetch@^0.8.0": - version "0.8.8" - resolved "https://registry.yarnpkg.com/@whatwg-node/fetch/-/fetch-0.8.8.tgz#48c6ad0c6b7951a73e812f09dd22d75e9fa18cae" - integrity sha512-CdcjGC2vdKhc13KKxgsc6/616BQ7ooDIgPeTuAiE8qfCnS0mGzcfCOoZXypQSz73nxI+GWc7ZReIAVhxoE1KCg== - dependencies: - "@peculiar/webcrypto" "^1.4.0" - "@whatwg-node/node-fetch" "^0.3.6" - busboy "^1.6.0" - urlpattern-polyfill "^8.0.0" - web-streams-polyfill "^3.2.1" - -"@whatwg-node/node-fetch@^0.3.6": - version "0.3.6" - resolved "https://registry.yarnpkg.com/@whatwg-node/node-fetch/-/node-fetch-0.3.6.tgz#e28816955f359916e2d830b68a64493124faa6d0" - integrity sha512-w9wKgDO4C95qnXZRwZTfCmLWqyRnooGjcIwG0wADWjw9/HN0p7dtvtgSvItZtUyNteEvgTrd8QojNEqV6DAGTA== - dependencies: - "@whatwg-node/events" "^0.0.3" - busboy "^1.6.0" - fast-querystring "^1.1.1" - fast-url-parser "^1.1.3" - tslib "^2.3.1" - -"@whatwg-node/node-fetch@^0.7.21": - version "0.7.21" - resolved "https://registry.yarnpkg.com/@whatwg-node/node-fetch/-/node-fetch-0.7.21.tgz#ba944eea7684047c91ac7f50097243633f6c9f5f" - integrity sha512-QC16IdsEyIW7kZd77aodrMO7zAoDyyqRCTLg+qG4wqtP4JV9AA+p7/lgqMdD29XyiYdVvIdFrfI9yh7B1QvRvw== - dependencies: - "@fastify/busboy" "^3.1.1" - "@whatwg-node/disposablestack" "^0.0.6" - "@whatwg-node/promise-helpers" "^1.3.2" - tslib "^2.6.3" - -"@whatwg-node/promise-helpers@^1.0.0", "@whatwg-node/promise-helpers@^1.2.1", "@whatwg-node/promise-helpers@^1.2.4", "@whatwg-node/promise-helpers@^1.3.0", "@whatwg-node/promise-helpers@^1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@whatwg-node/promise-helpers/-/promise-helpers-1.3.2.tgz#3b54987ad6517ef6db5920c66a6f0dada606587d" - integrity sha512-Nst5JdK47VIl9UcGwtv2Rcgyn5lWtZ0/mhRQ4G8NN2isxpq2TO30iqHzmwoJycjWuyUfg3GFXqP/gFHXeV57IA== - dependencies: - tslib "^2.6.3" - "@xobotyi/scrollbar-width@^1.9.5": version "1.9.5" resolved "https://registry.npmjs.org/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.5.tgz#80224a6919272f405b87913ca13b92929bdf3c4d" @@ -6100,7 +5254,7 @@ agent-base@6: dependencies: debug "4" -agent-base@^7.1.0, agent-base@^7.1.2: +agent-base@^7.1.2: version "7.1.3" resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz#29435eb821bc4194633a5b89e5bc4703bafc25a1" integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== @@ -6152,7 +5306,7 @@ ansi-colors@^4.1.1, ansi-colors@^4.1.3: resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== -ansi-escapes@^4.2.1, ansi-escapes@^4.3.0, ansi-escapes@^4.3.2: +ansi-escapes@^4.3.0, ansi-escapes@^4.3.2: version "4.3.2" resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== @@ -6345,11 +5499,6 @@ arraybuffer.prototype.slice@^1.0.4: get-intrinsic "^1.2.6" is-array-buffer "^3.0.4" -asap@~2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== - asn1js@^3.0.5: version "3.0.6" resolved "https://registry.yarnpkg.com/asn1js/-/asn1js-3.0.6.tgz#53e002ebe00c5f7fd77c1c047c3557d7c04dce25" @@ -6394,11 +5543,6 @@ at-least-node@^1.0.0: resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -auto-bind@~4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-4.0.0.tgz#e3589fc6c2da8f7ca43ba9f84fa52a744fc997fb" - integrity sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ== - autolinker@^3.11.0: version "3.16.2" resolved "https://registry.npmjs.org/autolinker/-/autolinker-3.16.2.tgz#6bb4f32432fc111b65659336863e653973bfbcc9" @@ -6457,15 +5601,6 @@ axios@^1.6.7: form-data "^4.0.4" proxy-from-env "^1.1.0" -axios@^1.8.4: - version "1.10.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.10.0.tgz#af320aee8632eaf2a400b6a1979fa75856f38d54" - integrity sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw== - dependencies: - follow-redirects "^1.15.6" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - axobject-query@^2.2.0: version "2.2.0" resolved "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" @@ -6529,44 +5664,6 @@ babel-plugin-polyfill-regenerator@^0.6.1: dependencies: "@babel/helper-define-polyfill-provider" "^0.6.4" -babel-plugin-syntax-trailing-function-commas@^7.0.0-beta.0: - version "7.0.0-beta.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-7.0.0-beta.0.tgz#aa213c1435e2bffeb6fca842287ef534ad05d5cf" - integrity sha512-Xj9XuRuz3nTSbaTXWv3itLOcxyF4oPD8douBBmj7U9BBC6nEBYfyOJYQMf/8PJAFotC62UY5dFfIGEPr7WswzQ== - -babel-preset-fbjs@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/babel-preset-fbjs/-/babel-preset-fbjs-3.4.0.tgz#38a14e5a7a3b285a3f3a86552d650dca5cf6111c" - integrity sha512-9ywCsCvo1ojrw0b+XYk7aFvTH6D9064t0RIL1rtMf3nsa02Xw41MS7sZw216Im35xj/UY0PDBQsa1brUDDF1Ow== - dependencies: - "@babel/plugin-proposal-class-properties" "^7.0.0" - "@babel/plugin-proposal-object-rest-spread" "^7.0.0" - "@babel/plugin-syntax-class-properties" "^7.0.0" - "@babel/plugin-syntax-flow" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - "@babel/plugin-transform-arrow-functions" "^7.0.0" - "@babel/plugin-transform-block-scoped-functions" "^7.0.0" - "@babel/plugin-transform-block-scoping" "^7.0.0" - "@babel/plugin-transform-classes" "^7.0.0" - "@babel/plugin-transform-computed-properties" "^7.0.0" - "@babel/plugin-transform-destructuring" "^7.0.0" - "@babel/plugin-transform-flow-strip-types" "^7.0.0" - "@babel/plugin-transform-for-of" "^7.0.0" - "@babel/plugin-transform-function-name" "^7.0.0" - "@babel/plugin-transform-literals" "^7.0.0" - "@babel/plugin-transform-member-expression-literals" "^7.0.0" - "@babel/plugin-transform-modules-commonjs" "^7.0.0" - "@babel/plugin-transform-object-super" "^7.0.0" - "@babel/plugin-transform-parameters" "^7.0.0" - "@babel/plugin-transform-property-literals" "^7.0.0" - "@babel/plugin-transform-react-display-name" "^7.0.0" - "@babel/plugin-transform-react-jsx" "^7.0.0" - "@babel/plugin-transform-shorthand-properties" "^7.0.0" - "@babel/plugin-transform-spread" "^7.0.0" - "@babel/plugin-transform-template-literals" "^7.0.0" - babel-plugin-syntax-trailing-function-commas "^7.0.0-beta.0" - bail@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz#d26f5cd8fe5d6f832a31517b9f7c356040ba6d5d" @@ -6839,13 +5936,6 @@ bs58check@^3.0.1: "@noble/hashes" "^1.2.0" bs58 "^5.0.0" -bser@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" @@ -6901,7 +5991,7 @@ builtins@^5.0.1: dependencies: semver "^7.0.0" -busboy@1.6.0, busboy@^1.6.0: +busboy@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== @@ -6944,14 +6034,6 @@ callsites@^3.0.0: resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camel-case@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-4.1.2.tgz#9728072a954f805228225a6deea6b38461e1bd5a" - integrity sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw== - dependencies: - pascal-case "^3.1.2" - tslib "^2.0.3" - camelcase-css@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz#ee978f6947914cc30c6b44741b6ed1df7f043fd5" @@ -6972,15 +6054,6 @@ caniuse-lite@^1.0.30001538, caniuse-lite@^1.0.30001579, caniuse-lite@^1.0.300017 resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001717.tgz#5d9fec5ce09796a1893013825510678928aca129" integrity sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw== -capital-case@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/capital-case/-/capital-case-1.0.4.tgz#9d130292353c9249f6b00fa5852bee38a717e669" - integrity sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - upper-case-first "^2.0.2" - ccount@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" @@ -6995,7 +6068,7 @@ chalk@2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" -chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: +chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -7022,40 +6095,6 @@ chalk@^5.3.0, chalk@^5.4.1: resolved "https://registry.npmjs.org/chalk/-/chalk-5.5.0.tgz#67ada1df5ca809dc84c9b819d76418ddcf128428" integrity sha512-1tm8DTaJhPBG3bIkVeZt1iZM9GfSX2lzOeDVZH9R9ffRHpmHvxZ/QhgQH/aDTkswQVt+YHdXAdS/In/30OjCbg== -change-case-all@1.0.15: - version "1.0.15" - resolved "https://registry.yarnpkg.com/change-case-all/-/change-case-all-1.0.15.tgz#de29393167fc101d646cd76b0ef23e27d09756ad" - integrity sha512-3+GIFhk3sNuvFAJKU46o26OdzudQlPNBCu1ZQi3cMeMHhty1bhDxu2WrEilVNYaGvqUtR1VSigFcJOiS13dRhQ== - dependencies: - change-case "^4.1.2" - is-lower-case "^2.0.2" - is-upper-case "^2.0.2" - lower-case "^2.0.2" - lower-case-first "^2.0.2" - sponge-case "^1.0.1" - swap-case "^2.0.2" - title-case "^3.0.3" - upper-case "^2.0.2" - upper-case-first "^2.0.2" - -change-case@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/change-case/-/change-case-4.1.2.tgz#fedfc5f136045e2398c0410ee441f95704641e12" - integrity sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A== - dependencies: - camel-case "^4.1.2" - capital-case "^1.0.4" - constant-case "^3.0.4" - dot-case "^3.0.4" - header-case "^2.0.4" - no-case "^3.0.4" - param-case "^3.0.4" - pascal-case "^3.1.2" - path-case "^3.0.4" - sentence-case "^3.0.4" - snake-case "^3.0.4" - tslib "^2.0.3" - character-entities-html4@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b" @@ -7175,19 +6214,6 @@ cli-spinners@^2.5.0, cli-spinners@^2.8.0, cli-spinners@^2.9.2: resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== -cli-truncate@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" - integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== - dependencies: - slice-ansi "^3.0.0" - string-width "^4.2.0" - -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== - cli-width@^4.0.0, cli-width@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz#42daac41d3c254ef38ad8ac037672130173691c5" @@ -7224,15 +6250,6 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" -cliui@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" - integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.1" - wrap-ansi "^7.0.0" - clone@^1.0.2: version "1.0.4" resolved "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" @@ -7248,11 +6265,6 @@ clsx@^2.0.0, clsx@^2.1.0, clsx@^2.1.1: resolved "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz#eed397c9fd8bd882bfb18deab7102049a2f32999" integrity sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA== -cluster-key-slot@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz#88ddaa46906e303b5de30d3153b7d9fe0a0c19ac" - integrity sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA== - collapse-white-space@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-2.1.0.tgz#640257174f9f42c740b40f3b55ee752924feefca" @@ -7298,11 +6310,6 @@ color@^4.2.3: color-convert "^2.0.1" color-string "^1.9.0" -colorette@^2.0.16: - version "2.0.20" - resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" - integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== - combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -7355,11 +6362,6 @@ commander@^8.1.0, commander@^8.3.0: resolved "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== -common-tags@1.8.2: - version "1.8.2" - resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.2.tgz#94ebb3c076d26032745fd54face7f688ef5ac9c6" - integrity sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA== - compute-scroll-into-view@^3.0.2: version "3.1.1" resolved "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-3.1.1.tgz#02c3386ec531fb6a9881967388e53e8564f3e9aa" @@ -7370,68 +6372,11 @@ concat-map@0.0.1: resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== -concurrently@8.2.2: - version "8.2.2" - resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-8.2.2.tgz#353141985c198cfa5e4a3ef90082c336b5851784" - integrity sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg== - dependencies: - chalk "^4.1.2" - date-fns "^2.30.0" - lodash "^4.17.21" - rxjs "^7.8.1" - shell-quote "^1.8.1" - spawn-command "0.0.2" - supports-color "^8.1.1" - tree-kill "^1.2.2" - yargs "^17.7.2" - confusing-browser-globals@^1.0.10: version "1.0.11" resolved "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== -constant-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-3.0.4.tgz#3b84a9aeaf4cf31ec45e6bf5de91bdfb0589faf1" - integrity sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - upper-case "^2.0.2" - -contentful-resolve-response@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/contentful-resolve-response/-/contentful-resolve-response-1.9.3.tgz#83bca77e315261146fd523b7044f808f61a3b2da" - integrity sha512-1mPTz7bJLZsLdWAOEyjoVKys/eTXa7o3aV3EYLH7sqqF8V1fnRHlJqlDoxGZFsPxQPBYag+V89B1E/HYE0ENnQ== - dependencies: - fast-copy "^2.1.7" - -contentful-sdk-core@^9.0.1: - version "9.2.0" - resolved "https://registry.yarnpkg.com/contentful-sdk-core/-/contentful-sdk-core-9.2.0.tgz#d3648fcb8392fd2eb9368b579258a9152de802cf" - integrity sha512-cUvHbC2u8ouJHhG3tofQhUc0FAmM/QBcalYjiczMtFKrR77BW+eSPcPg+A9DQlhIP0UGcQ/knXxoJpBvrERXTA== - dependencies: - fast-copy "^3.0.2" - lodash "^4.17.21" - p-throttle "^6.1.0" - process "^0.11.10" - qs "^6.12.3" - optionalDependencies: - "@rollup/rollup-linux-x64-gnu" "^4.18.0" - -contentful@11.7.3: - version "11.7.3" - resolved "https://registry.yarnpkg.com/contentful/-/contentful-11.7.3.tgz#5908afae116263065a6cfc39a7426dd7943c7354" - integrity sha512-LkSNdKLgQnC/ieWxebUaikfJt/V4hFG/OrP7FcVjGZigA5rs2Pny+0hJpTD5fuUZ3pdFJF8Dh6+4Toyp2+1vwQ== - dependencies: - "@contentful/content-source-maps" "^0.11.8" - "@contentful/rich-text-types" "^16.6.1" - axios "^1.8.4" - contentful-resolve-response "^1.9.0" - contentful-sdk-core "^9.0.1" - json-stringify-safe "^5.0.1" - type-fest "^4.0.0" - convert-source-map@^1.5.0: version "1.9.0" resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" @@ -7476,14 +6421,6 @@ core-util-is@~1.0.0: resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -cors@2.8.5: - version "2.8.5" - resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" - integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== - dependencies: - object-assign "^4" - vary "^1" - cose-base@^1.0.0: version "1.0.3" resolved "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz#650334b41b869578a543358b80cda7e0abe0a60a" @@ -7502,16 +6439,6 @@ cosmiconfig@^7.0.0, cosmiconfig@^7.0.1: path-type "^4.0.0" yaml "^1.10.0" -cosmiconfig@^8.1.0, cosmiconfig@^8.1.3: - version "8.3.6" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.3.6.tgz#060a2b871d66dba6c8538ea1118ba1ac16f5fae3" - integrity sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA== - dependencies: - import-fresh "^3.3.0" - js-yaml "^4.1.0" - parse-json "^5.2.0" - path-type "^4.0.0" - crc-32@^1.2.2: version "1.2.2" resolved "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" @@ -7571,13 +6498,6 @@ cross-fetch@^4.0.0: dependencies: node-fetch "^2.7.0" -cross-inspect@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cross-inspect/-/cross-inspect-1.0.1.tgz#15f6f65e4ca963cf4cc1a2b5fef18f6ca328712b" - integrity sha512-Pcw1JTvZLSJH83iiGWt6fRcT+BjZlCDRVwYLbUcHzv/CRpB7r0MlSrGbIyQvVSNyGnbt7G4AXuyCiDR3POvZ1A== - dependencies: - tslib "^2.4.0" - cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -7955,11 +6875,6 @@ damerau-levenshtein@^1.0.7, damerau-levenshtein@^1.0.8: resolved "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== -data-uri-to-buffer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" - integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== - data-view-buffer@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz#211a03ba95ecaf7798a8c7198d79536211f88570" @@ -7987,7 +6902,7 @@ data-view-byte-offset@^1.0.1: es-errors "^1.3.0" is-data-view "^1.0.1" -dataloader@^2.0.0, dataloader@^2.2.3: +dataloader@^2.0.0: version "2.2.3" resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-2.2.3.tgz#42d10b4913515f5b37c6acedcb4960d6ae1b1517" integrity sha512-y2krtASINtPFS1rSDjacrFgn1dcUuoREVabwlOGOe4SdxenREqwjwjElAdwvbGM7kgZz9a3KVicWR7vcz8rnzA== @@ -7997,13 +6912,6 @@ date-fns@*: resolved "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz#64b3d83fff5aa80438f5b1a633c2e83b8a1c2d14" integrity sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg== -date-fns@^2.30.0: - version "2.30.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" - integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== - dependencies: - "@babel/runtime" "^7.21.0" - date-fns@^3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz#f20ca4fe94f8b754951b24240676e8618c0206bf" @@ -8014,11 +6922,6 @@ dayjs@^1.11.13, dayjs@^1.11.7: resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c" integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg== -debounce@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.1.tgz#38881d8f4166a5c5848020c11827b834bcb3e0a5" - integrity sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug== - debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5, debug@^4.4.0: version "4.4.0" resolved "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" @@ -8119,31 +7022,16 @@ delayed-stream@~1.0.0: resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -denque@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/denque/-/denque-2.1.0.tgz#e93e1a6569fb5e66f16a3c2a2964617d349d6ab1" - integrity sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw== - depd@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== -dependency-graph@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/dependency-graph/-/dependency-graph-0.11.0.tgz#ac0ce7ed68a54da22165a85e97a01d53f5eb2e27" - integrity sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg== - dequal@^2.0.0: version "2.0.3" resolved "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== -detect-indent@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" - integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== - detect-libc@^2.0.0, detect-libc@^2.0.2: version "2.0.4" resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz#f04715b8ba815e53b4d8109655b6508a6865a7e8" @@ -8297,11 +7185,6 @@ dotenv@16.3.1: resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== -dotenv@^16.0.0: - version "16.6.1" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.6.1.tgz#773f0e69527a8315c7285d5ee73c4459d20a8020" - integrity sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow== - dotenv@^16.1.4: version "16.5.0" resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz#092b49f25f808f020050051d1ff258e404c78692" @@ -8312,11 +7195,6 @@ drange@^1.0.2: resolved "https://registry.npmjs.org/drange/-/drange-1.1.1.tgz#b2aecec2aab82fcef11dbbd7b9e32b83f8f6c0b8" integrity sha512-pYxfDYpued//QpnLIm4Avk7rsNtAtQkUES2cwAYSvD/wd2pKD71gN2Ebj3e7klzXwjocvE8c5vx/1fxwpqmSxA== -dset@^3.1.2, dset@^3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.4.tgz#f8eaf5f023f068a036d08cd07dc9ffb7d0065248" - integrity sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA== - dunder-proto@^1.0.0, dunder-proto@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" @@ -9294,7 +8172,7 @@ extend@^3.0.0, extend@^3.0.2: resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -external-editor@^3.0.3, external-editor@^3.1.0: +external-editor@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== @@ -9308,21 +8186,6 @@ eyes@^0.1.8: resolved "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" integrity sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ== -fast-copy@^2.1.7: - version "2.1.7" - resolved "https://registry.yarnpkg.com/fast-copy/-/fast-copy-2.1.7.tgz#affc9475cb4b555fb488572b2a44231d0c9fa39e" - integrity sha512-ozrGwyuCTAy7YgFCua8rmqmytECYk/JYAMXcswOcm0qvGoE3tPb7ivBeIHTOK2DiapBhDZgacIhzhQIKU5TCfA== - -fast-copy@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/fast-copy/-/fast-copy-3.0.2.tgz#59c68f59ccbcac82050ba992e0d5c389097c9d35" - integrity sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ== - -fast-decode-uri-component@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz#46f8b6c22b30ff7a81357d4f59abfae938202543" - integrity sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg== - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -9364,13 +8227,6 @@ fast-levenshtein@^2.0.6: resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== -fast-querystring@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/fast-querystring/-/fast-querystring-1.1.2.tgz#a6d24937b4fc6f791b4ee31dcb6f53aeafb89f53" - integrity sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg== - dependencies: - fast-decode-uri-component "^1.0.1" - fast-shallow-equal@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/fast-shallow-equal/-/fast-shallow-equal-1.0.0.tgz#d4dcaf6472440dcefa6f88b98e3251e27f25628b" @@ -9386,13 +8242,6 @@ fast-uri@^3.0.1: resolved "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz#88f130b77cfaea2378d56bf970dea21257a68748" integrity sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw== -fast-url-parser@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d" - integrity sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ== - dependencies: - punycode "^1.3.2" - fastest-stable-stringify@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/fastest-stable-stringify/-/fastest-stable-stringify-2.0.2.tgz#3757a6774f6ec8de40c4e86ec28ea02417214c76" @@ -9412,50 +8261,17 @@ fault@^1.0.0: dependencies: format "^0.2.0" -fb-watchman@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" - integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== - dependencies: - bser "2.1.1" - -fbjs-css-vars@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/fbjs-css-vars/-/fbjs-css-vars-1.0.2.tgz#216551136ae02fe255932c3ec8775f18e2c078b8" - integrity sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ== - -fbjs@^3.0.0: - version "3.0.5" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-3.0.5.tgz#aa0edb7d5caa6340011790bd9249dbef8a81128d" - integrity sha512-ztsSx77JBtkuMrEypfhgc3cI0+0h+svqeie7xHbh1k/IKdcydnvadp/mUaGgjAOXQmQSxsqgaRhS3q9fy+1kxg== - dependencies: - cross-fetch "^3.1.5" - fbjs-css-vars "^1.0.0" - loose-envify "^1.0.0" - object-assign "^4.1.0" - promise "^7.1.1" - setimmediate "^1.0.5" - ua-parser-js "^1.0.35" - fdir@^6.4.4: version "6.4.4" resolved "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz#1cfcf86f875a883e19a8fab53622cfe992e8d2f9" integrity sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg== -fetch-blob@^3.1.2, fetch-blob@^3.1.4: - version "3.2.0" - resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" - integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== - dependencies: - node-domexception "^1.0.0" - web-streams-polyfill "^3.0.3" - fflate@^0.4.8: version "0.4.8" resolved "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz#f90b82aefbd8ac174213abb338bd7ef848f0f5ae" integrity sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA== -figures@^3.0.0, figures@^3.2.0: +figures@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== @@ -9550,11 +8366,6 @@ for-each@^0.3.3, for-each@^0.3.5: dependencies: is-callable "^1.2.7" -foreach@^2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.6.tgz#87bcc8a1a0e74000ff2bf9802110708cfb02eb6e" - integrity sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg== - foreground-child@^3.1.0: version "3.3.1" resolved "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz#32e8e9ed1b68a3497befb9ac2b6adf92a638576f" @@ -9589,13 +8400,6 @@ format@^0.2.0: resolved "https://registry.npmjs.org/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b" integrity sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww== -formdata-polyfill@^4.0.10: - version "4.0.10" - resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" - integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== - dependencies: - fetch-blob "^3.1.2" - fp-ts@1.19.3: version "1.19.3" resolved "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" @@ -9817,7 +8621,7 @@ glob@^10.3.10, glob@^10.3.7: package-json-from-dist "^1.0.0" path-scurry "^1.11.1" -glob@^7.1.1, glob@^7.1.3: +glob@^7.1.3: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -9860,7 +8664,7 @@ globalthis@^1.0.4: define-properties "^1.2.1" gopd "^1.0.1" -globby@^11.0.3, globby@^11.1.0: +globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -9897,51 +8701,7 @@ graphemer@^1.4.0: resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -graphql-config@^5.0.2: - version "5.1.5" - resolved "https://registry.yarnpkg.com/graphql-config/-/graphql-config-5.1.5.tgz#34e0bfba88e74b6eefd889716a9378086f595f7f" - integrity sha512-mG2LL1HccpU8qg5ajLROgdsBzx/o2M6kgI3uAmoaXiSH9PCUbtIyLomLqUtCFaAeG2YCFsl0M5cfQ9rKmDoMVA== - dependencies: - "@graphql-tools/graphql-file-loader" "^8.0.0" - "@graphql-tools/json-file-loader" "^8.0.0" - "@graphql-tools/load" "^8.1.0" - "@graphql-tools/merge" "^9.0.0" - "@graphql-tools/url-loader" "^8.0.0" - "@graphql-tools/utils" "^10.0.0" - cosmiconfig "^8.1.0" - jiti "^2.0.0" - minimatch "^9.0.5" - string-env-interpolation "^1.0.1" - tslib "^2.4.0" - -graphql-request@7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-7.2.0.tgz#af4aa25f27a087dd4fc93a4ff54a0f59c4487269" - integrity sha512-0GR7eQHBFYz372u9lxS16cOtEekFlZYB2qOyq8wDvzRmdRSJ0mgUVX1tzNcIzk3G+4NY+mGtSz411wZdeDF/+A== - dependencies: - "@graphql-typed-document-node/core" "^3.2.0" - -graphql-request@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/graphql-request/-/graphql-request-6.1.0.tgz#f4eb2107967af3c7a5907eb3131c671eac89be4f" - integrity sha512-p+XPfS4q7aIpKVcgmnZKhMNqhltk20hfXtkaIkTfjjmiKMJ5xrt5c743cL03y/K7y1rg3WrIC49xGiEQ4mxdNw== - dependencies: - "@graphql-typed-document-node/core" "^3.2.0" - cross-fetch "^3.1.5" - -graphql-tag@^2.11.0: - version "2.12.6" - resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.12.6.tgz#d441a569c1d2537ef10ca3d1633b48725329b5f1" - integrity sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg== - dependencies: - tslib "^2.1.0" - -graphql-ws@^6.0.3: - version "6.0.5" - resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-6.0.5.tgz#24adcf444602df83477b9e07cd4b57f411ada024" - integrity sha512-HzYw057ch0hx2gZjkbgk1pur4kAtgljlWRP+Gccudqm3BRrTpExjWCQ9OHdIsq47Y6lHL++1lTvuQHhgRRcevw== - -graphql@*, "graphql@^15.5.0 || ^16.0.0 || ^17.0.0", graphql@^16.11.0: +"graphql@^15.5.0 || ^16.0.0 || ^17.0.0", graphql@^16.11.0: version "16.11.0" resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.11.0.tgz#96d17f66370678027fdf59b2d4c20b4efaa8a633" integrity sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw== @@ -10320,14 +9080,6 @@ he@^1.2.0: resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -header-case@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/header-case/-/header-case-2.0.4.tgz#5a42e63b55177349cf405beb8d775acabb92c063" - integrity sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q== - dependencies: - capital-case "^1.0.4" - tslib "^2.0.3" - hey-listen@^1.0.8: version "1.0.8" resolved "https://registry.npmjs.org/hey-listen/-/hey-listen-1.0.8.tgz#8e59561ff724908de1aa924ed6ecc84a56a9aa68" @@ -10401,14 +9153,6 @@ http-errors@2.0.0: statuses "2.0.1" toidentifier "1.0.1" -http-proxy-agent@^7.0.0: - version "7.0.2" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz#9a8b1f246866c028509486585f62b8f2c18c270e" - integrity sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig== - dependencies: - agent-base "^7.1.0" - debug "^4.3.4" - https-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" @@ -10417,7 +9161,7 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -https-proxy-agent@^7.0.0, https-proxy-agent@^7.0.1: +https-proxy-agent@^7.0.1: version "7.0.6" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz#da8dfeac7da130b05c2ba4b59c9b6cd66611a6b9" integrity sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw== @@ -10476,12 +9220,7 @@ immutable@^4.0.0-rc.12: resolved "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz#c70145fc90d89fb02021e65c84eb0226e4e5a381" integrity sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw== -immutable@~3.7.6: - version "3.7.6" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.7.6.tgz#13b4d3cb12befa15482a26fe1b2ebae640071e4b" - integrity sha512-AizQPcaofEtO11RZhPPHBOJRdo/20MKQF9mBLnVkBoyHi1/zXK8fzVdnEpSV9gxqtnh6Qomfp3F0xT5qP/vThw== - -import-fresh@^3.2.1, import-fresh@^3.3.0: +import-fresh@^3.2.1: version "3.3.1" resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz#9cecb56503c0ada1f2741dbbd6546e4b13b57ccf" integrity sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ== @@ -10489,11 +9228,6 @@ import-fresh@^3.2.1, import-fresh@^3.3.0: parent-module "^1.0.0" resolve-from "^4.0.0" -import-from@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/import-from/-/import-from-4.0.0.tgz#2710b8d66817d232e16f4166e319248d3d5492e2" - integrity sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ== - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -10539,27 +9273,6 @@ inline-style-prefixer@^7.0.1: dependencies: css-in-js-utils "^3.1.0" -inquirer@^8.0.0: - version "8.2.6" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.6.tgz#733b74888195d8d400a67ac332011b5fae5ea562" - integrity sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.1" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.21" - mute-stream "0.0.8" - ora "^5.4.1" - run-async "^2.4.0" - rxjs "^7.5.5" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - wrap-ansi "^6.0.1" - internal-slot@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz#1eac91762947d2f7056bc838d93e13b2e9604961" @@ -10584,7 +9297,7 @@ intersection-observer@^0.12.2: resolved "https://registry.npmjs.org/intersection-observer/-/intersection-observer-0.12.2.tgz#4a45349cc0cd91916682b1f44c28d7ec737dc375" integrity sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg== -invariant@^2.2.2, invariant@^2.2.4: +invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -10598,29 +9311,6 @@ io-ts@1.10.4: dependencies: fp-ts "^1.0.0" -ioredis@5.6.1: - version "5.6.1" - resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.6.1.tgz#1ed7dc9131081e77342503425afceaf7357ae599" - integrity sha512-UxC0Yv1Y4WRJiGQxQkP0hfdL0/5/6YvdfOOClRgJ0qppSarkhneSa6UvkMkms0AkdGimSH3Ikqm+6mkMmX7vGA== - dependencies: - "@ioredis/commands" "^1.1.1" - cluster-key-slot "^1.1.0" - debug "^4.3.4" - denque "^2.1.0" - lodash.defaults "^4.2.0" - lodash.isarguments "^3.1.0" - redis-errors "^1.2.0" - redis-parser "^3.0.0" - standard-as-callback "^2.1.0" - -is-absolute@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" - integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== - dependencies: - is-relative "^1.0.0" - is-windows "^1.0.1" - is-alphabetical@^1.0.0: version "1.0.4" resolved "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" @@ -10802,7 +9492,7 @@ is-generator-function@^1.0.10, is-generator-function@^1.0.7: has-tostringtag "^1.0.2" safe-regex-test "^1.1.0" -is-glob@4.0.3, is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== @@ -10824,13 +9514,6 @@ is-interactive@^1.0.0: resolved "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== -is-lower-case@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-lower-case/-/is-lower-case-2.0.2.tgz#1c0884d3012c841556243483aa5d522f47396d2a" - integrity sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ== - dependencies: - tslib "^2.0.3" - is-map@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" @@ -10891,13 +9574,6 @@ is-regex@^1.2.1: has-tostringtag "^1.0.2" hasown "^2.0.2" -is-relative@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" - integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== - dependencies: - is-unc-path "^1.0.0" - is-set@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz#8ab209ea424608141372ded6e0cb200ef1d9d01d" @@ -10951,25 +9627,11 @@ is-typed-array@^1.1.13, is-typed-array@^1.1.14, is-typed-array@^1.1.15, is-typed dependencies: which-typed-array "^1.1.16" -is-unc-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" - integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== - dependencies: - unc-path-regex "^0.1.2" - is-unicode-supported@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== -is-upper-case@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-upper-case/-/is-upper-case-2.0.2.tgz#f1105ced1fe4de906a5f39553e7d3803fd804649" - integrity sha512-44pxmxAvnnAOwBg4tHPnkfvgjPwbc5QIsSstNU+YcJ1ovxVzCWpSGosPJOZh/a1tdl81fbgnLc9LLv+x2ywbPQ== - dependencies: - tslib "^2.0.3" - is-weakmap@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd" @@ -10990,11 +9652,6 @@ is-weakset@^2.0.3: call-bound "^1.0.3" get-intrinsic "^1.2.6" -is-windows@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - is-wsl@^2.1.1: version "2.2.0" resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" @@ -11076,21 +9733,6 @@ jayson@^4.1.1: uuid "^8.3.2" ws "^7.5.10" -jiti@^1.17.1: - version "1.21.7" - resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.7.tgz#9dd81043424a3d28458b193d965f0d18a2300ba9" - integrity sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A== - -jiti@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/jiti/-/jiti-2.4.2.tgz#d19b7732ebb6116b06e2038da74a55366faef560" - integrity sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A== - -jose@^5.0.0: - version "5.10.0" - resolved "https://registry.yarnpkg.com/jose/-/jose-5.10.0.tgz#c37346a099d6467c401351a9a0c2161e0f52c4be" - integrity sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg== - js-base64@^3.7.5: version "3.7.7" resolved "https://registry.npmjs.org/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79" @@ -11116,7 +9758,7 @@ js-sha3@0.8.0: resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@4.1.0, js-yaml@=4.1.0, js-yaml@^4.0.0, js-yaml@^4.1.0: +js-yaml@4.1.0, js-yaml@=4.1.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== @@ -11151,13 +9793,6 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== -json-pointer@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/json-pointer/-/json-pointer-0.6.2.tgz#f97bd7550be5e9ea901f8c9264c9d436a22a93cd" - integrity sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw== - dependencies: - foreach "^2.0.4" - json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -11194,14 +9829,6 @@ json-stringify-safe@^5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json-to-pretty-yaml@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/json-to-pretty-yaml/-/json-to-pretty-yaml-1.2.2.tgz#f4cd0bd0a5e8fe1df25aaf5ba118b099fd992d5b" - integrity sha512-rvm6hunfCcqegwYaG5T4yKJWxc9FXFgBVrcTZ4XfSVRwa5HA/Xs+vB/Eo9treYYHCeNM0nrSUr82V/M31Urc7A== - dependencies: - remedial "^1.0.7" - remove-trailing-spaces "^1.0.6" - json5@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" @@ -11351,20 +9978,6 @@ linkinator@^6.0.5: server-destroy "^1.0.1" srcset "^5.0.0" -listr2@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-4.0.5.tgz#9dcc50221583e8b4c71c43f9c7dfd0ef546b75d5" - integrity sha512-juGHV1doQdpNT3GSTs9IUN43QJb7KHdF9uqg7Vufs/tG9VTzpFphqF4pm/ICdAABGQxsyNn9CiYA3StkI6jpwA== - dependencies: - cli-truncate "^2.1.0" - colorette "^2.0.16" - log-update "^4.0.0" - p-map "^4.0.0" - rfdc "^1.3.0" - rxjs "^7.5.5" - through "^2.3.8" - wrap-ansi "^7.0.0" - locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" @@ -11389,21 +10002,11 @@ lodash.debounce@^4, lodash.debounce@^4.0.8: resolved "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== -lodash.defaults@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" - integrity sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ== - lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ== -lodash.isarguments@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - integrity sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg== - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" @@ -11414,12 +10017,12 @@ lodash.truncate@^4.4.2: resolved "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== -lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.20, lodash@^4.17.21, lodash@~4.17.0: +lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.20, lodash@^4.17.21: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@^4.0.0, log-symbols@^4.1.0: +log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== @@ -11427,16 +10030,6 @@ log-symbols@^4.0.0, log-symbols@^4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -log-update@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" - integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== - dependencies: - ansi-escapes "^4.3.0" - cli-cursor "^3.1.0" - slice-ansi "^4.0.0" - wrap-ansi "^6.2.0" - longest-streak@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4" @@ -11449,13 +10042,6 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" -lower-case-first@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/lower-case-first/-/lower-case-first-2.0.2.tgz#64c2324a2250bf7c37c5901e76a5b5309301160b" - integrity sha512-EVm/rR94FJTZi3zefZ82fLWab+GX14LJN4HrWBcuo6Evmsl9hEfnqxgcHCKb9q+mNf6EVdsjx/qucYFIIB84pg== - dependencies: - tslib "^2.0.3" - lower-case@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" @@ -11496,11 +10082,6 @@ lru_map@^0.3.3: resolved "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== -map-cache@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg== - markdown-extensions@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-1.1.1.tgz#fea03b539faeaee9b4ef02a3769b455b189f7fc3" @@ -11910,11 +10491,6 @@ mermaid@^10.2.2: uuid "^9.0.0" web-worker "^1.2.0" -meros@^1.2.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/meros/-/meros-1.3.1.tgz#21a090d59c02afb1e418e40631b78aa37a21ac69" - integrity sha512-eV7dRObfTrckdmAz4/n7pT1njIsIJXRIZkgCiX43xEsPNy4gjXQzOYYxmGcolAMtF7HyfqRuDBh3Lgs4hmhVEw== - micro-eth-signer@^0.14.0: version "0.14.0" resolved "https://registry.npmjs.org/micro-eth-signer/-/micro-eth-signer-0.14.0.tgz#8aa1fe997d98d6bdf42f2071cef7eb01a66ecb22" @@ -12679,7 +11255,7 @@ minimatch@^7.4.3: dependencies: brace-expansion "^2.0.1" -minimatch@^9.0.4, minimatch@^9.0.5: +minimatch@^9.0.4: version "9.0.5" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.5.tgz#d74f9dd6b57d83d8e98cfb82133b03978bc929e5" integrity sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow== @@ -12762,11 +11338,6 @@ multipipe@^1.0.2: duplexer2 "^0.1.2" object-assign "^4.1.0" -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - mute-stream@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e" @@ -12998,25 +11569,11 @@ node-fetch@^2.6.9, node-fetch@^2.7.0: dependencies: whatwg-url "^5.0.0" -node-fetch@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" - integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== - dependencies: - data-uri-to-buffer "^4.0.0" - fetch-blob "^3.1.4" - formdata-polyfill "^4.0.10" - node-gyp-build@^4.2.0, node-gyp-build@^4.3.0, node-gyp-build@^4.8.2, node-gyp-build@^4.8.4: version "4.8.4" resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz#8a70ee85464ae52327772a90d66c6077a900cfc8" integrity sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ== -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== - node-releases@^2.0.19: version "2.0.19" resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" @@ -13027,13 +11584,6 @@ non-layered-tidy-tree-layout@^2.0.2: resolved "https://registry.npmjs.org/non-layered-tidy-tree-layout/-/non-layered-tidy-tree-layout-2.0.2.tgz#57d35d13c356643fc296a55fb11ac15e74da7804" integrity sha512-gkXMxRzUH+PB0ax9dUN0yYF0S25BqeAYqhgMaLUFmpXLEk7Fcu8f4emJuOAY0V8kjDICxROIKsTAKsV/v355xw== -normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w== - dependencies: - remove-trailing-separator "^1.0.1" - normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -13063,12 +11613,7 @@ nth-check@^2.0.1: dependencies: boolbase "^1.0.0" -nullthrows@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1" - integrity sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw== - -object-assign@^4, object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== @@ -13211,7 +11756,7 @@ optionator@^0.9.3: type-check "^0.4.0" word-wrap "^1.2.5" -ora@5.4.1, ora@^5.4.1: +ora@5.4.1: version "5.4.1" resolved "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== @@ -13273,13 +11818,6 @@ p-finally@^1.0.0: resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== -p-limit@3.1.0, p-limit@^3.0.2, p-limit@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - p-limit@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" @@ -13287,6 +11825,13 @@ p-limit@^2.2.0: dependencies: p-try "^2.0.0" +p-limit@^3.0.2, p-limit@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + p-locate@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" @@ -13308,11 +11853,6 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" -p-throttle@^6.1.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/p-throttle/-/p-throttle-6.2.0.tgz#bc75ff1f128680bec15568cbf7312ae34a9d35ed" - integrity sha512-NCKkOVj6PZa6NiTmfvGilDdf6vO1rFCD3KDnkHko8dTOtkpk4cSR/VTAhhLMG9aiQ7/A9HYgEDNmxzf6hxzR3g== - p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -13328,14 +11868,6 @@ pako@^2.0.3: resolved "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== -param-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5" - integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A== - dependencies: - dot-case "^3.0.4" - tslib "^2.0.3" - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -13368,16 +11900,7 @@ parse-entities@^4.0.0: is-decimal "^2.0.0" is-hexadecimal "^2.0.0" -parse-filepath@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" - integrity sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q== - dependencies: - is-absolute "^1.0.0" - map-cache "^0.2.0" - path-root "^0.1.1" - -parse-json@^5.0.0, parse-json@^5.2.0: +parse-json@^5.0.0: version "5.2.0" resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== @@ -13413,14 +11936,6 @@ parse5@^7.0.0: dependencies: entities "^6.0.0" -pascal-case@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" - integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - patch-package@^8.0.0: version "8.0.0" resolved "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz#d191e2f1b6e06a4624a0116bcb88edd6714ede61" @@ -13442,14 +11957,6 @@ patch-package@^8.0.0: tmp "^0.0.33" yaml "^2.2.2" -path-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/path-case/-/path-case-3.0.4.tgz#9168645334eb942658375c56f80b4c0cb5f82c6f" - integrity sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg== - dependencies: - dot-case "^3.0.4" - tslib "^2.0.3" - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -13475,18 +11982,6 @@ path-parse@^1.0.6, path-parse@^1.0.7: resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== -path-root-regex@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" - integrity sha512-4GlJ6rZDhQZFE0DPVKh0e9jmZ5egZfxTkp7bcRDuPlJXbAwhxcl2dINPUAsjLdejqaLsCeg8axcLjIbvBjN4pQ== - -path-root@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" - integrity sha512-QLcPegTHF11axjfojBIoDygmS2E3Lf+8+jI6wOVmNVenrKSo3mFdSGiIgdSHenczw3wPtlVMQaFVwGmM7BJdtg== - dependencies: - path-root-regex "^0.1.0" - path-scurry@^1.11.1: version "1.11.1" resolved "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz#7960a668888594a0720b12a911d1a742ab9f11d2" @@ -13715,13 +12210,6 @@ process@^0.11.10: resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== -promise@^7.1.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" - integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== - dependencies: - asap "~2.0.3" - prop-types@^15.6.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -13771,17 +12259,12 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -punycode@^1.3.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== - punycode@^2.1.0: version "2.3.1" resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== -pvtsutils@^1.3.5, pvtsutils@^1.3.6: +pvtsutils@^1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/pvtsutils/-/pvtsutils-1.3.6.tgz#ec46e34db7422b9e4fdc5490578c1883657d6001" integrity sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg== @@ -13807,13 +12290,6 @@ qrcode@^1.5.4: pngjs "^5.0.0" yargs "^15.3.1" -qs@^6.12.3: - version "6.14.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930" - integrity sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w== - dependencies: - side-channel "^1.1.0" - querystringify@^2.1.1: version "2.2.0" resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" @@ -14136,18 +12612,6 @@ recma-stringify@^1.0.0: unified "^11.0.0" vfile "^6.0.0" -redis-errors@^1.0.0, redis-errors@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/redis-errors/-/redis-errors-1.2.0.tgz#eb62d2adb15e4eaf4610c04afe1529384250abad" - integrity sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w== - -redis-parser@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-3.0.0.tgz#b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4" - integrity sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A== - dependencies: - redis-errors "^1.0.0" - redux-immutable@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/redux-immutable/-/redux-immutable-4.0.0.tgz#3a1a32df66366462b63691f0e1dc35e472bbc9f3" @@ -14281,15 +12745,6 @@ rehype-recma@^1.0.0: "@types/hast" "^3.0.0" hast-util-to-estree "^3.0.0" -relay-runtime@12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/relay-runtime/-/relay-runtime-12.0.0.tgz#1e039282bdb5e0c1b9a7dc7f6b9a09d4f4ff8237" - integrity sha512-QU6JKr1tMsry22DXNy9Whsq5rmvwr3LSZiiWV/9+DFpuTWvp+WFhobWMc8TC4OjKFfNhEZy7mOiqUAn5atQtug== - dependencies: - "@babel/runtime" "^7.0.0" - fbjs "^3.0.0" - invariant "^2.2.4" - remark-gfm@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz#0b180f095e3036545e9dddac0e8df3fa5cfee54f" @@ -14384,26 +12839,11 @@ remarkable@^2.0.1: argparse "^1.0.10" autolinker "^3.11.0" -remedial@^1.0.7: - version "1.0.8" - resolved "https://registry.yarnpkg.com/remedial/-/remedial-1.0.8.tgz#a5e4fd52a0e4956adbaf62da63a5a46a78c578a0" - integrity sha512-/62tYiOe6DzS5BqVsNpH/nkGlX45C/Sp6V+NtiN6JQNS1Viay7cWkazmRkrQrdFj2eshDe96SIQNIoMxqhzBOg== - remove-accents@0.5.0: version "0.5.0" resolved "https://registry.npmjs.org/remove-accents/-/remove-accents-0.5.0.tgz#77991f37ba212afba162e375b627631315bed687" integrity sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A== -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw== - -remove-trailing-spaces@^1.0.6: - version "1.0.9" - resolved "https://registry.yarnpkg.com/remove-trailing-spaces/-/remove-trailing-spaces-1.0.9.tgz#39c270a309ea16fda84253ffbdeb1b5afa0aa271" - integrity sha512-xzG7w5IRijvIkHIjDk65URsJJ7k4J95wmcArY5PRcmjldIOl7oTvG8+X2Ag690R7SfwiOcHrWZKVc1Pp5WIOzA== - repeat-string@^1.5.2: version "1.6.1" resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" @@ -14444,11 +12884,6 @@ resize-observer-polyfill@^1.5.1: resolved "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg== -resolve-from@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -14502,11 +12937,6 @@ reusify@^1.0.4: resolved "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz#0fe13b9522e1473f51b558ee796e08f11f9b489f" integrity sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw== -rfdc@^1.3.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.4.1.tgz#778f76c4fb731d93414e8f925fbecf64cce7f6ca" - integrity sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA== - rimraf@^2.6.3: version "2.7.1" resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -14579,11 +13009,6 @@ rtl-css-js@^1.16.1: dependencies: "@babel/runtime" "^7.1.2" -run-async@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - run-async@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz#42a432f6d76c689522058984384df28be379daad" @@ -14601,13 +13026,6 @@ rw@1: resolved "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4" integrity sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ== -rxjs@^7.5.5, rxjs@^7.8.1: - version "7.8.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.2.tgz#955bc473ed8af11a002a2be52071bf475638607b" - integrity sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA== - dependencies: - tslib "^2.1.0" - sade@^1.7.3: version "1.8.1" resolved "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701" @@ -14682,11 +13100,6 @@ scrypt-js@3.0.1, scrypt-js@^3.0.0: resolved "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== -scuid@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/scuid/-/scuid-1.1.0.tgz#d3f9f920956e737a60f72d0e4ad280bf324d5dab" - integrity sha512-MuCAyrGZcTLfQoH2XoBlQ8C6bzwN88XT/0slOGz0pn8+gIP85BOAfYa44ZXQUTOwRwPU0QvgU+V+OSajl/59Xg== - secp256k1@^4.0.1: version "4.0.4" resolved "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.4.tgz#58f0bfe1830fe777d9ca1ffc7574962a8189f8ab" @@ -14733,15 +13146,6 @@ semver@^7.6.2, semver@^7.7.2: resolved "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q== -sentence-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-3.0.4.tgz#3645a7b8c117c787fde8702056225bb62a45131f" - integrity sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - upper-case-first "^2.0.2" - serialize-error@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/serialize-error/-/serialize-error-8.1.0.tgz#3a069970c712f78634942ddd50fbbc0eaebe2f67" @@ -14867,11 +13271,6 @@ shebang-regex@^3.0.0: resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -shell-quote@^1.7.3, shell-quote@^1.8.1: - version "1.8.3" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.3.tgz#55e40ef33cf5c689902353a3d8cd1a6725f08b4b" - integrity sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw== - shiki@1.3.0: version "1.3.0" resolved "https://registry.npmjs.org/shiki/-/shiki-1.3.0.tgz#3eda35cb49f6f0a98525e9da48fc072e6c655a3f" @@ -14944,11 +13343,6 @@ signal-exit@^4.0.1, signal-exit@^4.1.0: resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== -signedsource@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/signedsource/-/signedsource-1.0.0.tgz#1ddace4981798f93bd833973803d80d52e93ad6a" - integrity sha512-6+eerH9fEnNmi/hyM1DXcRK3pWdoMQtlkQ+ns0ntzunjKqp5i3sKCc80ym8Fib3iaYhdJUOPdhlJWj1tvge2Ww== - simple-concat@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" @@ -14989,15 +13383,6 @@ slash@^3.0.0: resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -slice-ansi@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787" - integrity sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - slice-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" @@ -15078,11 +13463,6 @@ space-separated-tokens@^2.0.0: resolved "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz#1ecd9d2350a3844572c3f4a312bceb018348859f" integrity sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q== -spawn-command@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/spawn-command/-/spawn-command-0.0.2.tgz#9544e1a43ca045f8531aac1a48cb29bdae62338e" - integrity sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ== - spinnies@^0.5.1: version "0.5.1" resolved "https://registry.npmjs.org/spinnies/-/spinnies-0.5.1.tgz#6ac88455d9117c7712d52898a02c969811819a7e" @@ -15092,13 +13472,6 @@ spinnies@^0.5.1: cli-cursor "^3.0.0" strip-ansi "^5.2.0" -sponge-case@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sponge-case/-/sponge-case-1.0.1.tgz#260833b86453883d974f84854cdb63aecc5aef4c" - integrity sha512-dblb9Et4DAtiZ5YSUZHLl4XhH4uK80GhAZrVXdN4O2P4gQ40Wa5UIOPUHlA/nFd2PLblBZWUioLMMAVrgpoYcA== - dependencies: - tslib "^2.0.3" - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -15155,11 +13528,6 @@ stacktrace-parser@^0.1.10: dependencies: type-fest "^0.7.1" -standard-as-callback@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.1.0.tgz#8953fc05359868a77b5b9739a665c5977bb7df45" - integrity sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A== - statuses@2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" @@ -15192,12 +13560,16 @@ streamx@^2.15.0, streamx@^2.21.0: optionalDependencies: bare-events "^2.2.0" -string-env-interpolation@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string-env-interpolation/-/string-env-interpolation-1.0.1.tgz#ad4397ae4ac53fe6c91d1402ad6f6a52862c7152" - integrity sha512-78lwMoCcn0nNu8LszbP1UA7g55OeE4v7rCeWnM5B453rnNr4aq+5it3FEYtZrSEiMvHZOZ9Jlqb0OD0M2VInqg== +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -15310,7 +13682,7 @@ stringify-entities@^4.0.0: character-entities-html4 "^2.0.0" character-entities-legacy "^3.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15324,6 +13696,13 @@ strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -15527,13 +13906,6 @@ swagger-ui-react@5.17.2: xml-but-prettier "^1.0.1" zenscroll "^4.0.2" -swap-case@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/swap-case/-/swap-case-2.0.2.tgz#671aedb3c9c137e2985ef51c51f9e98445bf70d9" - integrity sha512-kc6S2YS/2yXbtkSMunBtKdah4VFETZ8Oh6ONSmSd9bRxhqTrtARUCBUiWXH3xVPpvR7tz2CSnkuXVE42EcGnMw== - dependencies: - tslib "^2.0.3" - swr@2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/swr/-/swr-2.2.5.tgz#063eea0e9939f947227d5ca760cc53696f46446b" @@ -15547,15 +13919,6 @@ symbol.inspect@1.0.1: resolved "https://registry.npmjs.org/symbol.inspect/-/symbol.inspect-1.0.1.tgz#e13125b8038c4996eb0dfa1567332ad4dcd0763f" integrity sha512-YQSL4duoHmLhsTD1Pw8RW6TZ5MaTX5rXJnqacJottr2P2LZBF/Yvrc3ku4NUpMOm8aM0KOCqM+UAkMA5HWQCzQ== -sync-fetch@0.6.0-2: - version "0.6.0-2" - resolved "https://registry.yarnpkg.com/sync-fetch/-/sync-fetch-0.6.0-2.tgz#d82d6dc8efaf2d103a9015e7bd7ba0bfc8e078f2" - integrity sha512-c7AfkZ9udatCuAy9RSfiGPpeOKKUAUK5e1cXadLOGUjasdxqYqAK0jTNkM/FSEyJ3a5Ra27j/tw/PS0qLmaF/A== - dependencies: - node-fetch "^3.3.2" - timeout-signal "^2.0.0" - whatwg-mimetype "^4.0.0" - table@^6.9.0: version "6.9.0" resolved "https://registry.npmjs.org/table/-/table-6.9.0.tgz#50040afa6264141c7566b3b81d4d82c47a8668f5" @@ -15677,16 +14040,11 @@ through2@~0.4.1: readable-stream "~1.0.17" xtend "~2.1.1" -through@^2.3.6, through@^2.3.8: +through@^2.3.8: version "2.3.8" resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== -timeout-signal@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/timeout-signal/-/timeout-signal-2.0.0.tgz#23207ea448d50258bb0defe3beea4a467643abba" - integrity sha512-YBGpG4bWsHoPvofT6y/5iqulfXIiIErl5B0LdtHT1mGXDFTAhhRrbUpTvBgYbovr+3cKblya2WAOcpoy90XguA== - tiny-secp256k1@^2.2.3: version "2.2.3" resolved "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-2.2.3.tgz#fe1dde11a64fcee2091157d4b78bcb300feb9b65" @@ -15702,13 +14060,6 @@ tinyglobby@^0.2.13, tinyglobby@^0.2.6: fdir "^6.4.4" picomatch "^4.0.2" -title-case@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/title-case/-/title-case-3.0.3.tgz#bc689b46f02e411f1d1e1d081f7c3deca0489982" - integrity sha512-e1zGYRvbffpcHIrnuqT0Dh+gEJtDaxDSoG4JAIpq4oDFyooziLBIiYQv0GBT4FUAnUop5uZ1hiIAj7oAF6sOCA== - dependencies: - tslib "^2.0.3" - title@^3.5.3: version "3.5.3" resolved "https://registry.npmjs.org/title/-/title-3.5.3.tgz#b338d701a3d949db6b49b2c86f409f9c2f36cd91" @@ -15772,11 +14123,6 @@ tr46@~0.0.3: resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - tree-sitter-json@=0.24.8: version "0.24.8" resolved "https://registry.npmjs.org/tree-sitter-json/-/tree-sitter-json-0.24.8.tgz#72bfa26942691f2bf59d973b6794923c033f04c2" @@ -15818,11 +14164,6 @@ ts-easing@^0.2.0: resolved "https://registry.npmjs.org/ts-easing/-/ts-easing-0.2.0.tgz#c8a8a35025105566588d87dbda05dd7fbfa5a4ec" integrity sha512-Z86EW+fFFh/IFB1fqQ3/+7Zpf9t2ebOAxNI/V6Wo7r5gqiqtxmgTlQ1qbqQcjLKYeSHPTsEmvlJUDg/EuL0uHQ== -ts-log@^2.2.3: - version "2.2.7" - resolved "https://registry.yarnpkg.com/ts-log/-/ts-log-2.2.7.tgz#4f4512144898b77c9984e91587076fcb8518688e" - integrity sha512-320x5Ggei84AxzlXp91QkIGSw5wgaLT6GeAH0KsqDmRZdVWW2OiSeVvElVoatk3f7nicwXlElXsoFkARiGE2yg== - ts-mixer@^6.0.3, ts-mixer@^6.0.4: version "6.0.4" resolved "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.4.tgz#1da39ceabc09d947a82140d9f09db0f84919ca28" @@ -15853,26 +14194,11 @@ tslib@^1.8.1, tslib@^1.9.3: resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.2, tslib@^2.6.3, tslib@^2.7.0, tslib@^2.8.0, tslib@^2.8.1: +tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.8.0, tslib@^2.8.1: version "2.8.1" resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== -tslib@~2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" - integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== - -tslib@~2.5.0: - version "2.5.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" - integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== - -tslib@~2.6.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" - integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== - tsort@0.0.1: version "0.0.1" resolved "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" @@ -15936,11 +14262,6 @@ type-fest@^1.0.2: resolved "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA== -type-fest@^4.0.0: - version "4.41.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58" - integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA== - typed-array-buffer@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz#a72395450a4869ec033fd549371b47af3a2ee536" @@ -16003,11 +14324,6 @@ typescript@5.0.4: resolved "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== -ua-parser-js@^1.0.35: - version "1.0.40" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.40.tgz#ac6aff4fd8ea3e794a6aa743ec9c2fc29e75b675" - integrity sha512-z6PJ8Lml+v3ichVojCiB8toQJBuwR42ySM4ezjXIqXK3M0HczmKQ3LF4rhU55PfD99KEEXQG6yb7iOMyvYuHew== - uglify-js@^3.1.4: version "3.19.3" resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz#82315e9bbc6f2b25888858acd1fff8441035b77f" @@ -16028,11 +14344,6 @@ unbox-primitive@^1.1.0: has-symbols "^1.1.0" which-boxed-primitive "^1.1.1" -unc-path-regex@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" - integrity sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg== - undici-types@~6.19.2: version "6.19.8" resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" @@ -16263,13 +14574,6 @@ universalify@^2.0.0: resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== -unixify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unixify/-/unixify-1.0.0.tgz#3a641c8c2ffbce4da683a5c70f03a462940c2090" - integrity sha512-6bc58dPYhCMHHuwxldQxO3RRNZ4eCogZ/st++0+fcC1nr0jiGUtAdBJ2qzmLQWSxbtz42pWt4QQMiZ9HvZf5cg== - dependencies: - normalize-path "^2.1.1" - unpipe@1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -16313,20 +14617,6 @@ update-browserslist-db@^1.1.3: escalade "^3.2.0" picocolors "^1.1.1" -upper-case-first@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-2.0.2.tgz#992c3273f882abd19d1e02894cc147117f844324" - integrity sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg== - dependencies: - tslib "^2.0.3" - -upper-case@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-2.0.2.tgz#d89810823faab1df1549b7d97a76f8662bae6f7a" - integrity sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg== - dependencies: - tslib "^2.0.3" - uri-js@^4.2.2: version "4.4.1" resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -16342,16 +14632,6 @@ url-parse@^1.5.10: querystringify "^2.1.1" requires-port "^1.0.0" -urlpattern-polyfill@^10.0.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/urlpattern-polyfill/-/urlpattern-polyfill-10.1.0.tgz#1b2517e614136c73ba32948d5e7a3a063cba8e74" - integrity sha512-IGjKp/o0NL3Bso1PymYURCJxMPNAf/ILOpendP9f5B6e1rTJgdgiOvgfoT8VxCAdY+Wisb9uhGaJJf3yZ2V9nw== - -urlpattern-polyfill@^8.0.0: - version "8.0.2" - resolved "https://registry.yarnpkg.com/urlpattern-polyfill/-/urlpattern-polyfill-8.0.2.tgz#99f096e35eff8bf4b5a2aa7d58a1523d6ebc7ce5" - integrity sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ== - use-sync-external-store@^1.0.0, use-sync-external-store@^1.2.0, use-sync-external-store@^1.4.0: version "1.5.0" resolved "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz#55122e2a3edd2a6c106174c27485e0fd59bcfca0" @@ -16412,11 +14692,6 @@ varuint-bitcoin@^1.1.2: dependencies: safe-buffer "^5.1.1" -vary@^1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== - vfile-location@^5.0.0: version "5.0.3" resolved "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz#cb9eacd20f2b6426d19451e0eafa3d0a846225c3" @@ -16517,7 +14792,7 @@ web-namespaces@^2.0.0: resolved "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz#1010ff7c650eccb2592cebeeaf9a1b253fd40692" integrity sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ== -web-streams-polyfill@^3.0.3, web-streams-polyfill@^3.2.1: +web-streams-polyfill@^3.0.3: version "3.3.3" resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b" integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw== @@ -16764,17 +15039,6 @@ web3@^4.15.0: web3-utils "^4.3.3" web3-validator "^2.0.6" -webcrypto-core@^1.8.0: - version "1.8.1" - resolved "https://registry.yarnpkg.com/webcrypto-core/-/webcrypto-core-1.8.1.tgz#09d5bd8a9c48e9fbcaf412e06b1ff1a57514ce86" - integrity sha512-P+x1MvlNCXlKbLSOY4cYrdreqPG5hbzkmawbcXLKN/mf6DZW0SdNNkZ+sjwsqVkI4A4Ko2sPZmkZtCKY58w83A== - dependencies: - "@peculiar/asn1-schema" "^2.3.13" - "@peculiar/json-schema" "^1.1.12" - asn1js "^3.0.5" - pvtsutils "^1.3.5" - tslib "^2.7.0" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -16795,11 +15059,6 @@ webpack-bundle-analyzer@4.7.0: sirv "^1.0.7" ws "^7.3.1" -whatwg-mimetype@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz#bc1bf94a985dc50388d54a9258ac405c3ca2fc0a" - integrity sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg== - whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -16909,7 +15168,7 @@ workerpool@^6.5.1: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -16927,6 +15186,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -17010,11 +15278,6 @@ yallist@^3.0.2: resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== -yaml-ast-parser@^0.0.43: - version "0.0.43" - resolved "https://registry.yarnpkg.com/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz#e8a23e6fb4c38076ab92995c5dca33f3d3d7c9bb" - integrity sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A== - yaml@^1.10.0, yaml@^1.10.2: version "1.10.2" resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" @@ -17030,11 +15293,6 @@ yaml@^2.2.2: resolved "https://registry.npmjs.org/yaml/-/yaml-2.7.1.tgz#44a247d1b88523855679ac7fa7cda6ed7e135cf6" integrity sha512-10ULxpnOCQXxJvBgxsn9ptjq6uviG/htZKk9veJGhlqn3w/DxQ631zFF+nlQXLwmImeS5amR2dl2U8sg6U9jsQ== -yaml@^2.3.1: - version "2.8.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.0.tgz#15f8c9866211bdc2d3781a0890e44d4fa1a5fff6" - integrity sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ== - yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" @@ -17048,11 +15306,6 @@ yargs-parser@^20.2.2, yargs-parser@^20.2.9: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^21.1.1: - version "21.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" - integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== - yargs-unparser@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" @@ -17093,19 +15346,6 @@ yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.0.0, yargs@^17.7.2: - version "17.7.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"