CellarMigrationAdaptor
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.
function identifier() public pure virtual returns (bytes32);
deposit
Function Cellars call to deposit users funds into holding position.
function deposit(uint256, bytes memory, bytes memory) public virtual;
withdraw
Function Cellars call to withdraw funds from positions to send to users.
function withdraw(uint256 assets, address receiver, bytes memory, bytes memory configurationData) public virtual;
Parameters
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.
function balanceOf(bytes memory) public view virtual returns (uint256);
Returns
<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
function withdrawableFrom(bytes memory, bytes memory configurationData) public view virtual returns (uint256);
Returns
<none>
uint256
withdrawable balance of the position in terms of assetOf
assetOf
Function Cellars use to determine the underlying ERC20 asset of a position.
function assetOf(bytes memory) public view virtual returns (ERC20);
Returns
<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.
function assetsUsed(bytes memory adaptorData) public view virtual returns (ERC20[] memory assets);
isDebt
Functions Registry/Cellars use to determine if this adaptor reports debt values.
returns true if this adaptor reports debt values.
function isDebt() public view virtual returns (bool);
deposit
Allows strategist to perform a bulkDeposit into Teller.
function deposit(ERC20 depositAsset, uint256 depositAmount, uint256 minimumMint) external;
withdraw
Allows strategist to perform a bulkWithdraw from Teller.
function withdraw(ERC20 withdrawAsset, uint256 shareAmount, uint256 minimumAssets) external;
_maxAvailable
Helper function that allows adaptor calls to use the max available of an ERC20 asset by passing in type(uint256).max
function _maxAvailable(ERC20 token, uint256 amount) internal view virtual returns (uint256);
Parameters
token
ERC20
the ERC20 asset to work with
amount
uint256
when type(uint256).max
is used, this function returns token
s balanceOf
otherwise this function returns amount.
_revokeExternalApproval
Helper function that checks if spender
has any more approval for asset
, and if so revokes it.
function _revokeExternalApproval(ERC20 asset, address spender) internal;
_externalReceiverCheck
Helper function that validates external receivers are allowed.
function _externalReceiverCheck(address receiver) internal view;
Errors
CellarMigrationAdaptor__ExternalReceiverBlocked
Attempted to specify an external receiver during a Cellar callOnAdaptor
call.
error CellarMigrationAdaptor__ExternalReceiverBlocked();
CellarMigrationAdaptor__UserDepositsNotAllowed
Attempted to deposit to a position where user deposits were not allowed.
error CellarMigrationAdaptor__UserDepositsNotAllowed();
CellarMigrationAdaptor__UserWithdrawsNotAllowed
Attempted to withdraw from a position where user withdraws were not allowed.
error CellarMigrationAdaptor__UserWithdrawsNotAllowed();
Was this helpful?