開發者資源
ZetaChain is the first ever L1 blockchain to enable fully interoperable smart contracts, or universal smart contracts, that connect all blockchains and bring the power of programmability to non-smart contract chains like Bitcoin and Dogecoin. We provide an unparalleled combination of security, simplicity, and flexibility for developers.
專為無與倫比的開發者體驗所打造
一次部署,即可在所有區塊鏈上取用
Manage a single universal contract for all chains, instead of one contract for each supported chain. Experience the simplicity of building on Ethereum with access to assets on any chain, even non-smart contract chains like Bitcoin.
更少交易,更少費用
ZetaChain 上的複雜合約邏輯可透過簡單的轉移和單一交易來協調所有連結的外部區塊鏈資源,最大限度地降低使用者的總 gas 支出和滑點。
更安全、更良好的使用者體驗
交易邏輯在我們的智慧合約中以不可分拆式的方式發生,從而降低滑點、減少受攻擊面,並降低競爭危害的機率。體驗真正的一步式交易(及費用),即使在跨鏈操作時也是如此。
最佳 DevX = 最佳 UX
Universal Smart Contracts and Messaging give you a complete toolkit to easily build intuitive, traceable, single-step transactions so your users don’t get stuck or risk their funds.
// 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 區塊鏈互動,請在您的去中心化應用程式中實行 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;
Universal Primitives
ZetaChain's universal primitives give developers the ability to deploy applications once and orchestrate assets on any connected chain from a single place of logic.
Universal Smart Contracts
Leverage the existing Ethereum smart contract ecosystem and build truly interoperable apps on ZetaChain as if everything were on a single chain.
了解更多 →Universal Accounts
ZetaChain’s novel TSS architecture lets users and contracts custody and manage assets from a single place, in a secure and decentralized manner.
即將推出ZetaChain 比起來如何?
As a blockchain and smart contract platform, ZetaChain provides a fully public, transparent, decentralized interoperability solution that supports both universal messaging and smart contracts. Developers on ZetaChain only need to implement their dApp logic, while ZetaChain handles the transaction of data and value across chains in a trust-minimized way.
降低風險
ZetaChain 是採用 TSS 和 Pos Tendermint 共識所建構的去中心化網路,可受攻擊面極小。
統一流動性
無打包資源、中心化橋接或越來越多的互賴性風險。更高的自由度和更經濟的交易。
無限的相容性
ZetaChain 可支援任何現存或新的區塊鏈,甚至包括比特幣和狗狗幣等非智慧合約型區塊鏈。
開始建構
運用我們不斷擴增的範例庫以及真實使用案例的真實合約來啟動您的開發工作。
想進行合作嗎?
Share ideas and find collaborators to build universal dApps on ZetaChain in our Discord Development Zone. Our team is always ready to help out.
最新
查看最新的 ZetaChain 消息