# ISuperToken

This is the technical reference related to the interface for Super Tokens.

### Implementation addresses[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#implementation-addresses) <a href="#implementation-addresses" id="implementation-addresses"></a>

Super Token deployments work in a proxy pattern with the original implementation being comon between all super tokens for each chain. The implementation address for the SuperToken is different for each network and can be found in the SuperTokenFactory at the method `getSuperTokenLogic`.

To get the addresses of all the SuperTokenFactory contracts, you can use the Tagomi Explorer, section Protocol.

### ABI[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#abi) <a href="#abi" id="abi"></a>

In order to interact with any contract satistying the `ISuperToken` interface, you can use the following ABI:

<details>

<summary>Click here to show <code>ISuperToken</code> ABI</summary>

</details>

### Functions[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#functions) <a href="#functions" id="functions"></a>

#### Fn initialize[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-initialize) <a href="#fn-initialize" id="fn-initialize"></a>

```
function initialize(
    contract IERC20 underlyingToken,
    uint8 underlyingDecimals,
    string n,
    string s
) 
    external
```

*Initialize the contract*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters)

| Name                 | Type            | Description |
| -------------------- | --------------- | ----------- |
| `underlyingToken`    | contract IERC20 |             |
| `underlyingDecimals` | uint8           |             |
| `n`                  | string          |             |
| `s`                  | string          |             |

#### Fn initializeWithAdmin[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-initializewithadmin) <a href="#fn-initializewithadmin" id="fn-initializewithadmin"></a>

```
function initializeWithAdmin(
    contract IERC20 underlyingToken,
    uint8 underlyingDecimals,
    string n,
    string s,
    address admin
) 
    external
```

*Initialize the contract with an admin*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-1)

| Name                 | Type            | Description |
| -------------------- | --------------- | ----------- |
| `underlyingToken`    | contract IERC20 |             |
| `underlyingDecimals` | uint8           |             |
| `n`                  | string          |             |
| `s`                  | string          |             |
| `admin`              | address         |             |

#### Fn changeAdmin[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-changeadmin) <a href="#fn-changeadmin" id="fn-changeadmin"></a>

```
function changeAdmin(
    address newAdmin
) 
    external
```

*Only the current admin can call this function if admin is address(0), it is implicitly the host address*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-2)

| Name       | Type    | Description       |
| ---------- | ------- | ----------------- |
| `newAdmin` | address | New admin address |

Changes the admin for the SuperToken

#### Fn getAdmin[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-getadmin) <a href="#fn-getadmin" id="fn-getadmin"></a>

```
function getAdmin(
) 
    external 
    returns (address admin)
```

*Returns the admin address for the SuperToken*

#### Fn CONSTANT\_OUTFLOW\_NFT[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-constant_outflow_nft) <a href="#fn-constant_outflow_nft" id="fn-constant_outflow_nft"></a>

```
function CONSTANT_OUTFLOW_NFT(
) 
    external 
    returns (contract IConstantOutflowNFT)
```

#### Fn CONSTANT\_INFLOW\_NFT[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-constant_inflow_nft) <a href="#fn-constant_inflow_nft" id="fn-constant_inflow_nft"></a>

```
function CONSTANT_INFLOW_NFT(
) 
    external 
    returns (contract IConstantInflowNFT)
```

#### Fn POOL\_ADMIN\_NFT[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-pool_admin_nft) <a href="#fn-pool_admin_nft" id="fn-pool_admin_nft"></a>

```
function POOL_ADMIN_NFT(
) 
    external 
    returns (contract IPoolAdminNFT)
```

#### Fn POOL\_MEMBER\_NFT[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-pool_member_nft) <a href="#fn-pool_member_nft" id="fn-pool_member_nft"></a>

```
function POOL_MEMBER_NFT(
) 
    external 
    returns (contract IPoolMemberNFT)
```

#### Fn name[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-name) <a href="#fn-name" id="fn-name"></a>

```
function name(
) 
    external 
    returns (string)
```

*Returns the name of the token.*

#### Fn symbol[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-symbol) <a href="#fn-symbol" id="fn-symbol"></a>

