Giter VIP home page Giter VIP logo

swisstronik-task-3's Introduction

Swisstronik Tesnet Techinal Task 3 (Mint a ERC-721 Token)

link : Click!

Feel free donate to my EVM address

EVM :

0x9902C3A98Df4b240ad5496cC26F89bAb8058f4aE

Steps

1. Clone Repository

git clone https://github.com/Mnuralim/swisstronik-erc721-mint-token.git
cd swisstronik-erc721-mint-token

2. Install Dependency

npm install

3. Set .env File

create .env file in root project

PRIVATE_KEY="your private key"

4. Update Smart Contract (Skipp if you won't modify NFT name)

  • Open contracts folder
  • Open Nft.sol file
  • Feel free to modify token name and token symbol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract TestNFT is ERC721 {
    uint256 private _currentTokenId = 0;

    event NFTMinted(address recipient, uint256 tokenId);

    constructor() ERC721("IzzyNFT", "IZZNFT") {}

    function mintNFT(address recipient) public returns (uint256) {
        _currentTokenId += 1;
        uint256 newItemId = _currentTokenId;
        _mint(recipient, newItemId);

        emit NFTMinted(recipient, newItemId);

        return newItemId;
    }

    function burnNFT(uint256 tokenId) public {
        _burn(tokenId);
    }
}

5. Compile Smart Contract

npm run compile

6. Deploy Smart Contract

npm run deploy

7. Mint Token

npm run mint

8. Finsihed

  • Open the deployed-adddress.ts (location in utils folder)
  • Copy the address and paste the address into testnet dashboard
  • Open the tx-hash.txt (location in utils folder)
  • Copy the address and paste the tx hash link into testnet dashboard
  • push this project to your github and paste your repository link in testnet dashboard

by : github : Mnuralim twitter : @Izzycracker04 telegram : @fitriay19

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.