Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
BCLeFevre committed May 10, 2022
1 parent dff0f80 commit c0bfc34
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 59 deletions.
68 changes: 33 additions & 35 deletions reference/lib/ReferenceConsiderationInternal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ contract ReferenceConsiderationInternal is
consideration[0] = primaryReceivedItem;

// Loop through all additionalRecipients, to generate
// ReceivedItems for OrderFulfilled Event and
// ReceivedItems for OrderFulfilled Event and
// ConsiderationItems for hashing
for (
uint256 recipientCount = 0;
Expand All @@ -237,7 +237,7 @@ contract ReferenceConsiderationInternal is
// OrderFulfilled ReceivedItem[]
consideration[recipientCount + 1] = additionalReceivedItem;

// Skip hashing items not contained in the
// Skip hashing items not contained in the
// Original Recipients.
if (
recipientCount >=
Expand Down Expand Up @@ -271,13 +271,13 @@ contract ReferenceConsiderationInternal is
);
}

/**
* The considerationHashes array now contains
* all consideration Item hashes.
*
* The consideration array now contains all receieved
* items excluding tips for OrderFulfilled Event.
*/
/**
* The considerationHashes array now contains
* all consideration Item hashes.
*
* The consideration array now contains all receieved
* items excluding tips for OrderFulfilled Event.
*/

// Get hash of all consideration items.
hashes.receivedItemsHash = keccak256(
Expand Down Expand Up @@ -312,7 +312,7 @@ contract ReferenceConsiderationInternal is

{
// Now let's handle the offer side.

// Write the offer to the Event SpentItem array
SpentItem[] memory offer = new SpentItem[](1);

Expand Down Expand Up @@ -391,7 +391,7 @@ contract ReferenceConsiderationInternal is
}

/**
* @dev Internal function to calculate the order hash
* @dev Internal function to calculate the order hash
*
* @param hashes The array of offerItems and
* receivedItems hashes.
Expand Down Expand Up @@ -1235,7 +1235,7 @@ contract ReferenceConsiderationInternal is
* order's partial fill amount to be
* considered valid.
*
* @param ordersToExecute The orders to execute. This is an
* @param ordersToExecute The orders to execute. This is an
* explicit version of advancedOrders without
* memory optimization, that provides
* an array of spentItems and receivedItems
Expand Down Expand Up @@ -1329,7 +1329,7 @@ contract ReferenceConsiderationInternal is
* respectively. Note that a failing item transfer or an issue with
* order formatting will cause the entire batch to fail.
*
* @param ordersToExecute The orders to execute. This is an
* @param ordersToExecute The orders to execute. This is an
* explicit version of advancedOrders without
* memory optimization, that provides
* an array of spentItems and receivedItems
Expand Down Expand Up @@ -1455,12 +1455,11 @@ contract ReferenceConsiderationInternal is

// If some number of executions have been filtered...
if (totalFilteredExecutions != 0) {

/**
* The following is highly inefficient, but written this way
* to show in the most simplest form what the optimized
* contract is performing inside it's assembly.
*/
/**
* The following is highly inefficient, but written this way
* to show in the most simplest form what the optimized
* contract is performing inside it's assembly.
*/

// Get the total execution length.
uint256 executionLength = (totalOfferFulfillments +
Expand Down Expand Up @@ -1643,8 +1642,8 @@ contract ReferenceConsiderationInternal is
* approvals set on Consideration) and
* `bytes32(uint256(1))` signifies to utilize the legacy
* user proxy for the transfer.
* @param accumulatorStruct A struct containing conduit transfer data and it's
* corresponding conduitKey.
* @param accumulatorStruct A struct containing conduit transfer data and it's
* corresponding conduitKey.
*/
function _transfer(
ReceivedItem memory item,
Expand Down Expand Up @@ -1728,8 +1727,8 @@ contract ReferenceConsiderationInternal is
* approvals set on Consideration) and
* `bytes32(uint256(1))` signifies to utilize the legacy
* user proxy for the transfer.
* @param accumulatorStruct A struct containing conduit transfer data and it's
* corresponding conduitKey.
* @param accumulatorStruct A struct containing conduit transfer data and it's
* corresponding conduitKey.
*/
function _transferERC20(
address token,
Expand Down Expand Up @@ -1780,8 +1779,8 @@ contract ReferenceConsiderationInternal is
* approvals set on Consideration) and
* `bytes32(uint256(1))` signifies to utilize the legacy
* user proxy for the transfer.
* @param accumulatorStruct A struct containing conduit transfer data and it's
* corresponding conduitKey.
* @param accumulatorStruct A struct containing conduit transfer data and it's
* corresponding conduitKey.
*/
function _transferERC721(
address token,
Expand Down Expand Up @@ -1835,8 +1834,8 @@ contract ReferenceConsiderationInternal is
* approvals set on Consideration) and
* `bytes32(uint256(1))` signifies to utilize the legacy
* user proxy for the transfer.
* @param accumulatorStruct A struct containing conduit transfer data and it's
* corresponding conduitKey.
* @param accumulatorStruct A struct containing conduit transfer data and it's
* corresponding conduitKey.
*/
function _transferERC1155(
address token,
Expand Down Expand Up @@ -1892,12 +1891,11 @@ contract ReferenceConsiderationInternal is
uint256 identifier,
uint256 amount
) internal view {

/**
* The following is highly inefficient, but written this way
* to show in the most simplest form what the optimized
* contract is performing inside it's assembly.
*/
/**
* The following is highly inefficient, but written this way
* to show in the most simplest form what the optimized
* contract is performing inside it's assembly.
*/

// Get the current length of the accumulator's transfers.
uint256 currentTransferLength = accumulatorStruct.transfers.length;
Expand Down Expand Up @@ -2063,8 +2061,8 @@ contract ReferenceConsiderationInternal is
* @param amount The amount of ERC20 tokens to transfer.
* @param parameters The parameters of the order.
* @param fromOfferer Whether to decrement amount from the offered amount.
* @param accumulatorStruct A struct containing conduit transfer data and it's
* corresponding conduitKey.
* @param accumulatorStruct A struct containing conduit transfer data and it's
* corresponding conduitKey.
*/
function _transferERC20AndFinalize(
address from,
Expand Down
20 changes: 10 additions & 10 deletions reference/lib/ReferenceConsiderationInternalView.sol
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ contract ReferenceConsiderationInternalView is
}

/**
* @dev Internal view function to derive the EIP-712 hash for an offer item.
* @param offerItem The offered item to hash.
* @return The hash.
*/
* @dev Internal view function to derive the EIP-712 hash for an offer item.
* @param offerItem The offered item to hash.
* @return The hash.
*/
function _hashOfferItem(OfferItem memory offerItem)
internal
view
Expand All @@ -228,11 +228,11 @@ contract ReferenceConsiderationInternalView is
);
}

