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 Methods
  • wrap()
  • wrapWithEther()
  • unwrap()
  • unwrapWithEther()
  • initialize()
  1. Protocol
  2. Index Protocol
  3. Modules

Wrap Module

PreviousStreaming Fee ModuleNextAirdrop Module

Last updated 1 year ago

The WrapModuleV2 () is a smart contract that enables the wrapping of ERC20 and Ether positions via third-party protocols. The WrapModule works in conjunction with WrapAdapters, in which the wrapAdapterID / integrationNames are stored on the . Examples of wrap actions include wrapping DAI to cDAI (Compound) or DAI to aDAI (Aave).

Select Methods

wrap()

function wrap(ISetToken _setToken, address _underlyingToken, address _wrappedToken, uint256 _underlyingUnits, string calldata _integrationName)

Manager only. Instructs the SetToken to wrap an underlying asset into a wrappedToken via a specified adapter.

Parameter Name

Type

Description

_setToken

ISetToken

Instance of the SetToken

_underlyingToken

address

Address of the component to be wrapped

_wrappedToken

address

Address of the desired wrapped token

_underlyingUnits

uint256

Quantity of underlying units in Position units

_integrationName

string

Name of wrap module integration (mapping on integration registry)

wrapWithEther()

function wrapWithEther(ISetToken _setToken, address _wrappedToken, uint256 _underlyingUnits, string calldata _integrationName)

Manager only. Instructs the SetToken to wrap Ether into a wrappedToken via a specified adapter. Since SetTokens only hold WETH, in order to support protocols that collateralize with Ether the SetToken's WETH must be unwrapped first before sending to the external protocol.

Parameter Name

Type

Description

_setToken

ISetToken

Instance of the SetToken

_wrappedToken

address

Address of the desired wrapped token

_underlyingUnits

uint256

Quantity of underlying units in Position units

_integrationName

string

Name of wrap module integration (mapping on integration registry)

unwrap()

function unwrap(ISetToken _setToken, address _underlyingToken, address _wrappedToken, uint256 _wrappedUnits, string calldata _integrationName)

Manager only. Instructs the SetToken to wrap an underlying asset into a wrappedToken via a specified adapter.

Parameter Name

Type

Description

_setToken

ISetToken

Instance of the SetToken

_underlyingToken

address

Address of the component to be wrapped

_wrappedToken

address

Address of the desired wrapped token

_wrappedUnits

uint256

Quantity of wrapped units in Position units

_integrationName

string

Name of wrap module integration (mapping on integration registry)

unwrapWithEther()

function unwrapWithEther(ISetToken _setToken, address _wrappedToken, uint256 _wrappedUnits, string calldata _integrationName)

Manager only. Instructs the SetToken to wrap an underlying asset into a wrappedToken via a specified adapter.

Parameter Name

Type

Description

_setToken

ISetToken

Instance of the SetToken

_wrappedToken

address

Address of the desired wrapped token

_wrappedUnits

uint256

Quantity of wrapped units in Position units

_integrationName

string

Name of wrap module integration (mapping on integration registry)

initialize()

function initialize(ISetToken _setToken)

Manager only. Initializes this module to the SetToken.

Parameter Name

Type

Description

_setToken

ISetToken

Address of the SetToken

Etherscan
integration registry