Skip to content

Commit d307c63

Browse files
committed
fix(ens): pass bytes to setContenthash explicitly and log bytes length
- Convert 0x-hex to Uint8Array via ethers.getBytes before calling setContenthash - Add length logs to aid debugging in forks
1 parent 68ca44c commit d307c63

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

scripts/update-ens.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ async function main() {
8989
console.log(`Original CID: ${IPFS_CID}`)
9090
if (cidForEns !== IPFS_CID) console.log(`Converted to CIDv0: ${cidForEns}`)
9191
console.log(`Encoded contenthash (hex, 0x-prefixed) length=${encoded.length}`)
92-
const tx = await resolver.setContenthash(node, encoded)
92+
const encodedBytes = getBytes(encoded)
93+
console.log(`Encoded contenthash bytes length=${encodedBytes.length}`)
94+
const tx = await resolver.setContenthash(node, encodedBytes)
9395
console.log(`Submitted tx: ${tx.hash}`)
9496
const receipt = await tx.wait()
9597
console.log(`Confirmed in block ${receipt.blockNumber}`)

0 commit comments

Comments
 (0)