-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding the swapper contract back (#15)
* adding the swapper contract back * changing with new commands
- Loading branch information
Showing
6 changed files
with
119 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity 0.8.17; | ||
|
||
import "@openzeppelin/contracts/interfaces/IERC20.sol"; | ||
|
||
/// @title ISwapper | ||
/// @author Angle Core Team | ||
/// @notice Interface for a generic swapper, that supports swaps of higher complexity than aggregators | ||
interface ISwapper { | ||
function swap( | ||
IERC20 inToken, | ||
IERC20 outToken, | ||
address outTokenRecipient, | ||
uint256 outTokenOwed, | ||
uint256 inTokenObtained, | ||
bytes memory data | ||
) external; | ||
} |
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,22 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity 0.8.17; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | ||
|
||
contract MockSwapper { | ||
using SafeERC20 for IERC20; | ||
|
||
function swap( | ||
IERC20 inToken, | ||
IERC20 outToken, | ||
address outTokenRecipient, | ||
uint256 outTokenOwed, | ||
uint256 inTokenObtained, | ||
bytes memory | ||
) external { | ||
inToken.safeTransferFrom(msg.sender, address(this), inTokenObtained); | ||
outToken.safeTransfer(outTokenRecipient, outTokenOwed); | ||
} | ||
} |
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