Skip to content

Commit 090c922

Browse files
JamesLefrerealvrs
andauthored
fix(cli): checksum deployed world addresses (#3465)
Co-authored-by: alvarius <alvarius@lattice.xyz>
1 parent f52b147 commit 090c922

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.changeset/warm-rules-listen.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@latticexyz/cli": patch
3+
---
4+
5+
The world address stored in `worlds.json` and `deploys/latest.json` is now checksummed.

packages/cli/src/deploy/logsToWorldDeploy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AbiEventSignatureNotFoundError, Log, decodeEventLog, hexToString, parseAbi } from "viem";
1+
import { AbiEventSignatureNotFoundError, Log, decodeEventLog, hexToString, parseAbi, getAddress } from "viem";
22
import { WorldDeploy, worldDeployEvents } from "./common";
33
import { isDefined } from "@latticexyz/common/utils";
44

@@ -14,6 +14,9 @@ export function logsToWorldDeploy(logs: readonly Log<bigint, number, false>[]):
1414
topics: log.topics,
1515
data: log.data,
1616
}),
17+
// Log addresses are not checksummed, but we want them checksummed before writing to disk.
18+
// https://github.com/wevm/viem/issues/2207
19+
address: getAddress(log.address),
1720
};
1821
} catch (error: unknown) {
1922
if (error instanceof AbiEventSignatureNotFoundError) {

0 commit comments

Comments
 (0)