SwapModule
Inherits: AccessManagedUpgradeable, MakinaContext, ISwapModule
Constants
SwapModuleStorageLocation
bytes32 private constant SwapModuleStorageLocation =
0x2964c0594a3da0414db90b8d5f6c112accd22109f0399a98ea4b239ff3f7a200;Functions
_getSwapModuleStorage
function _getSwapModuleStorage() private pure returns (SwapModuleStorage storage $);Returns
| Name | Type | Description |
|---|---|---|
| $ | SwapModuleStorage |
constructor
constructor(address _registry) MakinaContext(_registry);Parameters
| Name | Type | Description |
|---|---|---|
| _registry | address |
initialize
function initialize(address initialAuthority) external initializer;Parameters
| Name | Type | Description |
|---|---|---|
| initialAuthority | address |
getSwapperTargets
Returns approval and execution targets for a given swapper ID.
function getSwapperTargets(uint16 swapperId)
external
view
override
returns (address approvalTarget, address executionTarget);Parameters
| Name | Type | Description |
|---|---|---|
| swapperId | uint16 | The swapper ID. |
Returns
| Name | Type | Description |
|---|---|---|
| approvalTarget | address | The approval target. |
| executionTarget | address | The execution target. |
swap
Swaps tokens using a given swapper.
function swap(SwapOrder calldata order) external override returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| order | SwapOrder | The swap order object. |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
setSwapperTargets
Sets approval and execution targets for a given swapper ID.
function setSwapperTargets(uint16 swapperId, address approvalTarget, address executionTarget)
external
override
restricted;Parameters
| Name | Type | Description |
|---|---|---|
| swapperId | uint16 | The swapper ID. |
| approvalTarget | address | The approval target. |
| executionTarget | address | The execution target. |
Structs
SwapModuleStorage
Note:
- storage-location: erc7201:makina.storage.SwapModule
struct SwapModuleStorage {
mapping(uint16 swapperId => SwapperTargets targets) _swapperTargets;
}Properties
| Name | Type | Description |
|---|---|---|
| _swapperTargets | mapping(uint16 swapperId => SwapperTargets targets) |