From f6d02c51b50c5e23127f63ac80a793738132afec Mon Sep 17 00:00:00 2001 From: nezouse Date: Tue, 23 Apr 2024 15:08:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=B4=20Allow=20setting=20CCR=20to=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contracts/AdminContract.sol | 4 ++-- test/trinity/AdminContractTest.js | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/contracts/AdminContract.sol b/contracts/AdminContract.sol index 9c7ed45..edc2709 100644 --- a/contracts/AdminContract.sol +++ b/contracts/AdminContract.sol @@ -21,7 +21,7 @@ contract AdminContract is IAdminContract, UUPSUpgradeable, OwnableUpgradeable, A uint256 private constant DEFAULT_DECIMALS = 18; uint256 public constant BORROWING_FEE_DEFAULT = 0.005 ether; // 0.5% - uint256 public constant CCR_DEFAULT = 1.5 ether; // 150% + uint256 public constant CCR_DEFAULT = 0; // 0% uint256 public constant MCR_DEFAULT = 1.1 ether; // 110% uint256 public constant MIN_NET_DEBT_DEFAULT = 2_000 ether; uint256 public constant MINT_CAP_DEFAULT = 1_000_000 ether; // 1 million TRI @@ -178,7 +178,7 @@ contract AdminContract is IAdminContract, UUPSUpgradeable, OwnableUpgradeable, A public override onlyTimelock - safeCheck("CCR", _collateral, newCCR, 1 ether, 10 ether) // 100% - 1,000% + safeCheck("CCR", _collateral, newCCR, 0, 10 ether) // 100% - 1,000% { CollateralParams storage collParams = collateralParams[_collateral]; uint256 oldCCR = collParams.ccr; diff --git a/test/trinity/AdminContractTest.js b/test/trinity/AdminContractTest.js index f7b9483..5e1c3c8 100644 --- a/test/trinity/AdminContractTest.js +++ b/test/trinity/AdminContractTest.js @@ -44,7 +44,7 @@ contract("AdminContract", async accounts => { const MCR_SAFETY_MIN = toBN((1.01e18).toString()) const CCR_SAFETY_MAX = toBN(dec(10, 18)) - const CCR_SAFETY_MIN = toBN(dec(1, 18)) + const CCR_SAFETY_MIN = toBN(dec(0, 18)) const PERCENT_DIVISOR_SAFETY_MAX = toBN(200) const PERCENT_DIVISOR_SAFETY_MIN = toBN(2) @@ -86,7 +86,7 @@ contract("AdminContract", async accounts => { it("Formula Checks: Call every function with default value, Should match default values", async () => { await adminContract.setBorrowingFee(ZERO_ADDRESS, (0.005e18).toString()) - await adminContract.setCCR(ZERO_ADDRESS, "1500000000000000000") + await adminContract.setCCR(ZERO_ADDRESS, "0") await adminContract.setMCR(ZERO_ADDRESS, "1100000000000000000") await adminContract.setMinNetDebt(ZERO_ADDRESS, dec(2_000, 18)) await adminContract.setMintCap(ZERO_ADDRESS, dec(1_000_000, 18)) @@ -138,7 +138,6 @@ contract("AdminContract", async accounts => { }) it("setCCR: Owner change parameter - Failing SafeCheck", async () => { - await assertRevert(adminContract.setCCR(ZERO_ADDRESS, CCR_SAFETY_MIN.sub(toBN(1)))) await assertRevert(adminContract.setCCR(ZERO_ADDRESS, CCR_SAFETY_MAX.add(toBN(1)))) })