# Flash Mint Support

Expanding the array of functionalities offered by TUP, we introduced support for Flash Mint, catering to developers who choose to utilize or integrate TUP into their services and protocols.

To explain the mechanism, Flash Mint, in tandem with the TUP protocol, operates as follows: any address can interact with the contract by employing the function **`flashMint(`**`uint256 tupAmountToBorrow, bytes calldata data`**`)`**. This function allows specifying the desired amount of TUP to be minted/borrowed, along with additional arbitrary parameters encoded as `bytes calldata`. After invoking the function, the contract will return to the caller and execute the **`doSomething(`**`uint256 amountTup, uint256 fee, bytes calldata data`**`)`** function. It is essential to declare the **`doSomething()`** function and include the necessary logic to cover the operation's fees upon execution.

Notably, the fees must be paid in the native cryptocurrency token, amounting to 1% of the total TUP value generated. Despite potential debates over the service cost, we have concluded that this fee is equitable, given that all collected funds are distributed evenly to token holders as dividends, without any discrimination. Furthermore, it's important to bear in mind that Flash Mint can only generate an amount equivalent to the total supply for the smart contract on the specific network.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.timetoken.finance/time-is-up-tup-+-worker/flash-mint-support.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