```
function symbol(
) 
    external 
    returns (string)
```

*Returns the symbol of the token, usually a shorter version of the name.*

#### Fn decimals[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-decimals) <a href="#fn-decimals" id="fn-decimals"></a>

```
function decimals(
) 
    external 
    returns (uint8)
```

\_Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5,05` (`505 / 10 ** 2`).

Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the value ERC20 uses, unless *setupDecimals is called.*

**Note**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#note)

SuperToken always uses 18 decimals.

This information is only used for *display* purposes: it in no way affects any of the arithmetic of the contract, including IBEP20-balanceOf and IBEP20-transfer.

#### Fn totalSupply[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-totalsupply) <a href="#fn-totalsupply" id="fn-totalsupply"></a>

```
function totalSupply(
) 
    external 
    returns (uint256)
```

*See IBEP20-totalSupply.*

#### Fn balanceOf[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-balanceof) <a href="#fn-balanceof" id="fn-balanceof"></a>

```
function balanceOf(
    address account
) 
    external 
    returns (uint256 balance)
```

*Returns the amount of tokens owned by an account (`owner`).*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-3)

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| `account` | address |             |

#### Fn transfer[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-transfer) <a href="#fn-transfer" id="fn-transfer"></a>

```
function transfer(
    address recipient,
    uint256 amount
) 
    external 
    returns (bool)
```

*Moves `amount` tokens from the caller's account to `recipient`.*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-4)

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| `recipient` | address |             |
| `amount`    | uint256 |             |

**Return Values**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#return-values)

| Name  | Type | Description                                                                 |
| ----- | ---- | --------------------------------------------------------------------------- |
| `[0]` | bool | Returns Success a boolean value indicating whether the operation succeeded. |

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits)

a BEP20 Transfer event.

#### Fn allowance[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-allowance) <a href="#fn-allowance" id="fn-allowance"></a>

```
function allowance(
    address owner,
    address spender
) 
    external 
    returns (uint256)
```

*Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through transferFrom. This is zero by default.*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-5)

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| `owner`   | address |             |
| `spender` | address |             |

This value changes when approve or transferFrom are called.

#### Fn approve[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-approve) <a href="#fn-approve" id="fn-approve"></a>

```
function approve(
    address spender,
    uint256 amount
) 
    external 
    returns (bool)
```

*Sets `amount` as the allowance of `spender` over the caller's tokens.*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-6)

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| `spender` | address |             |
| `amount`  | uint256 |             |

**Return Values**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#return-values-1)

| Name  | Type | Description                                                                 |
| ----- | ---- | --------------------------------------------------------------------------- |
| `[0]` | bool | Returns Success a boolean value indicating whether the operation succeeded. |

**Note**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#note-1)

Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits-1)

an Approval event.

#### Fn transferFrom[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-transferfrom) <a href="#fn-transferfrom" id="fn-transferfrom"></a>

```
function transferFrom(
    address sender,
    address recipient,
    uint256 amount
) 
    external 
    returns (bool)
```

*Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance.*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-7)

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| `sender`    | address |             |
| `recipient` | address |             |
| `amount`    | uint256 |             |

**Return Values**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#return-values-2)

| Name  | Type | Description                                                                 |
| ----- | ---- | --------------------------------------------------------------------------- |
| `[0]` | bool | Returns Success a boolean value indicating whether the operation succeeded. |

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits-2)

a Transfer event.

#### Fn increaseAllowance[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-increaseallowance) <a href="#fn-increaseallowance" id="fn-increaseallowance"></a>

```
function increaseAllowance(
    address spender,
    uint256 addedValue
) 
    external 
    returns (bool)
```

\_Atomically increases the allowance granted to `spender` by the caller.

This is an alternative to `approve` that can be used as a mitigation for problems described in IBEP20-approve.\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-8)

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| `spender`    | address |             |
| `addedValue` | uint256 |             |

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits-3)

an Approval event indicating the updated allowance.

@custom:requirements

* \`spender\` cannot be the zero address.

#### Fn decreaseAllowance[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-decreaseallowance) <a href="#fn-decreaseallowance" id="fn-decreaseallowance"></a>

```
function decreaseAllowance(
    address spender,
    uint256 subtractedValue
) 
    external 
    returns (bool)
