Skip to content

Commit

Permalink
🐢 Allow setting redemption fee floor to 0 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
nezouse authored Apr 25, 2024
1 parent a4b4fe8 commit 1f9713e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions contracts/AdminContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ contract AdminContract is IAdminContract, UUPSUpgradeable, OwnableUpgradeable, A
uint256 public constant MIN_NET_DEBT_DEFAULT = 2_000 ether;
uint256 public constant MINT_CAP_DEFAULT = 1_000_000 ether; // 1 million TRI
uint256 public constant PERCENT_DIVISOR_DEFAULT = 200; // dividing by 200 yields 0.5%
uint256 public constant REDEMPTION_FEE_FLOOR_DEFAULT = 0.005 ether; // 0.5%
uint256 public constant REDEMPTION_FEE_FLOOR_DEFAULT = 0; // 0%
uint256 public constant REDEMPTION_BLOCK_TIMESTAMP_DEFAULT = type(uint256).max; // never
bool public constant REDEMPTION_BASE_FEE_ENABLED_DEFAULT = false;

Expand Down Expand Up @@ -235,7 +235,7 @@ contract AdminContract is IAdminContract, UUPSUpgradeable, OwnableUpgradeable, A
public
override
onlyTimelock
safeCheck("Redemption Fee Floor", _collateral, redemptionFeeFloor, 0.001 ether, 0.1 ether) // 0.10% - 10%
safeCheck("Redemption Fee Floor", _collateral, redemptionFeeFloor, 0, 0.1 ether) // 0% - 10%
{
CollateralParams storage collParams = collateralParams[_collateral];
uint256 oldRedemptionFeeFloor = collParams.redemptionFeeFloor;
Expand Down
5 changes: 2 additions & 3 deletions test/trinity/AdminContractTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ contract("AdminContract", async accounts => {
const MIN_NET_DEBT_SAFETY_MIN = toBN(0)

const REDEMPTION_FEE_FLOOR_SAFETY_MAX = toBN((0.1e18).toString()) // 10%
const REDEMPTION_FEE_FLOOR_SAFETY_MIN = toBN((0.001e18).toString()) // 0.1%
const REDEMPTION_FEE_FLOOR_SAFETY_MIN = toBN('0') // 0%

before(async () => {
await deploy(treasury, accounts.slice(0, 5))
Expand Down Expand Up @@ -91,7 +91,7 @@ contract("AdminContract", async accounts => {
await adminContract.setMinNetDebt(ZERO_ADDRESS, dec(2_000, 18))
await adminContract.setMintCap(ZERO_ADDRESS, dec(1_000_000, 18))
await adminContract.setPercentDivisor(ZERO_ADDRESS, 200)
await adminContract.setRedemptionFeeFloor(ZERO_ADDRESS, (0.005e18).toString())
await adminContract.setRedemptionFeeFloor(ZERO_ADDRESS, '0')

assert.equal((await adminContract.getBorrowingFee(ZERO_ADDRESS)).toString(), BORROWING_FEE)
assert.equal((await adminContract.getCcr(ZERO_ADDRESS)).toString(), CCR)
Expand Down Expand Up @@ -188,7 +188,6 @@ contract("AdminContract", async accounts => {
})

it("setRedemptionFeeFloor: Owner change parameter - Failing SafeCheck", async () => {
await assertRevert(adminContract.setRedemptionFeeFloor(ZERO_ADDRESS, REDEMPTION_FEE_FLOOR_SAFETY_MIN.sub(toBN(1))))
await assertRevert(adminContract.setRedemptionFeeFloor(ZERO_ADDRESS, REDEMPTION_FEE_FLOOR_SAFETY_MAX.add(toBN(1))))
})

Expand Down

0 comments on commit 1f9713e

Please sign in to comment.