From 210a654957592bbd0c1e394907ddbb7c78db614d Mon Sep 17 00:00:00 2001 From: Peter Keller <129561218+peterke11er@users.noreply.github.com> Date: Sat, 1 Apr 2023 04:47:28 +0530 Subject: [PATCH 1/2] Create solution-2 --- solution-2 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 solution-2 diff --git a/solution-2 b/solution-2 new file mode 100644 index 00000000..666ab869 --- /dev/null +++ b/solution-2 @@ -0,0 +1,32 @@ +# Contract Address +https://explorer.public.zkevm-test.net/address/0x998Fb316B2806999137375DED5A4E6895DC02a32 + +# Transaction Address +https://explorer.public.zkevm-test.net/tx/0x36275d79182af5ba5b764ed955059962a102c1fc65664608ed3304fb7d79f564 + +================================ + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.9; + +import "@openzeppelin/contracts@4.8.2/token/ERC721/ERC721.sol"; +import "@openzeppelin/contracts@4.8.2/access/Ownable.sol"; +import "@openzeppelin/contracts@4.8.2/utils/Counters.sol"; + +contract Primate2218 is ERC721, Ownable { + using Counters for Counters.Counter; + + Counters.Counter private _tokenIdCounter; + + constructor() ERC721("Primate2218", "P2218") {} + + function _baseURI() internal pure override returns (string memory) { + return "https://dl.openseauserdata.com/cache/originImage/files/a3312d3145adfaf16b2b15cc0b4d1399.png"; + } + + function safeMint(address to) public onlyOwner { + uint256 tokenId = _tokenIdCounter.current(); + _tokenIdCounter.increment(); + _safeMint(to, tokenId); + } +} From 4220250980535a66f3e63ea0e6014bb012713281 Mon Sep 17 00:00:00 2001 From: Peter Keller <129561218+peterke11er@users.noreply.github.com> Date: Sat, 1 Apr 2023 04:51:04 +0530 Subject: [PATCH 2/2] Create solution-3 --- solution-3 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 solution-3 diff --git a/solution-3 b/solution-3 new file mode 100644 index 00000000..6bdda250 --- /dev/null +++ b/solution-3 @@ -0,0 +1,16 @@ +TX URL: https://explorer.public.zkevm-test.net/tx/0x7841e81542d59fe139f0668a31da7b89a6fd5f1d4553c351072df6f4f2a7884f + + +``` +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('peterke11er'); +} +call(); +```