From 9e78aeb1df2f6331242c35e060cbd0fd816469f7 Mon Sep 17 00:00:00 2001 From: PierreOssun Date: Tue, 5 Mar 2024 19:06:19 +0100 Subject: [PATCH 1/2] Updated LZ bridge instructions --- .../bridges-relays/AstarEVM-zkEVM.md | 50 ++++++++++++++----- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/docs/build/zkEVM/integrations/bridges-relays/AstarEVM-zkEVM.md b/docs/build/zkEVM/integrations/bridges-relays/AstarEVM-zkEVM.md index 2c8cf4c29..364fe7e4e 100644 --- a/docs/build/zkEVM/integrations/bridges-relays/AstarEVM-zkEVM.md +++ b/docs/build/zkEVM/integrations/bridges-relays/AstarEVM-zkEVM.md @@ -1,32 +1,56 @@ --- -title: Astar EVM <-> zkEVM Bridge +title: Astar <-> zkEVM Bridge --- ## Overview -:::note -Please note that the LayerZero bridge is only available between Shibuya and zKatana testnets at this time. In this walkthrough we will describe how to bridge Shibuya token to zKatana. -::: +LayerZero integration functionally connects the EVM on Astar parachain to the zkEVM on Ethereum. This takes the form of two smart contract-based endpoints that allow the chains to send messages to one another other. -A LayerZero integration functionally connects the EVM on Astar parachain to the zkEVM on Ethereum. This takes the form of two smart contract-based endpoints that allow the chains to send messages to one another other. +## Bridge ASTR on mainnet -## LSBY Token +LayerZero has a standard for synthetic assets that can be locked on a source chain and minted on another called Omnichain Fungible Token or **OFT**, which we will refer to going forward. -LayerZero has a standard for synthetic assets that can be locked on a source chain and minted on another called Omnichain Fungible Token or **OFT**, which we will refer to going forward. +For this walkthrough, on the Astar side, the contract is [NativeOFT](https://github.com/AstarNetwork/solidity-examples/blob/main/contracts/token/oft/v2/fee/NativeOFTWithFee.sol), which acts as an ERC20 wrapper contract (the function is payable) that will be used to send a cross-chain message to the OFT contract on zk Astar to mint ASTR, otherwise known as LayerZero (synthetic) ASTR. -For this walkthrough, on the Shibuya side, the contract is [NativeOFT](https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/token/oft/v2/fee/NativeOFTWithFee.sol), which acts as an ERC20 wrapper contract (the function is payable) so you can send it some SBY tokens, and it will respond by sending a cross-chain message to the OFT contract on zKatana to mint LSBY, otherwise known as LayerZero (synthetic) SBY. +On the Astar zkEVM side, the contract is [OFT](https://github.com/AstarNetwork/solidity-examples/blob/main/contracts/token/oft/v2/fee/OFTWithFee.sol), which acts as the ERC20 ASTR synthetic asset on Astar zkEVM, which exist in a 1:1 ratio with its NativeOFT counterpart. -On the zKatana side, the contract is [OFT](https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/token/oft/v2/fee/OFTWithFee.sol), which acts as the ERC20 SBY synthetic asset on zKatana, which should exist in a 1:1 ratio with its NativeOFT counterpart. +| Contract | Network | Address | +|------------|---------|------------------------------------------------| +| OFT Native | Astar | [0xC0297833040Df48141d31BF860A3f4766cec69c2](https://astar.blockscout.com/address/0xC0297833040Df48141d31BF860A3f4766cec69c2) | +| OFT | zkEVM | [0x9fC8d99a5eC47cDDea778fd28E1d67094075c603](https://astar-zkevm.blockscout.com/address/0x9fC8d99a5eC47cDDea778fd28E1d67094075c603) | -### Bridging LSBY Tokens +### Bridging ASTR To facilitate token transfer, we have provided a sample repository containing a utility script: -:::info +1. Fork the [Repository](https://github.com/AstarNetwork/layer-zero-bridge-mainnet) + +2. Install dependencies by running `npm install` + +3. Create a .env file (based on the .env.example) in the root directory + +4. Add your [private key](https://support.metamask.io/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key) in the .env file + +5. Run `npm hardhat compile` to compile the contracts + +#### Astar → Astar zkEVM +To send 1ASTR from `astar`(`astar L1 mainnet`) to `zk-astar`(`Astar zkEVM`), run the following command (Note that the `--quantity` flag is in wei): -Note: The current method is provisional and specific to testnet environments. The eventual mainnet implementation will incorporate the bridging of Native ASTR tokens through the Astar Portal. +`npx hardhat bridge --quantity 1000000000000000000 --target-network zk-astar --network astar` -::: +#### Astar zkEVM → Astar + +To send 1ASTR from `zk-astar`(`Astar zkEVM`) to `astar`(`astar L1 mainnet`), run the following command (Note that the `--quantity` flag is in wei): + +`npx hardhat bridge --quantity 1000000000000000000 --target-network astar --network zk-astar` + +## Bridge Shibuya testnet token + +We deployed OFT contracts on Shibuya and zKatana to bridge SBY (NAtive token of Shibuya) to zKatana. Please follow the steps below. + +### Bridging LSBY Tokens + +To facilitate token transfer, we have provided a sample repository containing a utility script: 1. Fork the [Repository](https://github.com/AstarNetwork/layer-zero-bridge-contracts-testnet) From 376f8c0ad5d9b642f1c1ac2352406e056db249b5 Mon Sep 17 00:00:00 2001 From: PierreOssun Date: Wed, 6 Mar 2024 10:41:15 +0100 Subject: [PATCH 2/2] updated address --- .../zkEVM/integrations/bridges-relays/AstarEVM-zkEVM.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/build/zkEVM/integrations/bridges-relays/AstarEVM-zkEVM.md b/docs/build/zkEVM/integrations/bridges-relays/AstarEVM-zkEVM.md index 364fe7e4e..52dd154e6 100644 --- a/docs/build/zkEVM/integrations/bridges-relays/AstarEVM-zkEVM.md +++ b/docs/build/zkEVM/integrations/bridges-relays/AstarEVM-zkEVM.md @@ -16,11 +16,16 @@ On the Astar zkEVM side, the contract is [OFT](https://github.com/AstarNetwork/s | Contract | Network | Address | |------------|---------|------------------------------------------------| -| OFT Native | Astar | [0xC0297833040Df48141d31BF860A3f4766cec69c2](https://astar.blockscout.com/address/0xC0297833040Df48141d31BF860A3f4766cec69c2) | -| OFT | zkEVM | [0x9fC8d99a5eC47cDDea778fd28E1d67094075c603](https://astar-zkevm.blockscout.com/address/0x9fC8d99a5eC47cDDea778fd28E1d67094075c603) | +| OFT Native | Astar | [0xdf41220C7e322bFEF933D85D01821ad277f90172](https://astar.blockscout.com/address/0xdf41220C7e322bFEF933D85D01821ad277f90172?tab=txs) | +| OFT | zkEVM | [0xdf41220C7e322bFEF933D85D01821ad277f90172](https://astar-zkevm.explorer.startale.com/address/0xdf41220C7e322bFEF933D85D01821ad277f90172?tab=txs) | ### Bridging ASTR +:::note +Token bridging will be integrated to Stargate UI https://stargate.finance/transfer shortly to make it easier for users to bridge tokens. + +::: + To facilitate token transfer, we have provided a sample repository containing a utility script: 1. Fork the [Repository](https://github.com/AstarNetwork/layer-zero-bridge-mainnet)