-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(SwapAndLock): lock yfi via CoveYFI instead of directly w/ YSD (
#297) * refactor(SwapAndLock): lock yfi via CoveYFI instead of directly w/ YSD * refactor: change lockYfi function name to convertToCoveYfi * fix: deployment script params update * chore: revert unnecessary change --------- Co-authored-by: Sunil Srivatsa <[email protected]>
- Loading branch information
1 parent
08dd75f
commit 637e7ed
Showing
10 changed files
with
77 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.18; | ||
|
||
import { ERC20Mock } from "@openzeppelin/contracts/mocks/ERC20Mock.sol"; | ||
import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; | ||
|
||
contract MockCoveYFI is ERC20Mock { | ||
address private immutable _YFI; | ||
|
||
constructor(address yfi) ERC20Mock() { | ||
_YFI = yfi; | ||
} | ||
|
||
function deposit(uint256 balance) external returns (uint256) { | ||
return _deposit(balance, msg.sender); | ||
} | ||
|
||
function deposit(uint256 balance, address receiver) external returns (uint256) { | ||
return _deposit(balance, receiver); | ||
} | ||
|
||
function _deposit(uint256 balance, address receiver) internal returns (uint256) { | ||
_mint(receiver, balance); | ||
IERC20(_YFI).transferFrom(msg.sender, address(this), balance); | ||
return balance; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters