Skip to content

Contract size printer#

Name: contract-size

Prints contract bytecode sizes compared to EVM limits for both creation (initcode) and runtime bytecode.

Example#

wake print contract-size                            ๐Ÿ“ Contract Bytecode Sizes vs EVM Limits                            โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ โ”ƒContract             โ”ƒ  Type  โ”ƒRuntime Sizeโ”ƒ Runtime %โ”ƒCreation Sizeโ”ƒ Creation %โ”ƒ โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ โ”‚UniswapV3Factoryโ”‚contractโ”‚24,617โ”‚100.2%โ”‚25,021โ”‚50.9%โ”‚ โ”‚UniswapV3Poolโ”‚contractโ”‚22,183โ”‚90.3%โ”‚22,769โ”‚46.3%โ”‚ โ”‚UniswapV3PoolDeployerโ”‚contractโ”‚288โ”‚1.2%โ”‚320โ”‚0.7%โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ๐Ÿ“Š Summary:    Total contracts analyzed: 3    Runtime size limit (Spurious Dragon)24,576 bytes    Creation size limit (Shanghai)49,152 bytes โš ๏ธ  1contract(s) exceed runtime size limit

Parameters#

Command-line name TOML name Type Default value Description
--name (multiple) names List[str] [] Contract names to analyze (can be used multiple times).
--all show_all bool False Include interfaces and libraries (default: contracts only).
--details show_details bool False Show detailed information including full file paths.
--files show_files bool False Show full source unit names.
--sort-by sort_by str runtime Sort contracts by: runtime size (default), creation size, name, or file.