Figure 1: Explorer, Transaction Ledger
In its first iteration, ZetaScan supports transaction indexing and details. For example, in Figure 2 below, one sees an event record where 1,004 ZETA was transferred from Ethereum to Optimism. Future versions will include enhanced features such as ZetaChain network-wide analytics, richer search and filtering features, additional explorable entities (blocks, connected networks, nodes, etc.), and much more.
Figure 2: Explorer, Transaction Details
One new addition to the developer documentation code examples is a cross-chain swap smart contract. This is a fully-fledged example swap/DEX that you can use to kickstart your own development of a cross-chain DEX on ZetaChain. Check out the full swap contract documentation here. We’ll have some exciting tools for our community to play with and build on top of along with other example dApp contracts soon!With this contract specifically, swapping cross-chain is as simple as sending a single swap transaction from your source wallet. The contract and its integration with ZetaChain’s Connector handles all of the fees, gas, and cross-chain transaction for you. Swapping functions look like:
function swapTokensForTokensCrossChain(
address originInputToken,
uint256 inputTokenAmount,
bytes calldata receiverAddress,
address destinationOutToken,
bool isDestinationOutETH,
/**
* @dev The minimum amount of tokens that receiverAddress should get,
* if it's not reached, the transaction will revert on the destination chain
*/
uint256 outTokenMinAmount,
uint256 destinationChainId,
uint256 crossChainGasLimit
)function swapETHForTokensCrossChain(
bytes calldata receiverAddress,
address destinationOutToken,
bool isDestinationOutETH,
/**
* @dev The minimum amount of tokens that receiverAddress should get,
* if it's not reached, the transaction will revert on the destination chain
*/
uint256 outTokenMinAmount,
uint256 destinationChainId,
uint256 crossChainGasLimit
)
ZetaChain is focused on open sourcing resources for developers and the broader ecosystem. To that extent, we provide smart contract code examples in our documentation for a variety of omnichain dApp use cases. Let’s examine some examples:
This example is the most rudimentary, showing how you would emit a Hello World event from chain-to-chain. Simple, but a great start!
With this example, you see how you’d send any value between any connected chain by using the ZETA token.
In this example, you can see how one would build a counter based on passing messages between two contracts on different chains.
With this example, you can build an NFT that can be sent across all chains natively with ZetaChain.
We’re looking to expand our community of builders and partners including one of the biggest crypto exchanges. Leverage our technical resources to guide your development and launch of the world’s first truly omnichain dApps.
The ZetaChain team is actively developing the protocol to prepare for the big mainnet launch later this year (our fully public network that transacts real data and assets). Expect to see and touch the first UIs that showcase omnichain functionality in the near term. Follow ZetaChain on Twitter @zetablockchain and join the conversation on Discord and Telegram.
The ZetaChain testnet and community experienced unprecedented growth last month. All crypto users may join the testnet now to experience and contribute to the future of multichain.
Omnichain Accounts can manage funds and data across any blockchain. The feature enables cold-wallet-level security with hot-level-wallet functionality and effectively adds a smart contract layer on non-smart contract platforms such as Bitcoin.