# Basic Issuance

## What is the BasicIssuanceModule:

Basic issuance that only works with Sets with [**default** **positions**](broken://pages/-MF1H3BLByF1acnYYJlR#settoken-considerations). Includes normal issue / redeem functionality. This performs the actions of moving the Set's components to / from user’s possession to the Set as needed. The module has access to the SetToken's *mint*, *burn*, and *transfer* functionality.

## Initializing the BasicIssuanceModule:

All modules need to be added to the SetToken as the first step. Learn how to add a module to your SetToken by referring to the 'Adding a Module' section.&#x20;

Once you have added the BasicIssuanceModule to the SetToken, you must initialize the SetToken on the BasicIssuanceModule:

```typescript
/**
 * Initializes this module to the SetToken with issuance-related hooks. Only callable by the SetToken's manager.
 * Hook addresses are optional. Address(0) means that no hook will be called
 *
 * @param _setToken             Instance of the SetToken to issue
 * @param _preIssueHook         Instance of the Manager Contract with the Pre-Issuance Hook function
 */
function initialize(ISetToken _setToken, IManagerIssuanceHook _preIssueHook);
```

The pre issue hook is an optional parameter for a contract that can contain any custom logic you write prior to issuance. For example, the manager issuance contract can include whitelisting functionality, issuance limits and any other custom logic for operating your Set.

If you do not wish to provide a pre issuance hook, you can input the zero address (0x0000000000000000000000000000000000000000).

## Issuing Sets:

In order to issue Sets you must call `issue` on the **BasicIssuanceModule**, the interface for issue is as follows:

```typescript
function issue(ISetToken _setToken, uint256 _quantity, address _to) external
```

Input the address of the Set you wish to issue and the amount of SetTokens you wish to issue. In order for issuance to work ALL of the components must be owned by the calling address in the correct proportions (whether it's a wallet or smart contract address).&#x20;

All components **must be approved** to the [**BasicIssuanceModule**](https://docs.tokensets.com/protocol/untitled) contract with appropriate allowance for transfer. In order to figure out the correct token amounts needed for issuance you can call the following function which returns a list of component addresses and required component units:

```typescript
/**
 * Retrieves the addresses and units required to mint a particular quantity of SetToken.
 *
 * @param _setToken             Instance of the SetToken to issue
 * @param _quantity             Quantity of SetToken to issue
 * @return address[]            List of component addresses
 * @return uint256[]            List of component units required to issue the quantity of SetTokens
 */
function getRequiredComponentUnitsForIssue(ISetToken _setToken, u
```

Each component unit is denominated the component base units. For example, 1 USDC is 10 \*\* 6 and 1 WBTC is 10 \*\* 8.

Once you confirm you have all the required components to collateralize each position of the Set you will be able to issue which transfers those components to the SetToken and mint's the passed `_quantity` to the calling address.

## Redeeming Sets:

Conversely, redeeming is the process of burning your SetToken balance and receiving the underlying collateral. The interface for redeem is as follows:

```typescript
function redeem(ISetToken _setToken, uint256 _quantity, address _to) external
```

Specify the amount of Sets to redeem and then those Sets are burned and the components are transferred to the calling address.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vingt-io.gitbook.io/vingt.io/technical-guide/visp-technical-foundation/index-token-manger-guide/basic-issuance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
