Token Facet

The Token Facet handles the transfers of assets outside the Silo.

Call Functions

Transfers

function transferToken(
    IERC20 token,
    address recipient,
    uint256 amount,
    LibTransfer.From fromMode,
    LibTransfer.To toMode
) external payable;

Transfers an asset from a Farmer's Internal and/or External Balance to a Farmer's Internal or External Balance.

Parameter
Type
Description

token

IERC20

The token to be transferred.

recipient

address

The recipient of the transferred tokens (can be msg.sender).

amount

uint256

The amount of tokens to be transferred.

fromMode

From

Specifies what balance to receive the tokens from (see Internal Balances).

toMode

To

Specifies what balance to send the tokens to (see Internal Balances).

WIP

Parameter
Type
Description

token

IERC20

WIP

sender

address

WIP

recipient

address

WIP

amount

uint256

WIP

toMode

To

WIP

Approvals

Wraps Ether into WETH.

Parameter
Type
Description

amount

uint256

The amount of Ether to wrap into WETH. Must be <= msg.value.

toMode

To

Specifies what balance to send the WETH to (see Internal Balances).

Wraps Ether into WETH.

Parameter
Type
Description

amount

uint256

The amount of Ether to wrap into WETH. Must be <= msg.value.

toMode

To

Specifies what balance to send the WETH to (see Internal Balances).

Wraps Ether into WETH.

Parameter
Type
Description

amount

uint256

The amount of Ether to wrap into WETH. Must be <= msg.value.

toMode

To

Specifies what balance to send the WETH to (see Internal Balances).

Wraps Ether into WETH.

Parameter
Type
Description

amount

uint256

The amount of Ether to wrap into WETH. Must be <= msg.value.

toMode

To

Specifies what balance to send the WETH to (see Internal Balances).

Permits

Wraps Ether into WETH.

Parameter
Type
Description

amount

uint256

The amount of Ether to wrap into WETH. Must be <= msg.value.

toMode

To

Specifies what balance to send the WETH to (see Internal Balances).

Wraps Ether into WETH.

Parameter
Type
Description

amount

uint256

The amount of Ether to wrap into WETH. Must be <= msg.value.

toMode

To

Specifies what balance to send the WETH to (see Internal Balances).

Wraps Ether into WETH.

Parameter
Type
Description

amount

uint256

The amount of Ether to wrap into WETH. Must be <= msg.value.

toMode

To

Specifies what balance to send the WETH to (see Internal Balances).

ERC-1155

Wraps Ether into WETH.

Parameter
Type
Description

amount

uint256

The amount of Ether to wrap into WETH. Must be <= msg.value.

toMode

To

Specifies what balance to send the WETH to (see Internal Balances).

Wraps Ether into WETH.

Parameter
Type
Description

amount

uint256

The amount of Ether to wrap into WETH. Must be <= msg.value.

toMode

To

Specifies what balance to send the WETH to (see Internal Balances).

WETH

Wraps Ether into WETH.

Parameter
Type
Description

amount

uint256

The amount of Ether to wrap into WETH. Must be <= msg.value.

toMode

To

Specifies what balance to send the WETH to (see Internal Balances).

Unwraps WETH into Ether.

Parameter
Type
Description

amount

uint256

The amount of WETH to unwrap into Ether.

fromMode

From

Specifies what balance to receive the WETH from (see Internal Balances).

View Functions

Parameter
Type
Description

account

address

WIP

token

IERC20

WIP

Return Value
Type
Description

balance

uint256

WIP

Parameter
Type
Description

account

address

WIP

tokens

IERC20[]

WIP

Return Value
Type
Description

balances

uint256[]

WIP

Parameter
Type
Description

account

address

WIP

token

IERC20

WIP

Return Value
Type
Description

balance

uint256

WIP

Parameter
Type
Description

account

address

WIP

tokens

IERC20[]

WIP

Return Value
Type
Description

balances

uint256[]

WIP

Parameter
Type
Description

account

address

WIP

token

IERC20

WIP

Return Value
Type
Description

balance

uint256

WIP

Parameter
Type
Description

account

address

WIP

tokens

IERC20[]

WIP

Return Value
Type
Description

balances

uint256[]

WIP

Parameter
Type
Description

account

address

WIP

token

IERC20

WIP

Return Value
Type
Description

b

Balance

WIP

Parameter
Type
Description

account

address

WIP

tokens

IERC20[]

WIP

Return Value
Type
Description

balances

Balance[]

WIP

Events

Parameter
Type
Description

account

address

WIP

token

IERC20

WIP

delta

int256

WIP

Parameter
Type
Description

owner

address

WIP

spender

address

WIP

token

IERC20

WIP

amount

uint256

WIP

Last updated