Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sakshisonii_zkThon #375

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions solution-2
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions solution-3
Original file line number Diff line number Diff line change
@@ -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);
```