Skip to content

Commit

Permalink
PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
asselstine committed Apr 2, 2024
1 parent 6a19314 commit 13c18cc
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/prb-math
Submodule prb-math updated 42 files
+9 −0 .github/ISSUE_TEMPLATE/1-bug-report.yml
+3 −27 .github/workflows/ci.yml
+8 −0 .gitmodules
+0 −22 CHANGELOG.md
+20 −16 README.md
+1 −0 foundry.toml
+1 −0 lib/forge-std
+1 −0 lib/prb-test
+6 −6 package.json
+37 −314 pnpm-lock.yaml
+2 −2 remappings.txt
+1 −1 src/Common.sol
+1 −1 src/sd59x18/Errors.sol
+5 −0 src/test/Assertions.sol
+5 −0 src/test/Utils.sol
+1 −0 src/ud2x18/Casting.sol
+1 −1 src/ud60x18/Math.sol
+9 −2 test/Base.t.sol
+1 −0 test/fuzz/sd1x18/casting/Casting.t.sol
+2 −0 test/fuzz/sd59x18/casting/Casting.t.sol
+3 −0 test/fuzz/sd59x18/helpers/Helpers.t.sol
+2 −1 test/fuzz/ud60x18/helpers/Helpers.t.sol
+3 −2 test/unit/sd59x18/SD59x18.t.sol
+1 −0 test/unit/sd59x18/conversion/convert-from/convertFrom.t.sol
+1 −1 test/unit/sd59x18/math/div/div.t.sol
+1 −0 test/unit/sd59x18/math/frac/frac.t.sol
+2 −2 test/unit/sd59x18/math/inv/inv.t.sol
+2 −0 test/unit/sd59x18/math/mul/mul.t.sol
+1 −0 test/unit/sd59x18/math/pow/pow.t.sol
+1 −1 test/unit/sd59x18/math/sqrt/sqrt.t.sol
+3 −2 test/unit/ud60x18/UD60x18.t.sol
+1 −0 test/unit/ud60x18/conversion/convert-from/convertFrom.t.sol
+1 −1 test/unit/ud60x18/math/div/div.t.sol
+1 −1 test/unit/ud60x18/math/gm/gm.t.sol
+1 −1 test/unit/ud60x18/math/inv/inv.t.sol
+2 −0 test/unit/ud60x18/math/ln/ln.t.sol
+2 −0 test/unit/ud60x18/math/log10/log10.t.sol
+2 −0 test/unit/ud60x18/math/log2/log2.t.sol
+2 −0 test/unit/ud60x18/math/mul/mul.t.sol
+1 −0 test/unit/ud60x18/math/pow/pow.t.sol
+1 −1 test/utils/Assertions.sol
+65 −65 test/utils/Utils.sol
2 changes: 1 addition & 1 deletion lib/pt-v5-claimable-interface
10 changes: 5 additions & 5 deletions src/Claimer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,17 @@ contract Claimer {
}
}

/// @notice Compute the starting fee for prize claims
/// @return The starting fee for prize claims
/// @notice Compute the target fee for prize claims
/// @return The target fee for prize claims
function _computeFeeTarget() internal view returns (uint256) {
uint8 numberOfTiers = prizePool.numberOfTiers();
// we expect the fee to match the second canary tier
return prizePool.getTierPrizeSize(numberOfTiers - 2);
}

/// @notice Computes the decay constant for the VRGDA.
/// @dev This is a decay constant that ensures the fee will grow to the target max fee
/// @param _targetFee The starting fee
/// @dev This is a decay constant that ensures the fee will grow from the target to the max fee within the time frame
/// @param _targetFee The target fee
/// @return The decay constant
function _computeDecayConstant(uint256 _targetFee) internal view returns (SD59x18) {
uint maximumFee = _computeMaxFee(0);
Expand All @@ -286,7 +286,7 @@ contract Claimer {
}

/// @notice Computes the fee for the next claim.
/// @param _targetFee The minimum fee that should be charged
/// @param _targetFee The target fee that should be charged
/// @param _decayConstant The VRGDA decay constant
/// @param _perTimeUnit The num to be claimed per second
/// @param _elapsed The number of seconds that have elapsed
Expand Down
13 changes: 12 additions & 1 deletion test/Claimer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,18 @@ contract ClaimerTest is Test {
address[] memory winners = newWinners(winner1);
uint32[][] memory prizeIndices = newPrizeIndices(1, 1);
mockPrizePool(1, -100, 0);
mockClaimPrize(1, winner1, 0, uint96(NO_SALES_100_SECONDS_BEHIND_SCHEDULE_FEE), address(this), 0);
vm.mockCallRevert(
address(vault),
abi.encodeWithSelector(
vault.claimPrize.selector,
winner1,
1,
0,
uint96(NO_SALES_100_SECONDS_BEHIND_SCHEDULE_FEE),
address(this)
),
abi.encodeWithSelector(AlreadyClaimed.selector, address(vault), winner1, 1, 0)
);
vm.expectEmit(true, true, true, true);
emit ClaimError(vault, 1, winner1, 0, abi.encodeWithSelector(AlreadyClaimed.selector, address(vault), winner1, 1, 0));
claimer.claimPrizes(vault, 1, winners, prizeIndices, address(this), 0);
Expand Down

0 comments on commit 13c18cc

Please sign in to comment.