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 ...
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 ...
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()
...
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 &...
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 ...
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 ...
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: ...
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 ...
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, ...
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 ^...
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 ...
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 ...
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 "...
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.
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....
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 ...
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 ...
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 ...
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....
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)...
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 ...
2
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
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 ...
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 ...
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 ...
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.
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 ...
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-...
2
votes
Accepted
I have an existing ERC721A smart contract deployed but how can I change public mint price and open that contract?
There is a function in your contract named updatePublicSalePrice(), which lets you update the price of your public sale.
function updatePublicSalePrice(uint256 _newPrice) public onlyOwner {
...
1
vote
How to mint 10000 NFT at single or minimum no of transactions on ethereum?
You can also look at the ERC721A contract. The contract supports minting of multiple NFTs at gas cost of one.
There are some limitations, though:
Token IDs must be subsequent
Reducing the gas costs ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mint × 170nft × 72
solidity × 56
erc-721 × 47
tokens × 26
erc-20 × 22
erc-1155 × 12
contract-development × 11
web3js × 10
remix × 10
burn × 8
gas × 7
etherscan × 7
ethers.js × 7
ether × 6
metamask × 5
contract-deployment × 5
openzeppelin × 5
smart-contract-wallets × 5
opensea × 5
contract-design × 4
gas-price × 4
ethereum-classic × 4
openzeppelin-contracts × 4
chainlink × 4