Skip to content

Commit

Permalink
Renamed LastValidated -> ValidationData
Browse files Browse the repository at this point in the history
  • Loading branch information
byshape committed Aug 1, 2024
1 parent 19f2bf4 commit 0b49cf5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/BaseEscrowFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ abstract contract BaseEscrowFactory is IEscrowFactory, ResolverValidationExtensi
uint256 partsAmount = uint256(extraDataArgs.hashlockInfo) >> 240;
if (partsAmount < 2) revert InvalidSecretsAmount();
bytes32 key = keccak256(abi.encodePacked(orderHash, uint240(uint256(extraDataArgs.hashlockInfo))));
LastValidated memory validated = lastValidated[key];
ValidationData memory validated = lastValidated[key];
hashlock = validated.leaf;
uint256 calculatedIndex = (order.makingAmount - remainingMakingAmount + makingAmount - 1) * partsAmount / order.makingAmount;
if (
Expand Down
4 changes: 2 additions & 2 deletions contracts/MerkleStorageInvalidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract MerkleStorageInvalidator is IMerkleStorageInvalidator, ITakerInteractio
address private immutable _LIMIT_ORDER_PROTOCOL;

/// @notice See {IMerkleStorageInvalidator-lastValidated}.
mapping(bytes32 => LastValidated) public lastValidated;
mapping(bytes32 key => ValidationData) public lastValidated;

/// @notice Only limit order protocol can call this contract.
modifier onlyLOP() {
Expand Down Expand Up @@ -63,6 +63,6 @@ contract MerkleStorageInvalidator is IMerkleStorageInvalidator, ITakerInteractio
if (takerData.idx < lastValidated[key].index) revert InvalidIndex();
bytes32 rootCalculated = takerData.proof.processProofCalldata(keccak256(abi.encodePacked(takerData.idx, takerData.secretHash)));
if (uint240(uint256(rootCalculated)) != rootShortened) revert InvalidProof();
lastValidated[key] = LastValidated(takerData.idx + 1, takerData.secretHash);
lastValidated[key] = ValidationData(takerData.idx + 1, takerData.secretHash);
}
}
2 changes: 1 addition & 1 deletion contracts/interfaces/IMerkleStorageInvalidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pragma solidity 0.8.23;
* @notice Interface to invalidate hashed secrets from an order that supports multiple fills.
*/
interface IMerkleStorageInvalidator {
struct LastValidated {
struct ValidationData {
uint256 index;
bytes32 leaf;
}
Expand Down

0 comments on commit 0b49cf5

Please sign in to comment.