Function: preCollateralizedMint(MintParams params, bytes signature)
This function mints an amount of USDf tokens to the recipient with a signature.
Inputs
params
Control: Fully controlled by the caller.
Constraints: N/A.
Impact: Struct of
MintParams
that has information for minting.
signature
Control: 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.collateralRef
is not zero.Check if
params.amount
is bigger than zero.Check if
params.recipient
is not the zero address.Check if
params.expiry
is bigger thanblock.timestamp
.Check if
params.nonce
is not used.Build signature with
MintParams
for verification.Check if the recovered address using the signature has
MINTER_ROLE
.Mint an amount of
params.amount
USDf forparams.recipient
.
Negative behavior
If
params.collateralRef
is zero, the transaction will be reverted.If
params.amount
is not bigger than zero, the transaction will be reverted.If
params.recipient
is the zero address, the transaction will be reverted.If
params.expiry
is not bigger thanblock.timestamp
, the transaction will be reverted.If
params.nonce
is used, the transaction will be reverted.If the recovered address using the signature does not have
MINTER_ROLE
, the transaction will be reverted.