@@ -25,18 +25,23 @@ const (
2525
2626// ContractInfo holds all parsed information about a contract needed for code generation.
2727type ContractInfo struct {
28- Name string
29- Version string
30- PackageName string
31- GobindingsPackage string
32- ZkSyncBytecodePackage string
33- ZkSyncBytecodeSymbol string
34- OutputPath string
35- OmitDeploy bool
36- Constructor * FunctionInfo
37- Functions map [string ]* FunctionInfo
38- FunctionOrder []string
39- StructDefs map [string ]* structDef
28+ Name string
29+ Version string
30+ PackageName string
31+ GobindingsPackage string
32+ ZkSync * ZkSyncContractInfo
33+ OutputPath string
34+ OmitDeploy bool
35+ Constructor * FunctionInfo
36+ Functions map [string ]* FunctionInfo
37+ FunctionOrder []string
38+ StructDefs map [string ]* structDef
39+ }
40+
41+ // ZkSyncContractInfo holds resolved zkSync VM deploy bytecode for code generation.
42+ type ZkSyncContractInfo struct {
43+ BytecodePackage string
44+ BytecodeSymbol string
4045}
4146
4247type structDef struct {
@@ -115,16 +120,20 @@ func extractContractInfo(cfg EvmContractConfig, input EvmInputConfig, output Evm
115120 }
116121
117122 info := & ContractInfo {
118- Name : cfg .Name ,
119- Version : cfg .Version ,
120- PackageName : packageName ,
121- GobindingsPackage : cfg .GobindingsPackage ,
122- ZkSyncBytecodePackage : zkSyncPackage ,
123- ZkSyncBytecodeSymbol : zkSyncSymbol ,
124- OutputPath : core .ContractOutputPath (output .BasePath , versionPath , packageName ),
125- OmitDeploy : cfg .OmitDeploy ,
126- Functions : make (map [string ]* FunctionInfo ),
127- StructDefs : make (map [string ]* structDef ),
123+ Name : cfg .Name ,
124+ Version : cfg .Version ,
125+ PackageName : packageName ,
126+ GobindingsPackage : cfg .GobindingsPackage ,
127+ OutputPath : core .ContractOutputPath (output .BasePath , versionPath , packageName ),
128+ OmitDeploy : cfg .OmitDeploy ,
129+ Functions : make (map [string ]* FunctionInfo ),
130+ StructDefs : make (map [string ]* structDef ),
131+ }
132+ if zkSyncSymbol != "" {
133+ info .ZkSync = & ZkSyncContractInfo {
134+ BytecodePackage : zkSyncPackage ,
135+ BytecodeSymbol : zkSyncSymbol ,
136+ }
128137 }
129138
130139 extractConstructor (info , parsedAbi )
0 commit comments