For the complete documentation index, see llms.txt. This page is also available as Markdown.

Token Facet

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

Call Functions

Transfers

Transfer Token

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).

Transfer Internal Token From

WIP

Parameter
Type
Description

token

IERC20

WIP

sender

address

WIP

recipient

address

WIP

amount

uint256

WIP

toMode

To

WIP

Approvals

Approve Token

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).

Increase Token Allowance

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).

Decrease Token Allowance

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).

Token Allowance

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

Permit Token

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).

Token Permit Nonces

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).

Token Permit Domain Separator

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

On ERC-1155 Received

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).

On ERC-1155 Batch Received

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

Wrap Ether

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).

Unwrap Ether

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

Get Internal Balance

Parameter
Type
Description

account

address

WIP

token

IERC20

WIP

Return Value
Type
Description

balance

uint256

WIP

Get Internal Balances

Parameter
Type
Description

account

address

WIP

tokens

IERC20[]

WIP

Return Value
Type
Description

balances

uint256[]

WIP

Get External Balance

Parameter
Type
Description

account

address

WIP

token

IERC20

WIP

Return Value
Type
Description

balance

uint256

WIP

Get External Balances

Parameter
Type
Description

account

address

WIP

tokens

IERC20[]

WIP

Return Value
Type
Description

balances

uint256[]

WIP

Get Balance

Parameter
Type
Description

account

address

WIP

token

IERC20

WIP

Return Value
Type
Description

balance

uint256

WIP

Get Balances

Parameter
Type
Description

account

address

WIP

tokens

IERC20[]

WIP

Return Value
Type
Description

balances

uint256[]

WIP

Get All Balance

Parameter
Type
Description

account

address

WIP

token

IERC20

WIP

Return Value
Type
Description

b

Balance

WIP

Get All Balances

Parameter
Type
Description

account

address

WIP

tokens

IERC20[]

WIP

Return Value
Type
Description

balances

Balance[]

WIP

Events

Internal Balance Changed

Parameter
Type
Description

account

address

WIP

token

IERC20

WIP

delta

int256

WIP

Token Approval

Parameter
Type
Description

owner

address

WIP

spender

address

WIP

token

IERC20

WIP

amount

uint256

WIP

Last updated