Index Coop Resource Center
  • Welcome to The Index Coop.
  • Products
    • Trade
      • Index Coop Leverage Suite
      • Leverage Token Parameters
      • Leverage Token Keepers
      • Trading Interface Guide
      • Ripcord Guide
    • Earn
      • High Yield ETH Index (hyETH)
      • Interest Compounding ETH Index (icETH)
    • Asset Management
      • Product Development Process
      • Product Revenue Tokens (PRTs)
    • Legacy Products
      • How to Redeem Legacy Products
      • DeFi Pulse Index (DPI)
      • Bankless BED Index (BED)
      • Metaverse Index (MVI)
      • Diversified Staked ETH Index (dsETH)
      • Index Coop CoinDesk ETH Trend Index (cdETI)
      • Index Coop Large Cap Index (ic21)
      • ETH 2x Flexible Leverage Index (ETH2x-FLI)
      • BTC 2x Flexible Leverage Index (BTC2x-FLI)
      • Flexible Leverage Index- Polygon (FLI-Ps)
        • ETH 2x Flexible Leverage Index (ETH2x-FLI-P)
        • Inverse ETH Flexible Leverage Index (iETH-FLI-P)
        • BTC 2x Flexible Leverage Index (BTC2x-FLI-P)
        • Inverse BTC Flexible Leverage Index (iBTC-FLI-P)
        • MATIC 2x Flexible Leverage Index (MATIC2x-FLI-P)
        • Inverse MATIC Flexible Leverage Index (iMATIC-FLI-P)
      • Market Neutral Yield ETH (MNYe)
      • Bankless DeFi Innovation Index (GMI)
      • Data Economy Index (DATA)
      • Legacy Contract Addresses
      • Gitcoin Staked ETH Index (gtcETH)
  • Protocol
    • Index Protocol
      • Core Contracts
        • Set Token
        • Set Token Creator
        • Controller
        • Integration Registry
        • Price Oracle
        • Set Valuer
      • Modules
        • Basic Issuance Module
        • Debt Issuance Module v2
        • NAV Issuance Module
        • Trade Module
        • Streaming Fee Module
        • Wrap Module
        • Airdrop Module
        • Claim Module
        • Governance Module
        • Compound Leverage Module
        • Aave v2 Leverage Module
        • Aave v3 Leverage Module
        • Auction Rebalance Module
    • Set Protocol v2
    • Security and Audits
    • Contract Verification
    • Programmatic Redemptions
  • Resources
    • Governance
      • $INDEX - Governance Token
      • Index Improvement Proposals (IIP) Overview
        • IIP Step-by-Step
        • Governance Representatives
        • IIP Template
        • Product (DG) Template
      • Meta-Governance
      • Delegation
    • Data & Analytics
    • Multisigs
    • Press Kit
Powered by GitBook
On this page
  • Select View Methods
  • manager()
  • getModules()
  • getPositions()
  • getComponents()
  • getDefaultPositionRealUnit()
  • getExternalPositionRealUnit()
  • getTotalComponentRealUnits()
  1. Protocol
  2. Index Protocol
  3. Core Contracts

Set Token

The Set Token contract is an ERC20 token contract that allows privileged modules to make modifications to its positions and invoke function calls from the SetToken.

Select View Methods

manager()

function manager() view returns (address)

Returns the manager of the SetToken.

Return Name

Type

Description

manager

address

Address of the SetToken's manager

getModules()

function getModules() external view returns (address[] memory)

Returns the list of modules a SetToken has enabled.

Return Name

Type

Description

modules

address[]

List of enabled modules

getPositions()

function getPositions() public view returns (ISetToken.Position[] memory)

Retrieves the positions in an array from the SetToken. A position definition is as follows:

    /**
     * The base definition of a SetToken Position
     *
     * @param component           Address of token in the Position
     * @param module              If not in default state, the address of associated module
     * @param unit                Each unit is the # of components per 10^18 of a SetToken
     * @param positionState       The type of position denoted as a uint8
     * @param data                Arbitrary data
     */
    struct Position {
        address component;
        address module;
        int256 unit;
        uint8 positionState;
        bytes data;
    }

Return Name

Type

Description

positions

Position[]

List of positions

getComponents()

function getComponents() public view returns (address[] memory)

Returns the list of component assets in the SetToken.

Return Name

Type

Description

components

address[]

List of components

getDefaultPositionRealUnit()

function getDefaultPositionRealUnit(address _component) external view returns (int256)

Returns the component real unit of a Default position.

Parameter Name

Type

Description

_component

address

Address of the component asset

Return Name

Type

Description

componentUnit

int256[]

Position real unit of the component (signed integer)

getExternalPositionRealUnit()

function getExternalPositionRealUnit(address _component, address _positionModule) public view returns(int256)

Returns the component real unit of an External position.

Parameter Name

Type

Description

_component

address

Address of the component asset

_positionModule

address

Module the external position is associated with

Return Name

Type

Description

componentUnit

int256[]

Position real unit of the component (signed integer)

getTotalComponentRealUnits()

function getTotalComponentRealUnits(address _component) external view returns(int256)‌

Returns the total component real units of a position, summing the Default and External.

Parameter Name

Type

Description

_component

address

Address of the component asset

Return Name

Type

Description

componentUnit

int256[]

Position real unit of the component (signed integer)

PreviousCore ContractsNextSet Token Creator

Last updated 1 year ago