IUserSettings
Inherits: IMulticall
Functions
isActionAuthorized
Returns true if operator is authorized to perform action for user
function isActionAuthorized(address user, address operator, Action action) external view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The user who grants authorization |
operator | address | The operator who is granted authorization |
action | Action | The action operator is authorized to perform |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | True if operator is authorized to perform action for user |
getActionAuthorization
Returns the actions and their corresponding authorization states. If the state of an action is true,
indexed enum in Action is omitted from actions.
function getActionAuthorization(address user, address operator)
external
view
returns (Action[] memory actions, bool[] memory authorization);
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The user who grants authorization |
operator | address | The operator who is granted authorization |
Returns
| Name | Type | Description |
|---|---|---|
actions | Action[] | All available actions a user may grant authorization to operator for |
authorization | bool[] | The authorization states of each action |
setActionAuthorization
Sets the authorization state for each action an operator may perform on behalf of user. actions
must be indexed in the same order as their corresponding authorization state.
function setActionAuthorization(address operator, Action[] memory actions, bool[] memory authorization) external;
Parameters
| Name | Type | Description |
|---|---|---|
operator | address | The operator who is granted authorization |
actions | Action[] | The actions to modify authorization state for |
authorization | bool[] | The authorization states to set for each action |
getAuthorizedCost
Returns the users authorized cost in the ERC20 Native token (WETH, WFTM, etc) used in conjunction with
exerciseFor, settleFor, and settlePositionFor`
function getAuthorizedCost(address user) external view returns (UD60x18);
Returns
| Name | Type | Description |
|---|---|---|
<none> | UD60x18 | The users authorized cost in the ERC20 Native token (WETH, WFTM, etc) (18 decimals) |
setAuthorizedCost
Sets the users authorized cost in the ERC20 Native token (WETH, WFTM, etc) used in conjunction with
exerciseFor, settleFor, and settlePositionFor
function setAuthorizedCost(UD60x18 amount) external;
Parameters
| Name | Type | Description |
|---|---|---|
amount | UD60x18 | The users authorized cost in the ERC20 Native token (WETH, WFTM, etc) (18 decimals) |
Events
ActionAuthorizationUpdated
event ActionAuthorizationUpdated(
address indexed user, address indexed operator, Action[] actions, bool[] authorization
);
AuthorizedCostUpdated
event AuthorizedCostUpdated(address indexed user, UD60x18 amount);
Errors
UserSettings__InvalidAction
error UserSettings__InvalidAction();
UserSettings__InvalidArrayLength
error UserSettings__InvalidArrayLength();
Enums
Action
Enumeration representing different actions which user may authorize an operator to perform
enum Action {
__,
Annihilate,
Exercise,
Settle,
SettlePosition,
WriteFrom
}