Hot answers tagged

8 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 ...
  • 1,960
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 ...
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,962
4 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() ...
3 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 &...
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, ...
  • 52.5k
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

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

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 "...
  • 1,553
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.
  • 30.2k
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....
  • 1,081
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)...
  • 3,999
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 ...
  • 1,960
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

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,062
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 ...
  • 3,590
1 vote

Is it possible to the dev program a mint for later?

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 ...
  • 30.2k
1 vote

Send Token to Random Addresses

You randomness generation will not work. You rely on now (alias of block.timestamp, the timestamp when the block including your transaction was mined, https://docs.soliditylang.org/en/v0.4.21/units-...
1 vote

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 ...
  • 6,074
1 vote
Accepted

What does maxMintAmount mean?

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 ...
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 ...
1 vote

How to mint 10000 NFT at single or minimum no of transactions on ethereum?

Please see the smart contract for https://tenthousandsu.com. This includes: Mints 10,000 NFTs All at once And supports ERC-721 Enumerable Su Squares is the first ERC-721 contract, it is mentioned in ...
1 vote
Accepted

TypeError: Invalid implicit conversion from address to address payable requested

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 ...
  • 1,254
1 vote

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

Long Story short SuperRare havent limited themself. What you see Max Token Supply number actually is how many tokens are minted till now - how many tokens are burned till now Max Token Supply just ...
1 vote
Accepted

Lazy minting contract - How to deal with unique (off-chain) metadata

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 ...
1 vote
Accepted

ERC20 Mint Function returns "Uncaught (in promise) Error: Transaction has been reverted by the EVM"

function mintToken() private private means the function can only be called from within the contract itself, try to change it to public or external and it should work
  • 1,676

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