Mask computed address in Create2 and Clones libraries (#4941)
Co-authored-by: ernestognw <ernestognw@gmail.com> Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
@ -82,7 +82,7 @@ library Create2 {
|
||||
mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes
|
||||
let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff
|
||||
mstore8(start, 0xff)
|
||||
addr := keccak256(start, 85)
|
||||
addr := and(keccak256(start, 85), 0xffffffffffffffffffffffffffffffffffffffff)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user