From ca836ba1578d12592386bd8bc78b345a8fc92c7a Mon Sep 17 00:00:00 2001 From: adityaaggarwal12 Date: Sat, 1 Apr 2023 01:16:25 +0530 Subject: [PATCH 1/5] solution-1 --- solution-1.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 solution-1.md diff --git a/solution-1.md b/solution-1.md new file mode 100644 index 00000000..a796f00f --- /dev/null +++ b/solution-1.md @@ -0,0 +1 @@ +https://twitter.com/0xAdityaaa/status/1641887188928417795 \ No newline at end of file From 0fa1c084aca4d471d0bf3b53ab7f8f88d3c98fd2 Mon Sep 17 00:00:00 2001 From: adityaaggarwal12 Date: Sat, 1 Apr 2023 01:26:10 +0530 Subject: [PATCH 2/5] solution-2 --- solution-2.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 solution-2.md diff --git a/solution-2.md b/solution-2.md new file mode 100644 index 00000000..acd1023d --- /dev/null +++ b/solution-2.md @@ -0,0 +1,20 @@ +Transaction Hash - 0xfcd816de27b2f9f4c57044255e1bc8c90c8e2bec3b3d0643c630d03b006a1ffd + +Contract Address - 0xb6983d469d62690c9b4927b26fe84d655b3de8bb + +```sol +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; +contract OurToken is ERC20, ERC20Burnable, Ownable{ + + constructor() ERC20("zkThon1", "ZKT1"){ + _mint(msg.sender, 1000000 * 10 ** decimals());//whoever deployes the contract will own all the tokens + } + function mint(address to, uint256 amount) public onlyOwner{ + _mint(to, amount); + } +} +``` From 0aacf40d308160a4bc0ba96542a43d8bc7aecbb2 Mon Sep 17 00:00:00 2001 From: adityaaggarwal12 Date: Sat, 1 Apr 2023 01:40:57 +0530 Subject: [PATCH 3/5] solution-3 --- solution-3.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 solution-3.md diff --git a/solution-3.md b/solution-3.md new file mode 100644 index 00000000..c4ec1bf6 --- /dev/null +++ b/solution-3.md @@ -0,0 +1,35 @@ +ransaction Hash - 0xfcd816de27b2f9f4c57044255e1bc8c90c8e2bec3b3d0643c630d03b006a1ffd + +Contract Address - 0xb6983d469d62690c9b4927b26fe84d655b3de8bb + +```js +const Web3 = require('web3'); +const tokenAbi = process.env.TOKEN_ABI; + +const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545')); + +const tokenAddress = ''; // Replace with the address of your token +const fromAddress = ''; // Replace with the address you want to mint tokens from +const privateKey = ''; // Replace with your private key + +const token = new web3.eth.Contract(tokenAbi, tokenAddress); + +async function mintToken(toAddress, amount) { + const nonce = await web3.eth.getTransactionCount(fromAddress); + const gasPrice = await web3.eth.getGasPrice(); + + const txParams = { + nonce: nonce, + gasPrice: gasPrice, + gasLimit: 500000, + to: tokenAddress, + value: 0, + data: token.methods.mint(toAddress, amount).encodeABI() + }; + + const signedTx = await web3.eth.accounts.signTransaction(txParams, privateKey); + const txReceipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction); +} + +mintToken('Address', 10); +``` \ No newline at end of file From 51f57289746e9501dd4f32890e7700b3009712fd Mon Sep 17 00:00:00 2001 From: Aditya Aggarwal <85849078+adityaaggarwal12@users.noreply.github.com> Date: Sat, 1 Apr 2023 01:41:40 +0530 Subject: [PATCH 4/5] Update solution-3.md --- solution-3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solution-3.md b/solution-3.md index c4ec1bf6..6a1f9e45 100644 --- a/solution-3.md +++ b/solution-3.md @@ -1,4 +1,4 @@ -ransaction Hash - 0xfcd816de27b2f9f4c57044255e1bc8c90c8e2bec3b3d0643c630d03b006a1ffd +Transaction Hash - 0xfcd816de27b2f9f4c57044255e1bc8c90c8e2bec3b3d0643c630d03b006a1ffd Contract Address - 0xb6983d469d62690c9b4927b26fe84d655b3de8bb @@ -32,4 +32,4 @@ async function mintToken(toAddress, amount) { } mintToken('Address', 10); -``` \ No newline at end of file +``` From 2fef7c137885ea0c2d166f4307955f66fad3711c Mon Sep 17 00:00:00 2001 From: Aditya Aggarwal <85849078+adityaaggarwal12@users.noreply.github.com> Date: Sat, 1 Apr 2023 01:42:41 +0530 Subject: [PATCH 5/5] Update solution-3.md --- solution-3.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solution-3.md b/solution-3.md index 6a1f9e45..3d17b1c1 100644 --- a/solution-3.md +++ b/solution-3.md @@ -2,6 +2,8 @@ Transaction Hash - 0xfcd816de27b2f9f4c57044255e1bc8c90c8e2bec3b3d0643c630d03b006 Contract Address - 0xb6983d469d62690c9b4927b26fe84d655b3de8bb +Transaction URL - https://testnet-zkevm.polygonscan.com/tx/0xc7699b208aa0182f426f42932bd19f6c6096d85b7b4ae04cf101b349c0eae6f3 + ```js const Web3 = require('web3'); const tokenAbi = process.env.TOKEN_ABI;