From 11dba20e82ff6edbd54dd7f543794b0adf33b49f Mon Sep 17 00:00:00 2001 From: Aalavandhan <6264334+aalavandhan@users.noreply.github.com> Date: Tue, 20 Sep 2022 14:37:10 -0400 Subject: [PATCH] Comment update (#102) * comment update * Update spot-contracts/contracts/PerpetualTranche.sol Co-authored-by: nms-7 <57442379+nms-7@users.noreply.github.com> * ran linter Co-authored-by: nms-7 <57442379+nms-7@users.noreply.github.com> --- spot-contracts/contracts/PerpetualTranche.sol | 12 ++++++------ spot-contracts/contracts/test/mocks/MockTranche.sol | 2 +- spot-contracts/test/PerpetualTranche_deposit.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spot-contracts/contracts/PerpetualTranche.sol b/spot-contracts/contracts/PerpetualTranche.sol index 232c7c39..c3492904 100644 --- a/spot-contracts/contracts/PerpetualTranche.sol +++ b/spot-contracts/contracts/PerpetualTranche.sol @@ -189,12 +189,12 @@ contract PerpetualTranche is ERC20BurnableUpgradeable, OwnableUpgradeable, Pausa /// @dev The computed price is expected to be a fixed point unsigned integer with {PRICE_DECIMALS} decimals. IPricingStrategy public pricingStrategy; - /// @notice External contract that computes a given reserve token's discount. - /// @dev Discount is the discount or premium factor applied to every asset when added to - /// the reserve. This accounts for things like tranche seniority and underlying - /// collateral volatility. It also allows for standardizing denominations when comparing, - /// two different reserve tokens. - /// The computed discount is expected to be a fixed point unsigned integer with {DISCOUNT_DECIMALS} decimals. + /// @notice External contract that computes a given reserve token's discount factor. + /// @dev It is a multiplier, applied to every asset when added to the reserve. + /// This accounts for things like tranche seniority and underlying collateral volatility. + /// It also allows for standardizing denominations when comparing two different reserve tokens. + /// For example, a factor of 0.95 on a particular tranche results in a 5% discount. + /// The discount factor is expected to be a fixed point unsigned integer with {DISCOUNT_DECIMALS} decimals. IDiscountStrategy public discountStrategy; /// @notice External contract that stores a predefined bond config and frequency, diff --git a/spot-contracts/contracts/test/mocks/MockTranche.sol b/spot-contracts/contracts/test/mocks/MockTranche.sol index a6d99f86..19a6afa9 100644 --- a/spot-contracts/contracts/test/mocks/MockTranche.sol +++ b/spot-contracts/contracts/test/mocks/MockTranche.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.15; -import {MockERC20} from "./MockERC20.sol"; +import { MockERC20 } from "./MockERC20.sol"; contract MockTranche is MockERC20 { address public bond; diff --git a/spot-contracts/test/PerpetualTranche_deposit.ts b/spot-contracts/test/PerpetualTranche_deposit.ts index d9c31142..08009891 100644 --- a/spot-contracts/test/PerpetualTranche_deposit.ts +++ b/spot-contracts/test/PerpetualTranche_deposit.ts @@ -133,8 +133,8 @@ describe("PerpetualTranche", function () { const ERC20 = await ethers.getContractFactory("MockTranche"); const maliciousTranche = await ERC20.deploy(); await maliciousTranche.init("Tranche", "TRA"); - await maliciousTranche.mint(deployerAddress, toFixedPtAmt("500")) - await maliciousTranche.setBond(await perp.callStatic.getDepositBond()) + await maliciousTranche.mint(deployerAddress, toFixedPtAmt("500")); + await maliciousTranche.setBond(await perp.callStatic.getDepositBond()); await maliciousTranche.approve(perp.address, toFixedPtAmt("500")); await expect(perp.deposit(maliciousTranche.address, toFixedPtAmt("500"))).to.revertedWith( "UnacceptableDepositTranche",