@rev-net/core-v6 0.0.41 → 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.
- package/package.json +2 -2
- package/src/REVLoans.sol +8 -14
- package/src/structs/REVStageConfig.sol +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rev-net/core-v6",
|
|
3
|
-
"version": "0.0.
|
|
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.
|
|
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.
|
|
469
|
-
|
|
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.
|
|
473
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
1239
|
-
|
|
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({
|
|
@@ -15,9 +15,10 @@ import {REVAutoIssuance} from "./REVAutoIssuance.sol";
|
|
|
15
15
|
/// @custom:member splits The split recipients for this stage's production allocation.
|
|
16
16
|
/// @custom:member initialIssuance Tokens per unit of base currency at stage start (18-decimal fixed point).
|
|
17
17
|
/// @custom:member issuanceCutFrequency Seconds between each issuance reduction. Should be >= 24 hours.
|
|
18
|
-
/// @custom:member issuanceCutPercent How much issuance decreases each period, out of
|
|
19
|
-
///
|
|
20
|
-
///
|
|
18
|
+
/// @custom:member issuanceCutPercent How much issuance decreases each period, out of
|
|
19
|
+
/// `JBConstants.MAX_WEIGHT_CUT_PERCENT`. 0 = no decay.
|
|
20
|
+
/// @custom:member cashOutTaxRate The tax on cash outs, out of `JBConstants.MAX_CASH_OUT_TAX_RATE`. 0 = no tax (full
|
|
21
|
+
/// reclaim). Higher = more tax retained by the treasury.
|
|
21
22
|
/// @custom:member extraMetadata Additional metadata bits passed to hooks for stage-specific behavior.
|
|
22
23
|
struct REVStageConfig {
|
|
23
24
|
uint48 startsAtOrAfter;
|