Nobody knows about EthItem as a published standard.
The list of published standards is recorded at https://eips.ethereum.org/all
But if you have seen some draft, then maybe people are talking about it. And it would then be in a very early stage // definitely not at a point where you want to implement it.
Yes, you have the correct approach.
This is the only way to retrieve an arbitrarily large amount of data out of the blockchain.
Other options we considered were to return an array. However, this opens attack scenarios or denial of service when the returned array might be too large for a certain client.
Parameter names are not included in the specification.
You can confirm it is working correctly by using the interface included in the EIP and having your contract subclass (is) that.
But for address, that is a return type, not a name. So you might consider address addressOfOwner.
As you’re already extending OpenZeppelin’s ERC721 contract, simply extend ERC721Enumerable too, and you may then enumerate user’s tokens by calling tokenOfOwnerByIndex(user, index) for index = 0, 1, 2, …, balanceOf(user) - 1.
This can be achieved by the following:
Declare storage variables at the contract level
mapping(address => uint256) public userOwnedTokens;
mapping(uint256 => int256) public tokenIsAtIndex;
// Prior minting logic from OpenZeppelin
uint256 arrayLength = userOwnedTokens[msg.sender]....
The short answer is that it looks like the latter, unique id for each NFT, regardless of grouping (eg stadium). But to have NFT-like grouping there are a couple of considerations:
The nft example implementation uses an IS_NFT bit for id's with single supplies. Notice that mint uses a packId.
Perhaps this can be done more simply for your use case, or you can ...
Because the standard says so.
/// @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 ...
Unfortunately the best practices way is not a 1-liner.
You'll need to comb through the events that involved the account in question.
Here's some code that would work. Disclaimer: i'm only grabbing the Transfer events that involve incoming transfers your address in question. If tokens were transferred out of this address then you'll need to comb through ...
No, web3 doesn't know about all ERC721 token contracts, which would be required to call ownerOf() for each NFT.
What could be done: take a list of popular ERC721 contracts (like this one from Bloxy) and check the owner of each and every token, which is quite cumbersome.
Alternative, more convenient approaches would be to use third party APIs like Alchemy's ...
Cryptokitties - and quite probably other similar NFT projects - uses an offchain genetic algorithm1 to assemble the unique combinations.
There were various articles at the time that attempted to explain how such alogorithms (probably) worked, such as the one by Hackernoon (here). (I won't speculate further here.)
1 In computer science and operations research,...
You could use the Etherscan API for search the NFTs of an address like:
https://api.etherscan.io/api?module=account&action=tokennfttx&address=" + address + "&startblock=0&endblock=999999999&sort=asc&apikey=" + key
Where "address" is the address you want to retrieve and the "key" your API key (if you ...
In your example. You may create another map to record the init price, the key is unint256 key = tokenID/50, the value is the init price. Then the size of the map changes from 5000 to 100.
mapping (uint256 => uint256) public initPrice;
initPrice[tokenID / 50] = "the token's init Price xxxxxxx"
But it seems a bad idea and hard to updata.
In NFT creation and minting; the process is for the NFT owner to create the token (and mint the required quantity) and let the transfer of nft to buyers.
The process lets the owner of the nft bare the gas for creation and transfer(or mint).
Rather, the mint function can be called directly by the user who intends to buy, paying the gas and appropriate amount ...
There is an explanation in the original Github ERC721 thread about keeping the "unsafe" transfer function (comment from Dieter Shirley, alias "dete", one of the authors of EIP-721) :
Upon further reflection and discussion with @flockonus, we are
proposing to keep a straightforward (and therefore "unsafe")
transfer() method. (i....
You can create a DAO which can buy the NFTs and then you can fractionalize ownership of the DAO however you want.
This notably happened to purchase this NFT:
Nothing stops you from creating a contract which owns the NFT. The contract may have whatever logic to manage the NFT and it may even itself be an ERC20.
There are probably also EIP standards for such, but no idea which. Or you could directly consider using a multi-type standard: https://eips.ethereum.org/EIPS/eip-1155
First of all, ERC721 has its amount fixed as 1, so you might wanna use ERC1155.
If you want to create 1500K ERC721 or 1500 ERC1155(1K of each) collectibles, I would not suggest you create all of them in one go, as there is a high possibility that they will exceed the block gas limit.
From your question, I see that you have all the different token URIs stored ...
This is a very important topic, and it's been pointed out that not enough attention is given to it.
Ultimately, immutability is a bit of a spectrum. If somehow every last device storing the Bitcoin and Ethereum networks would be destroyed, the networks would be lost. Fortunately, that is improbable enough to not worry about. Similarly, even IPFS is not as ...
You can have multiple functions with the same name, as long as their signature is not the same. The parameters are also part of the signature, so the function signature of those two functions is different. So the functions do not get mixed up in any way. Whenever you call a contract function, you have to provide the parameters as well. The executed function ...
According to several formal implementations, ERC721 is not supposed to a divisible token by itself.
Although, you can deploy an ERC721 through an ERC20 and distribute its shares using the fungible ERC20 tokens.(not my idea, check below link)
Watch this for full explanation: DeFi + NFT Tutorial | Code a Re-Fungible Token (Solidity + Tests)
Rather than changing the tokenURI for every possible permutations, you can change the metadata stored at the location of URI and update tokenURI accordingly.
Assuming that metadata is in JSON format hosted at IPFS. Retrieve that metadata, change the required fields, for e.g "hair_color": "grey" and pin it so you will get a new IPFS hash, ...