fix _computeHopTarget for otc subcalls
This commit is contained in:
parent
f32e834e11
commit
a0485ca3e0
@ -544,7 +544,11 @@ contract MultiplexFeature is
|
|||||||
// is executed, so we the target is the address encoded
|
// is executed, so we the target is the address encoded
|
||||||
// in the subcall data.
|
// in the subcall data.
|
||||||
(target, ) = abi.decode(subcall.data, (address, bytes));
|
(target, ) = abi.decode(subcall.data, (address, bytes));
|
||||||
} else if (subcall.id == MultiplexSubcall.UniswapV3 || subcall.id == MultiplexSubcall.BatchSell) {
|
} else if (
|
||||||
|
subcall.id == MultiplexSubcall.UniswapV3 ||
|
||||||
|
subcall.id == MultiplexSubcall.BatchSell ||
|
||||||
|
subcall.id == MultiplexSubcall.OTC
|
||||||
|
) {
|
||||||
// UniswapV3 uses a callback to pull in the tokens being
|
// UniswapV3 uses a callback to pull in the tokens being
|
||||||
// sold to it. The callback implemented in `UniswapV3Feature`
|
// sold to it. The callback implemented in `UniswapV3Feature`
|
||||||
// can either:
|
// can either:
|
||||||
@ -570,13 +574,6 @@ contract MultiplexFeature is
|
|||||||
} else {
|
} else {
|
||||||
target = address(this);
|
target = address(this);
|
||||||
}
|
}
|
||||||
} else if (subcall.id == MultiplexSubcall.OTC) {
|
|
||||||
//on the first call we want to pull tokens from the taker, subsequent calls should use the EP balance
|
|
||||||
if (i == 0) {
|
|
||||||
target = params.payer;
|
|
||||||
} else {
|
|
||||||
target = address(this);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
revert("MultiplexFeature::_computeHopTarget/INVALID_SUBCALL");
|
revert("MultiplexFeature::_computeHopTarget/INVALID_SUBCALL");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user