From 5a997c56b363e59ad702fd25541dedb1460d6507 Mon Sep 17 00:00:00 2001
From: Rohit Ranjan <rohitrjn629@gmail.com>
Date: Wed, 25 Oct 2023 14:36:37 +0530
Subject: [PATCH] make 2.3.0 as default cairo version

---
 api/src/utils/lib.rs                       | 4 ++--
 plugin/src/features/CairoVersion/index.tsx | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/api/src/utils/lib.rs b/api/src/utils/lib.rs
index e0f7426d..fd263b46 100644
--- a/api/src/utils/lib.rs
+++ b/api/src/utils/lib.rs
@@ -8,13 +8,13 @@ pub const DEFAULT_CAIRO_DIR: &str = concat!(
     env!("CARGO_MANIFEST_DIR"),
     "/",
     "cairo_compilers/",
-    "v2.2.0"
+    "v2.3.0"
 );
 pub const CAIRO_COMPILERS_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/", "cairo_compilers/");
 #[allow(dead_code)]
 pub const TEMP_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/", "temp/");
 
-pub const DEFAULT_CAIRO_VERSION: &str = "v2.2.0";
+pub const DEFAULT_CAIRO_VERSION: &str = "v2.3.0";
 
 pub const DURATION_TO_PURGE: u64 = 60 * 5; // 5 minutes
 
diff --git a/plugin/src/features/CairoVersion/index.tsx b/plugin/src/features/CairoVersion/index.tsx
index fbaf1f2b..17118d92 100644
--- a/plugin/src/features/CairoVersion/index.tsx
+++ b/plugin/src/features/CairoVersion/index.tsx
@@ -44,14 +44,14 @@ const CairoVersion: React.FC = () => {
       await fetchCairoVersions();
 
       if (getVersions.length > 0) {
-        setCairoVersion(getVersions[0])
+        setCairoVersion(getVersions[getVersions.length - 1])
       }
     }, 10000);
   }, [remixClient]);
 
   useEffect(() => {
     if (getVersions.length > 0) {
-      setCairoVersion(getVersions[0])
+      setCairoVersion(getVersions[getVersions.length - 1])
     }
   }, [remixClient, getVersions]);