Skip to content

nickyle99/NFT-Launchpad-Smartcontract

Repository files navigation


Smart contracts used to launchpad NFT project

Table of Contents
  1. About The Project
  2. Prerequisites
  3. Installation
  4. Usage
  5. Deployment to a testnet or mainnet
  6. Linting

About The Project

This project contains the source code of Launchpad NFT project, supports deploying, testing smart contracts and getting information about chain Id, address and abi to help front-end interact with these smart contracts.

Built With

  • Solidity
  • TypeScript
  • OpenZeppelin
  • Hardhat

Prerequisites

  • npm
    npm install npm@latest -g
  • yarn
    npm install --global yarn

Installation

  1. Clone the repo
    git clone https://gitlab.com/illumia-project/nft-amm-smartcontract.git
  2. Install packages
    yarn

Usage

Deploy

yarn hardhat deploy

Testing

yarn hardhat test

Test Coverage

yarn hardhat coverage

Deployment to a testnet or mainnet

  1. Setup environment variables Create a .env file, similar to what your see in .env.example
MAINNET_RPC_URL='https://eth-mainnet.g.alchemy.com/v2/your-api-key'
GOERLI_RPC_URL='https://eth-goerli.g.alchemy.com/v2/your-api-key'
PRIVATE_KEY='YOUR_PRIVATE_KEY'
REPORT_GAS=false
ETHERSCAN_API_KEY='YOUR_API_KEY'
  • MAINNET_RPC_URL: This is url of the mainnet node you're working with. You can get setup with one for free from Alchemy
  • GOERLI_RPC_URL: This is url of the goerli testnet node you're working with. You can get setup with one for free from Alchemy
  • SEPOLIA_RPC_URL: This is url of the sepolia testnet node you're working with. You can get setup with one for free from Infura
  • PRIVATE_KEY: The private key of your account (like from metamask). NOTE: FOR DEVELOPMENT, PLEASE USE A KEY THAT DOESN'T HAVE ANY REAL FUNDS ASSOCIATED WITH IT.
  • ETHERSCAN_API_KEY: This is the api key used for smart contract verification on etherscan. You can get one for free here Etherscan
  1. Get testnet ETH
  1. Deploy & Verify
  • Testnet:
yarn hardhat deploy --network <NETWORK> --tags "main"
  • Mainnet:
PRIVATE_KEY=<YOUR_PRIVATE_KEY> yarn hardhat deploy --network mainnet --tags "main"
history -c

Verify the deployed contract using frontend

The first contract deployed on a network needs to be verified, and similar contracts are automatically verified.

yarn hardhat verify --constructor-args arguments.ts <CONTRACT_ADDRESS> --network <NETWORK>

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published