Skip to content

Commit

Permalink
Change witness type to be consistent with the rest of the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ezynda3 committed Sep 3, 2024
1 parent 10b6204 commit f5f566d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Periphery/Permit2Proxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ contract Permit2Proxy {
mapping(address => bool) public diamondWhitelist;

string public constant WITNESS_TYPE_STRING =
"LIFICall witness)LIFICall(address tokenReceiver,address diamondAddress,bytes32 diamondCalldataHash)TokenPermissions(address token,uint256 amount)";
"LiFiCall witness)LiFiCall(address tokenReceiver,address diamondAddress,bytes32 diamondCalldataHash)TokenPermissions(address token,uint256 amount)";
bytes32 public constant WITNESS_TYPEHASH =
keccak256(
"LIFICall(address tokenReceiver,address diamondAddress,bytes32 diamondCalldataHash)"
"LiFiCall(address tokenReceiver,address diamondAddress,bytes32 diamondCalldataHash)"
);
bytes32 public immutable PERMIT_WITH_WITNESS_TYPEHASH;

/// Types ///

// @dev LIFI Specific Witness which verifies the correct calldata and
// diamond address
struct LIFICall {
struct LiFiCall {
address diamondAddress;
bytes32 diamondCalldataHash;
}
Expand Down Expand Up @@ -151,7 +151,7 @@ contract Permit2Proxy {
ISignatureTransfer.PermitTransferFrom calldata _permit,
bytes calldata _signature
) external payable {
LIFICall memory lifiCall = LIFICall(
LiFiCall memory lifiCall = LiFiCall(
LIFI_DIAMOND,
keccak256(_diamondCalldata)
);
Expand Down Expand Up @@ -202,7 +202,7 @@ contract Permit2Proxy {
bytes32 permit = _getTokenPermissionsHash(tokenPermissions);

// Witness
Permit2Proxy.LIFICall memory lifiCall = LIFICall(
Permit2Proxy.LiFiCall memory lifiCall = LiFiCall(
LIFI_DIAMOND,
keccak256(_diamondCalldata)
);
Expand Down Expand Up @@ -235,7 +235,7 @@ contract Permit2Proxy {
}

function _getWitnessHash(
Permit2Proxy.LIFICall memory lifiCall
Permit2Proxy.LiFiCall memory lifiCall
) internal pure returns (bytes32) {
return keccak256(abi.encode(WITNESS_TYPEHASH, lifiCall));
}
Expand Down
4 changes: 2 additions & 2 deletions test/solidity/Periphery/Permit2Proxy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ contract Permit2ProxyTest is TestBase {

// Witness
diamondCalldata = _getCalldataForBridging();
Permit2Proxy.LIFICall memory lifiCall = Permit2Proxy.LIFICall(
Permit2Proxy.LiFiCall memory lifiCall = Permit2Proxy.LiFiCall(
DIAMOND_ADDRESS,
keccak256(diamondCalldata)
);
Expand Down Expand Up @@ -542,7 +542,7 @@ contract Permit2ProxyTest is TestBase {
}

function _getWitnessHash(
Permit2Proxy.LIFICall memory lifiCall
Permit2Proxy.LiFiCall memory lifiCall
) internal view returns (bytes32) {
return
keccak256(abi.encode(permit2Proxy.WITNESS_TYPEHASH(), lifiCall));
Expand Down

0 comments on commit f5f566d

Please sign in to comment.