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 …
CRYPTO NEWS
Hackers Target Solana Wallets amid Bearish Wave
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?
Showing 1–8 of 312 results
-
Electroneum ETN Unisex Twill Crypto Hat
USD$25.30 Select options -
Pearl Crypto Coin Unisex Trucker Hat
USD$28.08 Select options -
Insight Chain INB Crypto Coin Unisex Trucker Hat
USD$28.08 Select options -
DASH Unisex Twill Crypto Hat
USD$25.30 Select options -
Naga NGC Crypto Coin Unisex Trucker Hat
USD$28.08 Select options -
Paypex PAYX Crypto Coin Unisex Trucker Hat
USD$28.08 Select options -
Poet POE Crypto Coin Unisex Trucker Hat
USD$28.08 Select options -
Cardano ADA Unisex Twill Crypto Hat
USD$25.30 Select options
