Function: preCollateralizedMint(MintParams params, bytes signature)
This function mints an amount of USDf tokens to the recipient with a signature.
Inputs
paramsControl: Fully controlled by the caller.
Constraints: N/A.
Impact: Struct of
MintParamsthat has information for minting.
signatureControl: Fully controlled by the caller.
Constraints: The address recovered using the generated hash and corresponding signature must possess the
MINTER_ROLE.Impact: Bytes of signature.
Branches and code coverage
Intended branches
Check if
params.collateralRefis not zero.Check if
params.amountis bigger than zero.Check if
params.recipientis not the zero address.Check if
params.expiryis bigger thanblock.timestamp.Check if
params.nonceis not used.Build signature with
MintParamsfor verification.Check if the recovered address using the signature has
MINTER_ROLE.Mint an amount of
params.amountUSDf forparams.recipient.
Negative behavior
If
params.collateralRefis zero, the transaction will be reverted.If
params.amountis not bigger than zero, the transaction will be reverted.If
params.recipientis the zero address, the transaction will be reverted.If
params.expiryis not bigger thanblock.timestamp, the transaction will be reverted.If
params.nonceis used, the transaction will be reverted.If the recovered address using the signature does not have
MINTER_ROLE, the transaction will be reverted.