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.
To deploy the contracts locally, follow these steps:
- Install the dependencies:
npm install
- Compile the contracts:
npx hardhat compile
- Deploy using:
npx hardhat run scripts/deploy.js
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
To ensure the robustness of your smart contracts, always test them. Execute tests using:
npx hardhat test