Skip to content

Commit

Permalink
Make rewardToken mutable to prepare for governance
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenshively committed Sep 8, 2023
1 parent 9af75cf commit 60ab139
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
30 changes: 15 additions & 15 deletions core/.gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
BorrowerGasTest:test_addMargin() (gas: 16203)
BorrowerGasTest:test_borrow() (gas: 110492)
BorrowerGasTest:test_borrow() (gas: 110489)
BorrowerGasTest:test_getUniswapPositions() (gas: 5219)
BorrowerGasTest:test_modify() (gas: 82111)
BorrowerGasTest:test_modifyWithAnte() (gas: 88566)
BorrowerGasTest:test_repay() (gas: 111851)
BorrowerGasTest:test_uniswapDepositInBorrower() (gas: 257726)
BorrowerGasTest:test_modify() (gas: 82108)
BorrowerGasTest:test_modifyWithAnte() (gas: 88563)
BorrowerGasTest:test_repay() (gas: 111848)
BorrowerGasTest:test_uniswapDepositInBorrower() (gas: 257723)
BorrowerGasTest:test_uniswapDepositStandard() (gas: 167558)
BorrowerGasTest:test_uniswapWithdraw() (gas: 147623)
BorrowerGasTest:test_withdraw() (gas: 105631)
FactoryGasTest:test_createBorrower() (gas: 156437)
FactoryGasTest:test_createMarket() (gas: 3900597)
BorrowerGasTest:test_uniswapWithdraw() (gas: 147620)
BorrowerGasTest:test_withdraw() (gas: 105628)
FactoryGasTest:test_createBorrower() (gas: 156431)
FactoryGasTest:test_createMarket() (gas: 3900591)
LenderGasTest:test_accrueInterest() (gas: 46287)
LenderGasTest:test_borrow() (gas: 40812)
LenderGasTest:test_deposit() (gas: 53639)
LenderGasTest:test_depositWithCourier() (gas: 53785)
LenderGasTest:test_redeem() (gas: 53334)
LenderGasTest:test_redeemWithCourier() (gas: 83730)
LenderGasTest:test_redeemWithCourier() (gas: 83726)
LenderGasTest:test_repay() (gas: 44752)
LiquidatorGasTest:test_noCallbackOneAsset() (gas: 51020)
LiquidatorGasTest:test_noCallbackTwoAssets() (gas: 59179)
LiquidatorGasTest:test_noCallbackTwoAssetsAndUniswapPosition() (gas: 95598)
LiquidatorGasTest:test_warn() (gas: 35026)
LiquidatorGasTest:test_withCallbackAndSwap() (gas: 130185)
LiquidatorGasTest:test_noCallbackOneAsset() (gas: 51017)
LiquidatorGasTest:test_noCallbackTwoAssets() (gas: 59176)
LiquidatorGasTest:test_noCallbackTwoAssetsAndUniswapPosition() (gas: 95596)
LiquidatorGasTest:test_warn() (gas: 35023)
LiquidatorGasTest:test_withCallbackAndSwap() (gas: 130182)
VolatilityGasTest:test_consult() (gas: 43075)
VolatilityGasTest:test_updateNoBinarySearch() (gas: 145880)
12 changes: 6 additions & 6 deletions core/src/Factory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ contract Factory {

IRateModel public immutable RATE_MODEL;

ERC20 public immutable REWARDS_TOKEN;

address public immutable LENDER_IMPLEMENTATION;

ERC20 public rewardsToken;

Check warning

Code scanning / Slither

State variables that could be declared immutable Warning

Factory.rewardsToken should be immutable

/*//////////////////////////////////////////////////////////////
WORLD STORAGE
//////////////////////////////////////////////////////////////*/
Expand Down Expand Up @@ -80,12 +80,12 @@ contract Factory {
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/

constructor(VolatilityOracle oracle, IRateModel rateModel, ERC20 rewardsToken) {
constructor(VolatilityOracle oracle, IRateModel rateModel, ERC20 rewardsToken_) {
ORACLE = oracle;
RATE_MODEL = rateModel;
REWARDS_TOKEN = rewardsToken;

LENDER_IMPLEMENTATION = address(new Lender(address(this)));

rewardsToken = rewardsToken_;
}

function pause(IUniswapV3Pool pool) external {
Expand Down Expand Up @@ -178,6 +178,6 @@ contract Factory {
}
}

REWARDS_TOKEN.safeTransfer(beneficiary, earned);
rewardsToken.safeTransfer(beneficiary, earned);
}
}
2 changes: 1 addition & 1 deletion core/src/Ledger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ contract Ledger {
* @return The maximum amount of `asset()` that can be withdrawn
*/
function maxWithdraw(address owner) external view returns (uint256) {
return convertToAssets(this.maxRedeem(owner));
return convertToAssets(maxRedeem(owner));
}

/*//////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion core/src/libraries/constants/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ uint256 constant MAX_RATE = 706354;

/// @dev The default amount of Ether required to take on debt in a `Borrower`. The `Factory` can override this value
/// on a per-market basis.
uint216 constant DEFAULT_ANTE = 0.1 ether;
uint216 constant DEFAULT_ANTE = 0.01 ether;

/// @dev The default number of standard deviations of price movement used to determine probe prices for `Borrower`
/// solvency. The `Factory` can override this value on a per-market basis.
Expand Down

0 comments on commit 60ab139

Please sign in to comment.