MultiDepositorVault
Inherits: IMultiDepositorVault, ERC20, FeeVault
A vault that allows users to deposit and withdraw multiple tokens. This contract just mints and burns unit tokens and all logic and validation is handled by the provisioner
State Variables
beforeTransferHook
Hooks contract called before unit transfers/mints/burns
IBeforeTransferHook public beforeTransferHook;provisioner
Role that can mint/burn vault units
address public provisioner;Functions
onlyProvisioner
Ensures caller is the provisioner
modifier onlyProvisioner();constructor
enter
Deposit tokens into the vault and mint units
Parameters
sender
address
The sender of the tokens
token
IERC20
The token to deposit
tokenAmount
uint256
The amount of token to deposit
unitsAmount
uint256
The amount of units to mint
recipient
address
The recipient of the units
exit
Withdraw tokens from the vault and burn units
Parameters
sender
address
The sender of the units
token
IERC20
The token to withdraw
tokenAmount
uint256
The amount of token to withdraw
unitsAmount
uint256
The amount of units to burn
recipient
address
The recipient of the tokens
setProvisioner
Sets the provisioner address
Parameters
provisioner_
address
The new provisioner address
setBeforeTransferHook
Set the before transfer hooks
Parameters
hook
IBeforeTransferHook
_update
Internal function to update token balances with transfer hook checks
Transfers a value amount of tokens from from to to, or alternatively mints (or burns) if from (or to) is the zero address. All customizations to transfers, mints, and burns should be done by overriding this function. Emits a {Transfer} event.
Parameters
from
address
The address tokens are transferred from
to
address
The address tokens are transferred to
amount
uint256
The amount of tokens to transfer
_setBeforeTransferHook
Set the transfer hook
Parameters
hook_
IBeforeTransferHook
The transfer hook address
_setProvisioner
Set the provisioner
Parameters
provisioner_
address
The provisioner address
Last updated

