Quick Start
This quick start guide will walk you through deploying and interacting with your own LoyaltyPoint contract. Follow the steps below to set up your loyalty points system quickly.
Prerequisites
Before you begin, ensure you have the following tools and dependencies installed:
- Foundry: Install Foundry by following the instructions at https://book.getfoundry.sh/getting-started/installation
Contract Deployment
Step 1: Clone the Repository
Note: Repo will be published soon.
Step 2: Install Dependencies
Step 3: Compile Contracts
Step 4: Deploy your own LoyaltyPoint
Set up necessary environment variables:
FACTORY_ADDRESS
is the address of the deployed LoyaltyPointFactory contract on the network you are deploying to. For example, on Gravity Alpha Testnet Sepolia, the factory address is0x8a85eC5AE1ae2c757eEfBb10b1203C984120bf8c
.PRIVATE_KEY
is the private key of the owner address.OWNER
is the owner address of the LoyaltyPoint contract.MINTER
is the minter address of the LoyaltyPoint contract.
Run the deployment script:
rpc-url
is the RPC URL of the network you are deploying to. For example, on Gravity Alpha Testnet Sepolia, the RPC URL ishttps://rpc-sepolia.gravity.xyz
.
Interacting with the LoyaltyPoint Contract
Mint Loyalty Points to user
Using the MINTER
address, you can mint loyalty points to a user:
Set up necessary environment variables:
PRIVATE_KEY
is the private key of the MINTER address.LOYALTY_POINT_ADDRESS
is the address of the deployed LoyaltyPoint contract.USER_ADDRESS
is the address of the user to mint points to.
Run the minting script:
Conclusion
You’ve successfully deployed your loyalty points system! The LoyaltyPoint contract provides a robust system for minting, burning, and controlling loyalty points for your users, while the factory allows for easy contract creation and management.
Continue by integrating the contracts with your frontend or dApp to offer a seamless user experience.