0

I have a ERC721 smart contract deployed on polygon test network mumbai.

I'm calling the mint function directly on my website, using ethers.js, to create a NFT:

const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = await provider.getSigner();
const accountSigner = await signer.getAddress();
const contractInstanceWrite = new ethers.Contract(myContractAddress, abi, signer);
mint = await contractInstanceWrite.mint(accountSigner, 1, { gasPrice: gas_price, gasLimit: gas_limit, value: cost });

It prompts MetaMask to pay the cost with MATIC, but I want to prompt it to directly pay with WETH (As I know, the fees must be paid with MATIC but the cost of the NFT can be with another token).

How to do this?

Thank you very much!

user2342558
  • 240
  • 1
  • 4
  • 11

0 Answers0