CellarMigrationAdaptor

Git Sourcearrow-up-right

State Variables

boringVault

BoringVault internal immutable boringVault;

accountant

AccountantWithRateProviders internal immutable accountant;

teller

TellerWithMultiAssetSupport internal immutable teller;

Functions

constructor

constructor(address _boringVault, address _accountant, address _teller);

identifier

Identifier unique to this adaptor for a shared registry. Normally the identifier would just be the address of this contract, but this Identifier is needed during Cellar Delegate Call Operations, so getting the address of the adaptor is more difficult.

deposit

Function Cellars call to deposit users funds into holding position.

withdraw

Function Cellars call to withdraw funds from positions to send to users.

Parameters

Name
Type
Description

assets

uint256

in terms of accountant's base asset

receiver

address

the address that should receive withdrawn funds

<none>

bytes

configurationData

bytes

balanceOf

Function Cellars use to determine assetOf balance of an adaptor position.

Returns

Name
Type
Description

<none>

uint256

assets of the position in terms of assetOf

withdrawableFrom

Functions Cellars use to determine the withdrawable balance from an adaptor position.

accepts adaptorData and configurationData

Debt positions MUST return 0 for their withdrawableFrom

Returns

Name
Type
Description

<none>

uint256

withdrawable balance of the position in terms of assetOf

assetOf

Function Cellars use to determine the underlying ERC20 asset of a position.

Returns

Name
Type
Description

<none>

ERC20

the underlying ERC20 asset of a position

assetsUsed

When positions are added to the Registry, this function can be used in order to figure out what assets this adaptor needs to price, and confirm pricing is properly setup.

isDebt

Functions Registry/Cellars use to determine if this adaptor reports debt values.

returns true if this adaptor reports debt values.

deposit

Allows strategist to perform a bulkDeposit into Teller.

withdraw

Allows strategist to perform a bulkWithdraw from Teller.

_maxAvailable

Helper function that allows adaptor calls to use the max available of an ERC20 asset by passing in type(uint256).max

Parameters

Name
Type
Description

token

ERC20

the ERC20 asset to work with

amount

uint256

when type(uint256).max is used, this function returns tokens balanceOf otherwise this function returns amount.

_revokeExternalApproval

Helper function that checks if spender has any more approval for asset, and if so revokes it.

_externalReceiverCheck

Helper function that validates external receivers are allowed.

Errors

CellarMigrationAdaptor__ExternalReceiverBlocked

Attempted to specify an external receiver during a Cellar callOnAdaptor call.

CellarMigrationAdaptor__UserDepositsNotAllowed

Attempted to deposit to a position where user deposits were not allowed.

CellarMigrationAdaptor__UserWithdrawsNotAllowed

Attempted to withdraw from a position where user withdraws were not allowed.

Was this helpful?