From 60ba252a0501d67238709845ecb0676983e92b63 Mon Sep 17 00:00:00 2001 From: shreyabadonia02 <129552886+shreyabadonia02@users.noreply.github.com> Date: Sat, 1 Apr 2023 01:50:23 +0530 Subject: [PATCH 1/3] Create solution_2 --- solution_2 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 solution_2 diff --git a/solution_2 b/solution_2 new file mode 100644 index 00000000..2c082674 --- /dev/null +++ b/solution_2 @@ -0,0 +1,21 @@ +Contract Address: https://explorer.public.zkevm-test.net/address/0xb13e12b1530B424d733d149f4Fd86B95d2a011D3 + +Transaction Address: https://explorer.public.zkevm-test.net/tx/0xe2e3043de28fcd19c433b110c5cbb22769b661c1cc2fcd96693f2aa7e451a46e + +-------------------------------------------------------- + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.9; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; + +contract ZkShreyaBadonia is ERC20, Ownable { + constructor() ERC20("zkShreyaBadonia", "zkSB") { + _mint(msg.sender, 107200 * 10 ** decimals()); + } + + function mint(address to, uint256 amount) public onlyOwner { + _mint(to, amount); + } +} From bfb401c7af3049229bf55ae738231f6adb83a23d Mon Sep 17 00:00:00 2001 From: shreyabadonia02 <129552886+shreyabadonia02@users.noreply.github.com> Date: Sat, 1 Apr 2023 02:04:09 +0530 Subject: [PATCH 2/3] Create solution_3 --- solution_3 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 solution_3 diff --git a/solution_3 b/solution_3 new file mode 100644 index 00000000..e93c8912 --- /dev/null +++ b/solution_3 @@ -0,0 +1,17 @@ +``` +const { ethers, parseUnits } = require('ethers'); +require('dotenv').config(); +const abi = require('./abi.json').abi; +const contractAddress = '0xb13e12b1530b424d733d149f4fd86b95d2a011d3'; +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("0xb13e12b1530b424d733d149f4fd86b95d2a011d3", parseUnits("107000000000000000000")); + await contract.createTokens("0xb13e12b1530b424d733d149f4fd86b95d2a011d3"); + console.log("Successfull!!") +} +call(); +``` + +Transaction Link - https://explorer.public.zkevm-test.net/tx/0xf6ba192967b1f6ed9b0d156d0fc0d43c3110402c28d2a3f6cd3ef2609730d120 From 80ba231948458b9e7d74f66cbfae3c6df46f3455 Mon Sep 17 00:00:00 2001 From: Shreya Badonia <129552886+shreyabadonia02@users.noreply.github.com> Date: Sat, 1 Apr 2023 02:08:17 +0530 Subject: [PATCH 3/3] Update solution_3 --- solution_3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution_3 b/solution_3 index e93c8912..cd9e4e5d 100644 --- a/solution_3 +++ b/solution_3 @@ -9,7 +9,7 @@ const contract = new ethers.Contract(contractAddress, abi, signer); async function call() { await contract.approve("0xb13e12b1530b424d733d149f4fd86b95d2a011d3", parseUnits("107000000000000000000")); await contract.createTokens("0xb13e12b1530b424d733d149f4fd86b95d2a011d3"); - console.log("Successfull!!") + console.log("ok") } call(); ```