Skip to content

Commit acac3da

Browse files
author
Yash Agrawal
committed
fix: add proper encodePacked
1 parent 1e5d0cc commit acac3da

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

contracts/SBTToken.sol

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ contract SBTToken is ISBTToken, ERC721EnumerableUpgradeable {
153153
string memory sbtAttributes = "";
154154

155155
if (stringDataPresent) {
156-
for (uint256 i = 0; i <= stringAttributes.length - 1; i++) {
156+
for (uint256 i = 0; i < stringAttributes.length; i++) {
157157
string memory attributeInString = string(
158158
abi.encodePacked(
159159
'{"trait_type": "',
@@ -194,7 +194,11 @@ contract SBTToken is ISBTToken, ERC721EnumerableUpgradeable {
194194
if (i == 0) {
195195
if (stringDataPresent) {
196196
sbtAttributes = string(
197-
abi.encodePacked(",", attributeInString)
197+
abi.encodePacked(
198+
sbtAttributes,
199+
",",
200+
attributeInString
201+
)
198202
);
199203
} else {
200204
sbtAttributes = attributeInString;

0 commit comments

Comments
 (0)