```

\_Atomically decreases the allowance granted to `spender` by the caller.

This is an alternative to approve that can be used as a mitigation for problems described in IBEP20-approve.\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-9)

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| `spender`         | address |             |
| `subtractedValue` | uint256 |             |

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits-4)

an Approval event indicating the updated allowance.

@custom:requirements

* \`spender\` cannot be the zero address.
* \`spender\` must have allowance for the caller of at least \`subtractedValue\`.

#### Fn granularity[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-granularity) <a href="#fn-granularity" id="fn-granularity"></a>

```
function granularity(
) 
    external 
    returns (uint256)
```

*Returns the smallest part of the token that is not divisible. This means all token operations (creation, movement and destruction) must have amounts that are a multiple of this number.*

**Note**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#note-2)

For super token contracts, this value is always 1

#### Fn send[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-send) <a href="#fn-send" id="fn-send"></a>

```
function send(
    address recipient,
    uint256 amount,
    bytes userData
) 
    external
```

\_Moves `amount` tokens from the caller's account to `recipient`.

If send or receive hooks are registered for the caller and `recipient`, the corresponding functions will be called with `userData` and empty `operatorData`. See [IERC777Sender](https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#IERC20) and [IERC777Recipient](https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#IERC20).\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-10)

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| `recipient` | address |             |
| `amount`    | uint256 |             |
| `userData`  | bytes   |             |

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits-5)

a Sent event.

@custom:requirements

* the caller must have at least \`amount\` tokens.
* \`recipient\` cannot be the zero address.
* if \`recipient\` is a contract, it must implement the IERC777Recipient interface.

#### Fn burn[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-burn) <a href="#fn-burn" id="fn-burn"></a>

```
function burn(
    uint256 amount,
    bytes userData
) 
    external
```

\_Destroys `amount` tokens from the caller's account, reducing the total supply and transfers the underlying token to the caller's account.

If a send hook is registered for the caller, the corresponding function will be called with `userData` and empty `operatorData`. See IERC777Sender.\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-11)

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| `amount`   | uint256 |             |
| `userData` | bytes   |             |

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits-6)

a Burned event.

@custom:requirements

* the caller must have at least \`amount\` tokens.

#### Fn isOperatorFor[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-isoperatorfor) <a href="#fn-isoperatorfor" id="fn-isoperatorfor"></a>

```
function isOperatorFor(
    address operator,
    address tokenHolder
) 
    external 
    returns (bool)
```

\_Returns true if an account is an operator of `tokenHolder`. Operators can send and burn tokens on behalf of their owners. All accounts are their own operator.

See operatorSend and operatorBurn.\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-12)

| Name          | Type    | Description |
| ------------- | ------- | ----------- |
| `operator`    | address |             |
| `tokenHolder` | address |             |

#### Fn authorizeOperator[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-authorizeoperator) <a href="#fn-authorizeoperator" id="fn-authorizeoperator"></a>

```
function authorizeOperator(
    address operator
) 
    external
```

\_Make an account an operator of the caller.

See isOperatorFor.\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-13)

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| `operator` | address |             |

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits-7)

an AuthorizedOperator event.

@custom:requirements

* \`operator\` cannot be calling address.

#### Fn revokeOperator[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-revokeoperator) <a href="#fn-revokeoperator" id="fn-revokeoperator"></a>

```
function revokeOperator(
    address operator
) 
    external
```

\_Revoke an account's operator status for the caller.

See isOperatorFor and defaultOperators.\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-14)

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| `operator` | address |             |

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits-8)

a RevokedOperator event.

@custom:requirements

* \`operator\` cannot be calling address.

#### Fn defaultOperators[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-defaultoperators) <a href="#fn-defaultoperators" id="fn-defaultoperators"></a>

```
function defaultOperators(
) 
    external 
    returns (address[])
