开发人员资源

ZetaChain 是有史以来第一个支持完全可互操作的智能合约或全链智能合约的 L1 区块链,它可以连接所有区块链,并为比特币和狗狗币等非智能合约链带来可编程力量。 我们为开发人员提供无与伦比的安全性、简单性和灵活性。

为给开发人员带来独特体验而构建

一次部署,访问所有链

为所有链管理一份全链合约,而不是为每个受支持的链管理一份合约。体验在以太坊上构建并访问任何链上资产的简便,甚至是比特币等非智能合约链。

更少的交易,更少的费用

ZetaChain 上的复杂合约逻辑可以通过简单的转移和单一交易在所有连接的外部链上协调资产,最大限度地减少用户的总体 gas 消耗和延误。

更安全、更良好的用户体验

交易逻辑基本上存在于我们的智能合约中,从而降低延误,减少攻击面,并且不容易受到竞态条件的影响。即使是在跨链操作时也能体验真正的单步执行的交易(和费用)。

最佳开发体验 = 最佳用户体验

全链智能合约和消息传递为您提供了一个完整的工具包,可以轻松构建直观、可追踪、单步执行的交易,这样您的用户就不会陷入困境或面临资金风险了。

// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

import "@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol";
import "@zetachain/protocol-contracts/contracts/zevm/interfaces/zContract.sol";

import "../shared/SwapHelperLib.sol";

contract ZetaSwap is zContract {
    SystemContract public immutable systemContract;

    constructor(address systemContractAddress) {
        systemContract = SystemContract(systemContractAddress);
    }

    modifier onlySystem() {
        require(msg.sender == address(systemContract), "Only system contract can call this function");
        _;
    }

    function onCrossChainCall(
        zContext calldata context,
        address zrc20,
        uint256 amount,
        bytes calldata message
    ) external virtual override onlySystem {
        (address targetZRC20, bytes32 receipient, uint256 minAmountOut) = abi.decode(
            message,
            (address, bytes32, uint256)
        );
        uint256 outputAmount = SwapHelperLib._doSwap(
            systemContract.wZetaContractAddress(),
            systemContract.uniswapv2FactoryAddress(),
            systemContract.uniswapv2Router02Address(),
            zrc20,
            amount,
            targetZRC20,
            minAmountOut
        );
        SwapHelperLib._doWithdrawal(targetZRC20, outputAmount, receipient);
    }
}

最简单、最通用的跨链平台

为了与 ZetaChain 区块链交互,在您的去中心化应用 (dApp) 中实现了 3 个功能,以获得直观、可跟踪、可恢复的行为,这样您的用户就不会陷入困境或面临资金风险了。

开始使用连接器 API
/**
/* Sending value and data cross-chain */
function send(ZetaInterfaces.SendInput calldata input) external;

/* onZetaMessage is called when cross-chain message reaches contract */
function onZetaMessage(ZetaInterfaces.ZetaMessage calldata zetaMessage) external;

/* onZetaRevert is called when cross-chain message reverts */
function onZetaRevert(ZetaInterfaces.ZetaRevert calldata zetaRevert) external;

全链图元

ZetaChain 的全链原语使开发人员能够一次性部署应用程序,并从单一逻辑位置编排任何连接的链上资产。

全链工具包

全链智能合约

充分利用现有的以太坊智能合约生态系统,在 ZetaChain 上构建真正可互操作的应用程序,就像一切都在单链之上。

了解更多

跨链消息传递

无需打包或锁定资产的情况下,发送任意消息,并将实际价值在任何链之间移动。

了解更多

全链账户

ZetaChain 新颖的 TSS 架构允许用户和合约以安全和去中心化方式从一个位置托管和管理资产。

即将到来

资源管理器

完全可探索的交易:查看和监控 ZetaChain 内部交易以及在任何链之间发生的交易。

转到资源管理器

ZetaChain 与之相比如何?

作为区块链和智能合约平台,ZetaChain 提供了完全公开、透明、去中心化的互操作性解决方案,支持全链消息传递和智能合约。ZetaChain 的相关开发人员只需要实现他们的去中心化应用逻辑,而 ZetaChain 则以信任最小化的方式处理跨链的数据和价值交易。

