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

Jeffanthony_zkthon #371

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
1 change: 1 addition & 0 deletions solution-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://twitter.com/JeffreyRAnthony/status/1641250472211234817
69 changes: 69 additions & 0 deletions solution-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<pre>// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts@4.8.2/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/ERC20Snapshot.sol";
import "@openzeppelin/contracts@4.8.2/access/Ownable.sol";
import "@openzeppelin/contracts@4.8.2/security/Pausable.sol";
import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/contracts@4.8.2/token/ERC20/extensions/ERC20Votes.sol";

contract Zk20Token is ERC20, ERC20Burnable, ERC20Snapshot, Ownable, Pausable, ERC20Permit, ERC20Votes {
constructor() ERC20("zk20Token", "zk20") ERC20Permit("zk20Token") {
_mint(msg.sender, 1000000000 * 10 ** decimals());
}

function snapshot() public onlyOwner {
_snapshot();
}

function pause() public onlyOwner {
_pause();
}

function unpause() public onlyOwner {
_unpause();
}

function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}

function _beforeTokenTransfer(address from, address to, uint256 amount)
internal
whenNotPaused
override(ERC20, ERC20Snapshot)
{
super._beforeTokenTransfer(from, to, amount);
}

// The following functions are overrides required by Solidity.

function _afterTokenTransfer(address from, address to, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._afterTokenTransfer(from, to, amount);
}

function _mint(address to, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._mint(to, amount);
}

function _burn(address account, uint256 amount)
internal
override(ERC20, ERC20Votes)
{
super._burn(account, amount);
}
}</pre>
-----------------------------------------------------------------------------
# Contract Address
https://explorer.public.zkevm-test.net/address/0x33470a06c4458d52615b1e2fd3843010544776a5/contracts

# Transaction Hash
https://explorer.public.zkevm-test.net/tx/0x37cd8e38a015c3d19cc6a93ba255fd30cabdbe659359d162a9f98487c5b68b53
19 changes: 19 additions & 0 deletions solution-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<pre>
from thirdweb import ThirdwebSDK

sdk = ThirdwebSDK("https://polygon-zkevm-testnet.rpc.thirdweb.com/ed043a51ae23b0db3873f5a38b77ab28175fa496f15d3c53cf70401be89b622a")
contract = sdk.get_contract("0x3ac587078b344a3d27e56632dff236f1aff04d56")

data = contract.call("submitUsername", "jeffanthony")
</pre>

------------------------------------------------------------------
# Blockchain Proof URL:
https://explorer.public.zkevm-test.net/tx/0x60f0715b52c268f3d091539d27ffc932a012d8609f2b520a1558ae2b4ad2bdea
------------------------------------------------------------------

# TX HASH:
0x60f0715b52c268f3d091539d27ffc932a012d8609f2b520a1558ae2b4ad2bdea

# CONTRACT ADDRESS:
0x3ac587078b344a3d27e56632dff236f1aff04d56