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

sergioermotti_zkThon #391

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
33 changes: 33 additions & 0 deletions solution2
Original file line number Diff line number Diff line change
@@ -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);
}
}
16 changes: 16 additions & 0 deletions solution3
Original file line number Diff line number Diff line change
@@ -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();
```