Quests Protocol is a protocol to distribute token rewards for completing on-chain tasks.
GNU General Public License v3.0
88
stars
22
forks
source link
[BOOST-4672] implement flexible fee structures for `QuestBudget` #291
Closed
mmackz closed 1 day ago
Management Fee Implementation for QuestBudget
Overview
This PR implements the management fee feature for the QuestBudget contract, allowing boost creators to earn a fee for managing boosts.
Key Changes
Management Fee Setting:
setManagementFee
function to allow the contract owner to set the management fee percentage.managementFee
state variable to store the fee percentage.Boost Creation with Management Fee:
createERC20Quest
to calculate and reserve the management fee during quest creation.reservedFunds
state variable to track funds reserved for management fees.available
function to account for reserved funds.Management Fee Payment:
payManagementFee
function to allow boost creators to claim their management fee after completion.Manager Tracking:
questManagers
mapping to associate quest IDs with their creators' addresses.Events:
ManagementFeeSet
event for logging changes to the management fee percentage.ManagementFeePaid
event for logging management fee payments.Testing:
Implementation Details
Security Considerations
setManagementFee
function is restricted to the contract owner.payManagementFee
function includes checks to prevent unauthorized claims.SafeERC20
for secure token transfers.Testing