MezoAllocator
IMezoPortal
Interface for the Mezo's Portal contract connected to dispatcher.
DepositInfo
DepositInfo keeps track of the deposit balance and unlock time. Each deposit is tracked separately and associated with a specific token. Some tokens can be deposited but can not be locked - in that case the unlockAt is the block timestamp of when the deposit was created. The same is true for tokens that can be locked but the depositor decided not to lock them. Some deposits can mint a receipt tokens against them: receiptMinted is the amount of receipt tokens minted against a deposit, while feeOwed is the fee owed by the deposit to Portal, and the lastFeeIntegral is the last updated value of the fee integral.
deposit
Deposit and optionally lock tokens for the given period.
Lock period will be normalized to weeks. If non-zero, it must not be shorter than the minimum lock period and must not be longer than the maximum lock period.
Parameters
withdraw
Withdraws all deposited tokens.
Parameters
withdrawPartially
Withdraws part of the deposited tokens.
Parameters
depositCount
The number of deposits created. Includes the deposits that were fully withdrawn. This is also the identifier of the most recently created deposit.
getDeposit
Get the balance and unlock time of a given deposit.
Parameters
MezoAllocator
MezoAllocator routes tBTC to/from MezoPortal.
mezoPortal
Address of the MezoPortal contract.
tbtc
tBTC token contract.
stbtc
stBTC token vault contract.
isMaintainer
Keeps track of the addresses that are allowed to trigger deposit allocations.
maintainers
List of maintainers.
depositId
keeps track of the latest deposit ID assigned in Mezo Portal.
depositBalance
Keeps track of the total amount of tBTC allocated to MezoPortal.
DepositAllocated
Emitted when tBTC is deposited to MezoPortal.
DepositWithdrawn
Emitted when tBTC is withdrawn from MezoPortal.
MaintainerAdded
Emitted when the maintainer address is updated.
MaintainerRemoved
Emitted when the maintainer address is updated.
DepositReleased
Emitted when tBTC is released from MezoPortal.
CallerNotMaintainer
Reverts if the caller is not a maintainer.
CallerNotStbtc
Reverts if the caller is not the stBTC contract.
MaintainerNotRegistered
Reverts if the maintainer is not registered.
MaintainerAlreadyRegistered
Reverts if the maintainer has been already registered.
onlyMaintainer
constructor
initialize
Initializes the MezoAllocator contract.
Parameters
allocate
Allocate tBTC to MezoPortal. Each allocation creates a new "rolling" deposit meaning that the previous Acre's deposit is fully withdrawn before a new deposit with added amount is created. This mimics a "top up" functionality with the difference that a new deposit id is created and the previous deposit id is no longer in use.
This function can be invoked periodically by a maintainer.
withdraw
Withdraws tBTC from MezoPortal and transfers it to stBTC. This function can withdraw partial or a full amount of tBTC from MezoPortal for a given deposit id.
Parameters
releaseDeposit
Releases deposit in full from MezoPortal.
This is a special function that can be used to migrate funds during allocator upgrade or in case of emergencies.
addMaintainer
Adds a new maintainer address.
Parameters
removeMaintainer
Removes the maintainer address.
Parameters
totalAssets
Returns the total amount of tBTC allocated to MezoPortal including the amount that is currently hold by this contract.
getMaintainers
Returns the list of maintainers.
Last updated