'Ethereum Donation Function defining by tiers of NFT's (Reactjs, Web3)
Hope you all having a great week!
I'm having a few issues with NFT's and already deployed a smart contract. Here's the problems I have at the moment and where I need some clarification because I was not able to find any info about it.
I'm doing the NFT's mint function, where the contact and ABI I'm taking from already deployed smart contract. The whole NFT function's purpose is for donation. There are only 5 NFT's released and depending on NFT's trier (index) the price will differ. Because we have an index from 1 to 5.
The question is, how I can access those tiers from Smart contact and assign different prices on them when the buyer chooses from 5 different NFT's.
Here's my code where I was able to access the Metamask and make the first mint, but It does not directly target the specific tiers (index).
As well, the connection with Metamask is already handled and working.
Any help will be appreciated, or any info where I can understand how I could go around making this Minting depending on tiers function. Thanks in advance!!!
const provider = new ethers.providers.Web3Provider(window.ethereum)
const signer = provider.getSigner();
const contract = new ethers.Contract(contractAddress, ContractAbi, signer);
const mintToken = async () => {
const connection = contract.connect(signer);
const addr = connection.address;
const result = await contract.donate(addr, {
value: ethers.utils.parseEther('0.05'),
});
await result.wait();
};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
