CellarMigrationAdaptor
State Variables
boringVault
accountant
teller
Functions
constructor
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 |
---|---|---|
|
| in terms of accountant's base asset |
|
| the address that should receive withdrawn funds |
|
| |
|
|
balanceOf
Function Cellars use to determine assetOf
balance of an adaptor position.
Returns
Name | Type | Description |
---|---|---|
|
| assets of the position in terms of |
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 |
---|---|---|
|
| withdrawable balance of the position in terms of |
assetOf
Function Cellars use to determine the underlying ERC20 asset of a position.
Returns
Name | Type | Description |
---|---|---|
|
| 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 |
---|---|---|
|
| the ERC20 asset to work with |
|
| when |
_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.