@rev-net/core-v6 0.0.42 → 0.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/REVLoans.sol +8 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rev-net/core-v6",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@bananapus/721-hook-v6": "0.0.43",
30
30
  "@bananapus/buyback-hook-v6": "0.0.37",
31
- "@bananapus/core-v6": "0.0.39",
31
+ "@bananapus/core-v6": "0.0.42",
32
32
  "@bananapus/ownable-v6": "0.0.24",
33
33
  "@bananapus/permission-ids-v6": "0.0.22",
34
34
  "@bananapus/router-terminal-v6": "0.0.36",
package/src/REVLoans.sol CHANGED
@@ -465,13 +465,11 @@ contract REVLoans is ERC721, ERC2771Context, JBPermissioned, Ownable, IREVLoans
465
465
  revert REVLoans_LoanExpired(timeSinceLoanCreated, LOAN_LIQUIDATION_DURATION);
466
466
  }
467
467
 
468
- // Get a reference to the amount prepaid for the full loan. This is an app-level loan fee, so keep it
469
- // floor-rounded instead of applying the protocol fee helper's dust minimum.
470
- uint256 prepaid = JBFees.feeAmountFromFloor({amountBeforeFee: loan.amount, feePercent: loan.prepaidFeePercent});
468
+ // Get a reference to the amount prepaid for the full loan.
469
+ uint256 prepaid = JBFees.feeAmountFrom({amountBeforeFee: loan.amount, feePercent: loan.prepaidFeePercent});
471
470
 
472
- // This source fee ramps with elapsed time. Use the floor-rounded fee helper so a one-second elapsed window
473
- // with zero fee percent stays free instead of inheriting the protocol fee helper's anti-dust minimum.
474
- uint256 fullSourceFeeAmount = JBFees.feeAmountFromFloor({
471
+ // This source fee ramps with elapsed time.
472
+ uint256 fullSourceFeeAmount = JBFees.feeAmountFrom({
475
473
  amountBeforeFee: loan.amount - prepaid,
476
474
  feePercent: mulDiv({
477
475
  x: timeSinceLoanCreated - loan.prepaidDuration,
@@ -1014,11 +1012,10 @@ contract REVLoans is ERC721, ERC2771Context, JBPermissioned, Ownable, IREVLoans
1014
1012
  // Keep a reference to the fee terminal.
1015
1013
  IJBTerminal feeTerminal = DIRECTORY.primaryTerminalOf({projectId: REV_ID, token: loan.source.token});
1016
1014
 
1017
- // Get the amount of additional fee to take for REV. This is an app-level loan fee, not the terminal's
1018
- // protocol fee, so keep it floor-rounded instead of applying the protocol fee helper's dust minimum.
1015
+ // Get the amount of additional fee to take for REV.
1019
1016
  uint256 revFeeAmount = address(feeTerminal) == address(0)
1020
1017
  ? 0
1021
- : JBFees.feeAmountFromFloor({amountBeforeFee: addedBorrowAmount, feePercent: REV_PREPAID_FEE_PERCENT});
1018
+ : JBFees.feeAmountFrom({amountBeforeFee: addedBorrowAmount, feePercent: REV_PREPAID_FEE_PERCENT});
1022
1019
 
1023
1020
  // Try to pay the REV fee. If it fails, revFeeAmount is zeroed so the borrower receives it instead.
1024
1021
  if (revFeeAmount > 0) {
@@ -1235,11 +1232,8 @@ contract REVLoans is ERC721, ERC2771Context, JBPermissioned, Ownable, IREVLoans
1235
1232
  // Make sure the minimum borrow amount is met.
1236
1233
  if (borrowAmount < minBorrowAmount) revert REVLoans_UnderMinBorrowAmount(minBorrowAmount, borrowAmount);
1237
1234
 
1238
- // Get the amount of additional fee to take for the revnet issuing the loan. This is an app-level loan fee,
1239
- // not the terminal's protocol fee, so keep it floor-rounded instead of applying the protocol fee helper's dust
1240
- // minimum.
1241
- uint256 sourceFeeAmount =
1242
- JBFees.feeAmountFromFloor({amountBeforeFee: borrowAmount, feePercent: prepaidFeePercent});
1235
+ // Get the amount of additional fee to take for the revnet issuing the loan.
1236
+ uint256 sourceFeeAmount = JBFees.feeAmountFrom({amountBeforeFee: borrowAmount, feePercent: prepaidFeePercent});
1243
1237
 
1244
1238
  // Borrow the amount.
1245
1239
  _adjust({