diff --git a/README.md b/README.md index a891b80..64bc224 100644 --- a/README.md +++ b/README.md @@ -3,54 +3,5 @@ Localnet is a local development environment that simplifies the development of universal apps. -Localnet: - -- Starts an [Anvil](https://book.getfoundry.sh/anvil/) local testnet node -- Deploys [protocol - contracts](https://github.com/zeta-chain/protocol-contracts/tree/main/v2) on - the local testnet node. Both EVM gateway and ZetaChain gateway are deployed - and running on the same local blockchain -- Simulates the real-world testnet environment of ZetaChain by observing events - and relaying the contract calls between EVM gateway and ZetaChain gateway - -Install dependencies: - -``` -yarn -``` - -Start localnet: - -``` -yarn hardhat localnet -``` - -``` -EVM Contract Addresses -======================= -┌─────────────────┬──────────────────────────────────────────────┐ -│ Gateway EVM │ '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0' │ -│ ERC-20 Custody │ '0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9' │ -│ TSS │ '0x70997970C51812dc3A010C7d01b50e0d17dc79C8' │ -│ ZETA │ '0x5FbDB2315678afecb367f032d93F642f64180aa3' │ -│ ERC-20 USDC.ETH │ '0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82' │ -└─────────────────┴──────────────────────────────────────────────┘ - -ZetaChain Contract Addresses -============================= -┌───────────────────┬──────────────────────────────────────────────┐ -│ Gateway ZetaChain │ '0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0' │ -│ ZETA │ '0xa513E6E4b8f2a923D98304ec87F64353C4D5C853' │ -│ Fungible Module │ '0x735b14BB79463307AAcBED86DAf3322B1e6226aB' │ -│ System Contract │ '0x610178dA211FEF7D417bC0e6FeD39F05609AD788' │ -│ ZRC-20 USDC.ETH │ '0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c' │ -│ ZRC-20 ETH.ETH │ '0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe' │ -└───────────────────┴──────────────────────────────────────────────┘ -``` - -You can also start localnet with custom Anvil parameters and using a different -port: - -``` -yarn hardhat localnet --anvil "--block-time 1" --port 2000 -``` +Learn more about localnet: +https://www.zetachain.com/docs/developers/tutorials/localnet/ diff --git a/package.json b/package.json index 4501873..8989a8f 100644 --- a/package.json +++ b/package.json @@ -43,4 +43,4 @@ "hardhat": "^2.22.8", "wait-on": "^7.2.0" } -} +} \ No newline at end of file diff --git a/packages/localnet/src/handleOnEVMCalled.ts b/packages/localnet/src/handleOnEVMCalled.ts index 1b1e159..c8c8cc7 100644 --- a/packages/localnet/src/handleOnEVMCalled.ts +++ b/packages/localnet/src/handleOnEVMCalled.ts @@ -47,7 +47,7 @@ export const handleOnEVMCalled = async ({ log( "ZetaChain", - `Universal contract ${receiver} executing onCrossChainCall (context: ${JSON.stringify( + `Universal contract ${receiver} executing onCall (context: ${JSON.stringify( context )}), zrc20: ${zrc20}, amount: 0, message: ${message})` ); @@ -61,10 +61,10 @@ export const handleOnEVMCalled = async ({ }); logs.forEach((data) => { - log("ZetaChain", `Event from onCrossChainCall: ${JSON.stringify(data)}`); + log("ZetaChain", `Event from onCall: ${JSON.stringify(data)}`); }); } catch (err: any) { - logErr("ZetaChain", `Error executing onCrossChainCall: ${err}`); + logErr("ZetaChain", `Error executing onCall: ${err}`); const revertOptions = args[3]; return await handleOnRevertEVM({ revertOptions, diff --git a/packages/localnet/src/handleOnEVMDeposited.ts b/packages/localnet/src/handleOnEVMDeposited.ts index 1a784b8..4eab1ec 100644 --- a/packages/localnet/src/handleOnEVMDeposited.ts +++ b/packages/localnet/src/handleOnEVMDeposited.ts @@ -62,7 +62,7 @@ export const handleOnEVMDeposited = async ({ if (message !== "0x") { log( "ZetaChain", - `Universal contract ${receiver} executing onCrossChainCall (context: ${JSON.stringify( + `Universal contract ${receiver} executing onCall (context: ${JSON.stringify( context )}), zrc20: ${zrc20}, amount: ${amount}, message: ${message})` ); @@ -78,10 +78,7 @@ export const handleOnEVMDeposited = async ({ }); logs.forEach((data) => { - log( - "ZetaChain", - `Event from onCrossChainCall: ${JSON.stringify(data)}` - ); + log("ZetaChain", `Event from onCall: ${JSON.stringify(data)}`); }); } else { const tx = await protocolContracts.gatewayZEVM diff --git a/yarn.lock b/yarn.lock index ff6b410..93999a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1054,14 +1054,14 @@ "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.2" "@openzeppelin/contracts-upgradeable@^5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-5.0.2.tgz#3e5321a2ecdd0b206064356798c21225b6ec7105" - integrity sha512-0MmkHSHiW2NRFiT9/r5Lu4eJq5UJ4/tzlOgYXNAIj/ONkQTVnz22pLxDvp4C4uZ9he7ZFvGn3Driptn1/iU7tQ== + version "5.1.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-5.1.0.tgz#4d37648b7402929c53e2ff6e45749ecff91eb2b6" + integrity sha512-AIElwP5Ck+cslNE+Hkemf5SxjJoF4wBvvjxc27Rp+9jaPs/CLIaUBMYe1FNzhdiN0cYuwGRmYaRHmmntuiju4Q== "@openzeppelin/contracts@^5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.0.2.tgz#b1d03075e49290d06570b2fd42154d76c2a5d210" - integrity sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA== + version "5.1.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.1.0.tgz#4e61162f2a2bf414c4e10c45eca98ce5f1aadbd4" + integrity sha512-p1ULhl7BXzjjbha5aqst+QMLY+4/LCWADXOCsmLHRM77AqiPjnd9vvUN9sosUfhL9JGKpZ0TjEGxgvnizmWGSA== "@scure/base@~1.1.0": version "1.1.7" @@ -1233,6 +1233,13 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== +"@types/node@22.7.5": + version "22.7.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.5.tgz#cfde981727a7ab3611a481510b473ae54442b92b" + integrity sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ== + dependencies: + undici-types "~6.19.2" + "@types/node@^22.5.2": version "22.5.4" resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.4.tgz#83f7d1f65bc2ed223bdbf57c7884f1d5a4fa84e8" @@ -2196,6 +2203,7 @@ ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: ethjs-util "0.1.6" rlp "^2.2.3" +<<<<<<< HEAD ethers@5.6.8: version "5.6.8" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.6.8.tgz#d36b816b4896341a80a8bbd2a44e8cb6e9b98dd4" @@ -2231,6 +2239,20 @@ ethers@5.6.8: "@ethersproject/wallet" "5.6.2" "@ethersproject/web" "5.6.1" "@ethersproject/wordlists" "5.6.1" +======= +ethers@^6.13.1: + version "6.13.4" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.4.tgz#bd3e1c3dc1e7dc8ce10f9ffb4ee40967a651b53c" + integrity sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA== + dependencies: + "@adraffy/ens-normalize" "1.10.1" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@types/node" "22.7.5" + aes-js "4.0.0-beta.5" + tslib "2.7.0" + ws "8.17.1" +>>>>>>> main ethers@^6.13.2: version "6.13.2" @@ -3676,6 +3698,11 @@ tslib@2.4.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== +tslib@2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" + integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== + tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"