@@ -120,9 +120,10 @@ contract Chips is IChips, Initializable, ERC721 {
120120 "]} "
121121 );
122122
123- return string .concat (
124- "data:application/json;base64, " , Base64.encode (bytes (string .concat (json)))
125- );
123+ return
124+ string .concat (
125+ "data:application/json;base64, " , Base64.encode (bytes (string .concat (json)))
126+ );
126127 }
127128
128129 function tokenURI (uint256 id ) public view override returns (string memory ) {
@@ -151,9 +152,10 @@ contract Chips is IChips, Initializable, ERC721 {
151152 "]} "
152153 );
153154
154- return string .concat (
155- "data:application/json;base64, " , Base64.encode (bytes (string .concat (json)))
156- );
155+ return
156+ string .concat (
157+ "data:application/json;base64, " , Base64.encode (bytes (string .concat (json)))
158+ );
157159 }
158160
159161 function _generateChipImage (uint256 tokenId )
@@ -191,13 +193,14 @@ contract Chips is IChips, Initializable, ERC721 {
191193 {
192194 Node memory node = IStaking (_staking).getNode (nodeAddr);
193195
194- (uint8 colorCount , uint8 frameCount , uint8 chipCornerCount , uint8 chipDetailCount ) =
195- chipVersion == ChipVersion.V1
196+ (uint8 colorCount , uint8 frameCount , uint8 chipCornerCount , uint8 chipDetailCount ) = chipVersion
197+ == ChipVersion.V1
196198 ? SVGGenerator.getNodeTraitsCount ()
197199 : SVGGeneratorV2.getNodeTraitsCount ();
198200
199- uint256 nodeTraitCount = uint256 (frameCount) * uint256 (colorCount)
200- * uint256 (chipDetailCount) * uint256 (colorCount) * uint256 (chipCornerCount);
201+ uint256 nodeTraitCount =
202+ uint256 (frameCount) * uint256 (colorCount) * uint256 (chipDetailCount)
203+ * uint256 (colorCount) * uint256 (chipCornerCount);
201204
202205 // Chips from the same node will have the same traits
203206 uint256 nodeTraitId = uint256 (keccak256 (abi.encodePacked (nodeAddr))) % nodeTraitCount;
@@ -263,8 +266,9 @@ contract Chips is IChips, Initializable, ERC721 {
263266 (colorCount,,,) = SVGGeneratorV2.getNodeTraitsCount ();
264267 }
265268
266- uint256 chipTraitCount = uint256 (eyeCount) * (mouthCount) * (headShapeCount) * (colorCount)
267- * (headDetailCount) * (colorCount) * (nftCardCount);
269+ uint256 chipTraitCount =
270+ uint256 (eyeCount) * (mouthCount) * (headShapeCount) * (colorCount) * (headDetailCount)
271+ * (colorCount) * (nftCardCount);
268272
269273 uint256 chipTraitId = seed % chipTraitCount;
270274
@@ -291,11 +295,11 @@ contract Chips is IChips, Initializable, ERC721 {
291295 uint8 colorCount ,
292296 uint8 nftCardCount
293297 ) internal pure returns (ChipTraits memory ) {
294- uint256 factor = uint256 (mouthCount) * uint256 (headShapeCount) * uint256 (colorCount)
298+ uint256 factor =
299+ uint256 (mouthCount) * uint256 (headShapeCount) * uint256 (colorCount)
295300 * uint256 (headDetailCount) * uint256 (colorCount) * uint256 (nftCardCount);
296301
297- return (
298- ChipTraits ({
302+ return (ChipTraits ({
299303 eyesId: _calTraitId (chipTraitId, eyeCount, factor),
300304 mouthId: _calTraitId (chipTraitId, mouthCount, factor / uint256 (mouthCount)),
301305 headShapeId: _calTraitId (
@@ -320,8 +324,7 @@ contract Chips is IChips, Initializable, ERC721 {
320324 (factor / uint256 (mouthCount)) / uint256 (headShapeCount) / uint256 (colorCount)
321325 / uint256 (headDetailCount) / uint256 (colorCount)
322326 )
323- })
324- );
327+ }));
325328 }
326329
327330 function _calTraitId (uint256 traitId , uint8 traitCount , uint256 divisionFactor )
0 commit comments