Go to the online IDE, select "Injected Web3" and connect to your account selected in MetaMask.
Implement a voting smart contract that fulfills the following requirements:
- users must register before they can cast a vote
- registered users can only cast votes for other registered users
- registered users can only cast one vote and can not change it
The resulting smart contract should be derived from the following smart contract and implement the following specified functions:
abstract contract Test {
function register() public virtual;
function voteFor(address) public virtual;
function numberOfVotesReceivedFor(address) view public virtual returns(uint);
}
Deploy the smart contract on the Goerli network!
Extend your smart contract to implement the following function too:
function winnersAndNumberOfWinningVotes() view public returns(address[] memory, uint);
Deploy the smart contract on the Goerli network!
Follow the instructions on https://docs.openzeppelin.com/contracts/4.x/erc20 and implement your ERC20 token with an initial supply that results in 1000 units being minted.
Deploy the token in the Görli network!
Add your ERC20 token as asset to MetaMask and send 10.25 units to the Görli address 0x15433DA387451F9dE4565280C85506CB71aF9376.
Rewrite your ERC20 token so that it requires accounts to be whitelisted by token holders to become valid recipients. The account receiving the initial supply should be whitelisted in the constructor.
Deploy your contract on the Görli network and transfer 10.25 units of your ERC20 token to the address f.
Follow the instructions on https://docs.openzeppelin.com/contracts/4.x/erc721 and implement your ERC721 token. Make the contract Ownable and let only the owner mint NFTs and set the URI.
Deploy the token in the Görli network and enter its address! As the contract owner, mint an NFT with the tokenId 1234 to yourself.
Create a JSON metadata file for the minted NFT and host it online.
You can host it wherever you want. Github pages is a free option. If you are already familiar with IPFS, your can use it too.
As the contract owner, set the URI of the ERC721 contract to point to the location where you host the JSON file.
Enter the content of the JSON file of the NFT with the tokenId 1234!
Add your ERC721 token to MetaMask and send your NFT with the tokenId 1234 to the Görli address 0x15433DA387451F9dE4565280C85506CB71aF9376.