diff --git a/resources/images/networks/Base@2x.png b/resources/images/networks/Base@2x.png new file mode 100644 index 0000000000..9918868621 Binary files /dev/null and b/resources/images/networks/Base@2x.png differ diff --git a/resources/images/networks/Base@3x.png b/resources/images/networks/Base@3x.png new file mode 100644 index 0000000000..cb064a92a8 Binary files /dev/null and b/resources/images/networks/Base@3x.png differ diff --git a/scripts/build-android.sh b/scripts/build-android.sh index 7eefa9113a..063bf39f9d 100755 --- a/scripts/build-android.sh +++ b/scripts/build-android.sh @@ -37,6 +37,8 @@ SECRETS_ENV_VARS=( 'ALCHEMY_ARBITRUM_SEPOLIA_TOKEN' 'ALCHEMY_OPTIMISM_MAINNET_TOKEN' 'ALCHEMY_OPTIMISM_SEPOLIA_TOKEN' + 'ALCHEMY_BASE_MAINNET_TOKEN' + 'ALCHEMY_BASE_SEPOLIA_TOKEN' 'RARIBLE_MAINNET_API_KEY' 'RARIBLE_TESTNET_API_KEY' 'INFURA_TOKEN' diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 1730f976f3..b5d7640596 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -87,7 +87,9 @@ status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN" status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN" status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN" - status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"} + status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN" + status-im.config/ALCHEMY_BASE_MAINNET_TOKEN #shadow/env "ALCHEMY_BASE_MAINNET_TOKEN" + status-im.config/ALCHEMY_BASE_SEPOLIA_TOKEN #shadow/env "ALCHEMY_BASE_SEPOLIA_TOKEN"} :compiler-options {:output-feature-set :es5 ;; We disable `:fn-deprecated` warnings because we ;; are managing deprecation via clj-kondo and we @@ -123,7 +125,9 @@ status-im.config/ALCHEMY_ARBITRUM_MAINNET_TOKEN #shadow/env "ALCHEMY_ARBITRUM_MAINNET_TOKEN" status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN" status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN" - status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN"} + status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN" + status-im.config/ALCHEMY_BASE_MAINNET_TOKEN #shadow/env "ALCHEMY_BASE_MAINNET_TOKEN" + status-im.config/ALCHEMY_BASE_SEPOLIA_TOKEN #shadow/env "ALCHEMY_BASE_SEPOLIA_TOKEN"} :compiler-options {:output-feature-set :es6 ;;disable for android build as there ;;is an intermittent warning with deftype @@ -165,6 +169,8 @@ status-im.config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_ARBITRUM_SEPOLIA_TOKEN" status-im.config/ALCHEMY_OPTIMISM_MAINNET_TOKEN #shadow/env "ALCHEMY_OPTIMISM_MAINNET_TOKEN" status-im.config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN #shadow/env "ALCHEMY_OPTIMISM_SEPOLIA_TOKEN" + status-im.config/ALCHEMY_BASE_MAINNET_TOKEN #shadow/env "ALCHEMY_BASE_MAINNET_TOKEN" + status-im.config/ALCHEMY_BASE_SEPOLIA_TOKEN #shadow/env "ALCHEMY_BASE_SEPOLIA_TOKEN" status-im.config/WALLET_CONNECT_PROJECT_ID #shadow/env "WALLET_CONNECT_PROJECT_ID"} :compiler-options {;; needed because we override require and it diff --git a/src/quo/components/wallet/summary_info/view.cljs b/src/quo/components/wallet/summary_info/view.cljs index 00e92c62f5..ac19e3189b 100644 --- a/src/quo/components/wallet/summary_info/view.cljs +++ b/src/quo/components/wallet/summary_info/view.cljs @@ -30,13 +30,16 @@ (defn networks [values theme] - (let [{:keys [ethereum optimism arbitrum]} values - show-optimism? (and optimism - (or (pos? (:amount optimism)) - (= (:amount optimism) "<0.01"))) - show-arbitrum? (and arbitrum - (or (pos? (:amount arbitrum)) - (= (:amount arbitrum) "<0.01")))] + (let [{:keys [ethereum optimism arbitrum base]} values + show-optimism? (and optimism + (or (pos? (:amount optimism)) + (= (:amount optimism) "<0.01"))) + show-arbitrum? (and arbitrum + (or (pos? (:amount arbitrum)) + (= (:amount arbitrum) "<0.01"))) + show-base? (and base + (or (pos? (:amount base)) + (= (:amount base) "<0.01")))] [rn/view {:style style/networks-container :accessibility-label :networks} @@ -56,6 +59,11 @@ [network-amount {:network :arbitrum :amount (str (:amount arbitrum) " " (or (:token-symbol arbitrum) "ARB")) + :theme theme}]) + (when show-base? + [network-amount + {:network :base + :amount (str (:amount base) " " (or (:token-symbol base) "ETH")) :theme theme}])])) (defn- view-internal diff --git a/src/quo/foundations/resources.cljs b/src/quo/foundations/resources.cljs index 372842ba1e..3ca7d1e511 100644 --- a/src/quo/foundations/resources.cljs +++ b/src/quo/foundations/resources.cljs @@ -44,6 +44,7 @@ :hermez (js/require "../resources/images/networks/Hermez.png") :optimism (js/require "../resources/images/networks/Optimism.png") :paraswap (js/require "../resources/images/networks/Paraswap.png") + :base (js/require "../resources/images/networks/Base.png") :polygon (js/require "../resources/images/networks/Polygon.png") :scroll (js/require "../resources/images/networks/Scroll.png") :taiko (js/require "../resources/images/networks/Taiko.png") diff --git a/src/status_im/config.cljs b/src/status_im/config.cljs index 5b6859e189..faca9684fa 100644 --- a/src/status_im/config.cljs +++ b/src/status_im/config.cljs @@ -23,6 +23,8 @@ (goog-define ALCHEMY_ARBITRUM_SEPOLIA_TOKEN "") (goog-define ALCHEMY_OPTIMISM_MAINNET_TOKEN "") (goog-define ALCHEMY_OPTIMISM_SEPOLIA_TOKEN "") +(goog-define ALCHEMY_BASE_MAINNET_TOKEN "") +(goog-define ALCHEMY_BASE_SEPOLIA_TOKEN "") (goog-define WALLET_CONNECT_PROJECT_ID "87815d72a81d739d2a7ce15c2cfdefb3") (goog-define MIXPANEL_APP_ID "3350627") (goog-define MIXPANEL_TOKEN "5c73bda2d36a9f688a5ee45641fb6775") @@ -38,9 +40,11 @@ (def mainnet-tx-details-base-link "https://etherscan.io/tx") (def optimism-mainnet-tx-details-base-link "https://optimistic.etherscan.io/tx") (def arbitrum-mainnet-tx-details-base-link "https://arbiscan.io/tx") +(def base-mainnet-tx-details-base-link "https://basescan.org/tx") (def mainnet-sepolia-tx-details-base-link "https://sepolia.etherscan.io/tx") (def optimism-sepolia-tx-details-base-link "https://sepolia-optimistic.etherscan.io/tx") (def arbitrum-sepolia-tx-details-base-link "https://sepolia.arbiscan.io/tx") +(def base-sepolia-tx-details-base-link "https://sepolia.basescan.org/tx") (def opensea-link "https://opensea.io") (def opensea-tesnet-link "https://testnets.opensea.io") diff --git a/src/status_im/constants.cljs b/src/status_im/constants.cljs index 559fa24a57..67f7a5fb1d 100644 --- a/src/status_im/constants.cljs +++ b/src/status_im/constants.cljs @@ -396,29 +396,34 @@ (def ^:const arbitrum-sepolia-chain-id 421614) (def ^:const optimism-mainnet-chain-id 10) (def ^:const optimism-sepolia-chain-id 11155420) +(def ^:const base-mainnet-chain-id 8453) +(def ^:const base-sepolia-chain-id 84532) (def opensea-url-names {:ethereum "ethereum" :sepolia "sepolia"}) (def ^:const mainnet-chain-ids - #{ethereum-mainnet-chain-id arbitrum-mainnet-chain-id optimism-mainnet-chain-id}) + #{ethereum-mainnet-chain-id arbitrum-mainnet-chain-id optimism-mainnet-chain-id base-mainnet-chain-id}) (def ^:const sepolia-chain-ids - #{ethereum-sepolia-chain-id arbitrum-sepolia-chain-id optimism-sepolia-chain-id}) + #{ethereum-sepolia-chain-id arbitrum-sepolia-chain-id optimism-sepolia-chain-id base-sepolia-chain-id}) (def ^:const mainnet-short-name "eth") (def ^:const ethereum-short-name "eth") (def ^:const optimism-short-name "oeth") (def ^:const arbitrum-short-name "arb1") +(def ^:const base-short-name "base") (def ^:const mainnet-abbreviated-name "Eth.") (def ^:const optimism-abbreviated-name "Oeth.") (def ^:const arbitrum-abbreviated-name "Arb1.") +(def ^:const base-abbreviated-name "Base") (def ^:const mainnet-full-name "Mainnet") (def ^:const optimism-full-name "Optimism") (def ^:const arbitrum-full-name "Arbitrum") +(def ^:const base-full-name "Base") (def ^:const sepolia-full-name "Sepolia") @@ -426,11 +431,13 @@ (def ^:const ethereum-network-name :ethereum) (def ^:const optimism-network-name :optimism) (def ^:const arbitrum-network-name :arbitrum) +(def ^:const base-network-name :base) (def ^:const layer-1-network 1) (def ^:const layer-2-network 2) -(def ^:const default-network-names [mainnet-network-name optimism-network-name arbitrum-network-name]) +(def ^:const default-network-names + [mainnet-network-name optimism-network-name arbitrum-network-name base-network-name]) (def ^:const default-network-count (count default-network-names)) diff --git a/src/status_im/contexts/profile/config.cljs b/src/status_im/contexts/profile/config.cljs index de27fe9aa7..d0b000a67e 100644 --- a/src/status_im/contexts/profile/config.cljs +++ b/src/status_im/contexts/profile/config.cljs @@ -26,7 +26,9 @@ :alchemyOptimismMainnetToken config/ALCHEMY_OPTIMISM_MAINNET_TOKEN :alchemyOptimismSepoliaToken config/ALCHEMY_OPTIMISM_SEPOLIA_TOKEN :alchemyArbitrumMainnetToken config/ALCHEMY_ARBITRUM_MAINNET_TOKEN - :alchemyArbitrumSepoliaToken config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN}) + :alchemyArbitrumSepoliaToken config/ALCHEMY_ARBITRUM_SEPOLIA_TOKEN + :alchemyBaseMainnetToken config/ALCHEMY_BASE_MAINNET_TOKEN + :alchemyBaseSepoliaToken config/ALCHEMY_BASE_SEPOLIA_TOKEN}) (defn create [] diff --git a/src/status_im/contexts/settings/wallet/network_settings/view.cljs b/src/status_im/contexts/settings/wallet/network_settings/view.cljs index 5058abd8b2..47744abb6f 100644 --- a/src/status_im/contexts/settings/wallet/network_settings/view.cljs +++ b/src/status_im/contexts/settings/wallet/network_settings/view.cljs @@ -45,6 +45,9 @@ [{:details (:optimism networks) :testnet-mode? testnet-mode? :testnet-label (i18n/label :t/sepolia-active)} + {:details (:base networks) + :testnet-mode? testnet-mode? + :testnet-label (i18n/label :t/sepolia-active)} {:details (:arbitrum networks) :testnet-mode? testnet-mode? :testnet-label (i18n/label :t/sepolia-active)}]) diff --git a/src/status_im/contexts/wallet/common/utils/external_links.cljs b/src/status_im/contexts/wallet/common/utils/external_links.cljs index a4fefd15c5..7ce7788362 100644 --- a/src/status_im/contexts/wallet/common/utils/external_links.cljs +++ b/src/status_im/contexts/wallet/common/utils/external_links.cljs @@ -37,6 +37,9 @@ constants/optimism-mainnet-chain-id config/optimism-mainnet-tx-details-base-link + constants/base-mainnet-chain-id + config/base-mainnet-tx-details-base-link + constants/ethereum-sepolia-chain-id config/mainnet-sepolia-tx-details-base-link @@ -46,6 +49,9 @@ constants/optimism-sepolia-chain-id config/optimism-sepolia-tx-details-base-link + constants/base-sepolia-chain-id + config/base-sepolia-tx-details-base-link + config/mainnet-tx-details-base-link)) (defn get-link-to-tx-details diff --git a/src/status_im/contexts/wallet/common/utils/networks.cljs b/src/status_im/contexts/wallet/common/utils/networks.cljs index 9938e554c9..8a84615a97 100644 --- a/src/status_im/contexts/wallet/common/utils/networks.cljs +++ b/src/status_im/contexts/wallet/common/utils/networks.cljs @@ -15,7 +15,9 @@ constants/optimism-mainnet-chain-id constants/optimism-network-name constants/optimism-sepolia-chain-id constants/optimism-network-name constants/arbitrum-mainnet-chain-id constants/arbitrum-network-name - constants/arbitrum-sepolia-chain-id constants/arbitrum-network-name}) + constants/arbitrum-sepolia-chain-id constants/arbitrum-network-name + constants/base-mainnet-chain-id constants/base-network-name + constants/base-sepolia-chain-id constants/base-network-name}) (defn- get-chain-id [{:keys [mainnet-chain-id sepolia-chain-id testnet-enabled?]}] @@ -46,6 +48,12 @@ (get-chain-id {:mainnet-chain-id constants/arbitrum-mainnet-chain-id :sepolia-chain-id constants/arbitrum-sepolia-chain-id + :testnet-enabled? testnet-enabled?}) + + #{constants/base-network-name (keyword constants/base-short-name)} + (get-chain-id + {:mainnet-chain-id constants/base-mainnet-chain-id + :sepolia-chain-id constants/base-sepolia-chain-id :testnet-enabled? testnet-enabled?})))) (defn network-list @@ -76,12 +84,14 @@ {constants/mainnet-network-name constants/mainnet-short-name constants/optimism-network-name constants/optimism-short-name constants/arbitrum-network-name constants/arbitrum-short-name - constants/ethereum-network-name constants/ethereum-short-name}) + constants/ethereum-network-name constants/ethereum-short-name + constants/base-network-name constants/base-short-name}) (def short-name->network {constants/mainnet-short-name constants/mainnet-network-name constants/optimism-short-name constants/optimism-network-name - constants/arbitrum-short-name constants/arbitrum-network-name}) + constants/arbitrum-short-name constants/arbitrum-network-name + constants/base-short-name constants/base-network-name}) (defn short-names->network-preference-prefix [short-names] @@ -152,6 +162,15 @@ :view-on-block-explorer-label :t/view-on-oeth :link-to-block-explorer-label :t/share-link-to-oeth}) +(def base-network-details + {:source (resources/get-network constants/base-network-name) + :short-name constants/base-short-name + :full-name constants/base-full-name + :network-name constants/base-network-name + :abbreviated-name constants/base-abbreviated-name + :view-on-block-explorer-label :t/view-on-base + :link-to-block-explorer-label :t/share-link-to-base}) + (defn get-network-details [chain-id] (as-> chain-id $ @@ -165,6 +184,9 @@ #{constants/optimism-mainnet-chain-id constants/optimism-sepolia-chain-id} optimism-network-details + #{constants/base-mainnet-chain-id constants/base-sepolia-chain-id} + base-network-details + nil) (when $ (assoc $ :chain-id chain-id)))) diff --git a/src/status_im/contexts/wallet/send/utils.cljs b/src/status_im/contexts/wallet/send/utils.cljs index 7b58bfdec7..e64dd97a10 100644 --- a/src/status_im/contexts/wallet/send/utils.cljs +++ b/src/status_im/contexts/wallet/send/utils.cljs @@ -135,7 +135,8 @@ (def ^:private network-priority-score {:ethereum 1 :optimism 2 - :arbitrum 3}) + :arbitrum 3 + :base 4}) (defn reset-loading-network-amounts-to-zero [network-amounts] diff --git a/src/status_im/contexts/wallet/swap/events.cljs b/src/status_im/contexts/wallet/swap/events.cljs index c0ef94b420..31518a9ee7 100644 --- a/src/status_im/contexts/wallet/swap/events.cljs +++ b/src/status_im/contexts/wallet/swap/events.cljs @@ -279,9 +279,7 @@ (fn [{:keys [db]} [{:keys [sent-transactions swap-data approval-transaction?]}]] (let [wallet-transactions (get-in db [:wallet :transactions] {}) transactions (utils/transactions->hash-to-transaction-map sent-transactions) - transaction-ids (->> transactions - vals - (map :hash)) + transaction-ids (keys transactions) transaction-id (first transaction-ids) transaction-details (cond-> transactions :always (assoc-in [transaction-id :tx-type] :swap) diff --git a/src/status_im/subs/wallet/wallet_test.cljs b/src/status_im/subs/wallet/wallet_test.cljs index f9c34d7577..21bed717b1 100644 --- a/src/status_im/subs/wallet/wallet_test.cljs +++ b/src/status_im/subs/wallet/wallet_test.cljs @@ -840,7 +840,7 @@ (swap! rf-db/app-db #(assoc % :wallet db/defaults)) (is (match? (sort [constants/ethereum-mainnet-chain-id constants/arbitrum-mainnet-chain-id - constants/optimism-mainnet-chain-id]) + constants/optimism-mainnet-chain-id constants/base-mainnet-chain-id]) (sort (rf/sub [sub-name]))))) (testing "selected networks -> chain-ids - specific network" (swap! rf-db/app-db #(assoc-in % diff --git a/src/tests/contract_test/wallet_test.cljs b/src/tests/contract_test/wallet_test.cljs index 4ccd756c1e..3d491e1ecd 100644 --- a/src/tests/contract_test/wallet_test.cljs +++ b/src/tests/contract_test/wallet_test.cljs @@ -54,9 +54,11 @@ (is (some #(= constants/ethereum-mainnet-chain-id (get-in % [:Prod :chainId])) response)) (is (some #(= constants/optimism-mainnet-chain-id (get-in % [:Prod :chainId])) response)) (is (some #(= constants/arbitrum-mainnet-chain-id (get-in % [:Prod :chainId])) response)) + (is (some #(= constants/base-mainnet-chain-id (get-in % [:Prod :chainId])) response)) (is (some #(= constants/ethereum-sepolia-chain-id (get-in % [:Test :chainId])) response)) (is (some #(= constants/arbitrum-sepolia-chain-id (get-in % [:Test :chainId])) response)) - (is (some #(= constants/optimism-sepolia-chain-id (get-in % [:Test :chainId])) response))) + (is (some #(= constants/optimism-sepolia-chain-id (get-in % [:Test :chainId])) response)) + (is (some #(= constants/base-sepolia-chain-id (get-in % [:Test :chainId])) response))) (deftest accounts-get-chains-contract-test (h/test-async :contract/wallet_get-ethereum-chains diff --git a/src/utils/ethereum/chain.cljs b/src/utils/ethereum/chain.cljs index 05eafb0c60..289fd4c847 100644 --- a/src/utils/ethereum/chain.cljs +++ b/src/utils/ethereum/chain.cljs @@ -13,7 +13,8 @@ :bsc-testnet {:id BSC-testnet-chain-id :name "BSC testnet"} :arbitrum {:id 42161 :name "Arbitrum"} - :optimism {:id 10 :name "Optimism"}}) + :optimism {:id 10 :name "Optimism"} + :base {:id 8453 :name "Base"}}) (defn chain-id->chain-keyword [i] diff --git a/status-go-version.json b/status-go-version.json index 281ac6536a..f11f630dcb 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "v9.0.0", - "commit-sha1": "59caca61960752c464cf21de99103c8649dfb0c5", - "src-sha256": "008qmdkgf9vxpz0q57his9wmlkahykcnyrq6qbcpjqfvk55cq5gr" + "version": "v9.1.0", + "commit-sha1": "4ec885a91f2857a30d1838213000f0a5a91fd52a", + "src-sha256": "1fkvhazv7v2vyqpffx3r4p3aii5ai464nx2pdfgn6b6gmb24bxdq" } diff --git a/translations/en.json b/translations/en.json index 3755e24c0a..354c8fd0ed 100644 --- a/translations/en.json +++ b/translations/en.json @@ -195,6 +195,7 @@ "backup-through-waku": "Backup through waku", "bad-fees-description": "Your priority fee is below our suggested parameters.", "balance": "Balance", + "base": "Base", "be-safe-with-secure-cold-wallet": "Be safe with secure cold wallet", "begin-set-up": "Begin setup", "below-base-fee": "max fee below base fee", @@ -2390,6 +2391,7 @@ "share-invite-link": "Share an invite link", "share-link": "Share link", "share-link-to-arb": "Share link to Arbiscan", + "share-link-to-base": "Share link to Basescan", "share-link-to-eth": "Share link to Etherscan", "share-link-to-oeth": "Share link to Optimism Explorer", "share-logs": "Share logs", @@ -2818,6 +2820,7 @@ "view-gitcoin": "View in Gitcoin", "view-members": "View members", "view-on-arb": "View on Arbiscan", + "view-on-base": "View on Basescan", "view-on-eth": "View on Etherscan", "view-on-oeth": "View on Optimism Explorer", "view-on-opensea": "View on OpenSea",