Skip to content

Cafereum

https://github.com/BlockCaffeine/Cafereum


This component is an Ethereum smart contract written in Solidity using the Hardhat framework.

The contract itself contracts/Cafereum.sol implements the ERC-721 standard for non-fungible tokens (NFTs) using the OpenZeppelin library. NFT metadata files are available in nft-metadata/ directory and are already deployed on the IPFS network.

The hardhat ignition module ignition/modules/Cafereum.ts is used to deploy the contract to the blockchain. Initial coffee product prices are set in the ignition module.

Getting Started

  1. Add .env file with the following content:
env
WALLET_PRIVATE_KEY=<your_private_key>
  1. Install dependencies:
bash
npm install
  1. Compile and deploy the contract:
bash
npx hardhat complile
npx hardhat ignition deploy ./ignition/modules/Cafereum.ts --network uniMaBlockchain

Scripts

To make interactions with the contract easier, several scripts are provided in the scripts/ directory. Scripts can be executed using the following command:

bash
npx hardhat run ./scripts/<name_of_script.ts> --network uniMaBlockchain

Testing

The contract is tested using the Hardhat testing framework. Tests are located in the test/ directory. To run the tests, use one of the following commands:

bash
npx hardhat test
npx hardhat coverage