Hot answers tagged

6

The problem of this standard is that it would not allow multiple owners of a token because each token is not divisible. Is there possibly confusion between the idea of divisibility and fractional ownership? They're quite different concerns. Divisibility is about division. For example, you can divide $100 into two $50 but you wouldn't want to saw a kitty in ...


4

The ERC721 Metadata standard does not enforce uniqueness of the returned tokenURI. It is allowable for two 721 tokens to return the same metadata. Whether this is appropriate is up to you to decide as you implement the 721 contract. Most likely in the code you run during the minting process you will assign the metadata and decide whether or not you want to ...


3

The uri need to point to a json file. The json file works with IPFS but over HTTP they usually add the ID of the NFT at the end of the URI which the IPFS Json file will no handle. Json file = IPFS (one file per NFT) <-- Decentralize API = HTTP request a DB by NFT ID. (one DB for all NFTs) <-- Centralized The Json format is used in all cases. This ...


3

To summarize : approve(address to, uint256 tokenId) : By calling this method, the sender authorizes the address to to transfer one of his tokens with the Id tokenId. setApprovalForAll(address to, bool approved) : By calling this method, the sender authorizes the address to to transfer all his tokens. to is then called an operator of the sender. In these ...


3

Let's take the open-zeppelin implementation of ERC721: _mint() function /** * @dev Internal function to mint a new token * Reverts if the given token ID already exists * @param to The address that will own the minted token * @param tokenId uint256 ID of the token to be minted by the msg.sender */ function _mint(address to, uint256 ...


3

I have requirement to create a platform on which users can register and create their own token with passing token name, price and so. Is it possible to develop such contract to create different token for different users? Using OpenZeppelin you can create either a fungible token ERC1155 or a non-fungible token ERC721. In case you want each platform user to ...


3

Interface support is advertised using ERC-165. This is documented in https://eips.ethereum.org/EIPS/eip-165 There are two cases where this is useful and these reasons motivated adding the feature as a requirement for all ERC-721 contracts: 1) Allowing off-chain entities (wallets, block explorers, Web3 clients) to recognize abilities of a contract. For ...


3

I'll come at this from a slightly different direction... The current price of ETH is ~$1500. The Yellow Paper states that storing a 256-bit (32-byte) word costs 20,000 gas. Average gas price is currently ~100 Gwei. That's 100 x 20,000 Gwei per 32 bytes, which is 2,000,000 Gwei, which is 0.002 ETH, which is $3. 1 GB is 1,073,741,824 bytes, so there are 33,554,...


2

Take a look at ERC-1155, https://github.com/ethereum/EIPs/issues/1155. This was designed by the Gnosis Team to address the problem of using ERC20 and ERC721 tokens in a case where when unique tokens would emerge. You can do that, and decompose/recompose according to rules to configure you will have the problem of gas cost for deploying a new contract each ...


2

Just create a JSON file following the "ERC721 Metadata JSON Schema" specified at https://eips.ethereum.org/EIPS/eip-721 Here is one simple example that meets the specification: { "name": "Square #00050", "description": "CoinGecko", "image": "https://tenthousandsu.com/erc721/00050....


2

No, this is not possible. Here is a more general explanation which is relevant and then application to your specific instance. ENTRIKEN'S LAW: Your ownership of assets on a ledger is only as valid as your trust in the custodian who has physical control of the assets. In your case, IPFS is the custodian which physically controls access to the media. So no,...


2

The main problem will be that all information on the blockchain is public. So you will not be able to store anything secret there. Therefore the process needs to include some elements outside the blockchain. Another problem you will face (as you noticed) is how to revoke access to the IPFS file. The only way I can think of is for the requests to come ...


2

Is it possible to somehow update an existing ERC-721 Token's MetaData after it was already minted? Yes. This is not disallowed by the standard and so you are free to do this. The official implementation of ERC-721 is maintained by 0xcert. It is free/open source and you can use the Metadata Mock contract as a starting point. You will simply add a public ...


2

The Ethereum transactions have a parameter called "nonce" representing the number of transactions sent from the address. You must increment this nonce each time you send a new transaction with the same address. So if you sign a transaction without broadcasting it, then send a new transaction to the network (with the same address and same nonce), ...


2

You need to write a public wrapper function for the _mint function. Since this function is internal, it can only be called from within the context of the contract itself. Something like: function addNewVideo(uint VideoN, uint ntokens, bytes memory IPFS_hash) public { _mint(msg.sender, VideoN, ntokens, IPFS_hash); }


