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); + } +} 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(); +```