Skip to content

Commit 0ccf7e3

Browse files
Krishang NadgaudaKrishang Nadgauda
authored andcommitted
add getter fn for underlying contents of wrapped token
1 parent 5ecef13 commit 0ccf7e3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

contracts/multiwrap/Multiwrap.sol

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,16 @@ contract Multiwrap is
287287
: (royaltyForToken.recipient, uint16(royaltyForToken.bps));
288288
}
289289

290+
/// @dev Returns the underlygin contents of a wrapped NFT.
291+
function getWrappedContents(uint256 _tokenId) external view returns (Token[] memory contents) {
292+
uint256 total = wrappedContents[_tokenId].count;
293+
contents = new Token[](total);
294+
295+
for(uint256 i = 0; i < total; i += 1) {
296+
contents[i] = wrappedContents[_tokenId].token[i];
297+
}
298+
}
299+
290300
/*///////////////////////////////////////////////////////////////
291301
Setter functions
292302
//////////////////////////////////////////////////////////////*/

0 commit comments

Comments
 (0)