阅读白皮书
ZetaChainCosmosPolkadotTHORChainBridges/Messaging通用智能合约
跨链价值转移
跨链消息传递
隐式链
仅限 Cosmos/IBC 链
特定于应用程序的链对
解决方法
即时本地解决方法
已打包
已打包
即时本地解决方法
已打包,补救风险
本地比特币库管理
特定于应用程序
全链智能合约
仅限 Cosmos/IBC 链
仅限平行链 (Parachain)

风险最小化

ZetaChain 是由 TSS 和 PoS Tendermint 共识构建的去中心化网络,具有最小的攻击面。

统一的流动性

没有打包资产、集中的桥或增加的相互依赖性风险。交易更自由、更经济。

无限的兼容性

ZetaChain 可以支持任何现有的或新的区块链,甚至像比特币和狗狗币这样的非智能合约链。

开始构建

通过我们不断增加的实例库,以及真实用例的真实合同,来启动您的开发进程。

部署全链去中心化应用
全链出借
任意点到点付款
全链 NFT
跨链所有权证明
狗狗币智能合约
跨链 DEX
全链 DAO
跨链稳定兑换
全链出借
任意点到点付款
全链 NFT
跨链所有权证明
狗狗币智能合约
跨链 DEX
全链 DAO
跨链稳定兑换

是否需要合作?

分享创意并寻找合作者,在我们的 Discord 开发区的 ZetaChain 上构建全链去中心化应用。我们的团队随时准备提供帮助。

最新

查看最新的 ZetaChain 更新

Placeholder

Building cross-chain DEX, Restaking, BTC staking as an Omnichain Smart Contract on ZetaChain

This blog explores deploying prominent crypto protocols as an Omnichain Smart Contract on ZetaChain. The mentioned products involve many functions, which are subject to change. Further, changes and upgrades to the ZetaChain protocol are required to achieve such functionality.

Placeholder

ZetaChain commits 5% of total ZETA supply to developer and dApp ecosystem growth program including 1% for Bitcoin projects

The new ecosystem program will accelerate growth of projects building on ZetaChain through developer grants, with a major carve out for Bitcoin-focused projects following the halving.

Placeholder

ZetaChain Enters Top 5 Blockchains by Total Weekly Active Users!

ZetaChain’s mission is to serve as a platform for universal access, simplicity, and utility across any blockchain. From entering the top five chains by users and top five Naming Service in one week on SPACE ID to the full day ZetaChain Bitcoin Builder Zone at ETH Seoul and everything in-between, March was a resounding success!

Placeholder

Coinbase launches Learning Rewards and ZetaChain support on Coinbase Wallet to bring omnichain to users

ZetaChain’s mission is to serve as a platform for universal access, simplicity, and utility across any blockchain. Today marks a significant milestone as leading wallet Coinbase Wallet adds support for ZetaChain to launch Learning Rewards quests campaign in Coinbase Wallet. The integration enables Coinbase Wallet users to experience omnichain interoperability across all chains in a simple, fast, and secure way.

Placeholder

Introducing universal web3 ID with the launch of .zeta Name Service with SPACE ID

.zeta universal identities span all of web3, from EVM to Cosmos, BNB and eventually even Bitcoin. Mint your ID and join the BTC Halving Claim Campaign hosted by Galxe!

Placeholder

ZetaChain and Galxe announce BTC drop for next generation Bitcoin Smart Contracts

In the lead-up to Bitcoin Halving, ZetaChain announces the first BTC drop to fuel a new generation of Bitcoin Smart Contracts. Eligible phase 1 users can claim ZETA now first-come, first served! Everyone can join the phase 2 BTC Halving claim through April!

Placeholder

What’s Next For Validators on ZetaChain Mainnet Beta

ZetaChain’s mission is to serve as a platform for universal access, simplicity, and utility across any blockchain. The successful launch of ZetaChain Mainnet Beta marks the conclusion of the incentivized testnet and the next evolution of distributed infrastructure to support ecosystem growth for many years to come.


有任何疑问?
查看常见问题解答或与专家沟通。