ERC721: How to get the owned tokens of an addressERC721 ownedTokens array length limitations on owners with thousands of tokensHow to know which ERC20 tokens a wallet owns?List ERC721 tokens owned by a user on a web pageProper way to implement “buyable” ERC721 tokensHow do ERC721 tokens get created on private blockchain?How can there be a balance for an ERC721 contract?Two ERC721 tokens that refer to the same metadataGet ERC721 token total supply using web3.jsWhat is the difference between the transfer and transferFrom function in an ERC721 contractDeploy ERC721 tokens to many addresses
How do you talk to someone whose loved one is dying?
If I can solve Sudoku, can I solve the Travelling Salesman Problem (TSP)? If so, how?
Meme-controlled people
Is a party consisting of only a bard, a cleric, and a warlock functional long-term?
Python if-else code style for reduced code for rounding floats
Life insurance that covers only simultaneous/dual deaths
I am confused as to how the inverse of a certain function is found.
Do I need to be arrogant to get ahead?
How could a scammer know the apps on my phone / iTunes account?
Bacteria contamination inside a thermos bottle
How to make healing in an exploration game interesting
Official degrees of earth’s rotation per day
Is it insecure to send a password in a `curl` command?
Professor being mistaken for a grad student
Describing a chess game in a novel
What exactly is this small puffer fish doing and how did it manage to accomplish such a feat?
"of which" is correct here?
Are Roman Catholic priests ever addressed as pastor
Why won't this compile? Argument of h has an extra {
How to solve this challenging limit?
What is a ^ b and (a & b) << 1?
Print a physical multiplication table
Bach's Toccata and Fugue in D minor breaks the "no parallel octaves" rule?
Employee lack of ownership
ERC721: How to get the owned tokens of an address
ERC721 ownedTokens array length limitations on owners with thousands of tokensHow to know which ERC20 tokens a wallet owns?List ERC721 tokens owned by a user on a web pageProper way to implement “buyable” ERC721 tokensHow do ERC721 tokens get created on private blockchain?How can there be a balance for an ERC721 contract?Two ERC721 tokens that refer to the same metadataGet ERC721 token total supply using web3.jsWhat is the difference between the transfer and transferFrom function in an ERC721 contractDeploy ERC721 tokens to many addresses
There is a balanceOf function, but it only displays one uint (the token identifier)
I see most ERC721 tokens doing this so I am confused on how to view all owned tokens.
solidity web3js erc-721
add a comment |
There is a balanceOf function, but it only displays one uint (the token identifier)
I see most ERC721 tokens doing this so I am confused on how to view all owned tokens.
solidity web3js erc-721
add a comment |
There is a balanceOf function, but it only displays one uint (the token identifier)
I see most ERC721 tokens doing this so I am confused on how to view all owned tokens.
solidity web3js erc-721
There is a balanceOf function, but it only displays one uint (the token identifier)
I see most ERC721 tokens doing this so I am confused on how to view all owned tokens.
solidity web3js erc-721
solidity web3js erc-721
asked 2 hours ago
BlockchainBoyBlockchainBoy
456
456
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
The function balanceOf actually returns the number of owned tokens and not the identifier of an owned token.
Therefore I'd assume the process could go something like this:
1) Find out how many tokens an address has (balanceOf). If this is more than zero, continue the process.
2) Find out which tokens exist in the contract. The standard offers no direct functionality for this so this depends on the implementation. Or, as is probably the case, simply start enumerating from zero upwards hoping that the tokens are enumerable in that way (and not assigned for example to random numbers). So you would check "does someone own token 0? does someone own token 1? .."
3) Once you have found all the tokens owned by the address you can stop the process.
add a comment |
There is basically no way to easily view all owned tokens. My Ethereum wallets own probably lots of random worthless tokens which someone has airdropped and I don't even know about it.
Some services (wallets) display many of the owned tokens. I'm unsure how exactly they do that but most likely they simply have a database of known token contracts and they check whether a certain address owns those known tokens.
If I now created a new token and donated some of it to random wallets nobody would probably know about it unless I somehow tell wallet creators "please include my token contract in your checks".
At least myetherwallet used to display all (known) ERC20 tokens still about a year ago but the quickly they gave up and last I checked you had to manually enter the contract address to see those tokens. The amount of different token contracts exploded a year ago and it was probably too much hassle to try to keep track of them (to store them all in their database).
I am looking at a specific token, I don't see a easy way to check this from the token's contract
– BlockchainBoy
2 hours ago
Ah, sorry, I had misunderstood the question. My answer is not so relevant in that case.
– Lauri Peltonen
2 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "642"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f68438%2ferc721-how-to-get-the-owned-tokens-of-an-address%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The function balanceOf actually returns the number of owned tokens and not the identifier of an owned token.
Therefore I'd assume the process could go something like this:
1) Find out how many tokens an address has (balanceOf). If this is more than zero, continue the process.
2) Find out which tokens exist in the contract. The standard offers no direct functionality for this so this depends on the implementation. Or, as is probably the case, simply start enumerating from zero upwards hoping that the tokens are enumerable in that way (and not assigned for example to random numbers). So you would check "does someone own token 0? does someone own token 1? .."
3) Once you have found all the tokens owned by the address you can stop the process.
add a comment |
The function balanceOf actually returns the number of owned tokens and not the identifier of an owned token.
Therefore I'd assume the process could go something like this:
1) Find out how many tokens an address has (balanceOf). If this is more than zero, continue the process.
2) Find out which tokens exist in the contract. The standard offers no direct functionality for this so this depends on the implementation. Or, as is probably the case, simply start enumerating from zero upwards hoping that the tokens are enumerable in that way (and not assigned for example to random numbers). So you would check "does someone own token 0? does someone own token 1? .."
3) Once you have found all the tokens owned by the address you can stop the process.
add a comment |
The function balanceOf actually returns the number of owned tokens and not the identifier of an owned token.
Therefore I'd assume the process could go something like this:
1) Find out how many tokens an address has (balanceOf). If this is more than zero, continue the process.
2) Find out which tokens exist in the contract. The standard offers no direct functionality for this so this depends on the implementation. Or, as is probably the case, simply start enumerating from zero upwards hoping that the tokens are enumerable in that way (and not assigned for example to random numbers). So you would check "does someone own token 0? does someone own token 1? .."
3) Once you have found all the tokens owned by the address you can stop the process.
The function balanceOf actually returns the number of owned tokens and not the identifier of an owned token.
Therefore I'd assume the process could go something like this:
1) Find out how many tokens an address has (balanceOf). If this is more than zero, continue the process.
2) Find out which tokens exist in the contract. The standard offers no direct functionality for this so this depends on the implementation. Or, as is probably the case, simply start enumerating from zero upwards hoping that the tokens are enumerable in that way (and not assigned for example to random numbers). So you would check "does someone own token 0? does someone own token 1? .."
3) Once you have found all the tokens owned by the address you can stop the process.
answered 1 hour ago
Lauri PeltonenLauri Peltonen
5,8382525
5,8382525
add a comment |
add a comment |
There is basically no way to easily view all owned tokens. My Ethereum wallets own probably lots of random worthless tokens which someone has airdropped and I don't even know about it.
Some services (wallets) display many of the owned tokens. I'm unsure how exactly they do that but most likely they simply have a database of known token contracts and they check whether a certain address owns those known tokens.
If I now created a new token and donated some of it to random wallets nobody would probably know about it unless I somehow tell wallet creators "please include my token contract in your checks".
At least myetherwallet used to display all (known) ERC20 tokens still about a year ago but the quickly they gave up and last I checked you had to manually enter the contract address to see those tokens. The amount of different token contracts exploded a year ago and it was probably too much hassle to try to keep track of them (to store them all in their database).
I am looking at a specific token, I don't see a easy way to check this from the token's contract
– BlockchainBoy
2 hours ago
Ah, sorry, I had misunderstood the question. My answer is not so relevant in that case.
– Lauri Peltonen
2 hours ago
add a comment |
There is basically no way to easily view all owned tokens. My Ethereum wallets own probably lots of random worthless tokens which someone has airdropped and I don't even know about it.
Some services (wallets) display many of the owned tokens. I'm unsure how exactly they do that but most likely they simply have a database of known token contracts and they check whether a certain address owns those known tokens.
If I now created a new token and donated some of it to random wallets nobody would probably know about it unless I somehow tell wallet creators "please include my token contract in your checks".
At least myetherwallet used to display all (known) ERC20 tokens still about a year ago but the quickly they gave up and last I checked you had to manually enter the contract address to see those tokens. The amount of different token contracts exploded a year ago and it was probably too much hassle to try to keep track of them (to store them all in their database).
I am looking at a specific token, I don't see a easy way to check this from the token's contract
– BlockchainBoy
2 hours ago
Ah, sorry, I had misunderstood the question. My answer is not so relevant in that case.
– Lauri Peltonen
2 hours ago
add a comment |
There is basically no way to easily view all owned tokens. My Ethereum wallets own probably lots of random worthless tokens which someone has airdropped and I don't even know about it.
Some services (wallets) display many of the owned tokens. I'm unsure how exactly they do that but most likely they simply have a database of known token contracts and they check whether a certain address owns those known tokens.
If I now created a new token and donated some of it to random wallets nobody would probably know about it unless I somehow tell wallet creators "please include my token contract in your checks".
At least myetherwallet used to display all (known) ERC20 tokens still about a year ago but the quickly they gave up and last I checked you had to manually enter the contract address to see those tokens. The amount of different token contracts exploded a year ago and it was probably too much hassle to try to keep track of them (to store them all in their database).
There is basically no way to easily view all owned tokens. My Ethereum wallets own probably lots of random worthless tokens which someone has airdropped and I don't even know about it.
Some services (wallets) display many of the owned tokens. I'm unsure how exactly they do that but most likely they simply have a database of known token contracts and they check whether a certain address owns those known tokens.
If I now created a new token and donated some of it to random wallets nobody would probably know about it unless I somehow tell wallet creators "please include my token contract in your checks".
At least myetherwallet used to display all (known) ERC20 tokens still about a year ago but the quickly they gave up and last I checked you had to manually enter the contract address to see those tokens. The amount of different token contracts exploded a year ago and it was probably too much hassle to try to keep track of them (to store them all in their database).
answered 2 hours ago
Lauri PeltonenLauri Peltonen
5,8382525
5,8382525
I am looking at a specific token, I don't see a easy way to check this from the token's contract
– BlockchainBoy
2 hours ago
Ah, sorry, I had misunderstood the question. My answer is not so relevant in that case.
– Lauri Peltonen
2 hours ago
add a comment |
I am looking at a specific token, I don't see a easy way to check this from the token's contract
– BlockchainBoy
2 hours ago
Ah, sorry, I had misunderstood the question. My answer is not so relevant in that case.
– Lauri Peltonen
2 hours ago
I am looking at a specific token, I don't see a easy way to check this from the token's contract
– BlockchainBoy
2 hours ago
I am looking at a specific token, I don't see a easy way to check this from the token's contract
– BlockchainBoy
2 hours ago
Ah, sorry, I had misunderstood the question. My answer is not so relevant in that case.
– Lauri Peltonen
2 hours ago
Ah, sorry, I had misunderstood the question. My answer is not so relevant in that case.
– Lauri Peltonen
2 hours ago
add a comment |
Thanks for contributing an answer to Ethereum Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fethereum.stackexchange.com%2fquestions%2f68438%2ferc721-how-to-get-the-owned-tokens-of-an-address%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown