1

I have written a contract to mint NFT in solidity. I intend to deploy it to Polygon eventually. There’s a slight confusion, I have put the price in my contract as 0.1 ether which works fine on Rinkeby. When I deploy the same contract on Mumbai Polygon price value 0.1 is deducted but in matic instead of ether. Now this makes sense because ether essentially represents the default coin of deployed chain. My requirement is to ask users to bridge their ethers to Polygon (just like we do for OpenSea) and then pay using ether. How can I force this check that incoming value is in ether otherwise reject transaction?

2 Answers2

0

If you want to make payment in Ether in polygon, you need to use pegged Ether in polygon chain, which is ERC20 token. Ask user to approve 0.1 pegged ETHER for your contract and make transfer from mg.sender by 0.1 ETHER.

gazoblock
  • 336
  • 2
  • 5
0

You will need to accept Wrapped Ether. (Wrapped Ether is a version of Ethereum pegged onto Polygon or any other chain)

You will implement this just like accepting any other token on Solidity, see this: deposite and withdraw erc20 token using smart contract

AvocadoChocolate
  • 995
  • 5
  • 14