Add a getter for an array of tokens held by an owner
See original GitHub issueProblem
I want to inherit ERC721Full.sol
contract and add an extra getter for an array of tokens held by a given user.
Expected behaviour
In previous versions it was possible by adding an extra function and accessing an internal
_ownedTokens
mapping:
function tokensOfOwner(address _owner) external view returns (uint256[]) {
return ownedTokens[_owner];
}
Current behaviour
In version 2.x it is impossible to access a private
_ownedTokens
mapping.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How do I write setters and getters for an array? (c++)
Im writing a class within c++, however I am not certain on how to create the setters and getters for the arrays (sorry...
Read more >How to write a getter function for an array of structs? "storage ...
Your issue is that you're retrieving inside userMatchesLookUp() function an uint256 array and you're returning entire array of struct.
Read more >Payment - OpenZeppelin Docs
Getter for the total shares held by payees. totalReleased() → uint256 public. Getter for the total amount of Ether already released.
Read more >Groovy Language Documentation
Groovy closures vs lambda expressions; Owner, delegate and this ... The first option 1 is interesting when the character is held in a...
Read more >Curve StableSwap Exchange: Deposit Contracts
Getter for the array of underlying coins within the associated pool. ... any LP tokens of the associated pool held by this contract...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
shouldn’t
uint256[] storage
beuint256[] memory
? @frangio Clear it, i will take this one.not work
TypeError: Return argument type mapping(uint256 => uint256) is not implicitly convertible to expected type (type of first return variable) uint256[] storage pointer.