Skip to content

Commit

Permalink
fix: review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
frontier159 committed Oct 31, 2024
1 parent 666c959 commit 1a2724c
Show file tree
Hide file tree
Showing 4 changed files with 22,269 additions and 22,860 deletions.
12 changes: 12 additions & 0 deletions protocol/contracts/interfaces/external/sky/IDaiUsds.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pragma solidity 0.8.20;
// SPDX-License-Identifier: AGPL-3.0-or-later
// Temple (interfaces/sky/IDaiUsds.sol)

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

interface IDaiUsds {
function daiToUsds(address usr, uint256 wad) external;
function usdsToDai(address usr, uint256 wad) external;
function dai() external view returns (IERC20);
function usds() external view returns (IERC20);
}
12 changes: 3 additions & 9 deletions protocol/contracts/v2/strategies/SkyFarmBaseStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@ import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IERC4626 } from "@openzeppelin/contracts/interfaces/IERC4626.sol";

import { ITempleBaseStrategy } from "contracts/interfaces/v2/strategies/ITempleBaseStrategy.sol";
import { IDaiUsds } from "contracts/interfaces/external/sky/IDaiUsds.sol";
import { AbstractStrategy } from "contracts/v2/strategies/AbstractStrategy.sol";
import { CommonEventsAndErrors } from "contracts/common/CommonEventsAndErrors.sol";

interface DaiUsds {
function daiToUsds(address usr, uint256 wad) external;
function usdsToDai(address usr, uint256 wad) external;
function dai() external view returns (IERC20);
function usds() external view returns (IERC20);
}

/**
* @title DAI to Origami SKY Farm - Base Strategy
* @notice Deposit idle DAI from the Treasury Reserve Vaults into the Origami sUSDS+s ERC4626 vault
Expand All @@ -36,7 +30,7 @@ contract SkyFarmBaseStrategy is AbstractStrategy, ITempleBaseStrategy {
IERC4626 public immutable usdsVaultToken;

/// @notice Maker/Sky provided contract to convert DAI<-->USDS 1:1
DaiUsds public immutable daiToUsds;
IDaiUsds public immutable daiToUsds;

event DaiDeposited(uint256 amount);
event DaiWithdrawn(uint256 amount);
Expand All @@ -50,7 +44,7 @@ contract SkyFarmBaseStrategy is AbstractStrategy, ITempleBaseStrategy {
address _daiToUsds
) AbstractStrategy(_initialRescuer, _initialExecutor, _strategyName, _treasuryReservesVault) {
usdsVaultToken = IERC4626(_usdsVaultToken);
daiToUsds = DaiUsds(_daiToUsds);
daiToUsds = IDaiUsds(_daiToUsds);
daiToken = daiToUsds.dai();
usdsToken = daiToUsds.usds();

Expand Down
Loading

0 comments on commit 1a2724c

Please sign in to comment.