Revert "ENG-3406: Add new bytes parameter to swap"

This commit is contained in:
Pierre
2024-08-08 22:24:35 +02:00
committed by GitHub
parent 9ef9782451
commit b3e3672172
13 changed files with 46 additions and 114 deletions

View File

@@ -56,8 +56,7 @@ contract AngleAdapter is ISwapAdapter {
address sellToken,
address buyToken,
OrderSide side,
uint256 specifiedAmount,
bytes32
uint256 specifiedAmount
) external returns (Trade memory trade) {
if (specifiedAmount == 0) {
return trade;
@@ -224,7 +223,7 @@ contract AngleAdapter is ISwapAdapter {
interface IAgToken is IERC20 {
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
MINTER ROLE ONLY FUNCTIONS
MINTER ROLE ONLY FUNCTIONS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
/// @notice Lets a whitelisted contract mint agTokens
@@ -255,7 +254,7 @@ interface IAgToken is IERC20 {
function burnSelf(uint256 amount, address burner) external;
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
TREASURY ONLY FUNCTIONS
TREASURY ONLY FUNCTIONS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
/// @notice Adds a minter in the contract
@@ -275,7 +274,7 @@ interface IAgToken is IERC20 {
function setTreasury(address _treasury) external;
/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
EXTERNAL FUNCTIONS
EXTERNAL FUNCTIONS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
/// @notice Checks whether an address has the right to mint agTokens

View File

@@ -118,12 +118,10 @@ contract BalancerV2SwapAdapter is ISwapAdapter {
address sellToken,
address buyToken,
OrderSide side,
uint256 specifiedAmount,
bytes32 data
uint256 specifiedAmount
) external override returns (Trade memory trade) {
uint256 sellAmount;
IVault.SwapKind kind;
bool reduceFee = abi.decode(abi.encodePacked(data), (bool));
uint256 limit; // TODO set this slippage limit properly
if (side == OrderSide.Sell) {
kind = IVault.SwapKind.GIVEN_IN;

View File

@@ -99,8 +99,7 @@ contract EtherfiAdapter is ISwapAdapter {
address sellToken,
address buyToken,
OrderSide side,
uint256 specifiedAmount,
bytes32
uint256 specifiedAmount
)
external
override

View File

@@ -59,8 +59,7 @@ contract IntegralSwapAdapter is ISwapAdapter {
address sellToken,
address buyToken,
OrderSide side,
uint256 specifiedAmount,
bytes32
uint256 specifiedAmount
) external override returns (Trade memory trade) {
if (specifiedAmount == 0) {
return trade;

View File

@@ -54,7 +54,6 @@ interface ISwapAdapter is ISwapAdapterTypes {
* @param buyToken The token being bought.
* @param side The side of the trade (Sell or Buy).
* @param specifiedAmount The amount to be traded.
* @param data Additional arbitrary data for the swap.
* @return trade Trade struct representing the executed trade.
*/
function swap(
@@ -62,8 +61,7 @@ interface ISwapAdapter is ISwapAdapterTypes {
address sellToken,
address buyToken,
OrderSide side,
uint256 specifiedAmount,
bytes32 data
uint256 specifiedAmount
) external returns (Trade memory trade);
/// @notice Retrieves the limits for each token.

View File

@@ -22,8 +22,7 @@ contract TemplateSwapAdapter is ISwapAdapter {
address sellToken,
address buyToken,
OrderSide side,
uint256 specifiedAmount,
bytes32
uint256 specifiedAmount
) external returns (Trade memory trade) {
revert NotImplemented("TemplateSwapAdapter.swap");
}

View File

@@ -66,8 +66,7 @@ contract UniswapV2SwapAdapter is ISwapAdapter {
address sellToken,
address buyToken,
OrderSide side,
uint256 specifiedAmount,
bytes32
uint256 specifiedAmount
) external override returns (Trade memory trade) {
if (specifiedAmount == 0) {
return trade;