Assessment reports>Bond Protocol>Threat Models>mintToken

Function mintToken(address to,uint256 tokenId_,uint256 amount_) internal

INTERNAL FUNCTION

  1. Intended behavior.

    • The internal function, which allows minting amount_ of Bond tokenId_ tokens for to address and increase supply value for this tokenId_.

  2. 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.

  3. Preconditions.

    • User should send the corresponding amount of underlying tokens to contract before the mint

  4. Postconditions.

    • the user’s bondTokens balance should increase by amount

    • the issued token’s supply within the metadata mapping should increase by the value that was minted tokenMetadata[tokenId_].supply += amount_;

  5. Inputs.

    • user should have possibility to mint amount_ of tokens only in exchange for a corresponding amount_ of underlying tokens

    • tokenId_ value should be connected with underlying token address. Users shouldn't be able to deposit one type of underlying token and get other Bond tokens in return.

  6. Examine all function calls the function makes.

    a. Call to mint(to, tokenId_, amount_, bytes("")) and ERC1155TokenReceiver(to).onERC1155Received() see _handlePayout._mintToken description

Zellic © 2024Back to top ↑