> For the complete documentation index, see [llms.txt](https://v1-docs.mint.club/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v1-docs.mint.club/developers/mint.club-javascript-sdk/contract-interaction-react.js/minting-a-new-token.md).

# Minting a new token

This is an example of  minting a new token.

```jsx
import React from 'react';
import useWeb3Provider from 'hooks/useWeb3Provider';
import { getMintClubBondContract } from 'utils/contractHelpers';
import { useWeb3React } from '@web3-react/core';
import BigNumber from 'bignumber.js';

const BIG_TEN = new BigNumber(10);
const DEFAULT_TOKEN_DECIMAL = 18;

function CreateComponent() {
    const provider = useWeb3Provider();
    const { account } = useWeb3React();
    
    export const create = async (name, symbol, supply) => {
      const bondContract = getMintClubBondContract(provider.getSigner(account));
      return bondContract.createToken(
        name,
        symbol,
        new BigNumber(supply).times(BIG_TEN.pow(DEFAULT_TOKEN_DECIMAL)).toString(),
      );
    };

    export const createAndBuy = async (name, symbol, supply, amount, beneficiary) => {
      const bondContract = getMintClubBondContract(provider.getSigner(account));
      return bondContract.createAndBuy(
        name,
        symbol,
        new BigNumber(supply).times(BIG_TEN.pow(DEFAULT_TOKEN_DECIMAL)).toString(),
        new BigNumber(amount).times(BIG_TEN.pow(DEFAULT_TOKEN_DECIMAL)).toString(),
        beneficiary || AddressZero,
      );
    };
    
    return (
      <button
        onClick={async () => {
          try {
            const tx = // call create or createAndBuy depending on the situation
            await tx.wait();
          } catch (e) {
            console.error(e);
          }
        }}
      >
        Create Token
      </button>
    );
}
```