```

\_Returns the list of default operators. These accounts are operators for all token holders, even if authorizeOperator was never called on them.

This list is immutable, but individual holders may revoke these via revokeOperator, in which case isOperatorFor will return false.\_

#### Fn operatorSend[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-operatorsend) <a href="#fn-operatorsend" id="fn-operatorsend"></a>

```
function operatorSend(
    address sender,
    address recipient,
    uint256 amount,
    bytes userData,
    bytes operatorData
) 
    external
```

\_Moves `amount` tokens from `sender` to `recipient`. The caller must be an operator of `sender`.

If send or receive hooks are registered for `sender` and `recipient`, the corresponding functions will be called with `userData` and `operatorData`. See IERC777Sender and IERC777Recipient.\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-15)

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| `sender`       | address |             |
| `recipient`    | address |             |
| `amount`       | uint256 |             |
| `userData`     | bytes   |             |
| `operatorData` | bytes   |             |

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits-9)

a Sent event.

@custom:requirements

* \`sender\` cannot be the zero address.
* \`sender\` must have at least \`amount\` tokens.
* the caller must be an operator for \`sender\`.
* \`recipient\` cannot be the zero address.
* if \`recipient\` is a contract, it must implement the IERC777Recipient interface.

#### Fn operatorBurn[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-operatorburn) <a href="#fn-operatorburn" id="fn-operatorburn"></a>

```
function operatorBurn(
    address account,
    uint256 amount,
    bytes userData,
    bytes operatorData
) 
    external
```

\_Destroys `amount` tokens from `account`, reducing the total supply. The caller must be an operator of `account`.

If a send hook is registered for `account`, the corresponding function will be called with `userData` and `operatorData`. See IERC777Sender.\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-16)

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| `account`      | address |             |
| `amount`       | uint256 |             |
| `userData`     | bytes   |             |
| `operatorData` | bytes   |             |

**Emits**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#emits-10)

a Burned event.

@custom:requirements

* \`account\` cannot be the zero address.
* \`account\` must have at least \`amount\` tokens.
* the caller must be an operator for \`account\`.

#### Fn selfMint[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-selfmint) <a href="#fn-selfmint" id="fn-selfmint"></a>

```
function selfMint(
    address account,
    uint256 amount,
    bytes userData
) 
    external
```

\_Mint new tokens for the account If `userData` is not empty, the `tokensReceived` hook is invoked according to ERC777 semantics.

@custom:modifiers

* onlySelf\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-17)

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| `account`  | address |             |
| `amount`   | uint256 |             |
| `userData` | bytes   |             |

#### Fn selfBurn[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-selfburn) <a href="#fn-selfburn" id="fn-selfburn"></a>

```
function selfBurn(
    address account,
    uint256 amount,
    bytes userData
) 
    external
```

\_Burn existing tokens for the account If `userData` is not empty, the `tokensToSend` hook is invoked according to ERC777 semantics.

@custom:modifiers

* onlySelf\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-18)

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| `account`  | address |             |
| `amount`   | uint256 |             |
| `userData` | bytes   |             |

#### Fn selfTransferFrom[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-selftransferfrom) <a href="#fn-selftransferfrom" id="fn-selftransferfrom"></a>

```
function selfTransferFrom(
    address sender,
    address spender,
    address recipient,
    uint256 amount
) 
    external
```

\_Transfer `amount` tokens from the `sender` to `recipient`. If `spender` isn't the same as `sender`, checks if `spender` has allowance to spend tokens of `sender`.

@custom:modifiers

* onlySelf\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-19)

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| `sender`    | address |             |
| `spender`   | address |             |
| `recipient` | address |             |
| `amount`    | uint256 |             |

#### Fn selfApproveFor[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-selfapprovefor) <a href="#fn-selfapprovefor" id="fn-selfapprovefor"></a>

```
function selfApproveFor(
    address account,
    address spender,
    uint256 amount
) 
    external
```

\_Give `spender`, `amount` allowance to spend the tokens of `account`.

@custom:modifiers

* onlySelf\_

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-20)

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| `account` | address |             |
| `spender` | address |             |
| `amount`  | uint256 |             |

#### Fn transferAll[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-transferall) <a href="#fn-transferall" id="fn-transferall"></a>

```
function transferAll(
    address recipient
) 
    external
