We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5da2261 commit 93d64a6Copy full SHA for 93d64a6
1 file changed
src/FVMAddress.sol
@@ -52,8 +52,8 @@ library FVMAddress {
52
let firstWord := mload(add(delegatedAddress, 0x20))
53
54
// Check 0x040a prefix (protocol 0x04, namespace 0x0a)
55
- // Shift right 240 bits (30 bytes) to get first 2 bytes
56
- if iszero(eq(shr(240, firstWord), 0x040a)) {
+ // shr(240, firstWord) isolates the top 2 bytes; xor is 0 iff equal
+ if xor(shr(240, firstWord), 0x040a) {
57
mstore(0, 0x8eb60a41) // InvalidDelegatedAddress.selector
58
revert(28, 4)
59
}
0 commit comments