11use crate :: {
2- item:: { Error , Event , Fallback , Function , Receive } ,
2+ item:: { Constructor , Error , Event , Fallback , Function , Receive } ,
33 EventParam , InternalType , JsonAbi , Param , StateMutability ,
44} ;
55use alloc:: { collections:: BTreeSet , string:: String , vec:: Vec } ;
@@ -69,6 +69,7 @@ impl ToSol for JsonAbi {
6969 fmt ! ( its. 0 ) ;
7070 fmt ! ( self . errors( ) ) ;
7171 fmt ! ( self . events( ) ) ;
72+ fmt ! ( self . constructor( ) ) ;
7273 fmt ! ( self . fallback) ;
7374 fmt ! ( self . receive) ;
7475 fmt ! ( self . functions( ) ) ;
@@ -233,6 +234,21 @@ impl ToSol for It<'_> {
233234 }
234235}
235236
237+ impl ToSol for Constructor {
238+ fn to_sol ( & self , out : & mut SolPrinter < ' _ > ) {
239+ AbiFunction :: < ' _ , Param > {
240+ kw : AbiFunctionKw :: Constructor ,
241+ name : None ,
242+ inputs : & self . inputs ,
243+ visibility : None ,
244+ state_mutability : Some ( self . state_mutability ) ,
245+ anonymous : false ,
246+ outputs : & [ ] ,
247+ }
248+ . to_sol ( out) ;
249+ }
250+ }
251+
236252impl ToSol for Event {
237253 fn to_sol ( & self , out : & mut SolPrinter < ' _ > ) {
238254 AbiFunction :: < ' _ , EventParam > {
@@ -319,6 +335,7 @@ struct AbiFunction<'a, IN> {
319335}
320336
321337enum AbiFunctionKw {
338+ Constructor ,
322339 Function ,
323340 Fallback ,
324341 Receive ,
@@ -330,6 +347,7 @@ impl AbiFunctionKw {
330347 #[ inline]
331348 const fn as_str ( & self ) -> & ' static str {
332349 match self {
350+ Self :: Constructor => "constructor" ,
333351 Self :: Function => "function" ,
334352 Self :: Fallback => "fallback" ,
335353 Self :: Receive => "receive" ,
0 commit comments