```

*Transfer all available balance from `msg.sender` to `recipient`*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-21)

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| `recipient` | address |             |

#### Fn getUnderlyingToken[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-getunderlyingtoken) <a href="#fn-getunderlyingtoken" id="fn-getunderlyingtoken"></a>

```
function getUnderlyingToken(
) 
    external 
    returns (address tokenAddr)
```

*Return the underlying token contract*

**Return Values**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#return-values-3)

| Name        | Type    | Description              |
| ----------- | ------- | ------------------------ |
| `tokenAddr` | address | Underlying token address |

#### Fn getUnderlyingDecimals[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-getunderlyingdecimals) <a href="#fn-getunderlyingdecimals" id="fn-getunderlyingdecimals"></a>

```
function getUnderlyingDecimals(
) 
    external 
    returns (uint8 underlyingDecimals)
```

*Return the underlying token decimals*

**Return Values**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#return-values-4)

| Name                 | Type  | Description               |
| -------------------- | ----- | ------------------------- |
| `underlyingDecimals` | uint8 | Underlying token decimals |

#### Fn toUnderlyingAmount[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-tounderlyingamount) <a href="#fn-tounderlyingamount" id="fn-tounderlyingamount"></a>

```
function toUnderlyingAmount(
    uint256 amount
) 
    external 
    returns (uint256 underlyingAmount, uint256 adjustedAmount)
```

*Return the underlying token conversion rate*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-22)

| Name     | Type    | Description                                      |
| -------- | ------- | ------------------------------------------------ |
| `amount` | uint256 | Number of tokens to be upgraded (in 18 decimals) |

**Return Values**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#return-values-5)

| Name               | Type    | Description                               |
| ------------------ | ------- | ----------------------------------------- |
| `underlyingAmount` | uint256 | The underlying token amount after scaling |
| `adjustedAmount`   | uint256 | The super token amount after scaling      |

#### Fn upgrade[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-upgrade) <a href="#fn-upgrade" id="fn-upgrade"></a>

```
function upgrade(
    uint256 amount
) 
    external
```

*Upgrade ERC20 to SuperToken.*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-23)

| Name     | Type    | Description                                      |
| -------- | ------- | ------------------------------------------------ |
| `amount` | uint256 | Number of tokens to be upgraded (in 18 decimals) |

**Note**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#note-3)

It will use \`transferFrom\` to get tokens. Before calling this function you should \`approve\` this contract

#### Fn upgradeTo[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-upgradeto) <a href="#fn-upgradeto" id="fn-upgradeto"></a>

```
function upgradeTo(
    address to,
    uint256 amount,
    bytes userData
) 
    external
```

*Upgrade BEP20 to SuperToken and transfer immediately*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-24)

| Name       | Type    | Description                                      |
| ---------- | ------- | ------------------------------------------------ |
| `to`       | address | The account to receive upgraded tokens           |
| `amount`   | uint256 | Number of tokens to be upgraded (in 18 decimals) |
| `userData` | bytes   | User data for the TokensRecipient callback       |

**Note**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#note-4)

It will use \`transferFrom\` to get tokens. Before calling this function you should \`approve\` this contract

@custom:warning

* there is potential of reentrancy IF the "to" account is a registered ERC777 recipient. @custom:requirements
* if \`userData\` is NOT empty AND \`to\` is a contract, it MUST be a registered ERC777 recipient otherwise it reverts.

#### Fn downgrade[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-downgrade) <a href="#fn-downgrade" id="fn-downgrade"></a>

```
function downgrade(
    uint256 amount
) 
    external
```

*Downgrade SuperToken to ERC20. It will call transfer to send tokens*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-25)

| Name     | Type    | Description                       |
| -------- | ------- | --------------------------------- |
| `amount` | uint256 | Number of tokens to be downgraded |

#### Fn downgradeTo[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-downgradeto) <a href="#fn-downgradeto" id="fn-downgradeto"></a>

```
function downgradeTo(
    address to,
    uint256 amount
) 
    external
