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

kaushikigarg_zkThon #387

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
27 changes: 27 additions & 0 deletions solution2
Original file line number Diff line number Diff line change
@@ -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/[email protected]/token/ERC20/ERC20.sol";
import "@openzeppelin/[email protected]/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/[email protected]/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);
}
}
23 changes: 23 additions & 0 deletions solution3
Original file line number Diff line number Diff line change
@@ -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();
```