Skip to content

Commit bdd9ec5

Browse files
committed
Changes on RMRKTokenAttributes.
No long uses structs as return values for batch getters. If a single attribute is sent on batch getter/setters it will use it for all collections and tokens.
1 parent 4fea571 commit bdd9ec5

File tree

6 files changed

+332
-337
lines changed

6 files changed

+332
-337
lines changed

contracts/RMRK/extension/tokenAttributes/IERC7508.sol

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -748,11 +748,11 @@ interface IERC7508 is IERC165 {
748748
* @param boolKeys An array of bool type attribute keys to retrieve
749749
* @param addressKeys An array of address type attribute keys to retrieve
750750
* @param bytesKeys An array of bytes type attribute keys to retrieve
751-
* @return stringAttributes An array of `StringAttribute` structs containing the string type attributes
752-
* @return uintAttributes An array of `UintAttribute` structs containing the uint type attributes
753-
* @return boolAttributes An array of `BoolAttribute` structs containing the bool type attributes
754-
* @return addressAttributes An array of `AddressAttribute` structs containing the address type attributes
755-
* @return bytesAttributes An array of `BytesAttribute` structs containing the bytes type attributes
751+
* @return stringAttributes An array of strings, in the same order as the stringKeys
752+
* @return uintAttributes An array of uints, in the same order as the uintKeys
753+
* @return boolAttributes An array of bools, in the same order as the boolKeys
754+
* @return addressAttributes An array of addresses, in the same order as the addressKeys
755+
* @return bytesAttributes An array of bytes, in the same order as the bytesKeys
756756
*/
757757
function getAttributes(
758758
address collection,
@@ -766,11 +766,11 @@ interface IERC7508 is IERC165 {
766766
external
767767
view
768768
returns (
769-
StringAttribute[] memory stringAttributes,
770-
UintAttribute[] memory uintAttributes,
771-
BoolAttribute[] memory boolAttributes,
772-
AddressAttribute[] memory addressAttributes,
773-
BytesAttribute[] memory bytesAttributes
769+
string[] memory stringAttributes,
770+
uint256[] memory uintAttributes,
771+
bool[] memory boolAttributes,
772+
address[] memory addressAttributes,
773+
bytes[] memory bytesAttributes
774774
);
775775

776776
/**
@@ -783,13 +783,13 @@ interface IERC7508 is IERC165 {
783783
* @param collections Addresses of the collections, in the same order as the attribute keys. If all tokens are from the same collection the array can contain a single element with the collection address.
784784
* @param tokenIds IDs of the tokens, in the same order as the attribute keys. If all attributes are for the same token the array can contain a single element with the token ID.
785785
* @param attributeKeys An array of string keys to retrieve
786-
* @return attributes An array of `StringAttribute` structs
786+
* @return attributes An array of strings, in the same order as the attribute keys
787787
*/
788788
function getStringAttributes(
789789
address[] memory collections,
790790
uint256[] memory tokenIds,
791791
string[] memory attributeKeys
792-
) external view returns (StringAttribute[] memory attributes);
792+
) external view returns (string[] memory attributes);
793793

794794
/**
795795
* @notice Used to get multiple uint parameter values for a token.
@@ -801,13 +801,13 @@ interface IERC7508 is IERC165 {
801801
* @param collections Addresses of the collections, in the same order as the attribute keys. If all tokens are from the same collection the array can contain a single element with the collection address.
802802
* @param tokenIds IDs of the tokens, in the same order as the attribute keys. If all attributes are for the same token the array can contain a single element with the token ID.
803803
* @param attributeKeys An array of uint keys to retrieve
804-
* @return attributes An array of `UintAttribute` structs
804+
* @return attributes An array of uints, in the same order as the attribute keys
805805
*/
806806
function getUintAttributes(
807807
address[] memory collections,
808808
uint256[] memory tokenIds,
809809
string[] memory attributeKeys
810-
) external view returns (UintAttribute[] memory attributes);
810+
) external view returns (uint256[] memory attributes);
811811

812812
/**
813813
* @notice Used to get multiple bool parameter values for a token.
@@ -819,13 +819,13 @@ interface IERC7508 is IERC165 {
819819
* @param collections Addresses of the collections, in the same order as the attribute keys. If all tokens are from the same collection the array can contain a single element with the collection address.
820820
* @param tokenIds IDs of the tokens, in the same order as the attribute keys. If all attributes are for the same token the array can contain a single element with the token ID.
821821
* @param attributeKeys An array of bool keys to retrieve
822-
* @return attributes An array of `BoolAttribute` structs
822+
* @return attributes An array of bools, in the same order as the attribute keys
823823
*/
824824
function getBoolAttributes(
825825
address[] memory collections,
826826
uint256[] memory tokenIds,
827827
string[] memory attributeKeys
828-
) external view returns (BoolAttribute[] memory attributes);
828+
) external view returns (bool[] memory attributes);
829829

830830
/**
831831
* @notice Used to get multiple address parameter values for a token.
@@ -837,13 +837,13 @@ interface IERC7508 is IERC165 {
837837
* @param collections Addresses of the collections, in the same order as the attribute keys. If all tokens are from the same collection the array can contain a single element with the collection address.
838838
* @param tokenIds IDs of the tokens, in the same order as the attribute keys. If all attributes are for the same token the array can contain a single element with the token ID.
839839
* @param attributeKeys An array of address keys to retrieve
840-
* @return attributes An array of `AddressAttribute` structs
840+
* @return attributes An array of addresses, in the same order as the attribute keys
841841
*/
842842
function getAddressAttributes(
843843
address[] memory collections,
844844
uint256[] memory tokenIds,
845845
string[] memory attributeKeys
846-
) external view returns (AddressAttribute[] memory attributes);
846+
) external view returns (address[] memory attributes);
847847

848848
/**
849849
* @notice Used to get multiple bytes parameter values for a token.
@@ -855,11 +855,11 @@ interface IERC7508 is IERC165 {
855855
* @param collections Addresses of the collections, in the same order as the attribute keys. If all tokens are from the same collection the array can contain a single element with the collection address.
856856
* @param tokenIds IDs of the tokens, in the same order as the attribute keys. If all attributes are for the same token the array can contain a single element with the token ID.
857857
* @param attributeKeys An array of bytes keys to retrieve
858-
* @return attributes An array of `BytesAttribute` structs
858+
* @return attributes An array of bytes, in the same order as the attribute keys
859859
*/
860860
function getBytesAttributes(
861861
address[] memory collections,
862862
uint256[] memory tokenIds,
863863
string[] memory attributeKeys
864-
) external view returns (BytesAttribute[] memory attributes);
864+
) external view returns (bytes[] memory attributes);
865865
}

0 commit comments

Comments
 (0)