Repository: 0xs34n/starknet.js
Pull request #719 (2023-08-10 21:37:01)

test: add cairo 2.1.0 simple contract
## Motivation and Resolution
Solve issue #714 
Add a simple Cairo 2.1.0 contract, without enum or struct..


## Usage related changes
N/A

## Development related changes

To be able to test a Cairo 2.1.0 contract without enum or struct.
[optional struct and enum in responseParser](https://github.com/0xs34n/starknet.js/pull/719/commits/14d3cca97a3cebedf07466f98dd46639999421c2)


## Checklist:

- [x] Performed a self-review of the code
- [x] Rebased to the last commit of the target branch (or merged it into my branch)
- [x] Linked the issues which this PR resolves
- [x] Updated the tests
- [x] All tests are passing 



Patch:
diff --git a/__mocks__/cairo/cairo210/cairo210.cairo b/__mocks__/cairo/cairo210/cairo210.cairo
new file mode 100644
index 00000000..5a9d942d
--- /dev/null
+++ b/__mocks__/cairo/cairo210/cairo210.cairo
@@ -0,0 +1,33 @@
+//Cairo 2.1.0
+
+#[starknet::interface]
+trait ITestC210<TContractState> {
+    fn test_felt(
+        self: @TContractState,
+        p1: felt252,
+        p2: u128,
+        p3: u8
+    ) -> u128;
+}
+
+#[starknet::contract]
+mod MyTestFelt {
+    
+
+    #[storage]
+    struct Storage {
+        counter: u128, 
+    }
+
+    #[external(v0)]
+    impl TestFelt of super::ITestC210<ContractState> {
+        fn test_felt(
+            self: @ContractState,
+            p1: felt252,
+        p2: u128,
+        p3: u8
+        ) -> u128 {
+            p2+1
+        }
+    }
+}
diff --git a/__mocks__/cairo/cairo210/cairo210.casm b/__mocks__/cairo/cairo210/cairo210.casm
new file mode 100644
index 00000000..50d0cdeb
--- /dev/null
+++ b/__mocks__/cairo/cairo210/cairo210.casm
@@ -0,0 +1,785 @@
+{
+  "prime": "0x800000000000011000000000000000000000000000000000000000000000001",
+  "compiler_version": "2.1.0",
+  "bytecode": [
+    "0xa0680017fff8000",
+    "0x7",
+    "0x482680017ffa8000",
+    "0xffffffffffffffffffffffffffffe098",
+    "0x400280007ff97fff",
+    "0x10780017fff7fff",
+    "0x9d",
+    "0x4825800180007ffa",
+    "0x1f68",
+    "0x400280007ff97fff",
+    "0x480a7ffc7fff8000",
+    "0x480a7ffd7fff8000",
+    "0x1104800180018000",
+    "0xa5",
+    "0x482680017ff98000",
+    "0x1",
+    "0x20680017fff7ffd",
+    "0x84",
+    "0x48127fff7fff8000",
+    "0x48127ffa7fff8000",
+    "0x48127ffa7fff8000",
+    "0x1104800180018000",
+    "0xc0",
+    "0x20680017fff7ffe",
+    "0x6f",
+    "0x48127ffb7fff8000",
+    "0x48127ffb7fff8000",
+    "0x48127ffb7fff8000",
+    "0x1104800180018000",
+    "0xef",
+    "0x20680017fff7ffe",
+    "0x5a",
+    "0x48307ffc80007ffd",
+    "0x4824800180007fff",
+    "0x0",
+    "0x20680017fff7fff",
+    "0x4",
+    "0x10780017fff7fff",
+    "0x13",
+    "0x480a7ffb7fff8000",
+    "0x1104800180018000",
+    "0x119",
+    "0x40780017fff7fff",
+    "0x1",
+    "0x480680017fff8000",
+    "0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473",
+    "0x400080007ffe7fff",
+    "0x48127ff37fff8000",
+    "0x48127fa97fff8000",
+    "0x48127ffb7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffa7fff8000",
+    "0x482480017ff98000",
+    "0x1",
+    "0x208b7fff7fff7ffe",
+    "0x1104800180018000",
+    "0x1b7",
+    "0x482480017fff8000",
+    "0x1b6",
+    "0x480080007fff8000",
+    "0xa0680017fff8000",
+    "0x9",
+    "0x4824800180007fab",
+    "0x0",
+    "0x482480017fff8000",
+    "0x100000000000000000000000000000000",
+    "0x400080007ff27fff",
+    "0x10780017fff7fff",
+    "0x25",
+    "0x4824800180007fab",
+    "0x0",
+    "0x400080007ff37fff",
+    "0x482480017ff38000",
+    "0x1",
+    "0x48127fb87fff8000",
+    "0x48127fd67fff8000",
+    "0x48127ff47fff8000",
+    "0x1104800180018000",
+    "0xf5",
+    "0x20680017fff7ffd",
+    "0x11",
+    "0x40780017fff7fff",
+    "0x1",
+    "0x48127ffe7fff8000",
+    "0x48127ffe7fff8000",
+    "0x48127ffd7fff8000",
+    "0x1104800180018000",
+    "0x101",
+    "0x48127fed7fff8000",
+    "0x48127fcf7fff8000",
+    "0x480a7ffb7fff8000",
+    "0x480680017fff8000",
+    "0x0",
+    "0x48127ffa7fff8000",
+    "0x48127ffa7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0x48127ffc7fff8000",
+    "0x48127fde7fff8000",
+    "0x480a7ffb7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffa7fff8000",
+    "0x48127ffa7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0x40780017fff7fff",
+    "0x1",
+    "0x480680017fff8000",
+    "0x4f7574206f6620676173",
+    "0x400080007ffe7fff",
+    "0x482480017ff08000",
+    "0x1",
+    "0x48127fa67fff8000",
+    "0x480a7ffb7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffa7fff8000",
+    "0x482480017ff98000",
+    "0x1",
+    "0x208b7fff7fff7ffe",
+    "0x40780017fff7fff",
+    "0x1",
+    "0x480680017fff8000",
+    "0x496e70757420746f6f2073686f727420666f7220617267756d656e7473",
+    "0x400080007ffe7fff",
+    "0x48127ff97fff8000",
+    "0x48127faf7fff8000",
+    "0x480a7ffb7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffa7fff8000",
+    "0x482480017ff98000",
+    "0x1",
+    "0x208b7fff7fff7ffe",
+    "0x40780017fff7fff",
+    "0x1",
+    "0x480680017fff8000",
+    "0x496e70757420746f6f2073686f727420666f7220617267756d656e7473",
+    "0x400080007ffe7fff",
+    "0x48127ff97fff8000",
+    "0x48127fce7fff8000",
+    "0x480a7ffb7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffa7fff8000",
+    "0x482480017ff98000",
+    "0x1",
+    "0x208b7fff7fff7ffe",
+    "0x40780017fff7fff",
+    "0x1",
+    "0x480680017fff8000",
+    "0x496e70757420746f6f2073686f727420666f7220617267756d656e7473",
+    "0x400080007ffe7fff",
+    "0x48127ffd7fff8000",
+    "0x48127fec7fff8000",
+    "0x480a7ffb7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffa7fff8000",
+    "0x482480017ff98000",
+    "0x1",
+    "0x208b7fff7fff7ffe",
+    "0x40780017fff7fff",
+    "0x1",
+    "0x480680017fff8000",
+    "0x4f7574206f6620676173",
+    "0x400080007ffe7fff",
+    "0x482680017ff98000",
+    "0x1",
+    "0x480a7ffa7fff8000",
+    "0x480a7ffb7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffa7fff8000",
+    "0x482480017ff98000",
+    "0x1",
+    "0x208b7fff7fff7ffe",
+    "0x48297ffc80007ffd",
+    "0x20680017fff7fff",
+    "0x4",
+    "0x10780017fff7fff",
+    "0xa",
+    "0x482680017ffc8000",
+    "0x1",
+    "0x480a7ffd7fff8000",
+    "0x480680017fff8000",
+    "0x0",
+    "0x480a7ffc7fff8000",
+    "0x10780017fff7fff",
+    "0x8",
+    "0x480a7ffc7fff8000",
+    "0x480a7ffd7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x48127ffc7fff8000",
+    "0x48127ffc7fff8000",
+    "0x20680017fff7ffc",
+    "0x8",
+    "0x48127ffe7fff8000",
+    "0x48127ffe7fff8000",
+    "0x480680017fff8000",
+    "0x0",
+    "0x480080007ffa8000",
+    "0x208b7fff7fff7ffe",
+    "0x48127ffe7fff8000",
+    "0x48127ffe7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x208b7fff7fff7ffe",
+    "0x48297ffc80007ffd",
+    "0x20680017fff7fff",
+    "0x4",
+    "0x10780017fff7fff",
+    "0xa",
+    "0x482680017ffc8000",
+    "0x1",
+    "0x480a7ffd7fff8000",
+    "0x480680017fff8000",
+    "0x0",
+    "0x480a7ffc7fff8000",
+    "0x10780017fff7fff",
+    "0x8",
+    "0x480a7ffc7fff8000",
+    "0x480a7ffd7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x48127ffc7fff8000",
+    "0x48127ffc7fff8000",
+    "0x20680017fff7ffc",
+    "0x17",
+    "0x480a7ffb7fff8000",
+    "0x480080007ffc8000",
+    "0x1104800180018000",
+    "0x72",
+    "0x20680017fff7ffe",
+    "0x9",
+    "0x48127ffd7fff8000",
+    "0x48127ff07fff8000",
+    "0x48127ff07fff8000",
+    "0x480680017fff8000",
+    "0x0",
+    "0x48127ffb7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0x48127ffd7fff8000",
+    "0x48127ff07fff8000",
+    "0x48127ff07fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x208b7fff7fff7ffe",
+    "0x40780017fff7fff",
+    "0xd",
+    "0x480a7ffb7fff8000",
+    "0x48127ff07fff8000",
+    "0x48127ff07fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x208b7fff7fff7ffe",
+    "0x48297ffc80007ffd",
+    "0x20680017fff7fff",
+    "0x4",
+    "0x10780017fff7fff",
+    "0xa",
+    "0x482680017ffc8000",
+    "0x1",
+    "0x480a7ffd7fff8000",
+    "0x480680017fff8000",
+    "0x0",
+    "0x480a7ffc7fff8000",
+    "0x10780017fff7fff",
+    "0x8",
+    "0x480a7ffc7fff8000",
+    "0x480a7ffd7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x48127ffc7fff8000",
+    "0x48127ffc7fff8000",
+    "0x20680017fff7ffc",
+    "0x17",
+    "0x480a7ffb7fff8000",
+    "0x480080007ffc8000",
+    "0x1104800180018000",
+    "0x63",
+    "0x20680017fff7ffe",
+    "0x9",
+    "0x48127ffd7fff8000",
+    "0x48127fef7fff8000",
+    "0x48127fef7fff8000",
+    "0x480680017fff8000",
+    "0x0",
+    "0x48127ffb7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0x48127ffd7fff8000",
+    "0x48127fef7fff8000",
+    "0x48127fef7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x208b7fff7fff7ffe",
+    "0x40780017fff7fff",
+    "0xe",
+    "0x480a7ffb7fff8000",
+    "0x48127fef7fff8000",
+    "0x48127fef7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x208b7fff7fff7ffe",
+    "0x480a7ffd7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0x480a7ffa7fff8000",
+    "0x480a7ffc7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x1104800180018000",
+    "0x66",
+    "0x20680017fff7ffd",
+    "0x9",
+    "0x48127ffc7fff8000",
+    "0x480680017fff8000",
+    "0x0",
+    "0x480680017fff8000",
+    "0x0",
+    "0x48127ffc7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0x48127ffc7fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffc7fff8000",
+    "0x48127ffc7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0x480a7ffb7fff8000",
+    "0x480a7ffc7fff8000",
+    "0x480a7ffd7fff8000",
+    "0x1104800180018000",
+    "0x7c",
+    "0x48127ffe7fff8000",
+    "0x48127ffe7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0xa0680017fff8000",
+    "0x16",
+    "0x480280007ffc8003",
+    "0x480280017ffc8003",
+    "0x4844800180017ffe",
+    "0x100000000000000000000000000000000",
+    "0x483180017ffd7ffd",
+    "0x482480017fff7ffd",
+    "0x800000000000010fffffffffffffffff7ffffffffffffef0000000000000001",
+    "0x20680017fff7ffc",
+    "0x6",
+    "0x402480017fff7ffd",
+    "0xffffffffffffffffffffffffffffffff",
+    "0x10780017fff7fff",
+    "0x4",
+    "0x402480017ffe7ffd",
+    "0xf7ffffffffffffef0000000000000000",
+    "0x400280027ffc7ffd",
+    "0x20680017fff7ffe",
+    "0xe",
+    "0x402780017fff7fff",
+    "0x1",
+    "0x400380007ffc7ffd",
+    "0x40780017fff7fff",
+    "0x5",
+    "0x482680017ffc8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x480a7ffd7fff8000",
+    "0x10780017fff7fff",
+    "0x8",
+    "0x482680017ffc8000",
+    "0x3",
+    "0x480680017fff8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x208b7fff7fff7ffe",
+    "0xa0680017fff8000",
+    "0x12",
+    "0x4825800180007ffd",
+    "0x100",
+    "0x4844800180008002",
+    "0x8000000000000110000000000000000",
+    "0x4830800080017ffe",
+    "0x480280007ffc7fff",
+    "0x482480017ffe8000",
+    "0xefffffffffffffde00000000000000ff",
+    "0x480280017ffc7fff",
+    "0x400280027ffc7ffb",
+    "0x402480017fff7ffb",
+    "0xffffffffffffffffffffffffffffffff",
+    "0x20680017fff7fff",
+    "0x11",
+    "0x402780017fff7fff",
+    "0x1",
+    "0x400380007ffc7ffd",
+    "0x482680017ffd8000",
+    "0xffffffffffffffffffffffffffffff00",
+    "0x400280017ffc7fff",
+    "0x40780017fff7fff",
+    "0x5",
+    "0x482680017ffc8000",
+    "0x2",
+    "0x480680017fff8000",
+    "0x0",
+    "0x480a7ffd7fff8000",
+    "0x10780017fff7fff",
+    "0x8",
+    "0x482680017ffc8000",
+    "0x3",
+    "0x480680017fff8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x208b7fff7fff7ffe",
+    "0x482a7ffd7ffc8001",
+    "0xa0680017fff7fff",
+    "0x7",
+    "0x4824800180007fff",
+    "0x100000000000000000000000000000000",
+    "0x400280007ffb7fff",
+    "0x10780017fff7fff",
+    "0xc",
+    "0x400280007ffb7fff",
+    "0x40780017fff7fff",
+    "0x1",
+    "0x482680017ffb8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x48127ffc7fff8000",
+    "0x10780017fff7fff",
+    "0x7",
+    "0x482680017ffb8000",
+    "0x1",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffd7fff8000",
+    "0x480680017fff8000",
+    "0x753132385f616464204f766572666c6f77",
+    "0x1104800180018000",
+    "0x16",
+    "0x20680017fff7ffd",
+    "0x9",
+    "0x48127ff67fff8000",
+    "0x480680017fff8000",
+    "0x0",
+    "0x480680017fff8000",
+    "0x0",
+    "0x48127ffc7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0x48127ff67fff8000",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffc7fff8000",
+    "0x48127ffc7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0x400380007ffd7ffb",
+    "0x480a7ffc7fff8000",
+    "0x482680017ffd8000",
+    "0x1",
+    "0x208b7fff7fff7ffe",
+    "0x20780017fff7ffb",
+    "0xa",
+    "0x40780017fff7fff",
+    "0x1",
+    "0x480680017fff8000",
+    "0x0",
+    "0x480680017fff8000",
+    "0x0",
+    "0x480a7ffc7fff8000",
+    "0x208b7fff7fff7ffe",
+    "0x40780017fff7fff",
+    "0x1",
+    "0x400180007fff7ffd",
+    "0x480680017fff8000",
+    "0x1",
+    "0x48127ffe7fff8000",
+    "0x482480017ffd8000",
+    "0x1",
+    "0x208b7fff7fff7ffe"
+  ],
+  "hints": [
+    [
+      0,
+      [
+        {
+          "TestLessThanOrEqual": {
+            "lhs": {
+              "Immediate": "0x1f68"
+            },
+            "rhs": {
+              "Deref": {
+                "register": "FP",
+                "offset": -6
+              }
+            },
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      42,
+      [
+        {
+          "AllocSegment": {
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      61,
+      [
+        {
+          "TestLessThanOrEqual": {
+            "lhs": {
+              "Immediate": "0x0"
+            },
+            "rhs": {
+              "Deref": {
+                "register": "AP",
+                "offset": -84
+              }
+            },
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      82,
+      [
+        {
+          "AllocSegment": {
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      105,
+      [
+        {
+          "AllocSegment": {
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      120,
+      [
+        {
+          "AllocSegment": {
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      134,
+      [
+        {
+          "AllocSegment": {
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      148,
+      [
+        {
+          "AllocSegment": {
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      162,
+      [
+        {
+          "AllocSegment": {
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      352,
+      [
+        {
+          "TestLessThan": {
+            "lhs": {
+              "Deref": {
+                "register": "FP",
+                "offset": -3
+              }
+            },
+            "rhs": {
+              "Immediate": "0x100000000000000000000000000000000"
+            },
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      354,
+      [
+        {
+          "DivMod": {
+            "lhs": {
+              "Deref": {
+                "register": "FP",
+                "offset": -3
+              }
+            },
+            "rhs": {
+              "Immediate": "0x100000000000000000000000000000000"
+            },
+            "quotient": {
+              "register": "AP",
+              "offset": 3
+            },
+            "remainder": {
+              "register": "AP",
+              "offset": 4
+            }
+          }
+        }
+      ]
+    ],
+    [
+      391,
+      [
+        {
+          "TestLessThan": {
+            "lhs": {
+              "Deref": {
+                "register": "FP",
+                "offset": -3
+              }
+            },
+            "rhs": {
+              "Immediate": "0x100"
+            },
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ],
+    [
+      395,
+      [
+        {
+          "LinearSplit": {
+            "value": {
+              "Deref": {
+                "register": "AP",
+                "offset": -1
+              }
+            },
+            "scalar": {
+              "Immediate": "0x8000000000000110000000000000000"
+            },
+            "max_x": {
+              "Immediate": "0xfffffffffffffffffffffffffffffffe"
+            },
+            "x": {
+              "register": "AP",
+              "offset": 0
+            },
+            "y": {
+              "register": "AP",
+              "offset": 1
+            }
+          }
+        }
+      ]
+    ],
+    [
+      430,
+      [
+        {
+          "TestLessThan": {
+            "lhs": {
+              "Deref": {
+                "register": "AP",
+                "offset": 0
+              }
+            },
+            "rhs": {
+              "Immediate": "0x100000000000000000000000000000000"
+            },
+            "dst": {
+              "register": "AP",
+              "offset": -1
+            }
+          }
+        }
+      ]
+    ],
+    [
+      486,
+      [
+        {
+          "AllocSegment": {
+            "dst": {
+              "register": "AP",
+              "offset": 0
+            }
+          }
+        }
+      ]
+    ]
+  ],
+  "entry_points_by_type": {
+    "EXTERNAL": [
+      {
+        "selector": "0x2c2c5a8bc1087f63772728099e970bfdfcac1558a10b9518575460292850835",
+        "offset": 0,
+        "builtins": [
+          "range_check"
+        ]
+      }
+    ],
+    "L1_HANDLER": [],
+    "CONSTRUCTOR": []
+  }
+}
\ No newline at end of file
diff --git a/__mocks__/cairo/cairo210/cairo210.sierra.json b/__mocks__/cairo/cairo210/cairo210.sierra.json
new file mode 100644
index 00000000..5509d1ed
--- /dev/null
+++ b/__mocks__/cairo/cairo210/cairo210.sierra.json
@@ -0,0 +1,424 @@
+{
+  "sierra_program": [
+    "0x1",
+    "0x3",
+    "0x0",
+    "0x2",
+    "0x1",
+    "0x0",
+    "0xe7",
+    "0x19",
+    "0x1b",
+    "0x52616e6765436865636b",
+    "0x0",
+    "0x4761734275696c74696e",
+    "0x66656c74323532",
+    "0x4172726179",
+    "0x1",
+    "0x2",
+    "0x536e617073686f74",
+    "0x3",
+    "0x537472756374",
+    "0x1baeba72e79e9db2587cf44fedb2f3700b2075a5e8e39a562584862c4b71f62",
+    "0x4",
+    "0x2ee1e2b1b89f8c495f200e4956278a4d47395fe262f27b52e5865c9524c08c3",
+    "0x456e756d",
+    "0x11c6d8087e00642489f92d2821ad6ebd6532ad1a3b6d12833da6d6810391511",
+    "0x6",
+    "0x75313238",
+    "0x1909a2057b9c1373b889e003e050a09f431d8108e0659d03444ced99a6eea68",
+    "0x8",
+    "0x7538",
+    "0x3b9ddf97bd58cc7301a2107c3eabad82196f38221c880cd3645d07c3aac1422",
+    "0xa",
+    "0x753332",
+    "0x53797374656d",
+    "0x16a4c8d7c05909052238a862d8cc3e7975bf05a07b3a69c6b28951083a6d672",
+    "0xe",
+    "0x5",
+    "0x9931c641b913035ae674b400b61a51476d506bbe8bba2ff8a6272790aba9e6",
+    "0x10",
+    "0xf",
+    "0x4275696c74696e436f737473",
+    "0x58317156263ede0652a67511e9ba3a35e3b24846d6437150dcf26263cdf0a6",
+    "0x1ef3d10a7c36a83479cccc7993ad9f26a14548d9e2398f65287c9eea6cd15f2",
+    "0x13",
+    "0x2f23416cc60464d4158423619ba713070eb82b686c9d621a22c67bd37f6e0a9",
+    "0x15",
+    "0x426f78",
+    "0x29d7d57c04a880978e7b3689f6218e507f3be17588744b58dc17762447ad0e7",
+    "0x17",
+    "0x1ca27f4a416836d321a19551a437aeb9946fde25373762126dda39b53c0bd11",
+    "0x69",
+    "0x7265766f6b655f61705f747261636b696e67",
+    "0x77697468647261775f676173",
+    "0x6272616e63685f616c69676e",
+    "0x73746f72655f74656d70",
+    "0x66756e6374696f6e5f63616c6c",
+    "0x656e756d5f6d61746368",
+    "0x7",
+    "0x9",
+    "0xb",
+    "0x7374727563745f6465636f6e737472756374",
+    "0x61727261795f6c656e",
+    "0x736e617073686f745f74616b65",
+    "0xc",
+    "0x64726f70",
+    "0x7533325f636f6e7374",
+    "0x72656e616d65",
+    "0x7533325f6571",
+    "0xd",
+    "0x61727261795f6e6577",
+    "0x66656c743235325f636f6e7374",
+    "0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473",
+    "0x61727261795f617070656e64",
+    "0x7374727563745f636f6e737472756374",
+    "0x656e756d5f696e6974",
+    "0x11",
+    "0x6765745f6275696c74696e5f636f737473",
+    "0x12",
+    "0x77697468647261775f6761735f616c6c",
+    "0x14",
+    "0x16",
+    "0x4f7574206f6620676173",
+    "0x496e70757420746f6f2073686f727420666f7220617267756d656e7473",
+    "0x61727261795f736e617073686f745f706f705f66726f6e74",
+    "0x18",
+    "0x6a756d70",
+    "0x756e626f78",
+    "0x753132385f636f6e7374",
+    "0x753132385f746f5f66656c74323532",
+    "0x75313238735f66726f6d5f66656c74323532",
+    "0x19",
+    "0x75385f7472795f66726f6d5f66656c74323532",
+    "0x753132385f6f766572666c6f77696e675f616464",
+    "0x1a",
+    "0x753132385f616464204f766572666c6f77",
+    "0x18d",
+    "0xffffffffffffffff",
+    "0x9a",
+    "0x8b",
+    "0x7b",
+    "0x6a",
+    "0x1c",
+    "0x1d",
+    "0x1e",
+    "0x1f",
+    "0x20",
+    "0x21",
+    "0x22",
+    "0x23",
+    "0x30",
+    "0x26",
+    "0x24",
+    "0x25",
+    "0x27",
+    "0x28",
+    "0x29",
+    "0x2a",
+    "0x2b",
+    "0x2c",
+    "0x2d",
+    "0x2e",
+    "0x2f",
+    "0x31",
+    "0x32",
+    "0x33",
+    "0x5a",
+    "0x34",
+    "0x35",
+    "0x36",
+    "0x37",
+    "0x38",
+    "0x39",
+    "0x3c",
+    "0x3d",
+    "0x3e",
+    "0x3f",
+    "0x40",
+    "0x3a",
+    "0x3b",
+    "0x41",
+    "0x53",
+    "0x42",
+    "0x43",
+    "0x44",
+    "0x45",
+    "0x46",
+    "0x49",
+    "0x4a",
+    "0x47",
+    "0x48",
+    "0x4b",
+    "0x4c",
+    "0x4d",
+    "0x4e",
+    "0x4f",
+    "0x50",
+    "0x51",
+    "0x52",
+    "0x54",
+    "0x55",
+    "0x56",
+    "0x57",
+    "0x58",
+    "0x59",
+    "0x5b",
+    "0x5c",
+    "0x5d",
+    "0x5e",
+    "0x5f",
+    "0x60",
+    "0x61",
+    "0x62",
+    "0x63",
+    "0x64",
+    "0x65",
+    "0x66",
+    "0x67",
+    "0x68",
+    "0x6b",
+    "0x6c",
+    "0x6d",
+    "0x6e",
+    "0x6f",
+    "0x70",
+    "0x71",
+    "0x72",
+    "0x73",
+    "0x74",
+    "0x75",
+    "0x76",
+    "0x77",
+    "0x78",
+    "0x79",
+    "0x7a",
+    "0x7c",
+    "0x7d",
+    "0x7e",
+    "0x7f",
+    "0x80",
+    "0x81",
+    "0x82",
+    "0x83",
+    "0x84",
+    "0x85",
+    "0x86",
+    "0x87",
+    "0x88",
+    "0x89",
+    "0x8a",
+    "0xaf",
+    "0xb4",
+    "0xbe",
+    "0xcc",
+    "0xd1",
+    "0xe7",
+    "0xe1",
+    "0xf6",
+    "0xfb",
+    "0x111",
+    "0x10b",
+    "0x12d",
+    "0x144",
+    "0x14b",
+    "0x154",
+    "0x159",
+    "0x162",
+    "0x166",
+    "0x172",
+    "0x184",
+    "0xa8",
+    "0xc5",
+    "0xef",
+    "0x119",
+    "0x11d",
+    "0x132",
+    "0x13e",
+    "0x14e",
+    "0x15c",
+    "0x177",
+    "0x17d",
+    "0xe95",
+    "0x7060f02090e0d02060a0c060b02070a090606080706060502040203020100",
+    "0xa1902060a02180217100616061502090e0214100613061202090e02111006",
+    "0x2102070a2002060a021f1e061d061c02090e1b060d02070a09061a060d0209",
+    "0x2090a100627062602090e070606251e0624062302090e13060d02070a2206",
+    "0x6062d0609062e1b06062d022c022b022a29130613062802090e130613060d",
+    "0x635070606341b0606333206062f0909062e3106062f0709062e3006062f02",
+    "0x606371606063707060637023a3606062d3606063902070638360606373606",
+    "0x6400706063f0706062d3e07063d0706063c100606370c09062e3b06062d13",
+    "0x6064002454406062d02434206062d0606062d0607420607411e0606401a06",
+    "0x62f1b09062e1606062d1306062d4606062d46060637460606354606064022",
+    "0x401b06064009060637090606351009062e0906062d13060635240606334706",
+    "0x2074b0607410706064a4907063d1b0606374807063d0207420607411d0606",
+    "0x606390706064d4b06062f06074b06074110060640024c4b06062d0c06062d",
+    "0x3106062d0207310607413009062e0607300607413006062d02073006074107",
+    "0x4e1006062d0607320607413206062d0207320607411309062e060731060741",
+    "0x130606390607470607414706062d020747060741240606403109062e060706",
+    "0x3902523106063902060639510606375106064002501609062e07060635024f",
+    "0x62e540606395507063d0607540607415406062d0207540607410253320606",
+    "0x6020702301007581b0c0757070602070602025706020202565406062f3209",
+    "0x310610020c0657060c061b02311307570616060c0216065706090609020257",
+    "0x300242065706130609021d0657060c061b0202570602070236065932065707",
+    "0x63b061b0202570602070222065a440657071e0613021e1a3b095706421d07",
+    "0x5b51065707470616024724460957064b270731024b0657061a060902270657",
+    "0x757065c063b025c0657060006360200065706240632020257060207025406",
+    "0x570660061a0261600757065f063b025f065706021e020257065d061a025e5d",
+    "0x7636207440262065706620642026306570661061d02620657065e061d0202",
+    "0x2570644062402025706510646020257063206220202570602070202640257",
+    "0x6806570602510202570667064b026766075706650627026506570607064702",
+    "0x6b065706025d026a0657066968075c02690657066906000269065706025402",
+    "0x57061b0660026e06570646061b026d0657066c065f026c0657066a6b075e02",
+    "0x202570602070264706f6e0c06640657066d06610270065706660647026f06",
+    "0x702767507747372075707711b460966027106570671066302710657060262",
+    "0x669027a790757067806680278065706770665027706570602670202570602",
+    "0x66b027d065706320600027c0657067a066a027b06570672061b0202570679",
+    "0x781066e0281800757067f7e7d7c7b1b6d027f06570651066c027e06570644",
+    "0x85067002860657060251028506570682066f02025706020702840683820657",
+    "0x771028a065706860664028906570688066b02025706870624028887075706",
+    "0x20257068d0673028e8d0757068b0672020257068c064b028c8b0757068a89",
+    "0x9206570680061b029106570690067702900657068f0676028f0657068e0675",
+    "0x2839493920c06830657069106610294065706070647029306570673066002",
+    "0x470297065706730660029606570680061b029506570684065f020257060207",
+    "0x632062202025706020702999897960c069906570695066102980657060706",
+    "0x2740657060278029a06570602510202570644062402025706510646020257",
+    "0x657069b9c075e029c065706025d029b065706749a075c0274065706740600",
+    "0x570607064702a0065706760660029f06570675061b029e0657069d065f029d",
+    "0x220202570654064b02025706020702a2a1a09f0c06a20657069e066102a106",
+    "0x5706027a02a306570602510202570644062402025706240679020257063206",
+    "0xa5a6075e02a6065706025d02a5065706a4a3075c02a4065706a4060002a406",
+    "0x647025b0657061b0660022906570646061b02a8065706a7065f02a7065706",
+    "0x570622064b02025706020702aaa95b290c06aa065706a8066102a906570607",
+    "0x2ac065706027a02ab0657060251020257061a0679020257063206220202",
+    "0xaf065706adae075e02ae065706025d02ad065706acab075c02ac065706ac06",
+    "0x6570607064702b20657061b066002b10657063b061b02b0065706af065f02",
+    "0x6790202570636064b02025706020702b4b3b2b10c06b4065706b0066102b3",
+    "0xb6b5075c02b6065706b6060002b6065706027a02b506570602510202570613",
+    "0x61b02b90657065a065f025a065706b7b8075e02b8065706025d02b7065706",
+    "0xc06bd065706b9066102bc06570607064702bb0657061b066002ba0657060c",
+    "0xbf065706027802be06570602510202570609067902025706020702bdbcbbba",
+    "0x5706c0c1075e02c1065706025d02c0065706bfbe075c02bf065706bf060002",
+    "0x607064702c506570630066002c406570610061b02c3065706c2065f02c206",
+    "0x5707060680020606570602063202c7c6c5c40c06c7065706c3066102c60657",
+    "0x67c021006570607067b021b065706090681020257060207020c06c8090707",
+    "0x6570613067f0213065706027e0202570602070202c906027d02300657061b",
+    "0x57061606090216065706100675023006570631067c02100657060c067b0231",
+    "0x3b0685023b065706320684020257060207023606ca32065707300682021606",
+    "0x1d0706420657061e0687021d065706160609021e0657061a0686021a065706",
+    "0x902220657064406880244065706027e0202570636064b0202570602070242",
+    "0x7070680020706570606063202244607062406570622068702460657061606",
+    "0x7c023006570609067b02100657060c0681020257060207021b06cb0c090757",
+    "0x570631067f0231065706027e0202570602070202cc06027d02130657061006",
+    "0x63206090232065706300675021306570616067c02300657061b067b021606",
+    "0x685021a065706360684020257060207023b06cd3606570713068202320657",
+    "0x421d0757062244078b02220657061e0600024406570602061b021e0657061a",
+    "0x57061d061b024706570646068c020257060207022406ce4606570742061302",
+    "0x8a02025706020702514b27090651065706470689024b065706320609022706",
+    "0x65d065706540689025c06570632060902000657061d061b02540657062406",
+    "0x657065e068a025e065706027e020257063b064b020257060207025d5c0009",
+    "0x26261600906620657065f06890261065706320609026006570602061b025f",
+    "0x57060c0681020257060207021b06cf0c090757070706800207065706060632",
+    "0x202570602070202d006027d021306570610067c023006570609067b021006",
+    "0x21306570616067c02300657061b067b021606570631067f0231065706027e",
+    "0x57060207023b06d13606570713068202320657063206090232065706300675",
+    "0x57061e0600024406570602061b021e0657061a0685021a0657063606840202",
+    "0x8e020257060207022406d24606570742061602421d0757062244078d022206",
+    "0x65106570647068f024b06570632060902270657061d061b02470657064606",
+    "0x632060902000657061d061b025406570624069002025706020702514b2709",
+    "0x7e020257063b064b020257060207025d5c0009065d06570654068f025c0657",
+    "0x8f0261065706320609026006570602061b025f0657065e0690025e06570602",
+    "0x606069102070657060206470206065706027e026261600906620657065f06",
+    "0x292020257060c064602025706070622020257060606690209070706090657",
+    "0x99302160657061b066b023106570609066b021306570602061b021b065706",
+    "0x570632066f020257060207023606d33206570730066e023010075706163113",
+    "0x61e0695021d06570610061b021e0657061a0683021a0657063b0694023b06",
+    "0x95022206570610061b024406570636069602025706020702421d0706420657",
+    "0x6090699020906570607069802070657060206970246220706460657064406",
+    "0x13079a023106570606066402130657061b0600020257060c0622021b0c0757",
+    "0x69102320657061006640216065706027e0202570630064b02301007570631",
+    "0x2025706020702101b0c09d409070757070602077402363207063606570616",
+    "0x70202d506027d0231065706300689021306570607061b023006570609068c",
+    "0x32068a0232065706027e0202570616069c0216065706101b079b0202570602",
+    "0x69e023b06570613069d023106570636068902130657060c061b0236065706",
+    "0x68e020257060207020c06d609070757070602079f021a3b07061a06570631",
+    "0x602070202d706027d02300657061b068f021006570607061b021b06570609",
+    "0x570631068f02100657060c061b02310657061306900213065706027e020257",
+    "0x7570707060209a10232160706320657063006a0021606570610069d023006",
+    "0x6a3021306570609061b02300657060c06a202025706020702101b07d80c09",
+    "0x57061b061b02160657061006a40202570602070202d906027d023106570630",
+    "0x5706320600023b0657063106a6023206570602a502310657061606a3021306",
+    "0x66f020257060207021d06da1e06570736066e02360657061a3b07a7021a06",
+    "0x95024606570613061b0222065706440683024406570642069402420657061e",
+    "0x6570613061b02470657061d06960202570602070224460706240657062206",
+    "0x2090657060706075c0207065706020685024b2707064b0657064706950227",
+    "0x70206a802101b0706100657060c0691021b065706090664020c065706027e",
+    "0xc0683020c06570607069402025706060622020257060207020906db070657",
+    "0x2510202570609062402025706020702100606100657061b0695021b065706",
+    "0x9602160657061331075e0231065706025d02130657060630075c0230065706",
+    "0x70602423b06020c1b3b06020c363606063606570632069502320657061606",
+    "0x3b06de0602321b02091b0207dd0602311b02091b0207dc02301b071b060209",
+    "0x207e10602100907091307e00c0907060247020716130746021bdf02103b07",
+    "0x7090707e407060247020713130209e30602320207070207e2060231020707",
+    "0xe606024706075407e506021009"
+  ],
+  "sierra_program_debug_info": {
+    "type_names": [],
+    "libfunc_names": [],
+    "user_func_names": []
+  },
+  "contract_class_version": "0.1.0",
+  "entry_points_by_type": {
+    "EXTERNAL": [
+      {
+        "selector": "0x2c2c5a8bc1087f63772728099e970bfdfcac1558a10b9518575460292850835",
+        "function_idx": 0
+      }
+    ],
+    "L1_HANDLER": [],
+    "CONSTRUCTOR": []
+  },
+  "abi": [
+    {
+      "type": "impl",
+      "name": "TestFelt",
+      "interface_name": "cairo210::cairo210::ITestC210"
+    },
+    {
+      "type": "interface",
+      "name": "cairo210::cairo210::ITestC210",
+      "items": [
+        {
+          "type": "function",
+          "name": "test_felt",
+          "inputs": [
+            {
+              "name": "p1",
+              "type": "core::felt252"
+            },
+            {
+              "name": "p2",
+              "type": "core::integer::u128"
+            },
+            {
+              "name": "p3",
+              "type": "core::integer::u8"
+            }
+          ],
+          "outputs": [
+            {
+              "type": "core::integer::u128"
+            }
+          ],
+          "state_mutability": "view"
+        }
+      ]
+    },
+    {
+      "type": "event",
+      "name": "cairo210::cairo210::MyTestFelt::Event",
+      "kind": "enum",
+      "variants": []
+    }
+  ]
+}
diff --git a/src/utils/calldata/responseParser.ts b/src/utils/calldata/responseParser.ts
index a8f5d644..0d12bc24 100644
--- a/src/utils/calldata/responseParser.ts
+++ b/src/utils/calldata/responseParser.ts
@@ -66,8 +66,8 @@ function parseBaseTypes(type: string, it: Iterator<string>) {
 function parseResponseValue(
   responseIterator: Iterator<string>,
   element: { name: string; type: string },
-  structs: AbiStructs,
-  enums: AbiEnums
+  structs?: AbiStructs,
+  enums?: AbiEnums
 ): BigNumberish | ParsedStruct | boolean | any[] | CairoEnum {
   if (element.type === '()') {
     return {};
@@ -92,7 +92,7 @@ function parseResponseValue(
   }
 
   // type struct
-  if (element.type in structs && structs[element.type]) {
+  if (structs && element.type in structs && structs[element.type]) {
     if (element.type === 'core::starknet::eth_address::EthAddress') {
       return parseBaseTypes(element.type, responseIterator);
     }
@@ -103,7 +103,7 @@ function parseResponseValue(
   }
 
   // type Enum (only CustomEnum)
-  if (element.type in enums && enums[element.type]) {
+  if (enums && element.type in enums && enums[element.type]) {
     const variantNum: number = Number(responseIterator.next().value); // get variant number
     const rawEnum = enums[element.type].variants.reduce((acc, variant, num) => {
       if (num === variantNum) {
@@ -178,8 +178,8 @@ function parseResponseValue(
 export default function responseParser(
   responseIterator: Iterator<string>,
   output: AbiEntry | EventEntry,
-  structs: AbiStructs,
-  enums: AbiEnums,
+  structs?: AbiStructs,
+  enums?: AbiEnums,
   parsedResult?: Args | ParsedStruct
 ): any {
   const { name, type } = output;
@@ -190,10 +190,10 @@ export default function responseParser(
       temp = responseIterator.next().value;
       return BigInt(temp);
 
-    case type in structs || isTypeTuple(type):
+    case (structs && type in structs) || isTypeTuple(type):
       return parseResponseValue(responseIterator, output, structs, enums);
 
-    case isTypeEnum(type, enums):
+    case enums && isTypeEnum(type, enums):
       return parseResponseValue(responseIterator, output, structs, enums);
 
     case isTypeArray(type):


Test patch:
diff --git a/__tests__/cairo1v2.test.ts b/__tests__/cairo1v2.test.ts
index 44f3cf51..9f403fda 100644
--- a/__tests__/cairo1v2.test.ts
+++ b/__tests__/cairo1v2.test.ts
@@ -28,6 +28,8 @@ import {
   compiledC1AccountCasm,
   compiledC1v2,
   compiledC1v2Casm,
+  compiledC210,
+  compiledC210Casm,
   compiledComplexSierra,
   describeIfDevnetSequencer,
   getTestAccount,
@@ -45,6 +47,8 @@ describe('Cairo 1 Devnet', () => {
   describe('API &  Contract interactions', () => {
     let dd: DeclareDeployUDCResponse;
     let cairo1Contract: Contract;
+    let dd2: DeclareDeployUDCResponse;
+    let cairo210Contract: Contract;
     initializeMatcher(expect);
 
     beforeAll(async () => {
@@ -52,14 +56,20 @@ describe('Cairo 1 Devnet', () => {
         contract: compiledC1v2,
         casm: compiledC1v2Casm,
       });
-
       cairo1Contract = new Contract(compiledC1v2.abi, dd.deploy.contract_address, account);
+
+      dd2 = await account.declareAndDeploy({
+        contract: compiledC210,
+        casm: compiledC210Casm,
+      });
+      cairo210Contract = new Contract(compiledC210.abi, dd2.deploy.contract_address, account);
     });
 
     test('Declare & deploy v2 - Hello Cairo 1 contract', async () => {
       expect(dd.declare).toMatchSchemaRef('DeclareContractResponse');
       expect(dd.deploy).toMatchSchemaRef('DeployContractUDCResponse');
       expect(cairo1Contract).toBeInstanceOf(Contract);
+      expect(cairo210Contract).toBeInstanceOf(Contract);
     });
 
     xtest('validate TS for redeclare - skip testing', async () => {
@@ -500,6 +510,11 @@ describe('Cairo 1 Devnet', () => {
       expect(res7a).toEqual(200n);
     });
 
+    test('Cairo 2.1.0 simple contract', async () => {
+      const res = await cairo210Contract.test_felt(1, 100, 3);
+      expect(res).toEqual(101n);
+    });
+
     test('myCallData.compile for Cairo 1', async () => {
       const myFalseUint256 = { high: 1, low: 23456 }; // wrong order
       type Order2 = {
diff --git a/__tests__/fixtures.ts b/__tests__/fixtures.ts
index 876c4ca9..d23db726 100644
--- a/__tests__/fixtures.ts
+++ b/__tests__/fixtures.ts
@@ -45,6 +45,8 @@ export const compiledC1Account = readContractSierra('cairo/account/account');
 export const compiledC1AccountCasm = readContractSierraCasm('cairo/account/account');
 export const compiledC1v2 = readContractSierra('cairo/helloCairo2/compiled');
 export const compiledC1v2Casm = readContractSierraCasm('cairo/helloCairo2/compiled');
+export const compiledC210 = readContractSierra('cairo/cairo210/cairo210.sierra');
+export const compiledC210Casm = readContractSierraCasm('cairo/cairo210/cairo210');
 
 /* Default test config based on run `starknet-devnet --seed 0` */
 const DEFAULT_TEST_PROVIDER_SEQUENCER_URL = 'http://127.0.0.1:5050/';