-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): warn when contract is over or close to the size limit (#1894)
- Loading branch information
Showing
11 changed files
with
71 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@latticexyz/cli": minor | ||
--- | ||
|
||
Deploys now validate contract size before deploying and warns when a contract is over or close to the size limit (24kb). This should help identify the most common cause of "evm revert" errors during system and module contract deploys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
import KeysWithValueModuleData from "@latticexyz/world-modules/out/KeysWithValueModule.sol/KeysWithValueModule.json" assert { type: "json" }; | ||
import KeysInTableModuleData from "@latticexyz/world-modules/out/KeysInTableModule.sol/KeysInTableModule.json" assert { type: "json" }; | ||
import UniqueEntityModuleData from "@latticexyz/world-modules/out/UniqueEntityModule.sol/UniqueEntityModule.json" assert { type: "json" }; | ||
import { Abi, Hex, size } from "viem"; | ||
|
||
// These modules are always deployed | ||
export const defaultModuleContracts = [ | ||
{ | ||
name: "KeysWithValueModule", | ||
abi: KeysWithValueModuleData.abi, | ||
bytecode: KeysWithValueModuleData.bytecode, | ||
abi: KeysWithValueModuleData.abi as Abi, | ||
bytecode: KeysWithValueModuleData.bytecode.object as Hex, | ||
deployedBytecodeSize: size(KeysWithValueModuleData.deployedBytecode.object as Hex), | ||
}, | ||
{ | ||
name: "KeysInTableModule", | ||
abi: KeysInTableModuleData.abi, | ||
bytecode: KeysInTableModuleData.bytecode, | ||
abi: KeysInTableModuleData.abi as Abi, | ||
bytecode: KeysInTableModuleData.bytecode.object as Hex, | ||
deployedBytecodeSize: size(KeysInTableModuleData.deployedBytecode.object as Hex), | ||
}, | ||
{ | ||
name: "UniqueEntityModule", | ||
abi: UniqueEntityModuleData.abi, | ||
bytecode: UniqueEntityModuleData.bytecode, | ||
abi: UniqueEntityModuleData.abi as Abi, | ||
bytecode: UniqueEntityModuleData.bytecode.object as Hex, | ||
deployedBytecodeSize: size(UniqueEntityModuleData.deployedBytecode.object as Hex), | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters