-
Notifications
You must be signed in to change notification settings - Fork 0
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
🥝 Remove gas compensation #2
Conversation
contracts/BorrowerOperations.sol
Outdated
@@ -90,8 +90,7 @@ contract BorrowerOperations is TrinityBase, ReentrancyGuardUpgradeable, UUPSUpgr | |||
_requireAtLeastMinNetDebt(vars.asset, vars.netDebt); | |||
|
|||
// ICR is based on the composite debt, i.e. the requested debt token amount + borrowing fee + gas comp. | |||
uint256 gasCompensation = IAdminContract(adminContract).getDebtTokenGasCompensation(vars.asset); | |||
vars.compositeDebt = vars.netDebt + gasCompensation; | |||
vars.compositeDebt = vars.netDebt; |
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.
Should we remove compositeDebt then?
dc134d7
to
5341d46
Compare
5341d46
to
742f56d
Compare
contracts/BorrowerOperations.sol
Outdated
vars.compositeDebt = vars.netDebt + gasCompensation; | ||
require(vars.compositeDebt != 0, "compositeDebt cannot be 0"); | ||
// ICR is based on the composite debt, i.e. the requested debt token amount + borrowing fee. | ||
require(vars.netDebt != 0, "compositeDebt cannot be 0"); |
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.
require(vars.netDebt != 0, "compositeDebt cannot be 0"); | |
require(vars.netDebt != 0, "Debt cannot be 0"); |
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.
In general should remove 'composite debt' from this file
@@ -85,7 +83,6 @@ interface IVesselManagerOperations is ITrinityBase { | |||
struct LiquidationValues { | |||
uint256 entireVesselDebt; | |||
uint256 entireVesselColl; | |||
uint256 collGasCompensation; | |||
uint256 debtTokenGasCompensation; |
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.
The other gas compensation is stil here?
contracts/VesselManager.sol
Outdated
@@ -237,7 +237,7 @@ contract VesselManager is IVesselManager, UUPSUpgradeable, ReentrancyGuardUpgrad | |||
) external override nonReentrant onlyVesselManagerOperations { | |||
_removeStake(_asset, _borrower); | |||
_closeVessel(_asset, _borrower, Status.closedByRedemption); | |||
_redeemCloseVessel(_asset, _borrower, IAdminContract(adminContract).getDebtTokenGasCompensation(_asset), _newColl); | |||
_redeemCloseVessel(_asset, _borrower, 0, _newColl); |
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.
Is this param is unused maybe it should be removed from function signature?
@@ -87,22 +87,16 @@ contract VesselManagerOperations is IVesselManagerOperations, UUPSUpgradeable, R | |||
IActivePool(activePool).sendAsset(_asset, collSurplusPool, totals.totalCollSurplus); | |||
} | |||
|
|||
IVesselManager(vesselManager).updateSystemSnapshots_excludeCollRemainder(_asset, totals.totalCollGasCompensation); | |||
IVesselManager(vesselManager).updateSystemSnapshots_excludeCollRemainder(_asset, 0); |
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.
Same here
0, | ||
0 |
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.
And here
0, | ||
0 |
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.
And here
@@ -144,22 +138,16 @@ contract VesselManagerOperations is IVesselManagerOperations, UUPSUpgradeable, R | |||
} | |||
|
|||
// Update system snapshots | |||
IVesselManager(vesselManager).updateSystemSnapshots_excludeCollRemainder(_asset, totals.totalCollGasCompensation); | |||
IVesselManager(vesselManager).updateSystemSnapshots_excludeCollRemainder(_asset, 0); |
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.
And here
test/utils/testHelpers.js
Outdated
@@ -319,18 +316,13 @@ class TestHelper { | |||
// Virtual debt = 50 TRI. |
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.
Shouldn't we just get rid of these functions? Or keep them to preserve the least amount of changes?
|
||
// --- Vessel ordering by ICR tests --- | ||
|
||
it("Vessel ordering: same collateral, decreasing debt. Price successively increases. Vessels should maintain ordering by ICR", async () => { |
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.
Shouldn't this be kept too, just adjust for no gas compensation?
No description provided.