Skip to content

Commit

Permalink
fix(build): build and lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeckers committed Oct 26, 2023
1 parent 2268e96 commit 7cc05d9
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 2,075 deletions.
7 changes: 3 additions & 4 deletions contracts/.solhint.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"plugins": ["prettier"],
"extends": "solhint:recommended",
"rules": {
"code-complexity": ["error", 8],
"compiler-version": ["error", "0.8.16"],
"code-complexity": ["error", 12],
"compiler-version": ["error", ">=0.8.16"],
"func-visibility": ["error", { "ignoreConstructors": true }],
"max-line-length": ["warn", 120],
"max-line-length": ["warn", 200],
"no-console": "off",
"not-rely-on-time": "off",
"reason-string": ["warn", { "maxLength": 64 }],
Expand Down
2 changes: 1 addition & 1 deletion contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const config = {
},
paths: {
cache: "./cache_hardhat", // Use a different cache for Hardhat than Foundry
sources: "./src",
sources: "./src/protocol",
tests: "./test",
},
preprocess: {
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"copy:contracts": "copyfiles -u 1 ./src/**/*.sol ./src/*.sol ./contracts",
"docs": "hardhat dodoc",
"lint": "pnpm lint:sol && pnpm prettier:check",
"lint:sol": "solhint -w 5 \"./{src,test}/**/*.sol\"",
"lint:sol": "solhint -w 60 \"./{src,test/protocol,test/marketplace}/**/*.sol\"",
"prebuild": "pnpm clean",
"prepublish": "pnpm build",
"prettier": "prettier --config \"./.prettierrc.yml\" --write \"**/*.{json,md,sol,yml}\"",
Expand Down
12 changes: 6 additions & 6 deletions contracts/src/marketplace/CreatorFeeManagerWithRoyalties.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ contract CreatorFeeManagerWithRoyalties is ICreatorFeeManager {
/**
* @inheritdoc ICreatorFeeManager
* @dev There are two on-chain sources for the royalty fee to distribute.
* 1. RoyaltyFeeRegistry: It is an on-chain registry where creator fee is defined
for all items of a collection.
* 1. RoyaltyFeeRegistry: It is an on-chain registry where creator fee is defined
* for all items of a collection.
* 2. ERC2981: The NFT Royalty Standard where royalty fee is defined at a itemId level in a collection.
* The on-chain logic looks up the registry first. If it does not find anything,
* The on-chain logic looks up the registry first. If it does not find anything,
* it checks if a collection is ERC2981. If so, it fetches the proper royalty information for the itemId.
* For a bundle that contains multiple itemIds (for a collection using ERC2981), if the royalty fee/recipient
* For a bundle that contains multiple itemIds (for a collection using ERC2981), if the royalty fee/recipient
* differ among the itemIds part of the bundle, the trade reverts.
* This contract DOES NOT enforce any restriction for extremely high creator fee,
* This contract DOES NOT enforce any restriction for extremely high creator fee,
* nor verifies the creator fee fetched is inferior to the total price.
* If any contract relies on it to build an on-chain royalty logic,
* If any contract relies on it to build an on-chain royalty logic,
* it should implement protection against:
* (1) high royalties
* (2) potential unexpected royalty changes that can occur after the creation of the order.
Expand Down
12 changes: 8 additions & 4 deletions contracts/src/marketplace/interfaces/ILooksRareProtocol.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ interface ILooksRareProtocol {
* feeAmounts[1] Creator fee amount
* feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment
*/
// maker (receives the NFT)
event TakerAsk(
// taker (initiates the transaction)
NonceInvalidationParameters nonceInvalidationParameters,
address askUser, // taker (initiates the transaction)
address bidUser, // maker (receives the NFT)
address askUser,
address bidUser,
uint256 strategyId,
address currency,
address collection,
Expand Down Expand Up @@ -90,10 +92,12 @@ interface ILooksRareProtocol {
* feeAmounts[1] Creator fee amount
* feeAmounts[2] Protocol fee amount prior to adjustment for a potential affiliate payment
*/
// taker (receives the NFT)
event TakerBid(
// taker (initiates the transaction)
NonceInvalidationParameters nonceInvalidationParameters,
address bidUser, // taker (initiates the transaction)
address bidRecipient, // taker (receives the NFT)
address bidUser,
address bidRecipient,
uint256 strategyId,
address currency,
address collection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ contract ProtocolFeeRecipientTest is TestParameters {
uint256 private feeSharingSetterInitialWETHBalance;

address private constant FEE_SHARING_SETTER = 0x5924A28caAF1cc016617874a2f0C3710d881f3c1;
uint256 private constant DUST = 0.69420 ether;
uint256 private constant DUST = 0.6942 ether;

function setUp() public {
vm.createSelectFork(vm.rpcUrl("mainnet"));
Expand Down
12 changes: 8 additions & 4 deletions contracts/test/foundry/marketplace/utils/MerkleWithPosition.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import { OrderStructs } from "@hypercerts/marketplace/libraries/OrderStructs.sol
* hashLeafPair does not sort the nodes to match EIP-712.
*/
contract MerkleWithPosition {
/********************
/**
*
* PROOF GENERATION *
********************/
*
*/

function getRoot(OrderStructs.MerkleTreeNode[] memory data) public pure returns (bytes32) {
require(data.length > 1, "won't generate root for single leaf");
Expand Down Expand Up @@ -90,9 +92,11 @@ contract MerkleWithPosition {
return result;
}

/******************
/**
*
* MATH "LIBRARY" *
******************/
*
*/

/// Original bitmagic adapted from https://github.com/paulrberg/prb-math/blob/main/contracts/PRBMath.sol
/// @dev Note that x assumed > 1
Expand Down
4 changes: 3 additions & 1 deletion contracts/test/foundry/protocol/HypercertMinter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ contract MinterTestHelper {
return 0;
}
sum = 0;
for (uint256 i = 0; i < array.length; i++) sum += array[i];
for (uint256 i = 0; i < array.length; i++) {
sum += array[i];
}
}

function buildFractions(uint256 size) public pure returns (uint256[] memory) {
Expand Down
Loading

0 comments on commit 7cc05d9

Please sign in to comment.