From 38e0b532bd8f8b0742130daae76580ed343f1390 Mon Sep 17 00:00:00 2001 From: sakshisonii <129555936+sakshisonii@users.noreply.github.com> Date: Sat, 1 Apr 2023 02:47:52 +0530 Subject: [PATCH 1/2] Create solution-2 --- solution-2 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 solution-2 diff --git a/solution-2 b/solution-2 new file mode 100644 index 00000000..5d16e3e5 --- /dev/null +++ b/solution-2 @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.9; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; + +contract SakshiSoni is ERC20, Ownable { + constructor() ERC20("SakshiSoni", "SKSI") { + _mint(msg.sender, 1659000 * 10 ** decimals()); + } + + function mint(address to, uint256 amount) public onlyOwner { + _mint(to, amount); + } +} +==================================================================== + +# Contract Address +https://explorer.public.zkevm-test.net/address/0x0d04D18136c70Efe36263b13b20F5D8c34068566 + +# Transaction Address +https://explorer.public.zkevm-test.net/tx/0x965b1d54f8d92955c055b900880cfc071989bd7b2589eb2cb3420d2af7420c88 From 31365a3a951fc3c259e0d7624dab26084996880c Mon Sep 17 00:00:00 2001 From: sakshisonii <129555936+sakshisonii@users.noreply.github.com> Date: Sat, 1 Apr 2023 02:52:28 +0530 Subject: [PATCH 2/2] Create solution-3 --- solution-3 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 solution-3 diff --git a/solution-3 b/solution-3 new file mode 100644 index 00000000..857dae76 --- /dev/null +++ b/solution-3 @@ -0,0 +1,26 @@ +Transaction Hash: https://explorer.public.zkevm-test.net/tx/0xff6e62991b9bc103c39f8756818dde5847521e23b04d9c014b8752bc2fca808a + +```js +const Web3 = require('web3'); +const tokenAbi = process.env.TOKEN_ABI; +const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545')); +const tokenAddress = '0x0d04D18136c70Efe36263b13b20F5D8c34068566'; // Replace with the address of your token +const fromAddress = '0x0f139974DFC5f21EE21043ceBe4E7c738B663b78; // Replace with the address +const privateKey = 'YOUR_PRIVATE_KEY'; // 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', 15000000000000000000); +```