```

*Downgrade SuperToken to BEP20 and transfer immediately*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-26)

| Name     | Type    | Description                                        |
| -------- | ------- | -------------------------------------------------- |
| `to`     | address | The account to receive downgraded tokens           |
| `amount` | uint256 | Number of tokens to be downgraded (in 18 decimals) |

#### Fn operationApprove[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-operationapprove) <a href="#fn-operationapprove" id="fn-operationapprove"></a>

```
function operationApprove(
    address account,
    address spender,
    uint256 amount
) 
    external
```

*Perform BEP20 approve by host contract.*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-27)

| Name      | Type    | Description                           |
| --------- | ------- | ------------------------------------- |
| `account` | address | The account owner to be approved.     |
| `spender` | address | The spender of account owner's funds. |
| `amount`  | uint256 | Number of tokens to be approved.      |

@custom:modifiers

* onlyHost |

#### Fn operationIncreaseAllowance[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-operationincreaseallowance) <a href="#fn-operationincreaseallowance" id="fn-operationincreaseallowance"></a>

```
function operationIncreaseAllowance(
    address account,
    address spender,
    uint256 addedValue
) 
    external
```

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-28)

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| `account`    | address |             |
| `spender`    | address |             |
| `addedValue` | uint256 |             |

#### Fn operationDecreaseAllowance[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-operationdecreaseallowance) <a href="#fn-operationdecreaseallowance" id="fn-operationdecreaseallowance"></a>

```
function operationDecreaseAllowance(
    address account,
    address spender,
    uint256 subtractedValue
) 
    external
```

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-29)

| Name              | Type    | Description |
| ----------------- | ------- | ----------- |
| `account`         | address |             |
| `spender`         | address |             |
| `subtractedValue` | uint256 |             |

#### Fn operationTransferFrom[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-operationtransferfrom) <a href="#fn-operationtransferfrom" id="fn-operationtransferfrom"></a>

```
function operationTransferFrom(
    address account,
    address spender,
    address recipient,
    uint256 amount
) 
    external
```

*Perform ERC20 transferFrom by host contract.*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-30)

| Name        | Type    | Description                               |
| ----------- | ------- | ----------------------------------------- |
| `account`   | address | The account to spend sender's funds.      |
| `spender`   | address | The account where the funds is sent from. |
| `recipient` | address | The recipient of the funds.               |
| `amount`    | uint256 | Number of tokens to be transferred.       |

@custom:modifiers

* onlyHost |

#### Fn operationSend[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-operationsend) <a href="#fn-operationsend" id="fn-operationsend"></a>

```
function operationSend(
    address spender,
    address recipient,
    uint256 amount,
    bytes userData
) 
    external
```

*Perform ERC777 send by host contract.*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-31)

| Name        | Type    | Description                               |
| ----------- | ------- | ----------------------------------------- |
| `spender`   | address | The account where the funds is sent from. |
| `recipient` | address | The recipient of the funds.               |
| `amount`    | uint256 | Number of tokens to be transferred.       |
| `userData`  | bytes   | Arbitrary user inputted data              |

@custom:modifiers

* onlyHost |

#### Fn operationUpgrade[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-operationupgrade) <a href="#fn-operationupgrade" id="fn-operationupgrade"></a>

```
function operationUpgrade(
    address account,
    uint256 amount
) 
    external
```

*Upgrade ERC20 to SuperToken by host contract.*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-32)

| Name      | Type    | Description                                      |
| --------- | ------- | ------------------------------------------------ |
| `account` | address | The account to be changed.                       |
| `amount`  | uint256 | Number of tokens to be upgraded (in 18 decimals) |

@custom:modifiers

* onlyHost |

#### Fn operationDowngrade[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#fn-operationdowngrade) <a href="#fn-operationdowngrade" id="fn-operationdowngrade"></a>

```
function operationDowngrade(
    address account,
    uint256 amount
) 
    external
