ERC721 NFT minting to accept custom ERC20 token as payment
zinderud
Mar 9
You can edit the mint function require the user to transfer certain ERC-20 tokens in your mint function. You can define a price for the ERC-721 tokens in terms of the ERC-20 token, and perform a transferFrom on the ERC-20 contract. Of course, the user should have to approve the ERC-721 contract as a spender. The code could look something like this. contract MyNFT is ERC721 { address tokenAddress; uint256 price; constructor(address _tokenAddress, uint256 _price) ERC721("MyNFT", "NFT") { tokenA...
ParagraphParagraph

zinderud

Written by
mokosam
Subscribe

2025 Paragraph Technologies Inc

PopularTrendingPrivacyTermsHome
Search...Ctrl+K

zinderud

Subscribe