DEV Community

Discussion on: How to Create an ERC20 Token in Solidity

Collapse
 
roni_sommerfeld profile image
RoNi Sommerfeld

Hello, is it possible to use an ERC20 token inside a function of an ERC721 token?
To better explain what I want to do is as follows.
Before minting an ERC721 token (Item of my game) I want to check if the player has my token (ERC20) in his wallet, if he has he could mint it...
Is it possible to do that? Thanks.

Collapse
 
abdulmaajid profile image
Abdul Maajid

Hey

If you want to access/use ERC20 Token in any contract Just create an interface of ERC20 Token. And pass your erc20 contract address in this interface then you can access.
e.g. IERC20 token = IERC20(address)