improve: Optimize sell function of Angle adapter

This commit is contained in:
Ale personal
2024-03-27 15:24:15 +01:00
parent 2d21f988dd
commit 81106d75f5

View File

@@ -183,12 +183,10 @@ contract AngleAdapter is ISwapAdapter {
{
address sellTokenAddress = address(sellToken);
address buyTokenAddress = address(buyToken);
calculatedAmount =
transmuter.quoteIn(amount, sellTokenAddress, buyTokenAddress);
sellToken.transferFrom(msg.sender, address(this), amount);
sellToken.approve(address(transmuter), amount);
transmuter.swapExactInput(
calculatedAmount = transmuter.swapExactInput(
amount, 0, sellTokenAddress, buyTokenAddress, msg.sender, 0
);
}