```

*Downgrade ERC20 to SuperToken by host contract.*

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-33)

| Name      | Type    | Description                                        |
| --------- | ------- | -------------------------------------------------- |
| `account` | address | The account to be changed.                         |
| `amount`  | uint256 | Number of tokens to be downgraded (in 18 decimals) |

@custom:modifiers

* onlyHost |

### Events[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#events) <a href="#events" id="events"></a>

#### Event AdminChanged[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#event-adminchanged) <a href="#event-adminchanged" id="event-adminchanged"></a>

```
event AdminChanged(
    address oldAdmin,
    address newAdmin
)
```

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-34)

| Name       | Type    | Description |
| ---------- | ------- | ----------- |
| `oldAdmin` | address |             |
| `newAdmin` | address |             |

#### Event TokenUpgraded[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#event-tokenupgraded) <a href="#event-tokenupgraded" id="event-tokenupgraded"></a>

```
event TokenUpgraded(
    address account,
    uint256 amount
)
```

Token upgrade event

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-35)

| Name      | Type    | Description                                |
| --------- | ------- | ------------------------------------------ |
| `account` | address | Account where tokens are upgraded to       |
| `amount`  | uint256 | Amount of tokens upgraded (in 18 decimals) |

#### Event TokenDowngraded[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#event-tokendowngraded) <a href="#event-tokendowngraded" id="event-tokendowngraded"></a>

```
event TokenDowngraded(
    address account,
    uint256 amount
)
```

Token downgrade event

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-36)

| Name      | Type    | Description                         |
| --------- | ------- | ----------------------------------- |
| `account` | address | Account whose tokens are downgraded |
| `amount`  | uint256 | Amount of tokens downgraded         |

#### Event ConstantOutflowNFTCreated[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#event-constantoutflownftcreated) <a href="#event-constantoutflownftcreated" id="event-constantoutflownftcreated"></a>

```
event ConstantOutflowNFTCreated(
    contract IConstantOutflowNFT constantOutflowNFT
)
```

Constant Outflow NFT proxy created event

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-37)

| Name                 | Type                         | Description                  |
| -------------------- | ---------------------------- | ---------------------------- |
| `constantOutflowNFT` | contract IConstantOutflowNFT | constant outflow nft address |

#### Event ConstantInflowNFTCreated[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#event-constantinflownftcreated) <a href="#event-constantinflownftcreated" id="event-constantinflownftcreated"></a>

```
event ConstantInflowNFTCreated(
    contract IConstantInflowNFT constantInflowNFT
)
```

Constant Inflow NFT proxy created event

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-38)

| Name                | Type                        | Description                 |
| ------------------- | --------------------------- | --------------------------- |
| `constantInflowNFT` | contract IConstantInflowNFT | constant inflow nft address |

#### Event PoolAdminNFTCreated[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#event-pooladminnftcreated) <a href="#event-pooladminnftcreated" id="event-pooladminnftcreated"></a>

```
event PoolAdminNFTCreated(
    contract IPoolAdminNFT poolAdminNFT
)
```

Pool Admin NFT proxy created event

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-39)

| Name           | Type                   | Description            |
| -------------- | ---------------------- | ---------------------- |
| `poolAdminNFT` | contract IPoolAdminNFT | pool admin nft address |

#### Event PoolMemberNFTCreated[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#event-poolmembernftcreated) <a href="#event-poolmembernftcreated" id="event-poolmembernftcreated"></a>

```
event PoolMemberNFTCreated(
    contract IPoolMemberNFT poolMemberNFT
)
```

Pool Member NFT proxy created event

**Parameters**[**​**](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#parameters-40)

| Name            | Type                    | Description             |
| --------------- | ----------------------- | ----------------------- |
| `poolMemberNFT` | contract IPoolMemberNFT | pool member nft address |

### Error Codes[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#error-codes) <a href="#error-codes" id="error-codes"></a>

#### SUPER\_TOKEN\_CALLER\_IS\_NOT\_OPERATOR\_FOR\_HOLDER[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_caller_is_not_operator_for_holder) <a href="#super_token_caller_is_not_operator_for_holder" id="super_token_caller_is_not_operator_for_holder"></a>

```
error SUPER_TOKEN_CALLER_IS_NOT_OPERATOR_FOR_HOLDER()
```

#### SUPER\_TOKEN\_NOT\_ERC777\_TOKENS\_RECIPIENT[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_not_erc777_tokens_recipient) <a href="#super_token_not_erc777_tokens_recipient" id="super_token_not_erc777_tokens_recipient"></a>

```
error SUPER_TOKEN_NOT_ERC777_TOKENS_RECIPIENT()
```

#### SUPER\_TOKEN\_INFLATIONARY\_DEFLATIONARY\_NOT\_SUPPORTED[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_inflationary_deflationary_not_supported) <a href="#super_token_inflationary_deflationary_not_supported" id="super_token_inflationary_deflationary_not_supported"></a>

```
error SUPER_TOKEN_INFLATIONARY_DEFLATIONARY_NOT_SUPPORTED()
```

#### SUPER\_TOKEN\_NO\_UNDERLYING\_TOKEN[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_no_underlying_token) <a href="#super_token_no_underlying_token" id="super_token_no_underlying_token"></a>

```
error SUPER_TOKEN_NO_UNDERLYING_TOKEN()
```

#### SUPER\_TOKEN\_ONLY\_SELF[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_only_self) <a href="#super_token_only_self" id="super_token_only_self"></a>

```
error SUPER_TOKEN_ONLY_SELF()
```

#### SUPER\_TOKEN\_ONLY\_ADMIN[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_only_admin) <a href="#super_token_only_admin" id="super_token_only_admin"></a>

```
error SUPER_TOKEN_ONLY_ADMIN()
```

#### SUPER\_TOKEN\_ONLY\_GOV\_OWNER[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_only_gov_owner) <a href="#super_token_only_gov_owner" id="super_token_only_gov_owner"></a>

```
error SUPER_TOKEN_ONLY_GOV_OWNER()
```

#### SUPER\_TOKEN\_APPROVE\_FROM\_ZERO\_ADDRESS[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_approve_from_zero_address) <a href="#super_token_approve_from_zero_address" id="super_token_approve_from_zero_address"></a>

```
error SUPER_TOKEN_APPROVE_FROM_ZERO_ADDRESS()
```

#### SUPER\_TOKEN\_APPROVE\_TO\_ZERO\_ADDRESS[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_approve_to_zero_address) <a href="#super_token_approve_to_zero_address" id="super_token_approve_to_zero_address"></a>

```
error SUPER_TOKEN_APPROVE_TO_ZERO_ADDRESS()
```

#### SUPER\_TOKEN\_BURN\_FROM\_ZERO\_ADDRESS[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_burn_from_zero_address) <a href="#super_token_burn_from_zero_address" id="super_token_burn_from_zero_address"></a>

```
error SUPER_TOKEN_BURN_FROM_ZERO_ADDRESS()
```

#### SUPER\_TOKEN\_MINT\_TO\_ZERO\_ADDRESS[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_mint_to_zero_address) <a href="#super_token_mint_to_zero_address" id="super_token_mint_to_zero_address"></a>

```
error SUPER_TOKEN_MINT_TO_ZERO_ADDRESS()
```

#### SUPER\_TOKEN\_TRANSFER\_FROM\_ZERO\_ADDRESS[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_transfer_from_zero_address) <a href="#super_token_transfer_from_zero_address" id="super_token_transfer_from_zero_address"></a>

```
error SUPER_TOKEN_TRANSFER_FROM_ZERO_ADDRESS()
```

#### SUPER\_TOKEN\_TRANSFER\_TO\_ZERO\_ADDRESS[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_transfer_to_zero_address) <a href="#super_token_transfer_to_zero_address" id="super_token_transfer_to_zero_address"></a>

```
error SUPER_TOKEN_TRANSFER_TO_ZERO_ADDRESS()
```

#### SUPER\_TOKEN\_NFT\_PROXY\_ADDRESS\_CHANGED[​](https://docs.superfluid.finance/docs/technical-reference/ISuperToken#super_token_nft_proxy_address_changed) <a href="#super_token_nft_proxy_address_changed" id="super_token_nft_proxy_address_changed"></a>

```
error SUPER_TOKEN_NFT_PROXY_ADDRESS_CHANGED()
```
