How many xen nft you can mint in one wallet ? It seems like I have 126 nft minted in one wallet, but cannot mint any more.
I wander if I can clame them smoothly. Anyone have idea ?
Limit to how many XENFTs a wallet can hold?
I have 560+ but that's probably not recommended
- Edited
I've heard rumors (not sure if it's just gossip or a real problem) that the cost of XENFT goes up based on how many XENFTs you hold in your wallet. Word is, this caps out at around 3,000 XENFTs, when you can't mint further XENFTs due to block limits.
- Edited
So, let's analyze this a little...
There are many functions in the XENFT contract, but as far as I can tell, only this one seems to be impacted by the number of XENFTs person owns.:
_afterTokenTransfer
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
_ownedTokens[from].removeItem(tokenId);
_ownedTokens[to].addItem(tokenId);
}
It seems, that when someone transfers a XENFT, the system checks the list of all XENFTs the sender owns, in order to find and remove the specific XENFT that is being transferred. If the sender has many XENFTs, it takes longer for the system to find and remove the specific one that is being transferred, which has a direct implication on the cost of gas.
This is because _ownedTokens[from].removeItem(tokenId) searches for the tokenId of the XENFT in the array of tokens owned by from in order to be able to remove it. It appears that the worst-case scenario for this operation is when the tokenId is the last item in the array, which would require iterating through the entire array. Therefore, we can say, that the gas consumption for this operation is proportional to the number of tokens owned by from.
So, why does this happen? Well, think of it like searching for a specific book in a large library versus a small one. The larger the library (or the more XENFTs the sender has), the longer it takes to find that XENFT (or book). And that means, that more tokens the sender has, the more it might cost them in terms of the overall transaction fees because the system has to search through a longer list. Now, this won't be an issue for the receiver, because adding the token to their list is straightforward (like placing a book on an empty shelf), so it shouldn't matter how many XENFTs they already have (this action is quick).
Anyways, if I understand this correctly (DON'T QUOTE ME ON THIS ONE) this may also mean that there could be a limit on each chain, for how many XENFTs someone can hold, before being unable to transfer them.
Someone can do the math on this, but it'd likely be gas dependent...
--
For those that worry about claiming XEN from existing XENFT. As far as I can tell, the total number of XENFTs shouldn't impact claiming XENFT cost, which is handled by this function:
bulkClaimMintReward
function bulkClaimMintReward(uint256 tokenId, address to) external notBeforeStart nonReentrant {
require(ownerOf(tokenId) == _msgSender(), "XENFT: Incorrect owner");
require(to != address(0), "XENFT: Illegal address");
require(!mintInfo[tokenId].getRedeemed(), "XENFT: Already redeemed");
bytes memory bytecode = bytes.concat(
bytes20(0x3D602d80600A3D3981F3363d3d373d3D3D363d73),
bytes20(address(this)),
bytes15(0x5af43d82803e903d91602b57fd5bf3)
);
uint256 end = vmuCount[tokenId] + 1;
bytes memory callData = abi.encodeWithSignature("callClaimMintReward(address)", to);
bytes memory callData1 = abi.encodeWithSignature("powerDown()");
for (uint256 i = 1; i < end; i++) {
bytes32 salt = keccak256(abi.encodePacked(i, tokenId));
bool succeeded;
bytes32 hash = keccak256(abi.encodePacked(hex"ff", address(this), salt, keccak256(bytecode)));
address proxy = address(uint160(uint256(hash)));
assembly {
succeeded := call(gas(), proxy, 0, add(callData, 0x20), mload(callData), 0, 0)
}
require(succeeded, "XENFT: Error while claiming rewards");
assembly {
succeeded := call(gas(), proxy, 0, add(callData1, 0x20), mload(callData1), 0, 0)
}
require(succeeded, "XENFT: Error while powering down");
}
_setRedeemed(tokenId);
emit EndTorrent(_msgSender(), tokenId, to);
}
The Bulk Claim Mint Reward function shouldn't be impacted by the number of XENFTs held in someone's wallet, because bulkClaimMintReward function's gas consumption is influenced by the number of VMUs being claimed and not by the total number of XENFTs held in the wallet. Also the functions such as bulkClaimRank and bulkClaimRankLimited (for APEX) that initiate a creation of new XENFTs do not seem to be directly impacted by the number of XENFTs already held in the wallet.
In Base I had problems when the total amount of xenfts in the same wallet got near 100. I think this is the same issue that Razvan spotted when launching dbxenfts on polygon and the reason for the relaunch.
same issue on X1 Fastnet
I think it manifests on cheaper chains simply because to get to the limit (somewhere in thousands) on Ethereum, you'd need a lot of XENFTs (which would be expensive).
Even if the cost of claiming isn't impacted by the number of XENFTs in one address, keeping them all in one address has significant downsides:
- If you accidentally sign a malicious contract with that address, kiss them all goodbye.
- A single nonce limits you to claiming only one at a time, whereas if you had 1 XENFT per address you can put all of them in the transaction queue at low gas fees and let the transactions get confirmed asynchronously. Particularly important if you want to claim multiple XENFTs on the same day and want to save on gas.
Best practice would be to use one address per asset per network. Most wallet apps are hierarchical deterministic and make the use of multiple addresses a non-issue.
FieldBlue hey buddy yep 100 per address is a good number