AvatarItems
is an Ethereum-based smart contract developed using the Hardhat framework. It implements the ERC1155 token standard for creating and managing semi-fungible tokens for avatar customization. The contract leverages Chainlink's Verifiable Random Function (VRF) for unbiased randomness in item distribution.
- ERC1155 implementation for semi-fungible avatar items.
- Chainlink VRF integration for random item distribution.
- Functions for item creation, purchase, and management.
- Power-up features with custom effects and durations.
- Clone the repository:
git clone [repository-url]
- Install NPM packages:
npm install
- Compile the smart contract:
npx hardhat compile
Run tests to validate the contract's functionalities:
npx hardhat test
Deploy the contract to a network (e.g., Ethereum mainnet, Rinkeby testnet):
npx hardhat deploy --network [network-name]
- Create Items: Use
addAvatarItem
to introduce new avatar customization items. - Purchase Packs: Users can buy item packs using
buyPack
. - Open Packs: On opening a pack,
packOpened
event provides details of the acquired item. - Power-Ups: Implement and manage power-ups with specific attributes.
packBought
: Emitted when a pack is bought.packOpened
: Emitted when a pack is opened, indicating the item received.itemAdded
: Indicates the addition of a new item.earnedReward
: Triggered upon distributing rewards.powerUpMinted
: Emitted when a power-up is minted.
We welcome contributions from the community. If you'd like to contribute, please follow these guidelines:
- Fork the repository.
- Create a branch:
git checkout -b feature/your-feature-name
. - Commit your changes:
git commit -am 'Add some feature'
. - Push to the branch:
git push origin feature/your-feature-name
. - Submit a pull request.
Please make sure to update tests as appropriate and adhere to the code of conduct.
This project is licensed under the MIT License - see the LICENSE file for details.