const mint = (Juit) => {
if(contract){
contract.methods.mint(Juit).send({from:account[0]})
.once("receipt",(receipt) => {
setJuit(juit => [...juit, Juit])
})
}
else {
alert("Metamask not connected or smart contract not hosted");
}
}
mintnft
FrontendSnippetsmint() is a function that takes an object as an argument. The object contains an account object with two properties, from and to .mint() will call the contract's mint() method, with the from and to properties set to the account object's own values. The contract will fire once the receipt event has been Fired.
Shortcut: mint.nft
0 Comments
Add Comment
Log in to add a comment