Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieraykatz committed Oct 2, 2023
1 parent 8498cac commit 0224333
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions contracts/core/strategy/APStrategy_V1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {IStrategy} from "./IStrategy.sol";
import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";

abstract contract APStrategy_V1 is IStrategy, Pausable {

/*** CONSTNATS ***/
uint256 constant EXP_SCALE = 1e18;

Expand Down Expand Up @@ -54,7 +53,7 @@ abstract contract APStrategy_V1 is IStrategy, Pausable {
function unpause() external virtual onlyAdmin {
_unpause();
}

modifier nonZeroAmount(uint256 amt) {
if (amt == 0) revert ZeroAmount();
_;
Expand Down
8 changes: 4 additions & 4 deletions contracts/integrations/flux/FluxStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ contract FluxStrategy is APStrategy_V1, ReentrancyGuard {
/// @return yieldTokenAmt the qty of `config.yieldToken` that were yielded from the deposit action
function deposit(
uint256 amt
) external override payable whenNotPaused nonReentrant nonZeroAmount(amt) returns (uint256) {
) external payable override whenNotPaused nonReentrant nonZeroAmount(amt) returns (uint256) {
IERC20(config.baseToken).safeTransferFrom(_msgSender(), address(this), amt);
IERC20(config.baseToken).safeApprove(config.yieldToken, amt);
uint256 yieldTokens = _enterPosition(amt);
Expand All @@ -49,7 +49,7 @@ contract FluxStrategy is APStrategy_V1, ReentrancyGuard {
/// @return baseTokenAmt the qty of `config.baseToken` that are approved for transfer by msg.sender
function withdraw(
uint256 amt
) external override payable whenNotPaused nonReentrant nonZeroAmount(amt) returns (uint256) {
) external payable override whenNotPaused nonReentrant nonZeroAmount(amt) returns (uint256) {
if (!IFlux(config.yieldToken).transferFrom(_msgSender(), address(this), amt)) {
revert TransferFailed();
}
Expand All @@ -66,7 +66,7 @@ contract FluxStrategy is APStrategy_V1, ReentrancyGuard {
/// @dev This method expects that the `amt` provided is denominated in `baseToken`
/// @param amt the qty of the `baseToken` that should be checked for conversion rates
/// @return yieldTokenAmt the expected qty of `yieldToken` if this strategy received `amt` of `baseToken`
function previewDeposit(uint256 amt) external override view returns (uint256) {
function previewDeposit(uint256 amt) external view override returns (uint256) {
// Exchange Rate == (EXP_SCALE * USDC) / fUSDC
uint256 exRate = IFlux(config.yieldToken).exchangeRateStored();
// Expected fUSDC == (amtUSDC * EXP_SCALE / exRate)
Expand All @@ -77,7 +77,7 @@ contract FluxStrategy is APStrategy_V1, ReentrancyGuard {
/// @dev This method expects that the `amt` provided is denominated in `yieldToken`
/// @param amt the qty of the `yieldToken` that should be checked for conversion rates
/// @return yieldTokenAmt the expected qty of `baseToken` if this strategy received `amt` of `yieldToken`
function previewWithdraw(uint256 amt) external override view returns (uint256) {
function previewWithdraw(uint256 amt) external view override returns (uint256) {
// Exchange Rate == (EXP_SCALE * USDC) / fUSDC
uint256 exRate = IFlux(config.yieldToken).exchangeRateStored();
// Expected USDC == (amtfUSDC * exRate) / EXP_SCALE
Expand Down

0 comments on commit 0224333

Please sign in to comment.