55 lines
1.2 KiB
Solidity
55 lines
1.2 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.20;
|
|
|
|
interface IComboHandler {
|
|
enum StepType {
|
|
BORROW,
|
|
SWAP,
|
|
REPAY,
|
|
PAY,
|
|
DEPOSIT,
|
|
WITHDRAW,
|
|
BRIDGE
|
|
}
|
|
|
|
enum ExecutionStatus {
|
|
PENDING,
|
|
IN_PROGRESS,
|
|
COMPLETE,
|
|
FAILED,
|
|
ABORTED
|
|
}
|
|
|
|
struct Step {
|
|
StepType stepType;
|
|
bytes data; // Encoded step-specific parameters
|
|
address target; // Target contract address (adapter or protocol)
|
|
uint256 value; // ETH value to send (if applicable)
|
|
}
|
|
|
|
struct StepReceipt {
|
|
uint256 stepIndex;
|
|
bool success;
|
|
bytes returnData;
|
|
uint256 gasUsed;
|
|
}
|
|
|
|
function executeCombo(
|
|
bytes32 planId,
|
|
Step[] calldata steps,
|
|
bytes calldata signature
|
|
) external returns (bool success, StepReceipt[] memory receipts);
|
|
|
|
function prepare(
|
|
bytes32 planId,
|
|
Step[] calldata steps
|
|
) external returns (bool prepared);
|
|
|
|
function commit(bytes32 planId) external returns (bool committed);
|
|
|
|
function abort(bytes32 planId) external;
|
|
|
|
function getExecutionStatus(bytes32 planId) external view returns (ExecutionStatus status);
|
|
}
|
|
|