Reputation: 325
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract MintWithERC20Test {
IERC20 token = IERC20(0x2de52C26AED95e4E618ec91b7F1cfb651214a4d8);
uint256 public cost = 99000000000000000000;
constructor() {
}
function depositToken(uint _amount, uint _mintAmount) public {
require(_amount >= cost * _mintAmount);
token.transferFrom(msg.sender, address(this), _amount);
//some code mint()
}
function getSmartContractBalance() external view returns(uint) {
return token.balanceOf(address(this));
} }
I want to launch my erc20 custom token on polygon and want to deploy this MintWithERC20Test contract on ethereum. Now as far as I know I cannot use the polygon token address on ethereum contract. So, is there any other way to use my polygon token as payment on ethereum contract? If I send some of my custom tokens from polygon to ethereum through bridging, will the above given code work? How will MintWithERC20Test contract then interact with my token? I am very confused about the use cases and benefits of bridginbg?
Another possible way I can think of listing my token on a market place. But to my knowledge, that will enable me to use my token as payment on polygon contracts only.
Please help. I am a new blockchain kid.
Upvotes: -1
Views: 110
Reputation: 83686
So, is there any other way to use my polygon token as payment on ethereum contract?
No
If I send some of my custom tokens from polygon to ethereum through bridging, will the above given code work?
No
How will MintWithERC20Test contract then interact with my token?
Please open a separate question if you do not know how to interact with deployed contracts.
I am very confused about the use cases and benefits of bridging?
Please open a separate question.
Upvotes: 0