Skip to main content

ERC20Mintable

Functionality available for contracts that implement the IERC20 and IMintableERC20 interfaces.

Allows the minting of new tokens into the contract.

mint

Mint tokens to the connected wallet.

const amount = "1.5"; // The amount of this token you want to mint
const txResult = await contract.erc20.mint(amount);
Configuration

amount

The amount of tokens to mint.

Must be a string or number.

const txResult = await contract.erc20.mint(
"1.5",
);

mintTo

The same as mint, but allows you to specify the address to mint the tokens to.

const toAddress = "{{wallet_address}}"; // Address of the wallet you want to mint the tokens to
const amount = "1.5"; // The amount of this token you want to mint
const txResult = await contract.erc20.mintTo(toAddress, amount);
Configuration

to

The wallet address to mint the tokens to.

Must be a string.

const txResult = await contract.erc20.mintTo(
"{{wallet_address}}",
"1.5",
);

amount

The number of tokens to mint.

Must be a string or number.

const txResult = await contract.erc20.mintTo(
"{{wallet_address}}",
"1.5",
);

getMintTransaction

Construct a mint transaction without executing it. This is useful for estimating the gas cost of a mint transaction, overriding transaction options and having fine grained control over the transaction execution.

const amount = "1.5"; // The amount of this token you want to mint
const tx = await contract.erc20.getMintTransaction(
"{{wallet_address}}", // Receiver of the tokens
amount,
);
Configuration

to

Address you want to mint the tokens to

Must be a string.

const tx = await contract.erc20.getMintTransaction(
"{{wallet_address}}",
"1.5",
);

amount

The amount of tokens you want to mint

Must be a string, number or BigNumber.

const tx = await contract.erc20.getMintTransaction(
"{{wallet_address}}", // Receiver of the tokens
"1.5",
);

Return Value

TransactionTask;