How to mint FLOW Tokens in the Emulator

The emulator runs a local version of the flow blockchain for developers to use for testing their smart contracts. Whenever you start an instance of the emulator, you have access to all the configuration options and keys. The FlowToken contract and the FungibleToken contracts are automatically deployed to the emulator on startup, (see emulator addresses here) and minting FLOW is controlled by the Service account, which is also pre-created at startup.

You can access the service account and service account keys within your testing code to run this transaction to mint Flow Tokens.

Here is an example of how this is done in the Go tests for the core contracts:

I’ll look for a JS example also

2 Likes