VaultAdmin
Inherits: IVaultAdmin, Initializable, AccessControl, ReentrancyGuardUpgradeable, VaultAssetRegistryAdmin, VaultFundraiseAdmin, VaultWhitelistAdmin, Pausable
Contains the admin functions, constructor, initializer, immutable variables and state checking for AriaIPRWAVault.
Functions
initFundraise
Initializes the vault for fundraise.
Can not initialize both a fundraise and a whitelist vault.
function initFundraise(
address admin,
StoryAddrs memory storyAddrs,
AriaIPRWAVaultStorage.FractionalTokenDetails memory tokenDetails,
VaultFundraiseStorage.Setup memory fundraiseSetup,
uint48 mintTimelockDuration,
uint256 claimDeadline,
address legal
) public override initializer;Parameters
admin
address
The address of the admin of the vault
storyAddrs
StoryAddrs
The addresses of the Story Protocol's contracts - zero addr check is done in the factory contract.
tokenDetails
AriaIPRWAVaultStorage.FractionalTokenDetails
The details of the fractional token to be deployed
fundraiseSetup
VaultFundraiseStorage.Setup
The setup of the fundraise
mintTimelockDuration
uint48
The timelock duration (in seconds) for admin fractional token mints.
claimDeadline
uint256
The deadline for the users to claim the fractional token.
legal
address
The address of the legal contract that checks blacklist and license.
initWhitelist
Initializes the vault for whitelist.
Can not initialize both a fundraise and a whitelist vault.
Parameters
admin
address
The address of the admin of the vault
storyAddrs
StoryAddrs
The addresses of the Story Protocol's contracts - zero addr check is done in the factory contract.
tokenDetails
AriaIPRWAVaultStorage.FractionalTokenDetails
The details of the fractional token to be deployed
merkleRoot
bytes32
The merkle root of the whitelist
mintTimelockDuration
uint48
The timelock duration (in seconds) for admin fractional token mints.
claimDeadline
uint256
The deadline for the users to claim the fractional token.
legal
address
The address of the legal contract that checks blacklist and license.
amIAdmin
Simplest self admin check
execFractionalTokenMint
Executes a previously initiated fractional token mint after the timelock duration.
Can be triggered by anyone. Checks if the timelock has passed and transfers the tokens. Resets the pending mint state. Reverts if no mint is pending or the timelock has not been reached.
execTimelockUpdate
Executes a previously initiated update to the admin fractional token mint duration.
Can only be called by anyone. Checks if the timelock has passed and updates the duration. Resets the pending duration update state. Reverts if no duration update is pending or the timelock has not been reached.
initFractionalTokenMint
Initiates a timelocked mint of the vault's fractional tokens by the admin.
Can only be called by the owner. Records the mint details and sets the unlock timestamp. A mint must be executed via execFractionalTokenMint at/after the timelock passes. Reverts if there is already a pending mint.
Parameters
recipient
address
The address to receive the minted tokens.
amount
uint256
The amount of fractional tokens to mint.
initTimelockUpdate
Initiates a timelocked update for the admin fractional token mint duration.
Can only be called by the owner. Uses the current timelock duration for the delay. A duration update must be executed via execTimelockUpdate after the timelock passes. Reverts if there is already a duration update pending.
Parameters
newDuration
uint48
The proposed new duration in seconds.
recoverLostTokens
Recovers lost tokens
Only the admin can recover lost tokens, including fractional tokens as they are minted not sent to the vault.
Parameters
token
address
The address of the token to be recovered
to
address
The address of the recipient
setClaimDeadline
setPauseState
_initVault
_execTimelockUpdate
Internal function to execute a pending timelock duration update if the timelock has passed.
_isTimelockUpdateReady
_getAdjustedMintAmount
Calculates the mint amount adjusted to token's cap.
Parameters
fractionalTokenAddress
address
The address of the ERC20Capped fractional token.
requestedAmount
uint256
The amount of tokens requested to be minted.
Returns
<none>
uint256
The actual amount that can be minted, respecting the cap. Returns 0 if the cap is already met or if requestedAmount is 0.