From c4aed436cd9747dbaaa4cd7a7f1c5de9c1bcafe4 Mon Sep 17 00:00:00 2001 From: undefined Date: Tue, 25 Nov 2025 01:51:39 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'lib/'=20with?= =?UTF-8?q?=20remote=20'lib/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/apis/bundler/BundlerApiImpl.kt | 6 +++-- .../modularwallets/core/chains/Monad.kt | 25 +++++++++++++++++++ .../core/chains/MonadTestnet.kt | 25 +++++++++++++++++++ .../core/constants/AbiConstants.kt | 2 ++ .../modularwallets/core/models/Token.kt | 4 ++- 5 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 lib/src/main/java/com/circle/modularwallets/core/chains/Monad.kt create mode 100644 lib/src/main/java/com/circle/modularwallets/core/chains/MonadTestnet.kt diff --git a/lib/src/main/java/com/circle/modularwallets/core/apis/bundler/BundlerApiImpl.kt b/lib/src/main/java/com/circle/modularwallets/core/apis/bundler/BundlerApiImpl.kt index c807deb..e84c396 100644 --- a/lib/src/main/java/com/circle/modularwallets/core/apis/bundler/BundlerApiImpl.kt +++ b/lib/src/main/java/com/circle/modularwallets/core/apis/bundler/BundlerApiImpl.kt @@ -284,8 +284,10 @@ internal object BundlerApiImpl : BundlerApi { tmpUserOp.callGasLimit = BigInteger.ZERO tmpUserOp.preVerificationGas = BigInteger.ZERO if(paymaster != null){ - tmpUserOp.paymasterVerificationGasLimit = BigInteger.ZERO - tmpUserOp.paymasterPostOpGasLimit = BigInteger.ZERO + // Preserve stub data values if available, only use ZERO as fallback + // This aligns with Viem's behavior: prioritize paymaster-provided gas limits + tmpUserOp.paymasterVerificationGasLimit = tmpUserOp.paymasterVerificationGasLimit ?: BigInteger.ZERO + tmpUserOp.paymasterPostOpGasLimit = tmpUserOp.paymasterPostOpGasLimit ?: BigInteger.ZERO } else{ tmpUserOp.paymasterVerificationGasLimit = null tmpUserOp.paymasterPostOpGasLimit = null diff --git a/lib/src/main/java/com/circle/modularwallets/core/chains/Monad.kt b/lib/src/main/java/com/circle/modularwallets/core/chains/Monad.kt new file mode 100644 index 0000000..a68d3b9 --- /dev/null +++ b/lib/src/main/java/com/circle/modularwallets/core/chains/Monad.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2025 Circle Internet Group, Inc. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at. + * + * http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.circle.modularwallets.core.chains + +object Monad : Chain() { + override val chainId: Long + get() = 143L +} + diff --git a/lib/src/main/java/com/circle/modularwallets/core/chains/MonadTestnet.kt b/lib/src/main/java/com/circle/modularwallets/core/chains/MonadTestnet.kt new file mode 100644 index 0000000..7c91442 --- /dev/null +++ b/lib/src/main/java/com/circle/modularwallets/core/chains/MonadTestnet.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2025 Circle Internet Group, Inc. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at. + * + * Http://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.circle.modularwallets.core.chains + +object MonadTestnet : Chain() { + override val chainId: Long + get() = 10143L +} + diff --git a/lib/src/main/java/com/circle/modularwallets/core/constants/AbiConstants.kt b/lib/src/main/java/com/circle/modularwallets/core/constants/AbiConstants.kt index 720abb1..e048147 100644 --- a/lib/src/main/java/com/circle/modularwallets/core/constants/AbiConstants.kt +++ b/lib/src/main/java/com/circle/modularwallets/core/constants/AbiConstants.kt @@ -39,6 +39,8 @@ internal val CONTRACT_ADDRESS: Map = mapOf( Token.PolygonAmoy_USDC.name to "0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582", Token.Unichain_USDC.name to "0x078D782b760474a361dDA0AF3839290b0EF57AD6", Token.UnichainSepolia_USDC.name to "0x31d0220469e10c4E71834a79b1f276d740d3768F", + Token.Monad_USDC.name to "0x754704bc059f8c67012fed69bc8a327a5aafb603", // Note: MONAD mainnet USDC contract address + Token.MonadTestnet_USDC.name to "0x534b2f3A21130d7a60830c2Df862319e593943A3", ) val CIRCLE_PLUGIN_ADD_OWNERS_ABI = """ [ diff --git a/lib/src/main/java/com/circle/modularwallets/core/models/Token.kt b/lib/src/main/java/com/circle/modularwallets/core/models/Token.kt index ba94306..61c5d63 100644 --- a/lib/src/main/java/com/circle/modularwallets/core/models/Token.kt +++ b/lib/src/main/java/com/circle/modularwallets/core/models/Token.kt @@ -38,5 +38,7 @@ enum class Token { Polygon_USDC, PolygonAmoy_USDC, Unichain_USDC, - UnichainSepolia_USDC; + UnichainSepolia_USDC, + Monad_USDC, + MonadTestnet_USDC; }