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:
Xenia
2024-03-25 14:33:45 +00:00
committed by GitHub
parent ad27fb654a
commit d398d68944
5 changed files with 43 additions and 2 deletions

View File

@ -110,7 +110,7 @@ library Clones {
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
mstore(add(ptr, 0x58), salt)
mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
predicted := keccak256(add(ptr, 0x43), 0x55)
predicted := and(keccak256(add(ptr, 0x43), 0x55), 0xffffffffffffffffffffffffffffffffffffffff)
}
}