diff --git a/README.md b/README.md index 3edcdaa2df83..0791c800da5a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,46 @@ [![Logo](eraLogo.png)](https://zksync.io/) +## 테스트 +#### 네트워크 및 서버 실행 +- 네트워크: poohgithub/poohgeth 리파지토리 +``` +cd poohnet +./init-cmd local +./enode-cmd +``` +- DB 서버: poohgithub/zksync-era 리파지토리 +``` +cd poohnet/local-setup +./start-sql.sh +``` +- zkSync 서버: poohgithub/zksync-era 리파지토리 +``` +./localentry.sh +``` +#### 컨트랙트 테스트 +- greeter-example: poohgithub/zksync-era 리파지토리 +``` +cd poohnet/greeter-example +yarn +yarn deploy-test +yarn greet-test +``` +- paymaster-examples: poohgithub/zksync-era 리파지토리 +``` +cd poohneet/paymaster-examples +yarn deploy:contracts +yarn test:contracts +``` + +#### 모듈 관계도 및 테스트 +- zksync-web3와 hardhat-zksync-deploy 관계 +- hardhat-zksync-deploy와 zksync-server의 관계 +- paymaster-examples/test/allowlist.test.ts 테스트 + +![Relations](relations.png) + +## Overview zkSync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on security or decentralization. Since it's EVM compatible (Solidity/Vyper), 99% of Ethereum projects can redeploy without refactoring or re-auditing a single line of code. zkSync Era also uses an LLVM-based compiler that will eventually let developers diff --git a/poohnet/paymaster-examples/contracts/.env.example b/poohnet/paymaster-examples/contracts/.env.example index c65faa8c16d4..bd1db9f708e7 100644 --- a/poohnet/paymaster-examples/contracts/.env.example +++ b/poohnet/paymaster-examples/contracts/.env.example @@ -1 +1,3 @@ -WALLET_PRIVATE_KEY= +WALLET_PRIVATE_KEY=0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 +RECIPIENT_ADDRESS=0x82fFb1bB229552D020C88b9eE8D5e4042E6Cbd42 +GREETER_ADDRESS=0x5B11c36bf87ED2EAc102C42E9528eC99D77f7aFd diff --git a/poohnet/paymaster-examples/contracts/package.json b/poohnet/paymaster-examples/contracts/package.json index 6f9450c39417..c6aa48bf9bb5 100644 --- a/poohnet/paymaster-examples/contracts/package.json +++ b/poohnet/paymaster-examples/contracts/package.json @@ -28,7 +28,8 @@ "zksync-web3": "^0.14.3" }, "scripts": { - "test": "hardhat test --network zkSyncLocal", + "test": "hardhat test", + "test:greeter": "hardhat deploy-zksync --script use-greeter.ts", "deploy": "hardhat deploy-zksync", "greeter": "hardhat deploy-zksync --script greeter.ts", "gasless": "hardhat deploy-zksync --script gaslessPaymaster.ts", diff --git a/poohnet/paymaster-examples/contracts/test/allowlist.test.ts b/poohnet/paymaster-examples/contracts/test/allowlist.test.ts index 161146c822b6..1f5746f336b6 100644 --- a/poohnet/paymaster-examples/contracts/test/allowlist.test.ts +++ b/poohnet/paymaster-examples/contracts/test/allowlist.test.ts @@ -13,7 +13,7 @@ dotenv.config(); // load wallet private key from env file const PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY || ""; -describe("AllowlistPaymaster", function () { +describe.only("AllowlistPaymaster", function () { let provider: Provider; let wallet: Wallet; let deployer: Deployer; @@ -38,6 +38,13 @@ describe("AllowlistPaymaster", function () { greeter = await deployContract(deployer, "Greeter", ["Hi"]); // fund paymaster await fundAccount(wallet, paymaster.address, "3"); + + // balance of wallet and paymaster + const walletBalance = await wallet.getBalance(); + const paymasterBalance = await provider.getBalance(paymaster.address); + console.log(`Wallet balance: ${walletBalance.toString()}`); + console.log(`Paymaster balance: ${paymasterBalance.toString()}`); + // set allowance for the user wallet const tx = await paymaster .connect(wallet) diff --git a/relations.png b/relations.png new file mode 100644 index 000000000000..72f083a263e5 Binary files /dev/null and b/relations.png differ