UserSettings
Inherits: IUserSettings, Multicall, ReentrancyGuard
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
nonReentrant;
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 nonReentrant;
Parameters
| Name | Type | Description |
|---|---|---|
amount | UD60x18 | The users authorized cost in the ERC20 Native token (WETH, WFTM, etc) (18 decimals) |