Skip to content

Instantly share code, notes, and snippets.

@grampabacon
Last active September 28, 2021 16:44
Show Gist options
  • Save grampabacon/b8ce4e11cca850955fd9d988270ec945 to your computer and use it in GitHub Desktop.
Save grampabacon/b8ce4e11cca850955fd9d988270ec945 to your computer and use it in GitHub Desktop.
function walletOfOwner(address _owner) public view returns(uint256[] memory) {
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for(uint256 i; i < tokenCount; i++) {
tokensId[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokensId;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment