fix: compare code against codehash

This commit is contained in:
Derrick Hammer 2023-07-13 13:17:27 -04:00
parent 39b1dac32a
commit dc4c6b3f36
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 4 deletions

View File

@ -640,10 +640,7 @@ export default class VerifyingProvider implements IClientVerifyingProvider {
private verifyCodeHash(code: Bytes, codeHash: Bytes32): boolean { private verifyCodeHash(code: Bytes, codeHash: Bytes32): boolean {
return ( return (
(code === "0x" && codeHash === "0x" + KECCAK256_NULL_S) || (code === "0x" && codeHash === "0x" + KECCAK256_NULL_S) ||
byteArrayEquals( byteArrayEquals(keccak256(fromHexString(code)), fromHexString(codeHash))
keccak256(fromHexString(codeHash)),
fromHexString(codeHash),
)
); );
} }