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

shreyabadonia02_zkThon #369

Open
wants to merge 3 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
21 changes: 21 additions & 0 deletions solution_2
Original file line number Diff line number Diff line change
@@ -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);
}
}
17 changes: 17 additions & 0 deletions solution_3
Original file line number Diff line number Diff line change
@@ -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("ok")
}
call();
```

Transaction Link - https://explorer.public.zkevm-test.net/tx/0xf6ba192967b1f6ed9b0d156d0fc0d43c3110402c28d2a3f6cd3ef2609730d120