generated from refcell/femplate
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial commit * tweaks to Matt's PR to block adding quote token above auction price (#1000) * reduce cost of reference price assignment * reduce pool contract size * fixed testDepositTakeAndSettleByRegularTakeSubsetPool * fixed tests in ERC20PoolLiquidationsArbTake.t.sol * fixed tests in ERC20PoolLiquidationsDepositTake.sol * fixed two more * updated testDepositTakeAndSettleSubsetPool * updated testKickAndSettleSubsetPoolFractionalCollateral * updated testSettleWithDepositFuzzy * Fixed final tests * add "AddAboveAuctionPrice" as expected pool error * implemented invariant A9: reference prices in liquidation queue shall not decrease * Update assertAuction to use ThresholdPrice from auctionInfo (#1003) * use auctionInfo thresholdprice instead of recalculating * fix most tests * update remaining tests --------- Co-authored-by: Mike <mikehathaway@makerdao.com> * Contract size mitigation (#1004) * moved debtInfo to PoolCommons, saving 10 bytes * moved withdrawBonds to KickerActions * documented a sample of invariant failures in regression tests * added unit test showing adding qt above auction price reverts * fixed _isCollateralized bug not returning true in all 0-debt use cases * updated nit spellings * fixed underflow calculating kicker reward * _repayDebtByThirdParty should check for expected pool errors * Round down when reward kicker, round up when kicker is penalized Fix roundings in tests * update test comments * fix and enable A9 invariant --------- Co-authored-by: mwc <matt@ajna.finance> Co-authored-by: Mike Hathaway <mahathaway93@gmail.com> Co-authored-by: Mike <mikehathaway@makerdao.com> Co-authored-by: Ian Harvey <iharvey@comcast.net> Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com> Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
- Loading branch information
1 parent
5a270be
commit 196376b
Showing
19 changed files
with
166 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests/forge/regression/ERC20Pool/RegressionTestSettleERC20Pool.t.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
|
||
pragma solidity 0.8.18; | ||
|
||
import { SettleERC20PoolInvariants } from "../../invariants/ERC20Pool/SettleERC20PoolInvariants.t.sol"; | ||
|
||
contract RegressionTestSettleERC20Pool is SettleERC20PoolInvariants { | ||
|
||
function setUp() public override { | ||
// failures reproduced with default number of active buckets | ||
vm.setEnv("NO_OF_BUCKETS", "3"); | ||
super.setUp(); | ||
} | ||
|
||
/** | ||
Test was failing because SettleERC20PoolHandler was not catching expected pool errors when repaying from a third party. | ||
*/ | ||
function test_regression_settle_then_repay() external { | ||
_settleERC20PoolHandler.settleDebt(3113042312187095938847976769131078147978133970801631984161493412007580, 71508422573531484609164655, 55359934378837189558162829458006585270105); | ||
_settleERC20PoolHandler.repayDebtByThirdParty(1333, 3439, 3116, 2819); | ||
invariant_quote(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.