@@ -125,12 +125,30 @@ contract SBTToken is ISBTToken, ERC721EnumerableUpgradeable {
125
125
126
126
function _tokenURI (uint256 tokenId ) private view returns (string memory ) {
127
127
SBTData memory sbtData = _sbtdata[tokenId];
128
- (bool stringDataPresent , StringAttribute[] memory stringAttributes ) = sbtData.stringAttributesEncoded.length > 0
129
- ? (true , abi.decode (sbtData.stringAttributesEncoded, (StringAttribute[])))
130
- : (false , new StringAttribute [](0 ));
131
- (bool numberDataPresent , NumberAttribute[] memory numberAttributes ) = sbtData.numberAttributesEncoded.length > 0
132
- ? (true , abi.decode (sbtData.numberAttributesEncoded, (NumberAttribute[])))
133
- : (false , new NumberAttribute [](0 ));
128
+ (
129
+ bool stringDataPresent ,
130
+ StringAttribute[] memory stringAttributes
131
+ ) = sbtData.stringAttributesEncoded.length > 0
132
+ ? (
133
+ true ,
134
+ abi.decode (
135
+ sbtData.stringAttributesEncoded,
136
+ (StringAttribute[])
137
+ )
138
+ )
139
+ : (false , new StringAttribute [](0 ));
140
+ (
141
+ bool numberDataPresent ,
142
+ NumberAttribute[] memory numberAttributes
143
+ ) = sbtData.numberAttributesEncoded.length > 0
144
+ ? (
145
+ true ,
146
+ abi.decode (
147
+ sbtData.numberAttributesEncoded,
148
+ (NumberAttribute[])
149
+ )
150
+ )
151
+ : (false , new NumberAttribute [](0 ));
134
152
135
153
string memory sbtAttributes = "" ;
136
154
@@ -151,11 +169,7 @@ contract SBTToken is ISBTToken, ERC721EnumerableUpgradeable {
151
169
sbtAttributes = attributeInString;
152
170
} else {
153
171
sbtAttributes = string (
154
- abi.encodePacked (
155
- sbtAttributes,
156
- ", " ,
157
- attributeInString
158
- )
172
+ abi.encodePacked (sbtAttributes, ", " , attributeInString)
159
173
);
160
174
}
161
175
}
@@ -180,33 +194,20 @@ contract SBTToken is ISBTToken, ERC721EnumerableUpgradeable {
180
194
if (i == 0 ) {
181
195
if (stringDataPresent) {
182
196
sbtAttributes = string (
183
- abi.encodePacked (
184
- ", " ,
185
- attributeInString
186
- )
197
+ abi.encodePacked (", " , attributeInString)
187
198
);
188
199
} else {
189
200
sbtAttributes = attributeInString;
190
201
}
191
202
} else {
192
203
sbtAttributes = string (
193
- abi.encodePacked (
194
- sbtAttributes,
195
- ", " ,
196
- attributeInString
197
- )
204
+ abi.encodePacked (sbtAttributes, ", " , attributeInString)
198
205
);
199
206
}
200
207
}
201
208
}
202
209
203
- sbtAttributes = string (
204
- abi.encodePacked (
205
- "[ " ,
206
- sbtAttributes,
207
- "] "
208
- )
209
- );
210
+ sbtAttributes = string (abi.encodePacked ("[ " , sbtAttributes, "] " ));
210
211
211
212
return
212
213
string (
0 commit comments