Skip to content

Commit c623dfd

Browse files
committed
Revert "fix(CCTPAdapter): Fix feeRecipient check to determine V2 vs V1"
This reverts commit cd36e36.
1 parent cd36e36 commit c623dfd

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

contracts/libraries/CircleCCTPAdapter.sol

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,7 @@ abstract contract CircleCCTPAdapter {
8383
(bool success, bytes memory feeRecipient) = address(cctpTokenMessenger).staticcall(
8484
abi.encodeWithSignature("feeRecipient()")
8585
);
86-
// In case of a call to nonexistent contract or a call to a contract with a fallback function which
87-
// doesn't return any data, feeRecipient can be empty so check its length.
88-
// Even with this check, its possible that the contract has implemented a fallback function that returns
89-
// 32 bytes of data but its not actually the feeRecipient address. This is extremely low risk but worth
90-
// mentioning that the following check is not 100% safe.
91-
cctpV2 = (success &&
92-
feeRecipient.length == 32 &&
93-
address(uint160(uint256(bytes32(feeRecipient)))) != address(0));
86+
cctpV2 = (success && address(bytes20(feeRecipient)) != address(0));
9487
}
9588

9689
/**

0 commit comments

Comments
 (0)