should be with ERC20 token that i have created before, i always get en error something like: gas estimation, your transaction is gonna fail. I'm too tired of it, i almost tried everything. Any example someone of you have that i can see and learn what my mistake is?
Any ideas? 😄
Use erc1155
Hard to tell without seeing the code. Can you post the minting function?
function mint (uint256 _mintAmount) public payable { uint256 supply = totalSupply(); require(_mintAmount > 0); require(supply + _mintAmount <= maxSupply); if (msg.sender != owner()) { require(!paused, "MINTING IS PAUSED"); require(_mintAmount <= maxMintAmount, "YOU CAN'T MINT MORE THAN MAX AMOUNT PER TRANSCTION"); IERC20(MyERCTokenAddress).basicTransferFrom(msg.sender, address(this), 100); uint256 ownerTokenCount = balanceOf(msg.sender); require(ownerTokenCount < nftLimitPerAddress); require(msg.value >= cost * _mintAmount); } for (uint256 i = 1; i <= _mintAmount; i++) { _safeMint(msg.sender, supply + i); } }
Обсуждают сегодня