chore: commit progress so far on test fixing
This commit is contained in:
@@ -127,10 +127,13 @@ contract BebopExecutor is IExecutor, IExecutorErrors, RestrictTransferFrom {
|
||||
partialFillOffset
|
||||
);
|
||||
|
||||
// Transfer tokens if needed
|
||||
// For ERC20 inputs, don't move tokens here. Bebop settlement pulls from the taker directly.
|
||||
// The router/harness will ensure the taker has the funds and has granted allowance to settlement.
|
||||
if (tokenIn != address(0)) {
|
||||
_transfer(address(this), transferType, tokenIn, givenAmount);
|
||||
// no-op
|
||||
}
|
||||
// For ETH (tokenIn == address(0)), don't transfer
|
||||
// The harness gives ETH to the taker, and Bebop settlement expects it to stay there
|
||||
|
||||
// Approve Bebop settlement to spend tokens if needed
|
||||
if (approvalNeeded && tokenIn != address(0)) {
|
||||
@@ -262,4 +265,14 @@ contract BebopExecutor is IExecutor, IExecutorErrors, RestrictTransferFrom {
|
||||
? account.balance
|
||||
: IERC20(token).balanceOf(account);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Allow receiving ETH for settlement calls that require ETH
|
||||
* This is needed when the executor handles native ETH swaps
|
||||
* In production, ETH typically comes from router or settlement contracts
|
||||
* In tests, it may come from EOA addresses via the test harness
|
||||
*/
|
||||
receive() external payable {
|
||||
// Allow ETH transfers for Bebop settlement functionality
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user