Skip to content

Commit 600303b

Browse files
Krishang NadgaudaKrishang Nadgauda
authored andcommitted
run prettier
1 parent e87679b commit 600303b

File tree

11 files changed

+42
-64
lines changed

11 files changed

+42
-64
lines changed

contracts/SignatureDrop.sol

Lines changed: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,14 @@ contract SignatureDrop is
115115

116116
event TokenLazyMinted(uint256 indexed startId, uint256 amount, string indexed baseURI, bytes encryptedBaseURI);
117117
event TokenURIRevealed(uint256 index, string revealedURI);
118-
event TokensMinted(address indexed minter, address receiver, uint256 indexed startTokenId, uint256 amountMinted, uint256 pricePerToken, address indexed currency);
118+
event TokensMinted(
119+
address indexed minter,
120+
address receiver,
121+
uint256 indexed startTokenId,
122+
uint256 amountMinted,
123+
uint256 pricePerToken,
124+
address indexed currency
125+
);
119126
event ClaimConditionUpdated(ClaimCondition condition, bool resetEligibility);
120127

121128
/*///////////////////////////////////////////////////////////////
@@ -189,7 +196,7 @@ contract SignatureDrop is
189196
function tokenURI(uint256 _tokenId) public view override returns (string memory uriForToken) {
190197
uriForToken = uri[_tokenId];
191198

192-
if(bytes(uriForToken).length == 0) {
199+
if (bytes(uriForToken).length == 0) {
193200
uriForToken = string(abi.encodePacked(getBaseURI(_tokenId), _tokenId.toString()));
194201
}
195202
}
@@ -229,15 +236,12 @@ contract SignatureDrop is
229236
uint256 _amount,
230237
string calldata _baseURIForTokens,
231238
bytes calldata _data
232-
)
233-
external
234-
onlyRole(MINTER_ROLE)
235-
{
239+
) external onlyRole(MINTER_ROLE) {
236240
(bytes memory encryptedBaseURI, uint256 expectedStartId) = abi.decode(_data, (bytes, uint256));
237241

238242
uint256 startId = nextTokenIdToMint;
239243
require(startId == expectedStartId, "Unexpected start Id");
240-
244+
241245
uint256 batchId;
242246
(nextTokenIdToMint, batchId) = _batchMint(startId, _amount, _baseURIForTokens);
243247

@@ -249,10 +253,7 @@ contract SignatureDrop is
249253
}
250254

251255
/// @dev Lets an account with `MINTER_ROLE` reveal the URI for a batch of 'delayed-reveal' NFTs.
252-
function reveal(
253-
uint256 _index,
254-
bytes calldata _key
255-
)
256+
function reveal(uint256 _index, bytes calldata _key)
256257
external
257258
onlyRole(MINTER_ROLE)
258259
returns (string memory revealedURI)
@@ -270,14 +271,7 @@ contract SignatureDrop is
270271
//////////////////////////////////////////////////////////////*/
271272

