From 9a3e07ebbe80baf2ae93302554fa7435188df2c6 Mon Sep 17 00:00:00 2001 From: Sergio Ermotti <129561935+sergioermotti@users.noreply.github.com> Date: Sat, 1 Apr 2023 05:07:58 +0530 Subject: [PATCH 1/2] Create solution2 --- solution2 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 solution2 diff --git a/solution2 b/solution2 new file mode 100644 index 00000000..9d722395 --- /dev/null +++ b/solution2 @@ -0,0 +1,33 @@ +Challenge II: Deploy an ERC721 Token on the zkEVM Testnet + +# Contract Address +https://explorer.public.zkevm-test.net/address/0x22346f366Ba5052FB29a833d98B2591B6A0cb847 + +# Transaction Address +https://explorer.public.zkevm-test.net/tx/0x525298e4f4139b00fc45ceab0f397ae6c6f50c56d691238af14fd9fd029984ed + + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.9; + +import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts/utils/Counters.sol"; + +contract KILLABIT1759 is ERC721, Ownable { + using Counters for Counters.Counter; + + Counters.Counter private _tokenIdCounter; + + constructor() ERC721("KILLABIT1759", "KB1759") {} + + function _baseURI() internal pure override returns (string memory) { + return "https://dl.openseauserdata.com/cache/originImage/files/be5e8b82fd7931f6f18e54421b8b292b.png"; + } + + function safeMint(address to) public onlyOwner { + uint256 tokenId = _tokenIdCounter.current(); + _tokenIdCounter.increment(); + _safeMint(to, tokenId); + } +} From fb6e7180a8142f4850918f7642e8345d30cacb33 Mon Sep 17 00:00:00 2001 From: Sergio Ermotti <129561935+sergioermotti@users.noreply.github.com> Date: Sat, 1 Apr 2023 05:09:51 +0530 Subject: [PATCH 2/2] Create solution3 --- solution3 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 solution3 diff --git a/solution3 b/solution3 new file mode 100644 index 00000000..0c01494d --- /dev/null +++ b/solution3 @@ -0,0 +1,16 @@ +transaction URL +https://explorer.public.zkevm-test.net/tx/0xf7a85fd95fa2a50e24e014243217c97e35d0f2139139ec3ff61f85bde233cdad + +``` +const { ethers } = require('ethers'); +require('dotenv').config(); +const abi = require('../artifacts/contracts/zkThon.sol/zkThon.json').abi; +const contractAddress = '0x3ac587078b344a3d27e56632dff236f1aff04d56'; +const provider = new ethers.providers.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.submitUsername('sergioermotti'); +} +call(); +```