fixed issue where we werent using delegatecall
This commit is contained in:
@@ -307,7 +307,7 @@ contract FillQuoteTransformer is Transformer {
|
||||
if (success) {
|
||||
results.makerTokenBoughtAmount = abi.decode(resultData, (uint256));
|
||||
results.takerTokenSoldAmount = takerTokenFillAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fill a single limit order.
|
||||
|
@@ -50,7 +50,17 @@ contract EthereumBridgeAdapter is IBridgeAdapter {
|
||||
) public override returns (uint256 boughtAmount) {
|
||||
uint128 protocolId = uint128(uint256(order.source) >> 128);
|
||||
if (protocolId < ADAPTER_1_LENGTH) {
|
||||
return adapter1.trade(order, sellToken, buyToken, sellAmount);
|
||||
(bool success, bytes memory resultData) = address(adapter1).delegatecall(abi.encodeWithSelector(
|
||||
IBridgeAdapter.trade.selector,
|
||||
order,
|
||||
sellToken,
|
||||
buyToken,
|
||||
sellAmount
|
||||
)
|
||||
);
|
||||
if (success) {
|
||||
return abi.decode(resultData, (uint256));
|
||||
}
|
||||
}
|
||||
revert("unknown protocolId");
|
||||
}
|
||||
|
@@ -82,6 +82,16 @@ contract EthereumBridgeAdapterGroup1 is
|
||||
MixinUniswap(weth)
|
||||
{}
|
||||
|
||||
|
||||
// function trade(
|
||||
// BridgeOrder memory order,
|
||||
// IERC20TokenV06 sellToken,
|
||||
// IERC20TokenV06 buyToken,
|
||||
// uint256 sellAmount
|
||||
// ) public override returns (uint256 boughtAmount) {
|
||||
// (boughtAmount, ) = _trade(order, sellToken, buyToken, sellAmount, false);
|
||||
// }
|
||||
|
||||
function _trade(
|
||||
BridgeOrder memory order,
|
||||
IERC20TokenV06 sellToken,
|
||||
|
Reference in New Issue
Block a user