Skip to content

Commit

Permalink
fix: add deployerFee to cancel tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathandiep committed Jul 1, 2024
1 parent 35be406 commit 5060c6d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/QuestBudget.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,12 @@ contract QuestBudgetTest is Test, TestUtils, IERC1155Receiver {
uint256 maxTotalRewards = totalParticipants_ * rewardAmount_;
uint256 questFee = uint256(mockQuestFactory.questFee());
uint256 maxProtocolReward = (maxTotalRewards * questFee) / 10_000; // Assuming questFee is 2000
uint256 deployerFee = (maxTotalRewards * 500) / 10_000;
uint256 approvalAmount = maxTotalRewards + maxProtocolReward;
mockERC20.mint(address(this), approvalAmount);
mockERC20.mint(address(this), approvalAmount + deployerFee);
// Ensure the budget has enough tokens for the reward
mockERC20.approve(address(questBudget), approvalAmount);
bytes memory allocateBytes = _makeFungibleTransfer(Budget.AssetType.ERC20, address(mockERC20), address(this), approvalAmount);
mockERC20.approve(address(questBudget), approvalAmount + deployerFee);
bytes memory allocateBytes = _makeFungibleTransfer(Budget.AssetType.ERC20, address(mockERC20), address(this), approvalAmount + deployerFee);
questBudget.allocate(allocateBytes);
console.logBytes(allocateBytes);

Expand Down

0 comments on commit 5060c6d

Please sign in to comment.