HashLips / hashlips_nft_minting_dapp

HashLips minting dapp is a quick and easy way to connect your smart contract and start minting NFTs.
MIT License
1.02k stars 982 forks source link

Randomize the Mint #73

Open vd4663rv opened 2 years ago

vd4663rv commented 2 years ago

I am trying to randomize the mint on my dapp. Instead of minting in order 1,2,3,4, ect. I would like to mint a random nft from my collection. I am using the hashlips minting dapp but it only mints in order. Can anyone help?? Thanks!!

02jsc-2020 commented 2 years ago

to randomly mint, you may edit your smart contract, as I remember there are Youtube video mentioning about that. Or you just randomly generate your art using art engine by setting shuffleLayerConfigurations = true

image
heisenbergpromotions commented 2 years ago

My smart contract assigns a random token ID and random Image so it's not predefined in any sort order, nothing different is needed on the DAPP side unless you are making your own custom integration like I did. My DAPP currently mints, then displays the minted NFT on the home page, then the user has a gallery of owned NFT's. They can also "Merge" their NFT's to create a new NFT mint. Pretty fun

02jsc-2020 commented 2 years ago

sounds great @heisenbergpromotions, hope to try yours

Bonzi-Studios commented 2 years ago

I am having a similar issue @heisenbergpromotions, I have a randomly assigned smart contract and can not get the dapp to pull the correct minted data from the contract. I have been doing some research and I think there is a function that needs to be added into the contract to call the smart contract remaining supply to mint from a dapp. Have you found any solutions?

idolaru commented 2 years ago

I am experiencing the same issue right now.

I have the RandomlyAssigned extension in the contract and the minting dapp gives the error "the sale has ended" ... definitely a conflict here.

Bonzi-Studios commented 2 years ago

If you are following Hashlips and using his dapp code as your own as well....

uint256 public currentSupply = 0; @. do not change value here uint256 public _totalSupply = 1500; @. total number of collection tokens (Change or remove) uint256 public baseCost = 5 ether; @.*** base minting cost (Change) "ether" represents "Matic"

string public baseURI = "ipfs://.....replace/";

constructor() ERC721("replace", "replace") RandomlyAssigned(1500,1) // Max. # of NFTs available; Start counting from 1 (instead of 0) "1500"change, "1" Do Not Change { for (uint256 a = 1; a <= 20; a++) { @.*** allocates a set number of tokens for developer mint(); } }

function _baseURI() internal view virtual override returns (string memory) { return baseURI; }

function @.*** if using hashlips minting dapp remove "totalSupply" call from mint function public payable

after you remove the total supply call from the mint function, you need to go deep into the dapp (hashlips minting dapp) get into the block chain file and then into the redux file and open the data actionsJS. ... the call back to the total supply in here is MAXsupply if I remember ... that needs to be changed to call the total supply function in the Randomly assigned contract... the code should read like this

export const fetchData = () => { return async (dispatch) => { dispatch(fetchDataRequest()); try { let totalSupply = await store <---- totalSupply here calls back to your contract .getState() .blockchain.smartContract.methods.totalSupply() <--- replace whatever is there with totalSupply() .call(); // let cost = await store // .getState() // .blockchain.smartContract.methods.cost() // .call();

dispatch( fetchDataSuccess({ totalSupply, <---- replace it here also // cost, }) ); } catch (err) { console.log(err); dispatch(fetchDataFailed("Could not load data from contract.")); } }; };

I believe these were the only changes I needed to make to the dapp to correct the contract expired issue. If you want to send me the code where you are having troubles if this isnt helpful.

https://pandamonium-minter.netlify.app/ <--- Go here and mint pandas!!!

On Sun, Apr 3, 2022 at 11:20 AM idolaru @.***> wrote:

I am experiencing the same issue right now.

I have the RandomlyAssigned extension in the contract and the minting dapp gives the error "the sale has ended" ... definitely a conflict here.

— Reply to this email directly, view it on GitHub https://github.com/HashLips/hashlips_nft_minting_dapp/issues/73#issuecomment-1086900802, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXH5LMVHO3UWVQF4ANDWQCDVDHALNANCNFSM5OPK2GCQ . You are receiving this because you commented.Message ID: @.***>