Skip to content

Commit 43dc143

Browse files
Krishang NadgaudaKrishang Nadgauda
authored andcommitted
run prettier
1 parent 31c0c5a commit 43dc143

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

contracts/feature/TokenBundle.sol

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import "./interface/ITokenBundle.sol";
55

66
abstract contract TokenBundle is ITokenBundle {
77
uint256 public bundleId;
8-
mapping(uint256=>BundleInfo) public bundle;
9-
mapping(uint256=>bool) public deletedBundle;
8+
mapping(uint256 => BundleInfo) public bundle;
9+
mapping(uint256 => bool) public deletedBundle;
1010

1111
// function getNextTokenId() public virtual returns (uint256);
1212

@@ -21,7 +21,7 @@ abstract contract TokenBundle is ITokenBundle {
2121
function getUri(uint256 _bundleId) public view returns (string memory) {
2222
return bundle[_bundleId].uri;
2323
}
24-
24+
2525
function getNextBundleId() public view returns (uint256) {
2626
return bundleId;
2727
}
@@ -46,7 +46,12 @@ abstract contract TokenBundle is ITokenBundle {
4646
bundle[_bundleId].count = _tokensToBind.length;
4747
}
4848

49-
function _setBundleToken(Token memory _tokenToBind, uint256 _bundleId, uint256 index, bool update) internal {
49+
function _setBundleToken(
50+
Token memory _tokenToBind,
51+
uint256 _bundleId,
52+
uint256 index,
53+
bool update
54+
) internal {
5055
require(_bundleId < bundleId, "bundle doesn't exist");
5156
require(!deletedBundle[_bundleId], "this bundle was deleted");
5257
bundle[_bundleId].tokens[index] = _tokenToBind;
@@ -66,4 +71,4 @@ abstract contract TokenBundle is ITokenBundle {
6671
delete bundle[_bundleId];
6772
deletedBundle[_bundleId] = true;
6873
}
69-
}
74+
}

contracts/feature/interface/ITokenBundle.sol

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
pragma solidity ^0.8.0;
33

44
interface ITokenBundle {
5-
65
enum TokenType {
76
ERC20,
87
ERC721,
@@ -14,13 +13,11 @@ interface ITokenBundle {
1413
TokenType tokenType;
1514
uint256 tokenId;
1615
uint256 totalAmount;
17-
1816
}
1917

2018
struct BundleInfo {
2119
uint256 count;
2220
string uri;
23-
mapping(uint256=>Token) tokens;
21+
mapping(uint256 => Token) tokens;
2422
}
25-
26-
}
23+
}

contracts/multiwrap/Multiwrap.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ contract Multiwrap is
222222

223223
/// @dev Unwrap a wrapped NFT to retrieve underlying ERC1155, ERC721, ERC20 tokens.
224224
function unwrap(uint256 _tokenId, address _recipient) external nonReentrant {
225-
226225
if (!hasRole(TRANSFER_ROLE, address(0))) {
227226
require(hasRole(TRANSFER_ROLE, _msgSender()), "restricted to UNWRAP_ROLE holders.");
228227
}
@@ -300,7 +299,7 @@ contract Multiwrap is
300299
uint256 total = wrappedContents[_tokenId].count;
301300
contents = new Token[](total);
302301

303-
for(uint256 i = 0; i < total; i += 1) {
302+
for (uint256 i = 0; i < total; i += 1) {
304303
contents[i] = wrappedContents[_tokenId].token[i];
305304
}
306305
}

contracts/multiwrap/TempMultiwrap.sol

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ contract TempMultiwrap is
4242
ERC721HolderUpgradeable,
4343
ERC721Upgradeable,
4444
ITempMultiwrap,
45-
TokenBundle
46-
{//mychange TokenBundle
45+
TokenBundle //mychange TokenBundle
46+
{
4747
/*///////////////////////////////////////////////////////////////
4848
State variables
4949
//////////////////////////////////////////////////////////////*/
@@ -228,7 +228,7 @@ contract TempMultiwrap is
228228
// wrappedContents[tokenId].count = _wrappedContents.length;
229229

230230
//mychange
231-
// uri[tokenId] = _uriForWrappedToken;
231+
// uri[tokenId] = _uriForWrappedToken;
232232

233233
_setUri(_uriForWrappedToken, tokenToBundle[tokenId]);
234234

@@ -241,7 +241,6 @@ contract TempMultiwrap is
241241

242242
/// @dev Unwrap a wrapped NFT to retrieve underlying ERC1155, ERC721, ERC20 tokens.
243243
function unwrap(uint256 _tokenId, address _recipient) external nonReentrant {
244-
245244
if (!hasRole(TRANSFER_ROLE, address(0))) {
246245
require(hasRole(TRANSFER_ROLE, _msgSender()), "restricted to UNWRAP_ROLE holders.");
247246
}
@@ -284,7 +283,13 @@ contract TempMultiwrap is
284283
} else if (_token.tokenType == TokenType.ERC721) {
285284
IERC721Upgradeable(_token.assetContract).safeTransferFrom(_from, _to, _token.tokenId);
286285
} else if (_token.tokenType == TokenType.ERC1155) {
287-
IERC1155Upgradeable(_token.assetContract).safeTransferFrom(_from, _to, _token.tokenId, _token.totalAmount, "");
286+
IERC1155Upgradeable(_token.assetContract).safeTransferFrom(
287+
_from,
288+
_to,
289+
_token.tokenId,
290+
_token.totalAmount,
291+
""
292+
);
288293
}
289294

290295
//mychange _token.amount now _token.totalAmount
@@ -327,7 +332,7 @@ contract TempMultiwrap is
327332
contents = new Token[](total);
328333

329334
//mychange
330-
for(uint256 i = 0; i < total; i += 1) {
335+
for (uint256 i = 0; i < total; i += 1) {
331336
contents[i] = getToken(tokenToBundle[_tokenId], i);
332337
}
333338
}

0 commit comments

Comments
 (0)