Skip to main content
11 votes

ERC721 NFT minting to accept custom ERC20 token as payment

You can edit the mint function require the user to transfer certain ERC-20 tokens in your mint function. You can define a price for the ERC-721 tokens in terms of the ERC-20 token, and perform a ...
pbsh's user avatar
  • 2,471
6 votes
Accepted

What is Lazy Minting in Ethereum?

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 ...
AlphaColo's user avatar
6 votes
Accepted

VoidSigner cannot sign transactions

In here the signer for any method called to the contract should be the signer object instead of its address. Your code: try { const creatorEtherBalanceBeforeClaim = await signer.getBalance() ...
liorcito's user avatar
5 votes

How to implement "Mint" and "Own" in an ERC20 Token

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 &...
Markus - soliditydeveloper.com's user avatar
4 votes
Accepted

Why do crypto art NFT platforms set their minting token's max supply so low?

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-fungible. That's why we see some ...
clement's user avatar
  • 4,332
3 votes

How to issue new ERC 721 tokens for each individuals with different name and symbol

I solved it this way. BTW, this code has no guards against stopping a user from registering multiple coins. // SPDX-License-Identifier: Unlicense ...
Joel M Ward's user avatar
3 votes

I am getting the following error : RPC Error: Invalid parameters: must provide an Ethereum address

You are declaring accounts as an empty array: thus accounts[0] will be null. either declare it manually, or use this
Francesco Cannarozzo's user avatar
3 votes
Accepted

Is it possible to verify someone else's smart contract on Etherscan?

That is right. Anybody with the source code can verify any contract. For example, I deployed this contract: 0xD93f610B9b70E9aCda192091645F48ACfB63C676 with this account: ...
Jeremy Then's user avatar
  • 4,619
3 votes

How do I make a contract mint NFTs randomly with a metadata that's already on IPFS?

Yes, you are correct that Chainlink VRF is a good solution to generate a random number at mint time for your NFT, and it can help to prevent any potential exploitation of the contract. Here's example ...
Talha Sajid Chaudhary's user avatar
2 votes

What does the single line "_;" in OpenZeppelin's onlyMinter() function do?

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, ...
Rob Hitchens's user avatar
  • 55.4k
2 votes

How to issue new ERC 721 tokens for each individuals with different name and symbol

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 ^...
GraphicalDot's user avatar
2 votes
Accepted

Correct terminology for minting?

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 ...
Lauri Peltonen's user avatar
2 votes

What is it mean by minting token?

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 ...
Richard Horrocks's user avatar
2 votes
Accepted

Proof of Stake Automatic Timed Release of Token

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 "...
hextet's user avatar
  • 1,593
2 votes
Accepted

Would it be possible to create a token that you can mint on-demand?

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.
Ismael's user avatar
  • 30.4k
2 votes

Smart-contract and mint

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....
Lauri Peltonen's user avatar
2 votes

Help tracking down missing ETH

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 ...
Lauri Peltonen's user avatar
2 votes
Accepted

How to get token id?

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 ...
regcostajr's user avatar
2 votes

Try to mint from a contract but the hash is missing

This contract is basically a "challenge". You need to provide a hash that matches : sha256(abi.encodePacked(msg.sender, "emperor")) abi.encodePacked will just transform your data ...
hroussille's user avatar
  • 7,771
2 votes

Does ERC-1155 contract use less gas to mint tokens?

Does it actually save gas when minting tokens Yes it can save a a lot of gas when minting tokens. Lets look at the example below where I have created two simple OpenZeppelin contracts. One is an ...
Joseph Roccisano's user avatar
2 votes
Accepted

Ethers.js - Error when calling the mint function with eth value

The value parameter takes a string as input, so you don't need to convert the cost to an int. When you try to convert it it becomes too big to be a regular integer, and that's why you get the overflow....
Kenzo Agada's user avatar
  • 1,236
2 votes

Using ECDSA to verify a signature inside smart contract

In general there is no issue in using ecrecover the most important part is how you create the hash that you sign (e.g. include the contract address and chain id into the hash to prevent replay attacks)...
Richard's user avatar
  • 5,069
2 votes
Accepted

Minting dependent on NFT ownership

I'm assuming that both the contracts are created using this template based on the code you posted. Let's say contract A is deployed at ADDRESS_A. We'll need to add an interface to interact with ...
pbsh's user avatar
  • 2,471
2 votes
Accepted

purpose of nonReentrant modifier on onlyOwner withdraw method?

It's not because there already is onlyOwner that you don't need to add a nonReentrant. A smart contract should also prove to its users that an owner cannot cheat. Here, because the whole contract ...
Xavier Leprêtre B9lab's user avatar
2 votes
Accepted

NFT mint call reverted while testing

The failed transaction calls the function with id 0xba41b0c6 which refers to the function mint(uint256 amount, bytes32[] merkleProof) But there isn't a function mint with that signature in the ...
Ismael's user avatar
  • 30.4k
2 votes

OpenZeppelin ERC721: difference between safeMint and mint

There was the answer here: _mint vs _safeMint, which is best for ERC721? To summarize, safeMint is there to prevent someone minting ERC721 to a contract which does not support ERC721 transfer. So the ...
turboza's user avatar
  • 340
2 votes

Is it possible to verify someone else's smart contract on Etherscan?

Yes they could. And in fact if the contract has been deployed before (same bytecode), many explorers are automatically verifying it. But the big thing you should know is that people can interact ...
thefett's user avatar
  • 3,910
2 votes

What is minting ERC20 in Uniswap v3 contract?

It is using this contract from open zeppelin which has a _mint function. Above piece of code just mints the initial amount to the person who deploys the contract.
0x4e696b68696c's user avatar
2 votes

ERC721 Minting Randomness

The best practice you can implement Is to use Chain Link VRF V2 , for creating randomness. It will help you to create pure random numbers. But remember it will cost you link token as gas-fee. Bcz ...
Umar Raza's user avatar
2 votes

ERC721 Minting Randomness

I wrote a post using three different alternatives to create vrf numbers (Chainlink/API3 or Witnet). There is also a repo with the demo code. https://medium.com/coinmonks/schedule-randomness-with-...
donoso.eth's user avatar
  • 1,503

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