DelegateApproval

Functions

initialize

  function initialize(
  ) external

approve

  function approve(
    address delegate,
    uint8 actions
  ) external

Parameters:

NameTypeDescription

delegate

address

The address of delegate

actions

uint8

The actions to be approved

revoke

  function revoke(
    address delegate,
    uint8 actions
  ) external

Parameters:

NameTypeDescription

delegate

address

The address of delegate

actions

uint8

The actions to be revoked

getClearingHouseOpenPositionAction

  function getClearingHouseOpenPositionAction(
  ) external returns (uint8)

Return Values:

NameTypeDescription

action

uint8

The value of action _CLEARINGHOUSE_OPENPOSITION

getClearingHouseAddLiquidityAction

  function getClearingHouseAddLiquidityAction(
  ) external returns (uint8)

Return Values:

NameTypeDescription

action

uint8

The value of action _CLEARINGHOUSE_ADDLIQUIDITY

getClearingHouseRemoveLiquidityAction

  function getClearingHouseRemoveLiquidityAction(
  ) external returns (uint8)

Return Values:

NameTypeDescription

action

uint8

The value of action _CLEARINGHOUSE_REMOVELIQUIDITY

getApprovedActions

  function getApprovedActions(
    address trader,
    address delegate
  ) external returns (uint8)

Parameters:

NameTypeDescription

trader

address

The address of trader

delegate

address

The address of delegate

Return Values:

NameTypeDescription

actions

uint8

The approved actions

hasApprovalFor

  function hasApprovalFor(
    address trader,
    address delegate,
    uint8 actions
  ) external returns (bool)

Parameters:

NameTypeDescription

trader

address

The address of trader

delegate

address

The address of delegate

actions

uint8

The actions to be checked

Return Values:

NameTypeDescription

true

bool

if delegate is allowed to perform each actions for trader, otherwise false

canOpenPositionFor

  function canOpenPositionFor(
    address trader,
    address delegate
  ) external returns (bool)

Parameters:

NameTypeDescription

trader

address

The address of trader

delegate

address

The address of delegate

Return Values:

NameTypeDescription

true

bool

if delegate can open position for trader, otherwise false

canAddLiquidityFor

  function canAddLiquidityFor(
    address trader,
    address delegate
  ) external returns (bool)

Parameters:

NameTypeDescription

trader

address

The address of trader

delegate

address

The address of delegate

Return Values:

NameTypeDescription

true

bool

if delegate can add liquidity for trader, otherwise false

canRemoveLiquidityFor

  function canRemoveLiquidityFor(
    address trader,
    address delegate
  ) external returns (bool)

Parameters:

NameTypeDescription

trader

address

The address of trader

delegate

address

The address of delegate

Return Values:

NameTypeDescription

true

bool

if delegate can remove liquidity for trader, otherwise false

Last updated