Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
fix(lint): updated foundry lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeckers committed Nov 24, 2023
1 parent 5ec959e commit 2e13a70
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import {ONE_HUNDRED_PERCENT_IN_BP} from "@hypercerts/marketplace/constants/Numer
contract DelegationRecipientsTakerTest is ProtocolBase {
function setUp() public {
_setUp();
CreatorFeeManagerWithRoyalties creatorFeeManager = new CreatorFeeManagerWithRoyalties(
address(royaltyFeeRegistry)
);
CreatorFeeManagerWithRoyalties creatorFeeManager =
new CreatorFeeManagerWithRoyalties(address(royaltyFeeRegistry));
vm.prank(_owner);
looksRareProtocol.updateCreatorFeeManager(address(creatorFeeManager));
}
Expand Down
4 changes: 1 addition & 3 deletions contracts/test/foundry/marketplace/NonceInvalidation.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,7 @@ contract NonceInvalidationTest is INonceManager, ProtocolBase {
bytes4 selector = StrategyTestMultiFillCollectionOrder.executeStrategyWithTakerAsk.selector;

StrategyTestMultiFillCollectionOrder strategyMultiFillCollectionOrder =
new StrategyTestMultiFillCollectionOrder(
address(looksRareProtocol)
);
new StrategyTestMultiFillCollectionOrder(address(looksRareProtocol));

vm.prank(_owner);
_addStrategy(address(strategyMultiFillCollectionOrder), selector, true);
Expand Down
7 changes: 2 additions & 5 deletions contracts/test/foundry/marketplace/OrderValidatorV2A.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,9 @@ contract OrderValidatorV2ATest is TestParameters {
function setUp() public {
transferManager = new TransferManager(address(this));
looksRareProtocol = new LooksRareProtocol(
address(this),
address(this),
address(transferManager),
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
address(this), address(this), address(transferManager), 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
);
royaltyFeeRegistry = new MockRoyaltyFeeRegistry(address(this), 9_500);
royaltyFeeRegistry = new MockRoyaltyFeeRegistry(address(this), 9500);
creatorFeeManager = new CreatorFeeManagerWithRoyalties(address(royaltyFeeRegistry));
looksRareProtocol.updateCreatorFeeManager(address(creatorFeeManager));
looksRareProtocol.updateCurrencyStatus(ETH, true);
Expand Down
8 changes: 2 additions & 6 deletions contracts/test/foundry/marketplace/ProtocolBase.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,8 @@ contract ProtocolBase is MockOrderGenerator, ILooksRareProtocol {
transferManager = new TransferManager(_owner);
royaltyFeeRegistry = new MockRoyaltyFeeRegistry(_owner, 9500);
protocolFeeRecipient = new ProtocolFeeRecipient(0x5924A28caAF1cc016617874a2f0C3710d881f3c1, address(weth));
looksRareProtocol = new LooksRareProtocol(
_owner,
address(protocolFeeRecipient),
address(transferManager),
address(weth)
);
looksRareProtocol =
new LooksRareProtocol(_owner, address(protocolFeeRecipient), address(transferManager), address(weth));
mockERC721WithRoyalties = new MockERC721WithRoyalties(_royaltyRecipient, _standardRoyaltyFee);

// Operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ contract SignaturesERC1271WalletForERC1155Test is ProtocolBase {
}

function testTakerBidIsInvalidSignatureReentrancy() public {
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = new MaliciousIsValidSignatureERC1271Wallet(
address(looksRareProtocol)
);
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet =
new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerBid);

Expand Down Expand Up @@ -135,9 +134,8 @@ contract SignaturesERC1271WalletForERC1155Test is ProtocolBase {
}

function testTakerAskIsValidSignatureReentrancy() public {
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = new MaliciousIsValidSignatureERC1271Wallet(
address(looksRareProtocol)
);
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet =
new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerAsk);

Expand All @@ -150,9 +148,8 @@ contract SignaturesERC1271WalletForERC1155Test is ProtocolBase {
}

function testTakerAskOnERC1155ReceivedReentrancy() public {
MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet = new MaliciousOnERC1155ReceivedERC1271Wallet(
address(looksRareProtocol)
);
MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet =
new MaliciousOnERC1155ReceivedERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));

(OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) =
Expand Down Expand Up @@ -185,9 +182,8 @@ contract SignaturesERC1271WalletForERC1155Test is ProtocolBase {
}

function testBatchTakerAskOnERC1155BatchReceivedReentrancy() public {
MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet = new MaliciousOnERC1155ReceivedERC1271Wallet(
address(looksRareProtocol)
);
MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet =
new MaliciousOnERC1155ReceivedERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));

(OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) =
Expand Down Expand Up @@ -262,9 +258,8 @@ contract SignaturesERC1271WalletForERC1155Test is ProtocolBase {
}

function testExecuteMultipleTakerBidsIsValidSignatureReentrancy() public {
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = new MaliciousIsValidSignatureERC1271Wallet(
address(looksRareProtocol)
);
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet =
new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteMultipleTakerBids);

Expand All @@ -288,9 +283,7 @@ contract SignaturesERC1271WalletForERC1155Test is ProtocolBase {

function testExecuteMultipleTakerBidsOnERC1155ReceivedReentrancyOnlyInTheLastCall() public {
MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet maliciousERC1271Wallet =
new MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet(
takerUser
);
new MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet(takerUser);
_setUpUser(makerUser);
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteMultipleTakerBids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ contract SignaturesERC1271WalletForERC721Test is ProtocolBase {
}

function testTakerBidReentrancy() public {
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = new MaliciousIsValidSignatureERC1271Wallet(
address(looksRareProtocol)
);
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet =
new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerBid);

Expand Down Expand Up @@ -127,9 +126,8 @@ contract SignaturesERC1271WalletForERC721Test is ProtocolBase {
}

function testTakerAskReentrancy() public {
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = new MaliciousIsValidSignatureERC1271Wallet(
address(looksRareProtocol)
);
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet =
new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerAsk);

Expand Down Expand Up @@ -196,9 +194,8 @@ contract SignaturesERC1271WalletForERC721Test is ProtocolBase {
}

function testExecuteMultipleTakerBidsReentrancy() public {
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = new MaliciousIsValidSignatureERC1271Wallet(
address(looksRareProtocol)
);
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet =
new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteMultipleTakerBids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ contract SignaturesERC1271WalletForHypercertTest is ProtocolBase {
}

function testTakerBidIsInvalidSignatureReentrancy() public {
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = new MaliciousIsValidSignatureERC1271Wallet(
address(looksRareProtocol)
);
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet =
new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerBid);

Expand Down Expand Up @@ -135,9 +134,8 @@ contract SignaturesERC1271WalletForHypercertTest is ProtocolBase {
}

function testTakerAskIsValidSignatureReentrancy() public {
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = new MaliciousIsValidSignatureERC1271Wallet(
address(looksRareProtocol)
);
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet =
new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteTakerAsk);

Expand All @@ -150,9 +148,8 @@ contract SignaturesERC1271WalletForHypercertTest is ProtocolBase {
}

function testTakerAskOnERC1155ReceivedReentrancy() public {
MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet = new MaliciousOnERC1155ReceivedERC1271Wallet(
address(looksRareProtocol)
);
MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet =
new MaliciousOnERC1155ReceivedERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));

(OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) =
Expand Down Expand Up @@ -185,9 +182,8 @@ contract SignaturesERC1271WalletForHypercertTest is ProtocolBase {
}

function testBatchTakerAskOnERC1155BatchReceivedReentrancy() public {
MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet = new MaliciousOnERC1155ReceivedERC1271Wallet(
address(looksRareProtocol)
);
MaliciousOnERC1155ReceivedERC1271Wallet maliciousERC1271Wallet =
new MaliciousOnERC1155ReceivedERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));

(OrderStructs.Taker memory takerAsk, OrderStructs.Maker memory makerBid) =
Expand Down Expand Up @@ -262,9 +258,8 @@ contract SignaturesERC1271WalletForHypercertTest is ProtocolBase {
}

function testExecuteMultipleTakerBidsIsValidSignatureReentrancy() public {
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet = new MaliciousIsValidSignatureERC1271Wallet(
address(looksRareProtocol)
);
MaliciousIsValidSignatureERC1271Wallet maliciousERC1271Wallet =
new MaliciousIsValidSignatureERC1271Wallet(address(looksRareProtocol));
_setUpUser(address(maliciousERC1271Wallet));
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteMultipleTakerBids);

Expand All @@ -288,9 +283,7 @@ contract SignaturesERC1271WalletForHypercertTest is ProtocolBase {

function testExecuteMultipleTakerBidsOnERC1155ReceivedReentrancyOnlyInTheLastCall() public {
MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet maliciousERC1271Wallet =
new MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet(
takerUser
);
new MaliciousOnERC1155ReceivedTheThirdTimeERC1271Wallet(takerUser);
_setUpUser(makerUser);
maliciousERC1271Wallet.setFunctionToReenter(MaliciousERC1271Wallet.FunctionToReenter.ExecuteMultipleTakerBids);

Expand Down
5 changes: 2 additions & 3 deletions contracts/test/foundry/marketplace/StandardTransactions.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ contract StandardTransactionsTest is ProtocolBase {

function setUp() public {
_setUp();
CreatorFeeManagerWithRoyalties creatorFeeManager = new CreatorFeeManagerWithRoyalties(
address(royaltyFeeRegistry)
);
CreatorFeeManagerWithRoyalties creatorFeeManager =
new CreatorFeeManagerWithRoyalties(address(royaltyFeeRegistry));
vm.prank(_owner);
looksRareProtocol.updateCreatorFeeManager(address(creatorFeeManager));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ contract StandardTransactionsHypercertsTest is ProtocolBase {

function setUp() public {
_setUp();
CreatorFeeManagerWithRoyalties creatorFeeManager = new CreatorFeeManagerWithRoyalties(
address(royaltyFeeRegistry)
);
CreatorFeeManagerWithRoyalties creatorFeeManager =
new CreatorFeeManagerWithRoyalties(address(royaltyFeeRegistry));
vm.prank(_owner);
looksRareProtocol.updateCreatorFeeManager(address(creatorFeeManager));

Expand Down

0 comments on commit 2e13a70

Please sign in to comment.