-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_mintERC115NFT
35 lines (32 loc) · 873 Bytes
/
_mintERC115NFT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import {
useContract,
useMintNFTSupply,
Web3Button,
} from "@thirdweb-dev/react";
const contractAddress = "{{contract_address}}";
const walletAddress = "{{wallet_address}}";
const tokenId = "{{token_id}}";
const additionalSupply = "{{additional_supply}}";
function App() {
// Contract must be an ERC-1155 contract that implements the ERC1155Mintable interface
const { contract } = useContract(contractAddress);
const {
mutateAsync: mintNftSupply,
isLoading,
error,
} = useMintNFTSupply(contract);
return (
<Web3Button
contractAddress={contractAddress}
action={() =>
mintNftSupply({
additionalSupply: additionalSupply, // 777777
to: walletAddress, // Address to mint to
tokenId: tokenId, // Token ID to add supply to
})
}
>
Mint NFT Supply
</Web3Button>
);
}