Perp v2
Perp v2
  • About Perpetual Protocol
    • Social Links
    • Governance
    • v2 Era Ecosystem
    • PERP Token
  • Terms of Service
  • General
    • Wallets
    • Transfering Assets
    • Deposit & Withdrawal
    • Perpetual + Uniswap
    • FAQs
    • Guides
    • Legacy Reward Programs
    • Security
  • Hot Tub
  • Trading on Perp v2
    • How It Works
    • UI Overview
    • Perpetual Futures Basics
    • Trading Quick-start
    • Opening and Closing Positions
    • Account Value & More
    • Funding Payments
    • Order Types
    • Trading Fees and Gas Fees
    • Managing Risk
    • Multi-collateral
    • More docs
  • Providing Liquidity
    • Basics
    • Introduction to Maker UI
    • Add / Remove Liquidity
    • Estimated Fees and Rewards APR
    • More on LPing
    • Tools for LPs
  • Perp v2 Specs
  • Developer Docs
    • Developer FAQs
    • Source Code
    • Protocol Attributes
    • Contract guide
      • AccountBalance
      • BaseToken
      • ClearingHouse
      • CollateralManager
      • DelegateApproval
      • Exchange
      • InsuranceFund
      • MarketRegistry
      • OrderBook
      • QuoteToken
      • Vault
      • VirtualToken
    • Interface Contracts
      • IAccountBalance
      • IBaseToken
      • IClearingHouse
      • IClearingHouseConfig
      • IClearingHouseConfigEvent
      • ICollateralManager
      • IDelegateApproval
      • IERC20Metadata
      • IExchange
      • IIndexPrice
      • IInsuranceFund
      • IMarketRegistry
      • IOrderBook
      • IVault
      • IVirtualToken
    • Integration guide
    • Dev tools
Powered by GitBook
On this page

Was this helpful?

  1. Developer Docs
  2. Contract guide

DelegateApproval

Last updated 1 year ago

Was this helpful?

Functions

initialize

  function initialize(
  ) external

approve

  function approve(
    address delegate,
    uint8 actions
  ) external

Parameters:

Name
Type
Description

delegate

address

The address of delegate

actions

uint8

The actions to be approved

revoke

  function revoke(
    address delegate,
    uint8 actions
  ) external

Parameters:

Name
Type
Description

delegate

address

The address of delegate

actions

uint8

The actions to be revoked

  function getClearingHouseOpenPositionAction(
  ) external returns (uint8)
Name
Type
Description

action

uint8

The value of action _CLEARINGHOUSE_OPENPOSITION

  function getClearingHouseAddLiquidityAction(
  ) external returns (uint8)
Name
Type
Description

action

uint8

The value of action _CLEARINGHOUSE_ADDLIQUIDITY

  function getClearingHouseRemoveLiquidityAction(
  ) external returns (uint8)
Name
Type
Description

action

uint8

The value of action _CLEARINGHOUSE_REMOVELIQUIDITY

  function getApprovedActions(
    address trader,
    address delegate
  ) external returns (uint8)
Name
Type
Description

trader

address

The address of trader

delegate

address

The address of delegate

Name
Type
Description

actions

uint8

The approved actions

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

trader

address

The address of trader

delegate

address

The address of delegate

actions

uint8

The actions to be checked

Name
Type
Description

true

bool

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

  function canOpenPositionFor(
    address trader,
    address delegate
  ) external returns (bool)
Name
Type
Description

trader

address

The address of trader

delegate

address

The address of delegate

Name
Type
Description

true

bool

if delegate can open position for trader, otherwise false

  function canAddLiquidityFor(
    address trader,
    address delegate
  ) external returns (bool)
Name
Type
Description

trader

address

The address of trader

delegate

address

The address of delegate

Name
Type
Description

true

bool

if delegate can add liquidity for trader, otherwise false

  function canRemoveLiquidityFor(
    address trader,
    address delegate
  ) external returns (bool)
Name
Type
Description

trader

address

The address of trader

delegate

address

The address of delegate

Name
Type
Description

true

bool

if delegate can remove liquidity for trader, otherwise false

getClearingHouseOpenPositionAction

Return Values:

getClearingHouseAddLiquidityAction

Return Values:

getClearingHouseRemoveLiquidityAction

Return Values:

getApprovedActions

Parameters:

Return Values:

hasApprovalFor

Parameters:

Return Values:

canOpenPositionFor

Parameters:

Return Values:

canAddLiquidityFor

Parameters:

Return Values:

canRemoveLiquidityFor

Parameters:

Return Values:

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​