CRYPTO NEWS

Hackers Target Solana Wallets amid Bearish Wave

Solana reported a hacking attack that compromised over 8,000 wallets while writing this post. The hacking attack is believed to have stolen around $7 million in funds in SPL, SOL, and other tokens. Most of the wallets targeted by the hackers were inactive for at least six months. The news adds to the ongoing grim …

Mint NFT through React frontend

I need advice on how to structure my contract. I will have 3 types of NFTs with a limited supply for each, that will be available for purchase through the website. I’m using the ERC21 contract and this is what my mint function looks like: function mint(uint256 index, address to) external whenNotPaused returns (uint256) {::Listen

I need advice on how to structure my contract. I will have 3 types of NFTs with a limited supply for each, that will be available for purchase through the website. I’m using the ERC21 contract and this is what my mint function looks like:

function mint(uint256 index, address to)         external         whenNotPaused         returns (uint256)     {         if (index == 0) {             uint256 totalMinted = _tokenIdTypeOneCounter.current();             require(                 totalMinted <= NFTTypes[index].maxSupply,                 "All NFTs are minted!"             );              _tokenIdTypeOneCounter.increment();              uint256 tokenID = _tokenIdTypeOneCounter.current();              TokenTypes[tokenID] = index;             _safeMint(to, tokenID);              return tokenID;         }          if (index == 1) {             uint256 totalMinted = _tokenIdTypeTwoCounter.current();             require(                 totalMinted <= NFTTypes[index].maxSupply,                 "All NFTs are minted!"             );              _tokenIdTypeOneCounter.increment();              uint256 tokenID = _tokenIdTypeTwoCounter.current();              TokenTypes[tokenID] = index;             _safeMint(to, tokenID);              return tokenID;         }          if (index == 2) {             uint256 totalMinted = _tokenIdTypeThreeCounter.current();             require(                 totalMinted <= NFTTypes[index].maxSupply,                 "All NFTs are minted!"             );              _tokenIdTypeOneCounter.increment();              uint256 tokenID = _tokenIdTypeThreeCounter.current();              TokenTypes[tokenID] = index;             _safeMint(to, tokenID);              return tokenID;         }          return 0;     } 

Now the question is how do I set my price for each NFT? The price would be dynamic and I will use ponder value for each NFT depending on the current price of the token on the market. I can pull the token price on the front end using the API from chainlink. Do I make the payment using the front end and then when is successful I mint the NFT or do I set the price directly in the smart contract somehow, but the issue is the price should be dynamic and pulled using API?

Hackers Target Solana Wallets amid Bearish Wave

Shopping cart
There are no products in the cart!
Continue shopping
0