Author

Topic: nft smart contract (Read 45 times)

newbie
Activity: 38
Merit: 0
May 07, 2022, 09:24:25 AM
#1
i make a smart contract nft using :

https://github.com/HashLips/solidity_smart_contracts/blob/main/contracts/NFT/NFT.sol



 now to add mint button on website i try :


Code:


.....



//Sending Ethereum to an address
sendEthButton.addEventListener('click', () => {
  ethereum
    .request({
      method: 'eth_sendTransaction',
      params: [
        {
          from: window.userWalletAddress,
          value: '0x00',
          to: '*SMART CONTRACT ADDRESS*',
  data: '70a08231000000000000000000000000d0*SMART CONTRACT ADDRESS*',
          gasPrice: '0x09184e72a000',
          gas: '0x2710',
        },
      ],
    })
    .then((txHash) => console.log(txHash))
    .catch((error) => console.error);
});

ethereumButton.addEventListener('click', () => {
  getAccount();
});



.....





the metamask button is greyed out

what can be the problem ?
Jump to: