Skip to content

Latest commit

History

History
55 lines (42 loc) 路 1.26 KB

README.md

File metadata and controls

55 lines (42 loc) 路 1.26 KB

LootBox and Item Contracts

With this project, you can create and manage LootBoxes and Items, which are NFTs (Non-Fungible Tokens). Additionally, a key mechanism is implemented to facilitate unlocking these LootBoxes.

This solution is built using Hardhat.

Deployment Instructions

To deploy the contracts locally, follow these steps:

  1. Install the dependencies:
npm install
  1. Compile the contracts:
npx hardhat compile
  1. Deploy using:
npx hardhat run scripts/deploy.js

Deploying to Remote Networks

If you wish to deploy the contracts to remote networks, such as mainnet or any testnets, you'll need to update your hardhat.config.js.

For demonstration, let's consider deploying to the Polygon Network:

Add the following network configuration to hardhat.config.js:

module.exports = {
  networks: {
    polygon: {
      url: 'https://polygon-rpc.com/',
      accounts: [
        `${PRIVATE_KEY}`,
      ],
    }
  }
};

Now, deploy to the specified network:

npx hardhat run scripts/deploy.js --network polygon

Running Tests

To ensure the robustness of your smart contracts, always test them. Execute tests using:

npx hardhat test