Skip to content

Instantly share code, notes, and snippets.

@Turupawn
Created November 4, 2021 23:56
Show Gist options
  • Save Turupawn/458200374c2c47e702ab4f1db4f75997 to your computer and use it in GitHub Desktop.
Save Turupawn/458200374c2c47e702ab4f1db4f75997 to your computer and use it in GitHub Desktop.
/* Whitelist */
const mintWhitelist = async () => {
let mint_amount = document.getElementById("mint_amount").value
const result = await contract.methods.mintWhitelist(mint_amount)
.send({ from: accounts[0], gas: 0, value: NFT_PRICE * mint_amount })
.on('transactionHash', function(hash){
document.getElementById("web3_message").textContent="Minting...";
})
.on('receipt', function(receipt){
document.getElementById("web3_message").textContent="Success! Minting finished."; })
.catch((revertReason) => {
getRevertReason(revertReason.receipt.transactionHash);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment