I have created a custom ERC20 token and that is currently deployed on testnet and will launch it on polygon in future.
Solidity
uint256 public cost = 0.001 ether;
function test(uint256 _mintAmount) public payable {
require(msg.value >= cost * _mintAmount);
//some code
}
I want to use my custom token in place of ether. How do I do it? Is there any straight forward way for it? And if want to use a react dapp how may I do that? Currently for Ethereum, my react dapp is configured as follow-
"WEI_COST": 1000000000000000,
Please help.