-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BOOST-4672] implement flexible fee structures for QuestBudget
#291
[BOOST-4672] implement flexible fee structures for QuestBudget
#291
Conversation
function testCreateERC20Quest() public { | ||
// Define the parameters for the new quest | ||
uint32 txHashChainId_ = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common parameters for quest creation are moved to helper functions at the bottom of this file setupQuestData
and createQuestWithMockData
. This is to avoid having to repeat the same quest setup on multiple tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have ownership permissions on this repo but this looks good to me
} | ||
|
||
function testPayManagementFee_NotAuthorized() public { | ||
vm.prank(address(0xc0ffee)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can use hoax
instead of vm.prank
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the info, I did not know about hoax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
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