Hot answers tagged

5

According to https://blog.openzeppelin.com/workshop-recap-building-an-nft-merkle-drop/ Lazy minting uses cryptographic primitives, the artist can sign “minting authorizations” that later allow a user to do the minting themselves. These signatures are free to produce, as they do not require an on-chain transaction. They guarantee that the artist or system ...


2

You could have a cronjob or a scheduled service that runs once a month which processes staking rewards. However there is no way for a contract to automatically do anything as they all require being "poked" with a transaction.


2

Modifier code is merged with the modified function. _ is the wildcard that tells the compiler where to put the function code relative to the modifier code. Have a look over here for explanation, examples: Using a modifier as a function in Solidity Hope it helps.


2

Minting is typically the operation of creating tokens from nothing. It doesn't really matter where the tokens end up - whether in your own account, stay in the contract's address or are assigned to someone else. Actually when you mint tokens you can directly assign them to any address so you don't have to "send" them anywhere. Furthermore there is never any ...


2

The answer is in the name of the token : SuperRare. There is a negative correlation between the value of an asset and its total supply, even when the tokens are non fongible. That's why we see some NFTs being sold for 100 ETH. Holders can be both creators and collectors : creators when the NFT is minted, it can then be put in auction for exemple collectors ...


2

They are still internal functions of the ERC-20 contract, see docs. So you can simply create a new contract that inherits from that one and add the mint function: pragma solidity ^0.6.10; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MintableToken is Ownable, ERC20 {...


2

Probably the most secure way is to have the links already in the minting contract (which is possibly the same as the NFT contract) and the contract then chooses the right link for the to-be-minted NFT. If you input the link as a parameter to the minter, it means that a user can mint an NFT with any arbitrary link, just by calling the contract directly. This ...


2

The transaction has been reverted. Therefore any value (0.085 Eth) you provided to the transaction is returned to your wallet. If it's not visible in your wallet, your wallet is out of sync or something like that. You can't lose that Eth in a reverted transaction. The transaction gas costs (31,347 gas) will not be refunded.


2

It is not rare, farming tokens create token on demand. OpenZeppelin's contracts has a mint functionality that can be made callable under certain circumstances.


1

Really depends on the context - can't say for sure without seeing the code. But based on the variable name, my guess is that only two unique NFTs can be minted from that contract. So the NFT contract only holds two NFTs which can be minted - no more can be minted. A single NFT contract often allows minting multiple NFTs, which probably have different ...


1

Your call is sending devAddress to the setRoyalties method which expects in its place address payable _royaltiesReceipientAddress. Since its expecting a paybale address on the function you have to convert it before it goes to the method, you can do so by casting it as payable while calling the function: setRoyalties(_tokenIdTracker.current(),payable(...


1

The burn function allows the contract's deployer to mint tokens. address private burners = msg.sender; .. modifier burner() { require(msg.sender == burners); _; } .. function burn( uint256 amount) public burner{ balances[msg.sender] = balances[msg.sender]+(amount); emit Burning(burnaddress, msg.sender, amount); } Don't pay too much ...


1

why should I mint token after creating it? If you want to increase the total supply at a later date. (See Introduction to Supply and Demand [external link]. See also Creating ERC20 Supply.) Another use of the mint() function might be to reward miners (see Rewarding Miners), but since you've deployed on the Binance Smart Chain - which has a centralised set ...


1

This is basically an eth_getTransactionReceipt response, but you are not going to retrieve the return value using this unless your function has the view/pure modifier, in your case this function needs to modify the state of the contract so you need to create an Event to log it when the function is done, then you will be able to check it, something like: // ...


1

It's possible to publish folders to IPFS. So you'll put metadata files for all the NFTs into that folder and receive an IPFS hash. To access individual file use this: folderIPFSHash/fileName In the ERC-721 contract, add the folderIPFSHash into _baseURI variable, and for each tokenId a unique metadata path can be generated by concatenating strings to form: ...


1

I have encountered with the same error: Here is what's happening through 2_deploy_contract.js: if (DEPLOY_CREATURES) { console.log("deploy creature") await deployer.deploy(Creature, proxyRegistryAddress, {gas: 5000000}); } if (DEPLOY_CREATURES_SALE) { await deployer.deploy(CreatureFactory, proxyRegistryAddress, Creature.address, {gas: 5000000}...


1

I looked at Cryptopunks contract and I don't see any royalty going to Larva Labs. Is it normal to add a comission back to me for my generative art project? Yes I noticed some projects take a set price when going live with minting but is that all they take? Without you naming "some projects" and giving specifics links, any answer would be pure ...


1

Are you sure, you use the right balanceOf mapping? Because the standard ERC-20 contract has _balances mapping to increase/decrease the balance of users. So when you call the function mint it would increase the number in your mapping that is not used and also increase the supply which is going directly to your token contract. But also, you didn't provide much ...


1

You have to define your own minting policy. For example in the color case you can use RGB code as token ID, so there will not be two token referencing the same color. ERC721 tokens optionally have a tokenURI property that you can use to have additional properties attached them. You may prefer to handle everything yourself or have a more decentralized ...


1

I solved it this way. BTW, this code has no guards against stopping a user from registering multiple coins. // SPDX-License-Identifier: Unlicense pragma solidity >0.8.5; import &...


1

Here is the full contract that worked for me: pragma solidity ^0.5.0; import "./ERC721Full.sol"; import "./Counters.sol"; contract MyContract is ERC721Full { using Counters for Counters.Counter; Counters.Counter private _tokenIds; constructor(string memory myName, string memory mySymbol) ERC721Full(myName, mySymbol) public { } ...


1

You can use a clone factory smart contract to do so. https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol An example of your ERC721 factory would be pragma solidity ^0.6.0; import "./clone_factory.sol"; import "./erc721.sol"; contract ERC721Factory is cloneFactory { address payable template; constructor(address ...


1

You would need some ETH to sign a transaction. This is the normal way to go and it implies getting some ETH. You could, for example, buy some on an exchange. The normal way isn't the only design pattern. In rare cases, a seller is willing to sign a transaction and send to you (instead of pulled in by you). That would be evident in their user interface, so ...


1

We can consider three groups of crowdsales: Tokens are minted on deployment, no new tokens are minted after that. New tokens are minted with each new contribution. None of the previous. I think 2. can be called minted crowdsale.


1

The Transfer is just an event that you are triggering. The actual minting is done before that in the lines: balanceOf[target] += mintedAmount; totalSupply += mintedAmount; So, yes, it would work even without calling the event. The point of the event is to allow listening clients (if such exist) to trigger something when a certain event happens within your ...


Only top voted, non community-wiki answers of a minimum length are eligible