IUserSettings

Git Source

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

NameTypeDescription
useraddressThe user who grants authorization
operatoraddressThe operator who is granted authorization
actionActionThe action operator is authorized to perform

Returns

NameTypeDescription
<none>boolTrue 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

NameTypeDescription
useraddressThe user who grants authorization
operatoraddressThe operator who is granted authorization

Returns

NameTypeDescription
actionsAction[]All available actions a user may grant authorization to operator for
authorizationbool[]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

NameTypeDescription
operatoraddressThe operator who is granted authorization
actionsAction[]The actions to modify authorization state for
authorizationbool[]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

NameTypeDescription
<none>UD60x18The 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

NameTypeDescription
amountUD60x18The 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
}