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
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.
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
.- Example deployed contract: 0x6B08B2fC665F766193A0cB9a64bcfB8beaac03D4
Interacting with the LoyaltyPoint Contract
Mint Loyalty Points to user
Using theMINTER
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.
- Example mint transaction: https://explorer.gravity.xyz/tx/0xc45af104acfc9f33df4a3ab877e114441113ad77cedb7044b789dad506970ac5