Function mintToken(address to,uint256 tokenId_,uint256 amount_) internal
INTERNAL FUNCTION
Intended behavior.
The internal function, which allows minting
amount_
of BondtokenId_
tokens forto
address and increasesupply
value for thistokenId_
.
Negative behavior.
Users should not have unrestricted access to this function. the calling function must control the all parameters, not allowing unlimited minting of any tokens.
Preconditions.
User should send the corresponding amount of
underlying
tokens to contract before themint
Postconditions.
the user’s
bondTokens
balance should increase byamount
the issued token’s supply within the
metadata
mapping should increase by the value that was mintedtokenMetadata[tokenId_].supply += amount_;
Inputs.
user should have possibility to mint
amount_
of tokens only in exchange for a correspondingamount_
ofunderlying
tokenstokenId_
value should be connected withunderlying
token address. Users shouldn't be able to deposit one type ofunderlying
token and get other Bond tokens in return.
Examine all function calls the function makes.
a. Call to
mint(to, tokenId_, amount_, bytes(""))
andERC1155TokenReceiver(to).onERC1155Received()
see_handlePayout._mintToken
description