Skip to content

Commit

Permalink
make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
jankjr committed Jul 28, 2023
1 parent e1e5ef7 commit da81c72
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
6 changes: 3 additions & 3 deletions contracts/facade/FacadeRead.sol
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ contract FacadeRead is IFacadeRead {
uint192 uoaHeldInBaskets; // {UoA}
{
(address[] memory basketERC20s, uint256[] memory quantities) = rToken
.main()
.basketHandler()
.quote(basketsNeeded, FLOOR);
.main()
.basketHandler()
.quote(basketsNeeded, FLOOR);

IAssetRegistry reg = rToken.main().assetRegistry();
IBackingManager bm = rToken.main().backingManager();
Expand Down
2 changes: 1 addition & 1 deletion contracts/p0/BackingManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ contract BackingManagerP0 is TradingP0, IBackingManager {

BasketRange memory basketsHeld = main.basketHandler().basketsHeldBy(address(this));
(bool doTrade, TradeRequest memory req, TradePrices memory prices) = TradingLibP0
.prepareRecollateralizationTrade(this, basketsHeld);
.prepareRecollateralizationTrade(this, basketsHeld);

if (doTrade) {
// Seize RSR if needed
Expand Down
4 changes: 2 additions & 2 deletions contracts/p0/BasketHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@ contract BasketHandlerP0 is ComponentP0, IBasketHandler {

// {tok} = {BU} * {ref/BU} / {ref/tok}
quantities[i] = amount
.safeMulDiv(refAmtsAll[i], collsAll[i].refPerTok(), FLOOR)
.shiftl_toUint(int8(collsAll[i].erc20Decimals()), FLOOR);
.safeMulDiv(refAmtsAll[i], collsAll[i].refPerTok(), FLOOR)
.shiftl_toUint(int8(collsAll[i].erc20Decimals()), FLOOR);
// marginally more penalizing than its sibling calculation that uses _quantity()
// because does not intermediately CEIL as part of the division
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/p0/RToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ contract RTokenP0 is ComponentP0, ERC20PermitUpgradeable, IRToken {
}

(address[] memory erc20s, uint256[] memory amounts) = main
.basketHandler()
.quoteCustomRedemption(basketNonces, portions, basketsRedeemed);
.basketHandler()
.quoteCustomRedemption(basketNonces, portions, basketsRedeemed);

// === Save initial recipient balances ===

Expand Down
17 changes: 7 additions & 10 deletions contracts/p1/BasketHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,8 @@ contract BasketHandlerP1 is ComponentP1, IBasketHandler {

// {qTok} = {tok/BU} * {BU} * {tok} * {qTok/tok}
quantities[i] = _quantity(basket.erc20s[i], coll)
.safeMul(amount, rounding)
.shiftl_toUint(
int8(IERC20Metadata(address(basket.erc20s[i])).decimals()),
rounding
);
.safeMul(amount, rounding)
.shiftl_toUint(int8(IERC20Metadata(address(basket.erc20s[i])).decimals()), rounding);
}
}

Expand Down Expand Up @@ -461,8 +458,8 @@ contract BasketHandlerP1 is ComponentP1, IBasketHandler {

// {tok} = {BU} * {ref/BU} / {ref/tok}
quantities[i] = amount
.safeMulDiv(refAmtsAll[i], collsAll[i].refPerTok(), FLOOR)
.shiftl_toUint(int8(collsAll[i].erc20Decimals()), FLOOR);
.safeMulDiv(refAmtsAll[i], collsAll[i].refPerTok(), FLOOR)
.shiftl_toUint(int8(collsAll[i].erc20Decimals()), FLOOR);
// marginally more penalizing than its sibling calculation that uses _quantity()
// because does not intermediately CEIL as part of the division
}
Expand Down Expand Up @@ -608,9 +605,9 @@ contract BasketHandlerP1 is ComponentP1, IBasketHandler {

// {tok} = {BU} * {ref/BU} / {ref/tok}
quantities[i] = b
.refAmts[erc20s[i]]
.safeDiv(ICollateral(address(asset)).refPerTok(), FLOOR)
.shiftl_toUint(int8(asset.erc20Decimals()), FLOOR);
.refAmts[erc20s[i]]
.safeDiv(ICollateral(address(asset)).refPerTok(), FLOOR)
.shiftl_toUint(int8(asset.erc20Decimals()), FLOOR);
} catch (bytes memory errData) {
// untested:
// OOG pattern tested in other contracts, cost to test here is high
Expand Down
2 changes: 1 addition & 1 deletion contracts/plugins/assets/OracleLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ library OracleLib {
returns (uint192)
{
(uint80 roundId, int256 p, , uint256 updateTime, uint80 answeredInRound) = chainlinkFeed
.latestRoundData();
.latestRoundData();

if (updateTime == 0 || answeredInRound < roundId) {
revert StalePrice();
Expand Down

0 comments on commit da81c72

Please sign in to comment.