Join Our Community Telegram
This Great Money Maker Page Allows All Offical Staff.
All staff members to interact with the Bitsee Bit Secure Token smart contract Directly.
You can:
View Your staff information (address, total sales, total referral rewards, and referral code).
Generate a referral code.
Record sales made to customers.
Record referral rewards earnings .
Explanation:
Checks if the Ethereum provider (e.g., MetaMask) is available.
If available, it connects to the provider and requests account access.
Retrieves the connected account (staff member's Ethereum address) and displays it.
Initializes the contract instance using the provided ABI and contract address.
Calls updateStaffInfo to fetch and display the staff's information.
2. Viewing Staff Information
Explanation:
Fetches the total sales and referral rewards for the staff member from the smart contract.
Fetches the referral code for the staff member.
Converts the sales and rewards from Wei to Ether for readability.
Displays the fetched data on the webpage.
3. Generating a Referral Code
When the staff member clicks the "Generate Referral Code" button, the generateReferralCode function is called:
Explanation:
Calls the generateReferralCode method on the smart contract.
If successful, alerts the staff member and updates their information.
If there's an error, it logs the error and alerts the staff member.
4. Recording a Sale
When the staff member enters the customer address and sale amount and clicks "Record Sale," the recordSale function is called:
Explanation:
Gets the customer address and sale amount from the input fields.
Converts the sale amount from Ether to Wei.
Calls the recordStaffSale method on the smart contract.
If successful, alerts the staff member and updates their information.
If there's an error, it logs the error and alerts the staff member.
5. Recording a Referral Reward
When the staff member enters the referrer address and reward amount and clicks "Record Referral Reward," the recordReferralReward function is called:
Explanation:
Gets the referrer address and reward amount from the input fields.
Converts the reward amount from Ether to Wei.
Calls the recordStaffReferralReward method on the smart contract.
If successful, alerts the staff member and updates their information.
If there's an error, it logs the error and alerts the staff member.
Load the Webpage: Connect to the Ethereum provider and display the staff address.
View Staff Information: Fetch and display total sales, referral rewards, and referral code.
Generate Referral Code: Create a unique referral code for the staff member.
Record Sale: Log a sale made by the staff member.
Record Referral Reward: Log a referral reward for the staff member.
This webpage provides an interface for staff members to interact with the BitSecure Token smart contract, manage their sales, and referral activities.