Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Oct 18, 2023
1 parent a8f5517 commit cd8c88d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 39 deletions.
6 changes: 0 additions & 6 deletions contracts/test/ERC4626BaseStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ abstract contract ERC4626BaseStrategy is ERC4626 {
_decimals = IERC20Metadata(address(_asset)).decimals();

vault = _vault;
// // using approve since initialization is only called once
// IERC20(_asset).approve(_vault, type(uint256).max); // Give Vault unlimited access (might save gas)
}

/** @dev See {IERC20Metadata-decimals}. */
function decimals()
public
view
Expand All @@ -43,9 +40,6 @@ abstract contract ERC4626BaseStrategy is ERC4626 {
return _decimals;
}

// TODO: add roles (including vault)
// TODO: should we force invest and freeFunds to be in deposit and withdraw functions?

function invest() external virtual {}

function freeFunds(
Expand Down
28 changes: 0 additions & 28 deletions contracts/test/mocks/ERC4626/LiquidStrategy.sol

This file was deleted.

3 changes: 2 additions & 1 deletion contracts/test/mocks/ERC4626/LossyStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ contract ERC4626LossyStrategy is MockTokenizedStrategy {
int256 public withdrawingLoss;
uint256 public lockedFunds;
address public vault;

address public yieldSource;

constructor(
Expand All @@ -41,13 +40,15 @@ contract ERC4626LossyStrategy is MockTokenizedStrategy {
) MockTokenizedStrategy(_asset, _name, _management, _keeper) {
yieldSource = address(new YieldSource(_asset));
ERC20(_asset).safeApprove(yieldSource, type(uint256).max);
// So we can record losses when it happens.
strategyStorage().management = address(this);
vault = _vault;
}

// used to generate losses, accepts single arg to send losses to
function setLoss(address _target, uint256 _loss) external {
strategyStorage().asset.safeTransferFrom(yieldSource, _target, _loss);
// Record the loss
MockTokenizedStrategy(address(this)).report();
}

Expand Down
4 changes: 0 additions & 4 deletions contracts/test/mocks/ERC4626/MockTokenizedStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ contract MockTokenizedStrategy is TokenizedStrategy {
// Set decimals based off the `asset`.
S.decimals = ERC20(_asset).decimals();

// Default to an instant profit unlock period
S.profitMaxUnlockTime = 0;
// set to a 0% performance fee.
S.performanceFee = 0;
// Set last report to this block.
S.lastReport = uint128(block.timestamp);

Expand Down

0 comments on commit cd8c88d

Please sign in to comment.