272273
/// @dev Claim lazy minted tokens via signature.
273-
function mintWithSignature(
274-
MintRequest calldata _req,
275-
bytes calldata _signature
276-
)
277-
external
278-
payable
279-
nonReentrant
280-
{
274+
function mintWithSignature(MintRequest calldata _req, bytes calldata _signature) external payable nonReentrant {
281275
require(_req.quantity > 0, "minting zero tokens");
282276
require(nextTokenIdToClaim + _req.quantity <= nextTokenIdToMint, "not enough minted tokens.");
283277

@@ -294,7 +288,7 @@ contract SignatureDrop is
294288
uint256 tokenIdToMint = nextTokenIdToClaim;
295289
nextTokenIdToClaim += _req.quantity;
296290

297-
for(uint256 i = tokenIdToMint; i < tokenIdToMint + _req.quantity; i += 1) {
291+
for (uint256 i = tokenIdToMint; i < tokenIdToMint + _req.quantity; i += 1) {
298292
_mint(receiver, i);
299293
}
300294

@@ -307,35 +301,25 @@ contract SignatureDrop is
307301
uint256 _quantity,
308302
address _currency,
309303
uint256 _pricePerToken
310-
)
311-
external
312-
payable
313-
314-
{
304+
) external payable {
315305
ClaimCondition memory condition = claimCondition;
316306

317307
// Verify claim
318308
require(
319309
_currency == condition.currency && _pricePerToken == condition.pricePerToken,
320310
"invalid currency or price."
321311
);
322-
require(
323-
_quantity > 0 && _quantity <= condition.quantityLimitPerTransaction,
324-
"invalid quantity."
325-
);
326-
require(
327-
condition.supplyClaimed + _quantity <= condition.maxClaimableSupply,
328-
"exceed max claimable supply."
329-
);
312+
require(_quantity > 0 && _quantity <= condition.quantityLimitPerTransaction, "invalid quantity.");
313+
require(condition.supplyClaimed + _quantity <= condition.maxClaimableSupply, "exceed max claimable supply.");
330314
require(nextTokenIdToClaim + _quantity <= nextTokenIdToMint, "not enough minted tokens.");
331315

332316
uint256 lastClaimTimestampForClaimer = lastClaimTimestamp[msg.sender][conditionId];
333317
require(
334-
lastClaimTimestampForClaimer == 0
335-
|| block.timestamp >= lastClaimTimestampForClaimer + condition.waitTimeInSecondsBetweenClaims,
318+
lastClaimTimestampForClaimer == 0 ||
319+
block.timestamp >= lastClaimTimestampForClaimer + condition.waitTimeInSecondsBetweenClaims,
336320
"cannot claim."
337321
);
338-
322+
339323
// Collect price for claim.
340324
collectPrice(_quantity, _currency, _pricePerToken);
341325

@@ -355,19 +339,16 @@ contract SignatureDrop is
355339
emit TokensMinted(_msgSender(), _receiver, tokenIdToClaim, _quantity, _pricePerToken, _currency);
356340
}
357341

358-
function setClaimCondition(
359-
ClaimCondition calldata _condition,
360-
bool _resetClaimEligibility
361-
)
342+
function setClaimCondition(ClaimCondition calldata _condition, bool _resetClaimEligibility)
362343
external
363344
onlyRole(DEFAULT_ADMIN_ROLE)
364345
{
365-
if(_resetClaimEligibility) {
346+
if (_resetClaimEligibility) {
366347
conditionId = keccak256(abi.encodePacked(msg.sender, block.number));
367348
}
368349

369350
ClaimCondition memory currentConditoin = claimCondition;
370-
351+
371352
claimCondition = ClaimCondition({
372353
startTimestamp: block.timestamp,
373354
maxClaimableSupply: _condition.maxClaimableSupply,
@@ -546,4 +527,4 @@ contract SignatureDrop is
546527
{
547528
return ERC2771ContextUpgradeable._msgData();
548529
}
549-
}
530+
}

contracts/drop/DelayedReveal.sol

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pragma solidity ^0.8.11;
44
import "../interfaces/drop/IDelayedReveal.sol";
55

66
abstract contract DelayedReveal is IDelayedReveal {
7-
87
/// @dev Mapping from id of a batch of tokens => to encrypted base URI for the respective batch of tokens.
98
mapping(uint256 => bytes) private encryptedBaseURI;
109

@@ -56,4 +55,4 @@ abstract contract DelayedReveal is IDelayedReveal {
5655
}
5756
}
5857
}
59-
}
58+
}

contracts/drop/LazyMint.sol

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pragma solidity ^0.8.11;
44
import "../interfaces/drop/ILazyMint.sol";
55

66
abstract contract LazyMint is ILazyMint {
7-
87
/// @dev Largest tokenId of each batch of tokens with the same baseURI.
98
uint256[] private batchIds;
109

@@ -38,7 +37,6 @@ abstract contract LazyMint is ILazyMint {
3837

3938
/// @dev Returns the baseURI for a token. The intended metadata URI for the token is baseURI + tokenId.
4039
function getBaseURI(uint256 _tokenId) internal view returns (string memory) {
41-
4240
uint256 numOfTokenBatches = getNumOfTokenBatches();
4341
uint256[] memory indices = batchIds;
4442

@@ -61,16 +59,12 @@ abstract contract LazyMint is ILazyMint {
6159
uint256 _startId,
6260
uint256 _amountToMint,
6361
string calldata _baseURIForTokens
64-
)
65-
internal
66-
returns (uint256 nextTokenIdToMint, uint256 batchId)
67-
{
62+
) internal returns (uint256 nextTokenIdToMint, uint256 batchId) {
6863
batchId = _startId + _amountToMint;
6964
nextTokenIdToMint = batchId;
7065

7166
batchIds.push(batchId);
7267

7368
baseURI[batchId] = _baseURIForTokens;
7469
}
75-
76-
}
70+
}

contracts/eip/ERC721Enumerable.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ pragma solidity ^0.8.11;
44
/// @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
55
/// @dev See https://eips.ethereum.org/EIPS/eip-721
66
/// Note: the ERC-165 identifier for this interface is 0x780e9d63.
7-
interface ERC721Enumerable /* is ERC721 */ {
7+
/* is ERC721 */
8+
interface ERC721Enumerable {
89
/// @notice Count NFTs tracked by this contract
910
/// @return A count of valid NFTs tracked by this contract, where each one of
1011
/// them has an assigned and queryable owner not equal to the zero address
@@ -25,4 +26,4 @@ interface ERC721Enumerable /* is ERC721 */ {
2526
/// @return The token identifier for the `_index`th NFT assigned to `_owner`,
2627
/// (sort order not specified)
2728
function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256);
28-
}
29+
}

contracts/interfaces/drop/IDelayedReveal.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ pragma solidity ^0.8.11;
33

44
interface IDelayedReveal {
55
function reveal(uint256 identifier, bytes calldata key) external returns (string memory revealedURI);
6+
67
function encryptDecrypt(bytes memory data, bytes calldata key) external pure returns (bytes memory result);
78
}

contracts/interfaces/drop/ILazyMint.sol

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

44
interface ILazyMint {
5-
function lazyMint(uint256 amount, string calldata baseURIForTokens, bytes calldata data) external;
6-
}
5+
function lazyMint(
6+
uint256 amount,
7+
string calldata baseURIForTokens,
8+
bytes calldata data
9+
) external;
10+
}

contracts/token/TokenERC1155.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,4 +478,4 @@ contract TokenERC1155 is
478478
{
479479
return ERC2771ContextUpgradeable._msgData();
480480
}
481-
}
481+
}

contracts/token/TokenERC20.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,4 +325,4 @@ contract TokenERC20 is
325325
{
326326
return ERC2771ContextUpgradeable._msgData();
327327
}
328-
}
328+
}

contracts/token/TokenERC721.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import "@openzeppelin/contracts-upgradeable/interfaces/IERC2981Upgradeable.sol";
3434
// Thirdweb top-level
3535
import "../interfaces/ITWFee.sol";
3636

37-
3837
contract TokenERC721 is
3938
Initializable,
4039
IThirdwebContract,

src/test/ByocRegistry.t.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,11 @@ contract ByocRegistryTest is BaseTest, IByocRegistryData {
8383
}
8484

8585
function test_publish_viaOperator() public {
86-
8786
string memory contractId = "MyContract";
88-
87+
8988
vm.prank(publisher);
9089
byoc.approveOperator(operator, true);
91-
90+
9291
vm.prank(operator);
9392
byoc.publishContract(
9493
publisher,

0 commit comments

Comments
 (0)