2

It is easy to create an NFT that transfers a fixed fee to you at every transfer of this NFT. Just add transfer (of ETH, or an ERC-20/1155) to it. It is nearly impossible to get a transaction percentage every time a token is traded: Suppose somebody buys your token on Uniswap. Then your token receives from a Uniswap a message to be transferred. The token can ...


2

Yes you can create an NFT out of your video because you will use the hash of the content, not the content itself. Content should not be stored on the Blockchain. It's stored preferably on a decentralised storage or generated from the uint256 tokenId that can be used as the seed to generate an image, music, kitties, whatever. In your case you could store the ...


2

You are asking two questions really: What can be stored on-chain What can be stored economically Let's address them separately. What can be stored on-chain? The ERC-721 Metadata Extension (ERC721Metadata) and ERC-1155 Metadata Extension (ERC1155Metadata_URI) both specify that a URI can be attached to an NFT but the specifications are slightly different: ...


2

There are several questions here. Let's review. If crypto art is stored off-chain, how does the collector have any control over their NFT's contents if the server where it is saved shuts down? Answer: they have no control. Please refer to Entriken's law. ENTRIKEN'S LAW: Your ownership of assets on a ledger is only as valid as your trust in the custodian who ...


2

Gas is burned for units of work, like gas in your car is burned by miles. Different fees for different operations. A transaction will burn a certain amount of gas. GasPrice is like the price at the pump. What you are willing to pay for work. Miners will prioritize transactions with a higher bid for gasPrice. If a transaction runs out of gas before finishing, ...


2

Just to add to Rob's answer: Why are gas fees taken for failed smart contract interactions? Because there's no way to tell the difference between transactions that have failed due to user error, and those that have failed due to user malice. If gas fees weren't charged for failing transactions, then the network would be open to attack. A malicious user ...


2

The common way to know the number of token types (aka. tokenId) is to have a counter inside the ERC1155 contract, for instance: uint256 private _currentTokenID = 0; This way, whenever you need to create a new token, you use the current one and then increment it by one. It also allows you to do a loop in case you need to retrieve a list of all current ...


2

If contracts is an ERC721 then you can query how many tokens a user owns with balanceOf uint count = token.balanceOf(user); if (count > 0) { // User owns at least 1 index } If the tokens implements the optional ERC721Enumerable interface you can use tokenOfOwnerByIndex to retrieve the tokenId of owned tokens by a user. try token.tokenOfOwnerByIndex(...


2

Seems like you have two problems - the first is ownership verification and the second is trusted exchange. The first is pretty easy to solve with the OpenZeppelin docs for ERC-721. Looks like you're looking for ownerOf(tokenId), which assuming you know the address of the ERC-721 contract and the tokenId should return the address of the owner which you can ...


2

Because the standard says so. https://eips.ethereum.org/EIPS/eip-721 /// @dev This emits when ownership of any NFT changes by any mechanism. /// This event emits when NFTs are created (`from` == 0) and destroyed /// (`to` == 0). Exception: during contract creation, any number of NFTs /// may be created and assigned without emitting Transfer. At the time ...


1

this is done using "Factory" approach. You have a factory contract and it does this for you. Take a look at uniswap v2 contract factory: function createPair(address tokenA, address tokenB) external returns (address pair) { require(tokenA != tokenB, 'UniswapV2: IDENTICAL_ADDRESSES'); (address token0, address token1) = tokenA < ...


1

Rather than just checking for an address, you may want to check for a valid signature and recover the address from that signature, so that the user can proof that they have access to the address. Otherwise anyone could simply send an address that has the NFT to your server.


1

Practically, yes. The ERC-721 standard supports a transfer function. You can use that to allow people to send you tokens. Then you can use transfer again to send them to the one address. This is a well-known address that is unable to recover any assets sent to it. (The zero address is better known with the same feature, but the standard specifically ...


1

Why people waste money on lottery tickets? Why a person decides to climb a Mt. Everest when there is 2% chance to die? I think those questions are out of scope of this forum, so I suggest take some courses in human psychology. However I can answer my Cryptokitties are the most popular NFT It was the first NFT token, as Bitcoin was the first cryptocurrency. ...


1

ERC721 is used for unique assets. So something which nobody else can possess. A music song is not a unique asset: multiple people can own (a copy of) the same song. But for example original copyrights to the song might be unique: that asset can be owned by only one person. Each token has a (probably) different value and they are not interchangeable. But ...


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