BaseOftMessageExecutor
Inherits: IOftMessageExecutor
Title: BaseOftMessageExecutor
Author: Malda Protocol
Base implementation for OFT message executors used via delegatecall by bridges.
Functions
processUncomposed
Processes stored/uncomposed messages for a market by falling back to underlying.
function processUncomposed(address market, address underlying, address bridgeContract)
external
payable
virtual
override;
Parameters
| Name | Type | Description |
|---|---|---|
market | address | The market address. |
underlying | address | The underlying token address. |
bridgeContract | address | The bridge contract used for OFT operations. |
executeCompose
Executes a compose step for a market by falling back to underlying.
function executeCompose(address market, address underlying, address bridgeContract)
external
payable
virtual
override;
Parameters
| Name | Type | Description |
|---|---|---|
market | address | The market address. |
underlying | address | The underlying token address. |
bridgeContract | address | The bridge contract used for OFT operations. |
_pullFromRebalancer
Pulls tokens from the rebalancer.
function _pullFromRebalancer(address underlying, uint256 amount, address rebalancer) internal;
Parameters
| Name | Type | Description |
|---|---|---|
underlying | address | The underlying token address. |
amount | uint256 | The amount of tokens to pull. |
rebalancer | address | The rebalancer address. |
_approve
Approves tokens to a spender.
function _approve(address token, address spender, uint256 amount) internal;
Parameters
| Name | Type | Description |
|---|---|---|
token | address | The token address. |
spender | address | The spender address. |
amount | uint256 | The amount of tokens to approve. |
_sendOFT
Sends tokens via OFT.
function _sendOFT(address oft, SendParam calldata params, MessagingFee calldata fees, address refundAddress)
internal
returns (MessagingReceipt memory receipt);
Parameters
| Name | Type | Description |
|---|---|---|
oft | address | The OFT address. |
params | SendParam | The send parameters. |
fees | MessagingFee | The messaging fees. |
refundAddress | address | The refund address. |
Returns
| Name | Type | Description |
|---|---|---|
receipt | MessagingReceipt | The messaging receipt. |
_fallbackToUnderlying
Falls back to underlying if the bridge contract is not the underlying.
function _fallbackToUnderlying(address market, address underlying, address bridgeContract) internal;
Parameters
| Name | Type | Description |
|---|---|---|
market | address | The market address. |
underlying | address | The underlying token address. |
bridgeContract | address | The bridge contract used for OFT operations. |
_verifyMinted
Verifies the minted tokens.
function _verifyMinted(address oft, uint256 required) internal view;
Parameters
| Name | Type | Description |
|---|---|---|
oft | address | The OFT address. |
required | uint256 | The required amount of tokens. |
Errors
Executor_NoOft
error Executor_NoOft();
Executor_AmountMismatch
error Executor_AmountMismatch();
Executor_WrongUnderlying
error Executor_WrongUnderlying();
Executor_NotRebalancer
error Executor_NotRebalancer();