CapybaraNFT is an Ethereum smart contract that allows the creation and management of non-fungible tokens (NFTs) representing adorable capybara creatures. This contract is built using the Ethereum blockchain and follows the ERC-721 standard, which is commonly used for NFTs.
- Creating NFTs: The contract owner can create new capybara NFTs by specifying the recipient's address, token ID, and corresponding token URI.
Make sure you have Node.js and npm (Node Package Manager) installed on your computer.
-
Clone the repository:
git clone https://github.com/kuzinkirill/CapybaraNFT.git
-
Navigate to the project directory:
cd CapybaraNFT
-
Install dependencies:
Dependencies are managed through
package.json
.npm install
-
The project configuration is defined in
hardhat.config.js
. It specifies the version of Solidity to use and provides network settings for Hardhat, including accounts and URLs. -
Create a .env file in the project root directory. Fill in the necessary values:
NETWORK=<network-name> INFURA_URL=<infura-url> PRIVATE_KEY=<private-key> ETHERSCAN_API=<etherscan-api-key>
-
Deploy the contract:
npx hardhat run scripts/deploy.js --network <network-name>
Replace with the desired network name.
After deploying the smart contract, you will receive its address and the owner's address in the console.
The smart contract includes unit tests to ensure its functionality. Run the tests using the following command:
-
Run tests:
npx hardhat test --network <network-name>