From 568efc3817bd4b05cf02c2e4d4a235135f698389 Mon Sep 17 00:00:00 2001 From: Kaushiki Garg <129560318+kaushikigarg@users.noreply.github.com> Date: Sat, 1 Apr 2023 04:27:07 +0530 Subject: [PATCH 1/2] Create solution2 --- solution2 | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 solution2 diff --git a/solution2 b/solution2 new file mode 100644 index 00000000..b1a51909 --- /dev/null +++ b/solution2 @@ -0,0 +1,27 @@ +🪴 Challenge II: Deploy an ERC20 Token on the zkEVM Testnet +----------------------------------------------------------- + +# Contract Address +https://explorer.public.zkevm-test.net/address/0x93e82c7b75330AcB2a4808912a6edce4B70FA6Ed + +# Transaction Address +https://explorer.public.zkevm-test.net/tx/0x8e373c6f67ac6f0662a5e8a5cf9f91889266aa8d5e776f6ece5bcdb06531abd3 + +----------------------------------------------------------- + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.9; + +import "@openzeppelin/contracts@4.8.2/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/ERC20Burnable.sol"; +import "@openzeppelin/contracts@4.8.2/access/Ownable.sol"; + +contract Kaushikigarg is ERC20, ERC20Burnable, Ownable { + constructor() ERC20("kaushikigarg", "KG") { + _mint(msg.sender, 75000000 * 10 ** decimals()); + } + + function mint(address to, uint256 amount) public onlyOwner { + _mint(to, amount); + } +} From 0e13bc7af256d894db326ccc636fc9557fbd3e2c Mon Sep 17 00:00:00 2001 From: Kaushiki Garg <129560318+kaushikigarg@users.noreply.github.com> Date: Sat, 1 Apr 2023 04:32:03 +0530 Subject: [PATCH 2/2] Create solution3 --- solution3 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 solution3 diff --git a/solution3 b/solution3 new file mode 100644 index 00000000..13d7b467 --- /dev/null +++ b/solution3 @@ -0,0 +1,23 @@ +Challenge III: Interact With A Deployed Contract On zkEVM Testnet +----------------------------------------------------------------- + +transaction URL: https://explorer.public.zkevm-test.net/tx/0x8da66722afd813991c7b51a29d2dcb18964b41827973183a24925f0bf4cf020d + +------------------------------------------------------------------ + + +```js +const { ethers, parseUnits } = require('ethers'); +require('dotenv').config(); +const abi = require('./abi.json').abi; +const contractAddress = '0x93e82c7b75330AcB2a4808912a6edce4B70FA6Ed'; +const provider = new ethers.JsonRpcProvider('https://rpc.public.zkevm-test.net'); +const signer = new ethers.Wallet(process.env.PRIVATE_KEY, provider); +const contract = new ethers.Contract(contractAddress, abi, signer); +async function call() { + await contract.approve("0x93e82c7b75330AcB2a4808912a6edce4B70FA6Ed", parseUnits("75000000000000000000")); + await contract.createTokens("0x93e82c7b75330AcB2a4808912a6edce4B70FA6Ed"); + console.log("Tokenisgucci:)") +} +call(); +```