/**
* @dev Internal view function to derive the EIP-712 hash for a consideration item.
* @param considerationItem The consideration item to hash.
* @return The hash.
*/
/**
* @dev Internal view function to derive the EIP-712 hash for a consideration item.
* @param considerationItem The consideration item to hash.
* @return The hash.
*/
function _hashConsiderationItem(ConsiderationItem memory considerationItem)
internal
view
Expand Down Expand Up @@ -734,7 +734,7 @@ contract ReferenceConsiderationInternalView is
if (invalidFulfillment) {
break;
}
// Get the order based on offer components order index.
// Get the order based on offer components order index.
orderToExecute = ordersToExecute[orderIndex];
if (orderToExecute.numerator != 0) {
// Ensure that the item index is not out of range.
Expand Down
8 changes: 4 additions & 4 deletions reference/lib/ReferenceConsiderationPure.sol
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ contract ReferenceConsiderationPure is

// Optimistically update identifier w/ supplied identifier.
offer.identifier = criteriaResolver.identifier;
} else {
} else {
// Otherwise, the resolver refers to a consideration item.

// Retrieve relevant item using order index.
ReceivedItem[] memory receivedItems = ordersToExecute[
orderIndex
].receivedItems;

// Ensure that the component index is in range.
if (componentIndex >= receivedItems.length) {
revert ConsiderationCriteriaResolverOutOfRange();
Expand Down Expand Up @@ -764,7 +764,7 @@ contract ReferenceConsiderationPure is
* @param startAmount The starting amount of the item.
* @param endAmount The ending amount of the item.
* @param fractionData A struct containing the data used to apply a
* fraction to an order.
* fraction to an order.
* @return amount The received item to transfer with the final amount.
*/
function _applyFraction(
Expand Down Expand Up @@ -1223,7 +1223,7 @@ contract ReferenceConsiderationPure is
// Add to array of received items
receivedItems[i] = receivedItem;
}

// Create the order to execute from the advanced order data.
orderToExecute = OrderToExecute(
advancedOrder.parameters.offerer,
Expand Down
20 changes: 10 additions & 10 deletions reference/lib/ReferenceConsiderationStructs.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ struct BasicFulfillmentHashes {
bytes32 offerItemHash;
}

/**
* @dev A struct that is an explicit version of advancedOrders without
* memory optimization, that provides an array of spentItems
* and receivedItems for fulfillment and event emission.
*/
/**
* @dev A struct that is an explicit version of advancedOrders without
* memory optimization, that provides an array of spentItems
* and receivedItems for fulfillment and event emission.
*/
struct OrderToExecute {
address offerer;
SpentItem[] spentItems; // Offer
Expand All @@ -62,11 +62,11 @@ struct OrderToExecute {
}

/**
* @dev A struct containing the data used to apply a
* fraction to an order.
*/
* @dev A struct containing the data used to apply a
* fraction to an order.
*/
struct FractionData {
uint256 numerator; // The portion of the order that should be filled.
uint256 numerator; // The portion of the order that should be filled.
uint256 denominator; // The total size of the order
bytes32 offererConduitKey; // The offerer's conduit key.
bytes32 fulfillerConduitKey; // The fulfiller's conduit key.
Expand All @@ -77,7 +77,7 @@ struct FractionData {

/**
* @dev A struct containing conduit transfer data and it's
* corresponding conduitKey.
* corresponding conduitKey.
*/
struct AccumulatorStruct {
bytes32 conduitKey;
Expand Down

0 comments on commit c0bfc34

Please sign in to comment.