diff --git a/.gitignore b/.gitignore index 150a9f219..a662b926c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,9 @@ -.tool-versions -starknet.go +.idea/ +.vscode/ vendor/ + +.tool-versions .env* !.env.template -rpc*/.env.mainnet -rpc*/.env.testnet - -*.txt -tmp/ - -examples/**/*.sum - -*/**/*abi.json - -.idea/ -.vscode/settings.json \ No newline at end of file diff --git a/cmd/starkgen/main.go b/cmd/starkgen/main.go new file mode 100644 index 000000000..fccb1bfcc --- /dev/null +++ b/cmd/starkgen/main.go @@ -0,0 +1,50 @@ +package main + +import ( + "fmt" + "time" + + "github.com/spf13/cobra" +) + +var ( + // Used for flags. + abiPath string + pkgName string + typeName string + outPath string + + // main CLI command + rootCmd = &cobra.Command{} +) + +func init() { + // set flags + rootCmd.PersistentFlags().StringVar(&abiPath, "abi", "", "path to the Cairo contract ABI") + rootCmd.MarkPersistentFlagRequired("abi") + // @todo at the end, validate default values correctness + rootCmd.PersistentFlags().StringVar(&pkgName, "pkg", "", "package name for the generated Go code (default is the lower case contract name)") + rootCmd.PersistentFlags().StringVar(&typeName, "type", "", "type name for the generated Go code (default is the upper case contract name)") + rootCmd.PersistentFlags().StringVar(&outPath, "out", "", "output directory for the generated Go code (default is the current directory)") +} + +func main() { + rootCmd.Use = "starkgen --abi --pkg [--type] [--out]" + rootCmd.Short = "Generate Go bindings for Cairo contracts" + rootCmd.Long = `Generate Go bindings for Cairo contracts + Creating now random content just to test + how this text will be displayed in the termina.` + + rootCmd.Run = func(cmd *cobra.Command, args []string) { + ticker := time.NewTicker(1 * time.Second) + go func() { + for { + time := <-ticker.C + fmt.Printf("%s\n", time) + } + }() + select {} + } + + rootCmd.Execute() +} diff --git a/go.mod b/go.mod index 18c13b6bc..a2ce8258c 100644 --- a/go.mod +++ b/go.mod @@ -8,12 +8,19 @@ require ( github.com/joho/godotenv v1.4.0 github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 github.com/pkg/errors v0.9.1 + github.com/spf13/cobra v1.9.1 github.com/stretchr/testify v1.10.0 go.uber.org/mock v0.5.0 golang.org/x/crypto v0.36.0 golang.org/x/net v0.38.0 ) +require ( + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/spf13/pflag v1.0.6 // indirect + golang.org/x/text v0.26.0 // indirect +) + require ( github.com/bits-and-blooms/bitset v1.21.0 // indirect github.com/consensys/bavard v0.1.27 // indirect @@ -25,8 +32,7 @@ require ( github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/x448/float16 v0.8.4 // indirect + golang.org/x/sys v0.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) - -require golang.org/x/sys v0.31.0 // indirect diff --git a/go.sum b/go.sum index 27fd75e9f..1f250087b 100644 --- a/go.sum +++ b/go.sum @@ -24,6 +24,7 @@ github.com/consensys/bavard v0.1.27 h1:j6hKUrGAy/H+gpNrpLU3I26n1yc+VMGmd6ID5+gAh github.com/consensys/bavard v0.1.27/go.mod h1:k/zVjHHC4B+PQy1Pg7fgvG3ALicQw540Crag8qx+dZs= github.com/consensys/gnark-crypto v0.16.0 h1:8Dl4eYmUWK9WmlP1Bj6je688gBRJCJbT8Mw4KoTAawo= github.com/consensys/gnark-crypto v0.16.0/go.mod h1:Ke3j06ndtPTVvo++PhGNgvm+lgpLvzbcE2MqljY7diU= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= @@ -43,6 +44,8 @@ github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aN github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/holiman/uint256 v1.3.2 h1:a9EgMPSC1AAaj1SZL5zIQD3WbwTuHrMGOerLjGmM/TA= github.com/holiman/uint256 v1.3.2/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= @@ -74,6 +77,9 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= @@ -92,10 +98,10 @@ golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa h1:t2QcU6V556bFjYgu4L6C+6VrC golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/starkgen/abi.go b/starkgen/abi.go new file mode 100644 index 000000000..62b3a710f --- /dev/null +++ b/starkgen/abi.go @@ -0,0 +1,134 @@ +package starkgen + +// Item represents a contract item ABI +// @todo make it a any type and use a switch statement to handle the different types +type Item struct { + Type string `json:"type"` + // The actual content is one of the following types based on the Type field + Function *Function `json:"function,omitempty"` + Constructor *Constructor `json:"constructor,omitempty"` + L1Handler *L1Handler `json:"l1_handler,omitempty"` + Event *Event `json:"event,omitempty"` + Struct *Struct `json:"struct,omitempty"` + Enum *Enum `json:"enum,omitempty"` + Interface *Interface `json:"interface,omitempty"` + Impl *Imp `json:"impl,omitempty"` +} + +// Imp represents a contract implementation ABI +type Imp struct { + Type string `json:"type"` + Name string `json:"name"` + InterfaceName string `json:"interface_name"` +} + +// Interface represents a contract interface ABI +type Interface struct { + Type string `json:"type"` + Name string `json:"name"` + Items []Item `json:"items"` +} + +// StateMutability represents the state mutability of a function +type StateMutability string + +const ( + External StateMutability = "external" + View StateMutability = "view" +) + +// Function represents a contract function ABI +type Function struct { + Type string `json:"type"` + Name string `json:"name"` + Inputs []Input `json:"inputs"` + Outputs []Output `json:"outputs"` + StateMutability StateMutability `json:"state_mutability"` +} + +// Constructor represents a contract constructor ABI +type Constructor struct { + Type string `json:"type"` + Name string `json:"name"` + Inputs []Input `json:"inputs"` +} + +// L1Handler represents a contract L1 handler ABI +type L1Handler struct { + Type string `json:"type"` + Name string `json:"name"` + Inputs []Input `json:"inputs"` + Outputs []Output `json:"outputs"` + StateMutability StateMutability `json:"state_mutability"` +} + +// Event represents a contract event ABI +type Event struct { + Type string `json:"type"` + Name string `json:"name"` + Kind EventKind `json:"kind"` + Members []EventField `json:"members,omitempty"` + Variants []EventField `json:"variants,omitempty"` +} + +// EventKind is a string enum representing the kind of an event +type EventKind string + +const ( + EventKindStruct EventKind = "struct" + EventKindEnum EventKind = "enum" +) + +// EventField represents a field in an event +type EventField struct { + Name string `json:"name"` + Type string `json:"type"` + Kind EventFieldKind `json:"kind"` +} + +// EventFieldKind represents how to serialize the event's field +type EventFieldKind string + +const ( + KeySerde EventFieldKind = "key" + DataSerde EventFieldKind = "data" + Nested EventFieldKind = "nested" + Flat EventFieldKind = "flat" +) + +// Input represents a function input ABI +type Input struct { + Name string `json:"name"` + Type string `json:"type"` +} + +// Output represents a function output ABI +type Output struct { + Type string `json:"type"` +} + +// Struct represents a struct ABI +type Struct struct { + Type string `json:"type"` + Name string `json:"name"` + Members []StructMember `json:"members"` +} + +// StructMember represents a struct member +type StructMember struct { + Name string `json:"name"` + Type string `json:"type"` +} + +// Enum represents an enum ABI +type Enum struct { + Type string `json:"type"` + Name string `json:"name"` + Variants []EnumVariant `json:"variants"` +} + +// EnumVariant represents an enum variant +type EnumVariant struct { + Name string `json:"name"` + Type string `json:"type"` +} diff --git a/starkgen/decode.go b/starkgen/decode.go new file mode 100644 index 000000000..7fca99cbb --- /dev/null +++ b/starkgen/decode.go @@ -0,0 +1,6 @@ +package starkgen + +func GetABIFromFile(abiPath string) ([]byte, error) { + // TODO: implement + return nil, nil +} diff --git a/starkgen/test/scarbtest_Contract.contract_class.json b/starkgen/test/scarbtest_Contract.contract_class.json new file mode 100644 index 000000000..565369fa1 --- /dev/null +++ b/starkgen/test/scarbtest_Contract.contract_class.json @@ -0,0 +1,760 @@ +{ + "sierra_program": [ + "0x1", + "0x7", + "0x0", + "0x2", + "0xb", + "0x4", + "0xb0", + "0x50", + "0x1b", + "0x52616e6765436865636b", + "0x800000000000000100000000000000000000000000000000", + "0x456e756d", + "0x800000000000000700000000000000000000000000000001", + "0x0", + "0x1e7cc030b6a62e51219c7055ff773a8dff8fb71637d893064207dc67ba74304", + "0x436f6e7374", + "0x800000000000000000000000000000000000000000000002", + "0x1", + "0x19", + "0x2", + "0x53746f7265553332202d206e6f6e20753332", + "0x4661696c656420746f20646573657269616c697a6520706172616d202331", + "0x4f7574206f6620676173", + "0x7533325f616464204f766572666c6f77", + "0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473", + "0x53746f726167654261736541646472657373", + "0x800000000000000700000000000000000000000000000000", + "0x537472756374", + "0x800000000000000700000000000000000000000000000002", + "0x1fc809ca0b1c685b35311401784f1fd1560d604774b1cdf30c3f472beb16179", + "0x7", + "0x800000000000000f00000000000000000000000000000001", + "0x16a4c8d7c05909052238a862d8cc3e7975bf05a07b3a69c6b28951083a6d672", + "0x4172726179", + "0x800000000000000300000000000000000000000000000001", + "0x536e617073686f74", + "0xa", + "0x1baeba72e79e9db2587cf44fedb2f3700b2075a5e8e39a562584862c4b71f62", + "0xb", + "0x2ee1e2b1b89f8c495f200e4956278a4d47395fe262f27b52e5865c9524c08c3", + "0xc", + "0x15", + "0x53746f7261676541646472657373", + "0x4275696c74696e436f737473", + "0x53797374656d", + "0x800000000000000300000000000000000000000000000003", + "0x9", + "0x9931c641b913035ae674b400b61a51476d506bbe8bba2ff8a6272790aba9e6", + "0xd", + "0x13", + "0x753332", + "0x426f78", + "0x800000000000000700000000000000000000000000000003", + "0x29d7d57c04a880978e7b3689f6218e507f3be17588744b58dc17762447ad0e7", + "0x17", + "0x16", + "0x66656c74323532", + "0x4761734275696c74696e", + "0x46", + "0x7265766f6b655f61705f747261636b696e67", + "0x77697468647261775f676173", + "0x6272616e63685f616c69676e", + "0x72656465706f7369745f676173", + "0x7374727563745f6465636f6e737472756374", + "0x656e61626c655f61705f747261636b696e67", + "0x73746f72655f74656d70", + "0x1a", + "0x61727261795f736e617073686f745f706f705f66726f6e74", + "0x656e756d5f696e6974", + "0x18", + "0x6a756d70", + "0x7374727563745f636f6e737472756374", + "0x656e756d5f6d61746368", + "0x64697361626c655f61705f747261636b696e67", + "0x756e626f78", + "0x72656e616d65", + "0x7533325f7472795f66726f6d5f66656c74323532", + "0x64726f70", + "0x66756e6374696f6e5f63616c6c", + "0x3", + "0x14", + "0x12", + "0x6765745f6275696c74696e5f636f737473", + "0x11", + "0x77697468647261775f6761735f616c6c", + "0x636f6e73745f61735f696d6d656469617465", + "0x10", + "0x7533325f6f766572666c6f77696e675f616464", + "0x73746f726167655f626173655f616464726573735f636f6e7374", + "0x1afeeaff0ed5cee7d05a21078399c2f56226b0cd5657062500cef4c4e736f85", + "0x7533325f746f5f66656c74323532", + "0x73746f726167655f616464726573735f66726f6d5f62617365", + "0xe", + "0xf", + "0x73746f726167655f77726974655f73797363616c6c", + "0x61727261795f6e6577", + "0x736e617073686f745f74616b65", + "0x4", + "0x5", + "0x8", + "0x73746f726167655f726561645f73797363616c6c", + "0x61727261795f617070656e64", + "0x6", + "0x12c", + "0xffffffffffffffff", + "0x8f", + "0x81", + "0x7b", + "0x1c", + "0x1d", + "0x1e", + "0x1f", + "0x31", + "0x20", + "0x21", + "0x22", + "0x23", + "0x24", + "0x25", + "0x26", + "0x27", + "0x71", + "0x28", + "0x29", + "0x2a", + "0x2b", + "0x2c", + "0x2d", + "0x5f", + "0x2e", + "0x2f", + "0x30", + "0x32", + "0x33", + "0x34", + "0x35", + "0x36", + "0x57", + "0x37", + "0x38", + "0x39", + "0x3a", + "0x3b", + "0x3c", + "0x3d", + "0x3e", + "0x3f", + "0x40", + "0x41", + "0x42", + "0x43", + "0x44", + "0x45", + "0x69", + "0x47", + "0x48", + "0x49", + "0x4a", + "0x4b", + "0x4c", + "0x4d", + "0x4e", + "0x4f", + "0x50", + "0x51", + "0x52", + "0x88", + "0x53", + "0x54", + "0x55", + "0x56", + "0x58", + "0xfa", + "0xac", + "0xf1", + "0xe2", + "0xd8", + "0xe9", + "0x99", + "0x104", + "0x10c", + "0x114", + "0x11c", + "0x124", + "0xac8", + "0xf0b0a0908070e0b0a0908070d0b0a0908070c0b0a09080706050403020100", + "0x91d0514131c09041b0a091a19180517131609150514131211100b0a090807", + "0x26091f05251302241223090b210908071222050b2109080720091f0514131e", + "0x3112302f092e092d052c030a09042b1f051713122a29092809270525031c09", + "0x90b3c0a09093b3a0909390509093905382009093705360535053405333202", + "0x94205413d090940090b3d090b3c2f09093f053e3d0909391e090939050b3d", + "0x90b3c0b470946210909452e0909451e09094505440a0909390a0909430a09", + "0x950054f210909394e09094d054c4b090939054a4809093949090939090b48", + "0x9093f1c0909451c0909580a0909570556550909395409094d05530552510b", + "0x2609093f2609094529090937474709461c090939050b48090b3c2809093f20", + "0x909455b0909585b09093f200909455a4709462f090945594709462909093f", + "0x5a09094d290909395e09094d5e4709460a09095d055c160909435b0909375b", + "0xb615a590b600b09050b09050560090505055f0b09094d4709094d5909094d", + "0x5056009055a0526096009470959055b0960095a094705056009050b05165e", + "0x9050b0520094e1e1c0b600b26095b055b0960095b0916055909600959095e", + "0x91c091c055509600928091605540960091e092605280960095b0947050560", + "0x490960095b094705056009050b05052e090520054b09600954091e054e0960", + "0x4e09600920091c055509600949091605480960092909540529096009052805", + "0x56009054e05056009050b052f09622109600b4b0955054b09600948091e05", + "0x960090a0929050a0960093d0949053d09600921094b052e09600955094705", + "0x94705056009050b05640963003a0b600b0a590b48052e0960092e0916050a", + "0x6867660b600b4e095b0565096009650916053a0960093a095e05650960092e", + "0x470505600900092e0505600967092f0505600966092105056009050b056909", + "0x16053a0960093a095e056c0960096b090a056b096009053d056a0960096509", + "0x50b056c0b6a3a59096c0960096c0900050b0960090b093a056a0960096a09", + "0x60096d0916056e0960090564056d0960096509470505600969092105056009", + "0x56009050b0573720b71706f0b600b6e6d3a4766056e0960096e0965056d09", + "0x74096009740916057509600975096905750960090567057409600970094705", + "0x6b057b09600974094705056009050b057a790b7877760b600b75006f476a05", + "0x916057e096009056e057d09600968096d057c09600977096c056809600905", + "0x70057609600976095e057d0960097d096f057e0960097e0969057b0960097b", + "0x57f0960097f091605056009050b058483824781807f0b600b7c7d7e0b7b5a", + "0x50560098709740588870b60098609730586096009057205850960097f0947", + "0x7609600976095e058b0960098a0977058a0960098909760589096009880975", + "0x58b80857659098b0960098b0900058009600980093a058509600985091605", + "0x16058d09600976095e058c096009820947058209600982091605056009050b", + "0x50b0505910905200590096009840979058f09600983093a058e0960098c09", + "0x600992097b0592096009057a0532096009740947050560097a092e05056009", + "0x90b093a058e096009320916058d09600979095e050560099309680594930b", + "0x96090a059609600990950b7d0595096009057c0590096009940979058f0960", + "0x900058f0960098f093a058e0960098e0916058d0960098d095e0597096009", + "0x960097309470505600900092e05056009050b05978f8e8d59099709600997", + "0x96009980916057209600972095e059a09600999090a0599096009057e0598", + "0x2105056009050b059a0b987259099a0960099a0900050b0960090b093a0598", + "0x20059d0960099b0916059c09600964095e059b0960092e0947050560094e09", + "0x50560094e0921050560092f097f05056009054e05056009050b05059e0905", + "0x5a00960090580059d0960099f0916059c09600959095e059f096009550947", + "0xb0960090b093a059d0960099d0916059c0960099c095e05a1096009a0090a", + "0x1609470505600947098205056009050b05a10b9d9c5909a1096009a1090005", + "0xa20916055e0960095e095e05a309600981090a0581096009057e05a2096009", + "0x6009050505a30ba25e5909a3096009a30900050b0960090b093a05a2096009", + "0x59055b0960095a094705056009050b05165e0ba45a590b600b09050b090505", + "0x1e1c0b600b26095b055b0960095b0916055909600959095e05260960094709", + "0x280960095b0947050560091e092f050560091c092105056009050b052009a5", + "0x28096009280916055909600959095e055509600954090a0554096009053d05", + "0x92105056009050b05550b2859590955096009550900050b0960090b093a05", + "0x4b0965054e0960094e0916054b0960090564054e0960095b09470505600920", + "0x600929094705056009050b0521480ba629490b600b4b4e594766054b096009", + "0x90a0985053a0a0b60093d0984053d0960092e0983052e096009056b052f09", + "0x6009056e056509600964096d056409600900098705000960093a0986050560", + "0x949095e056509600965096f0566096009660969052f0960092f0916056609", + "0x67091605056009050b056d6c6b47a76a696747600b65660b2f598805490960", + "0x916056909600969093a056a0960096a0929056e0960096709470567096009", + "0x960096e094705056009050b057209a8706f0b600b6a490b48056e0960096e", + "0x6009760973057609600975740b89057509600970096c057409600905720573", + "0x97b0977057b0960097a0976057a096009790975050560097709740579770b", + "0x680900056909600969093a0573096009730916056f0960096f095e05680960", + "0x7d096009058a057c0960096e094705056009050b056869736f590968096009", + "0x960097c0916058009600972095e050560097e0968057f7e0b60097d097b05", + "0x1605056009050b0505a909052005840960097f0979058309600969093a0582", + "0x582096009850916058009600949095e05850960096b0947056b0960096b09", + "0x8709600984860b7d0586096009057c05840960096d097905830960096c093a", + "0x9600983093a0582096009820916058009600980095e058809600987090a05", + "0x7e058909600921094705056009050b05888382805909880960098809000583", + "0x3a0589096009890916054809600948095e058b0960098a090a058a09600905", + "0x947098205056009050b058b0b894859098b0960098b0900050b0960090b09", + "0x60095e095e058e0960098d090a058d096009057e058c096009160947050560", + "0xb8c5e59098e0960098e0900050b0960090b093a058c0960098c0916055e09", + "0x9600909050b8905090960090909290509096009058b05050960090572058e", + "0x572055909095909600959098c05590960090b470b7d0547096009057c050b", + "0x57c050b09600909050b8905090960090909290509096009058d0505096009", + "0x50960090572055909095909600959098c05590960090b470b7d0547096009", + "0x47096009057c050b09600909050b8905090960090909290509096009058e05", + "0x9058f05050960090572055909095909600959098c05590960090b470b7d05", + "0x470b7d0547096009057c050b09600909050b89050909600909092905090960", + "0x509096009059005050960090572055909095909600959098c05590960090b", + "0x960090b470b7d0547096009057c050b09600909050b890509096009090929", + "0x3a055905470b090548493a055920493a0559165909095909600959098c0559", + "0x290905ae290905ad290905ac290905ab290905aa470b090548493a05592049", + "0xaf" + ], + "sierra_program_debug_info": { + "type_names": [ + [ + 0, + "RangeCheck" + ], + [ + 1, + "core::never" + ], + [ + 2, + "Const" + ], + [ + 3, + "Const" + ], + [ + 4, + "Const" + ], + [ + 5, + "Const" + ], + [ + 6, + "Const" + ], + [ + 7, + "StorageBaseAddress" + ], + [ + 8, + "core::starknet::storage::StoragePointer0Offset::" + ], + [ + 9, + "core::panics::Panic" + ], + [ + 10, + "Array" + ], + [ + 11, + "Snapshot>" + ], + [ + 12, + "core::array::Span::" + ], + [ + 13, + "Tuple>" + ], + [ + 14, + "Const" + ], + [ + 15, + "StorageAddress" + ], + [ + 16, + "Const" + ], + [ + 17, + "BuiltinCosts" + ], + [ + 18, + "System" + ], + [ + 19, + "Tuple>" + ], + [ + 20, + "core::panics::PanicResult::<(core::array::Span::,)>" + ], + [ + 21, + "u32" + ], + [ + 22, + "Unit" + ], + [ + 23, + "Box" + ], + [ + 24, + "core::option::Option::>" + ], + [ + 25, + "felt252" + ], + [ + 26, + "GasBuiltin" + ] + ], + "libfunc_names": [ + [ + 0, + "revoke_ap_tracking" + ], + [ + 1, + "withdraw_gas" + ], + [ + 2, + "branch_align" + ], + [ + 3, + "redeposit_gas" + ], + [ + 4, + "struct_deconstruct>" + ], + [ + 5, + "enable_ap_tracking" + ], + [ + 6, + "store_temp" + ], + [ + 7, + "store_temp" + ], + [ + 8, + "array_snapshot_pop_front" + ], + [ + 9, + "enum_init>, 0>" + ], + [ + 10, + "store_temp>>" + ], + [ + 11, + "store_temp>>" + ], + [ + 12, + "jump" + ], + [ + 13, + "struct_construct" + ], + [ + 14, + "enum_init>, 1>" + ], + [ + 15, + "enum_match>>" + ], + [ + 16, + "disable_ap_tracking" + ], + [ + 17, + "unbox" + ], + [ + 18, + "rename" + ], + [ + 19, + "store_temp" + ], + [ + 20, + "u32_try_from_felt252" + ], + [ + 21, + "drop>>" + ], + [ + 22, + "drop>" + ], + [ + 23, + "drop" + ], + [ + 24, + "function_call>" + ], + [ + 25, + "enum_init,)>, 1>" + ], + [ + 26, + "store_temp" + ], + [ + 27, + "store_temp,)>>" + ], + [ + 28, + "get_builtin_costs" + ], + [ + 29, + "store_temp" + ], + [ + 30, + "withdraw_gas_all" + ], + [ + 31, + "const_as_immediate>" + ], + [ + 32, + "store_temp" + ], + [ + 33, + "u32_overflowing_add" + ], + [ + 34, + "storage_base_address_const<763158443913282032384596498131031794477249071826004797576159089783775391621>" + ], + [ + 35, + "u32_to_felt252" + ], + [ + 36, + "storage_address_from_base" + ], + [ + 37, + "const_as_immediate>" + ], + [ + 38, + "store_temp" + ], + [ + 39, + "storage_write_syscall" + ], + [ + 40, + "array_new" + ], + [ + 41, + "snapshot_take>" + ], + [ + 42, + "drop>" + ], + [ + 43, + "struct_construct>" + ], + [ + 44, + "struct_construct>>" + ], + [ + 45, + "enum_init,)>, 0>" + ], + [ + 46, + "store_temp>" + ], + [ + 47, + "function_call>" + ], + [ + 48, + "struct_deconstruct>>" + ], + [ + 49, + "drop" + ], + [ + 50, + "struct_construct" + ], + [ + 51, + "struct_construct>>" + ], + [ + 52, + "function_call>" + ], + [ + 53, + "drop" + ], + [ + 54, + "function_call>" + ], + [ + 55, + "drop>" + ], + [ + 56, + "struct_construct>" + ], + [ + 57, + "snapshot_take>" + ], + [ + 58, + "drop>" + ], + [ + 59, + "struct_deconstruct>" + ], + [ + 60, + "rename" + ], + [ + 61, + "storage_read_syscall" + ], + [ + 62, + "array_append" + ], + [ + 63, + "function_call>" + ], + [ + 64, + "const_as_immediate>" + ], + [ + 65, + "store_temp>>" + ], + [ + 66, + "const_as_immediate>" + ], + [ + 67, + "const_as_immediate>" + ], + [ + 68, + "const_as_immediate>" + ], + [ + 69, + "const_as_immediate>" + ] + ], + "user_func_names": [ + [ + 0, + "scarbtest::Contract::Contract::__wrapper__ContractImpl__set" + ], + [ + 1, + "scarbtest::Contract::Contract::__wrapper__ContractImpl__get" + ], + [ + 2, + "core::panic_with_const_felt252::<7733229381460288120802334208475838166080759535023995805565484692595>" + ], + [ + 3, + "core::panic_with_const_felt252::<155785504323917466144735657540098748279>" + ], + [ + 4, + "core::panic_with_const_felt252::<375233589013918064796019>" + ], + [ + 5, + "core::panic_with_const_felt252::<485748461484230571791265682659113160264223489397539653310998840191492913>" + ], + [ + 6, + "core::panic_with_const_felt252::<7269940625183576940180048306939577043858226>" + ] + ] + }, + "contract_class_version": "0.1.0", + "entry_points_by_type": { + "EXTERNAL": [ + { + "selector": "0x17c00f03de8b5bd58d2016b59d251c13056b989171c5852949903bc043bc27", + "function_idx": 1 + }, + { + "selector": "0x2f67e6aeaad1ab7487a680eb9d3363a597afa7a3de33fa9bf3ae6edcb88435d", + "function_idx": 0 + } + ], + "L1_HANDLER": [], + "CONSTRUCTOR": [] + }, + "abi": [ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "scarbtest::Contract::ContractInterface" + }, + { + "type": "interface", + "name": "scarbtest::Contract::ContractInterface", + "items": [ + { + "type": "function", + "name": "set", + "inputs": [ + { + "name": "value", + "type": "core::integer::u32" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u32" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "scarbtest::Contract::Contract::Event", + "kind": "enum", + "variants": [] + } + ] +} \ No newline at end of file