A bit new to ETH development. I am trying to create a contract that helps me receive tokens of a particular address on the ETH network. For testing purposes, I am creating my own Token on the testnet using the OpenZeppelin implementation.
pragma solidity ^0.8.0;
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol';
contract Token is ERC20{
address public admin;
constructor() ERC20('MyToken', 'MTN'){
_mint(msg.sender, 10000 * 10 ** 18);
admin = msg.sender;
}
function mint(address to, uint ammount) external{
require(msg.sender == admin, "Only Admin Can Mint");
_mint(to, ammount);
}
function burn(uint ammount) external {
_burn(msg.sender, ammount);
}
}
For my contract, I am checking the address of the token being sent to validate the transaction.
function enter() public payable {
IERC20 token = IERC20(`0x123`); // Insert the token contract address instead of `0x123`
require(token.transferFrom(msg.sender, address(this), .01 ether));
}
My question is on the testnet, how do I know what the contract address of this newly created token is?