Teller
The Teller is responsible for allowing users to mint/redeem BoringVault shares. Note that in the first iteration of this architecture the Teller is responsible for both mint and redeem, but in the future this logic could be split into two more complex contracts.
User Entry
In order to mint shares users should call deposit
or depositWithPermit
. For both calls user specify:
depositAsset
The ERC20 asset to deposit into the BoringVault
depositAmount
The amount of
depositAsset
to deposit into the BoringVault
minimumMint
The minimum amount of shares to mint from the deposit
💡 The depositAsset
must be supported by Teller, which can be checked by calling Teller.isSupported(depositAsset)
. Additionally, the Teller can not be paused which can be checked by calling Teller.isPaused()
.
💡 After a user enters using deposit
or depositWithPermit
all BoringVault shares they own (including ones owned prior to deposit) will become locked to their account for a share lock period. The share lock period can be queried by calling Teller.shareLockPeriod()
and a user's share unlock time can be queried by calling Teller.shareUnlockTime(USER_ADDRESS)
.
💡 During a users share lock period, it is possible for a users deposit to be refunded. Where the user is sent back the exact amount of assets they sent in, and the shares are burned directly from their account. When this happens a special event is emitted Event DepositRefunded
. This functionality exists as a safety mechanism to mitigate unfavorable entries into the vault.
💡 For deposit
calls users can use native ETH if it is supported. Additionally users can just transfer ETH to the Teller to deposit, however this is not advised as users can not set a minimum share amount.
💡 For ERC20 deposits using deposit
or depositWithPermit
, users must approve the BoringVault to spend their assets, not the Teller.
User Exit
User withdrawals are processed through the bulkWithdraw
function through the Atomic Queue solver contract.
Bulk User Entry
The other way users can deposit is by utilizing the Atomic Queue. When users deposit this way, their shares are not locked to their address after the deposit.
Last updated