ERC20 - Mint Tokens
You can utilize these features of the SDK if your contract implements the ERC20Mintable interface.
Mint Tokens
Mint tokens to a specified address.
- React
- Javascript
- Python
- Go
- Unity
const Component = () => {
const { contract } = useContract("{{contract_address}}");
const {
mutate: mintTokens,
isLoading,
error,
} = useMintToken(contract);
if (error) {
console.error("failed to mint tokens", error);
}
return (
<button
disabled={isLoading}
onClick={() => mintTokens({ to: "{{wallet_address}}", amount: 1000 })}
>
Mint!
</button>
);
};
This snippet is for v3 of the SDK. Learn how to upgrade.
View in React SDK Documentationconst amount = "1.5"; // The amount of this token you want to mint
await contract.erc20.mint(amount);
This snippet is for v3 of the SDK. Learn how to upgrade.
View in Javascript SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Python SDK documentation for more information.
Reach out on Discord for further assistance!
View Python SDK DocumentationThis feature is missing a code snippet or might not be supported yet.
Check the Go SDK documentation for more information.
Reach out on Discord for further assistance!
View Go SDK Documentationvar amount = "1.5"; // The amount of this token you want to mint
await contract.ERC20.Mint(amount);