feat: Support Curve ETH
Curve pools use a different address from ETH (native token) - Pass Chain into the SwapEncoderBuilder and SwapEncoder - Add native_token_curve_address and native_token_address to CurveSwapEncoder - Added integration test for this curve case --- don't change below this line --- ENG-4306 Took 1 hour 4 minutes Took 11 seconds
This commit is contained in:
@@ -50,7 +50,7 @@ contract CurveExecutorTest is Test, Constants {
|
||||
function setUp() public {
|
||||
uint256 forkBlock = 22031795;
|
||||
vm.createSelectFork(vm.rpcUrl("mainnet"), forkBlock);
|
||||
curveExecutorExposed = new CurveExecutorExposed(ETH_ADDR);
|
||||
curveExecutorExposed = new CurveExecutorExposed(ETH_ADDR_FOR_CURVE);
|
||||
metaRegistry = MetaRegistry(CURVE_META_REGISTRY);
|
||||
}
|
||||
|
||||
@@ -105,7 +105,8 @@ contract CurveExecutorTest is Test, Constants {
|
||||
uint256 amountIn = 1 ether;
|
||||
deal(address(curveExecutorExposed), amountIn);
|
||||
|
||||
bytes memory data = _getData(ETH_ADDR, STETH_ADDR, STETH_POOL, 1);
|
||||
bytes memory data =
|
||||
_getData(ETH_ADDR_FOR_CURVE, STETH_ADDR, STETH_POOL, 1);
|
||||
|
||||
uint256 amountOut = curveExecutorExposed.swap(amountIn, data);
|
||||
|
||||
@@ -203,7 +204,8 @@ contract CurveExecutorTest is Test, Constants {
|
||||
uint256 initialBalance = address(curveExecutorExposed).balance; // this address already has some ETH assigned to it
|
||||
deal(XYO_ADDR, address(curveExecutorExposed), amountIn);
|
||||
|
||||
bytes memory data = _getData(XYO_ADDR, ETH_ADDR, ETH_XYO_POOL, 2);
|
||||
bytes memory data =
|
||||
_getData(XYO_ADDR, ETH_ADDR_FOR_CURVE, ETH_XYO_POOL, 2);
|
||||
|
||||
uint256 amountOut = curveExecutorExposed.swap(amountIn, data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user