Skip to content

Commit

Permalink
Feat: enable base sepolia (#3157)
Browse files Browse the repository at this point in the history
- updates safe-deployments
- updates safe-core-sdk packages
  • Loading branch information
schmanu authored Feb 6, 2024
1 parent b2e774b commit 91f4418
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 46 deletions.
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@
"@mui/material": "^5.14.20",
"@mui/x-date-pickers": "^5.0.20",
"@reduxjs/toolkit": "^1.9.5",
"@safe-global/api-kit": "^2.0.0",
"@safe-global/protocol-kit": "^2.0.0",
"@safe-global/api-kit": "2.1.0",
"@safe-global/protocol-kit": "3.0.0",
"@safe-global/safe-apps-sdk": "^9.0.0-next.1",
"@safe-global/safe-deployments": "1.28.0",
"@safe-global/safe-core-sdk": "^3.3.5",
"@safe-global/safe-core-sdk-utils": "^1.7.4",
"@safe-global/safe-ethers-lib": "^1.9.4",
"@safe-global/safe-deployments": "1.32.0",
"@safe-global/safe-gateway-typescript-sdk": "^3.14.0",
"@safe-global/safe-modules-deployments": "^1.2.0",
"@sentry/react": "^7.91.0",
Expand Down Expand Up @@ -97,7 +100,7 @@
"@faker-js/faker": "^8.1.0",
"@next/bundle-analyzer": "^13.5.6",
"@openzeppelin/contracts": "^4.9.2",
"@safe-global/safe-core-sdk-types": "^3.0.1",
"@safe-global/safe-core-sdk-types": "4.0.0",
"@sentry/types": "^7.74.0",
"@svgr/webpack": "^6.3.1",
"@testing-library/cypress": "^8.0.7",
Expand Down
3 changes: 2 additions & 1 deletion src/config/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const ChainLogos = {
[chains.matic]: '/images/networks/polygon.svg',
[chains.aurora]: '/images/networks/aurora.svg',
[chains.base]: '/images/networks/base.svg',
[chains['base-gor']]: '/images/networks/base.svg',
[chains.basegor]: '/images/networks/base.svg',
[chains.basesep]: '/images/networks/base.svg',
[chains.zkevm]: '/images/networks/polygon.svg',
[chains.zksync]: '/images/networks/zksync.svg',
[chains.celo]: '/images/networks/celo.svg',
Expand Down
2 changes: 1 addition & 1 deletion src/services/security/modules/RedefineModule/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class RedefineModule implements SecurityModule<RedefineModuleRequest, Red
safeVersion: '1.3.0', // TODO: pass to module, taking into account that lower Safe versions don't have chainId in payload
chainId: BigInt(chainId),
// TODO: find out why these types are incompaitble
safeTransactionData: {
data: {
...data.data,
safeTxGas: data.data.safeTxGas,
baseGas: data.data.baseGas,
Expand Down
8 changes: 7 additions & 1 deletion src/services/tx/tx-sender/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ export const createExistingTx = async (
// Create a tx and add pre-approved signatures
const safeTx = await createTx(txParams, txParams.nonce)
Object.entries(signatures).forEach(([signer, data]) => {
safeTx.addSignature({ signer, data, staticPart: () => data, dynamicPart: () => '' })
safeTx.addSignature({
signer,
data,
staticPart: () => data,
dynamicPart: () => '',
isContractSignature: false,
})
})

return safeTx
Expand Down
13 changes: 4 additions & 9 deletions src/services/tx/tx-sender/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getSafeSDK } from '@/hooks/coreSDK/safeCoreSDK'
import type Safe from '@safe-global/protocol-kit'
import { EthersAdapter } from '@safe-global/protocol-kit'
import { EthersAdapter, SigningMethod } from '@safe-global/protocol-kit'
import type { JsonRpcSigner } from 'ethers'
import { ethers } from 'ethers'
import { isWalletRejection, isHardwareWallet } from '@/utils/wallets'
Expand Down Expand Up @@ -123,17 +123,12 @@ export const getSafeSDKWithSigner = async (onboard: OnboardAPI, chainId: SafeInf
return sdk.connect({ ethAdapter })
}

type SigningMethods = Parameters<Safe['signTransaction']>[1]

export const getSupportedSigningMethods = (safeVersion: SafeInfo['version']): SigningMethods[] => {
const ETH_SIGN_TYPED_DATA: SigningMethods = 'eth_signTypedData'
const ETH_SIGN: SigningMethods = 'eth_sign'

export const getSupportedSigningMethods = (safeVersion: SafeInfo['version']): SigningMethod[] => {
if (!hasSafeFeature(SAFE_FEATURES.ETH_SIGN, safeVersion)) {
return [ETH_SIGN_TYPED_DATA]
return [SigningMethod.ETH_SIGN_TYPED_DATA]
}

return [ETH_SIGN_TYPED_DATA, ETH_SIGN]
return [SigningMethod.ETH_SIGN_TYPED_DATA, SigningMethod.ETH_SIGN]
}

export const tryOffChainTxSigning = async (
Expand Down
1 change: 1 addition & 0 deletions src/tests/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,6 @@ export const createMockSafeTransaction = ({
encodedSignatures: () => {
return '0x'
},
getSignature: (signer: string) => signatures.get(signer),
}
}
101 changes: 71 additions & 30 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@
"@ethersproject/properties" "^5.5.0"
"@ethersproject/transactions" "^5.5.0"

"@ethersproject/[email protected]":
"@ethersproject/[email protected]", "@ethersproject/contracts@^5.7.0":
version "5.7.0"
resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e"
integrity sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==
Expand Down Expand Up @@ -2110,7 +2110,7 @@
"@ethersproject/sha2" "^5.5.0"
"@ethersproject/strings" "^5.5.0"

"@ethersproject/[email protected]":
"@ethersproject/[email protected]", "@ethersproject/solidity@^5.7.0":
version "5.7.0"
resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8"
integrity sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==
Expand Down Expand Up @@ -3653,7 +3653,7 @@
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39"
integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==

"@noble/hashes@^1.3.2":
"@noble/hashes@^1.3.3":
version "1.3.3"
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699"
integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==
Expand Down Expand Up @@ -3911,23 +3911,23 @@
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.5.1.tgz#5f1b518ec5fa54437c0b7c4a821546c64fed6922"
integrity sha512-6i/8UoL0P5y4leBIGzvkZdS85RDMG9y1ihZzmTZQ5LdHUYmZ7pKFoj8X0236s3lusPs1Fa5HTQUpwI+UfTcmeA==

"@safe-global/api-kit@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@safe-global/api-kit/-/api-kit-2.0.0.tgz#5d7aaf0a36f5843ba1d788343f0036bf015aa92f"
integrity sha512-Tz6pLEmhhv/ROsYSjVzoR8qw4YK72yNPJCFcK97kSvNJQpM2+HpRVYNjB53rY0IkvP0kVFvF6Ogp/BJri8g1Pw==
"@safe-global/api-kit@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@safe-global/api-kit/-/api-kit-2.1.0.tgz#ae87aadf15d508549fbb115e601317d568a6a11a"
integrity sha512-pobd2UtvmuUVXn42u6IEW/Lm6ltYx0JBR7qKBigcK3XtNNffYHsS8qIKoDYmG9GG34b+pPLOyLtENcgrYLpzvw==
dependencies:
"@safe-global/protocol-kit" "^2.0.0"
"@safe-global/safe-core-sdk-types" "^3.0.0"
"@safe-global/protocol-kit" "^3.0.0"
"@safe-global/safe-core-sdk-types" "^4.0.0"
ethers "^6.7.1"
node-fetch "^2.7.0"

"@safe-global/protocol-kit@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@safe-global/protocol-kit/-/protocol-kit-2.0.0.tgz#9d7cd6299dc9728c5c5d229a45b73a3b07ec4af7"
integrity sha512-alnSxNZKC1ssKrFG5ytluu9kNKGwBifb1xhOyCqwMnm72JksbCEo0UWlNvaeCiYMwhYvMyS++mfxcLAsV/8Gfw==
"@safe-global/protocol-kit@3.0.0", "@safe-global/protocol-kit@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@safe-global/protocol-kit/-/protocol-kit-3.0.0.tgz#9db15a214bf307af81b082eab329b33642d5acd8"
integrity sha512-0x/VqxWQvjUpkK9VeO/llfYMNoUV/Zngq3PKD8mC3H40v/KzOa2jUSgwxkTiRJRxH1cjuwAG+tXcdVluk73Wfw==
dependencies:
"@noble/hashes" "^1.3.2"
"@safe-global/safe-deployments" "^1.28.0"
"@noble/hashes" "^1.3.3"
"@safe-global/safe-deployments" "^1.32.0"
ethereumjs-util "^7.1.5"
ethers "^6.7.1"
semver "^7.5.4"
Expand All @@ -3943,30 +3943,66 @@
"@safe-global/safe-gateway-typescript-sdk" "^3.5.3"
viem "^1.6.0"

"@safe-global/safe-core-sdk-types@^3.0.0", "@safe-global/safe-core-sdk-types@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk-types/-/safe-core-sdk-types-3.0.1.tgz#ec6d053b1648ab80c8d6909cf9d6b0be90b3d0f1"
integrity sha512-2AdlK6GJ5YEZXrQwFsHFwQScnNo3OonF3O6KzVeMc0/7OAuOTYBzKq1jzju2Eck6Z8UNPUinlHoF2Zb2pvTKhw==
"@safe-global/safe-core-sdk-types@4.0.0", "@safe-global/safe-core-sdk-types@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk-types/-/safe-core-sdk-types-4.0.0.tgz#68f6206d14cac077986f99d8c9b75348d63cf5f3"
integrity sha512-KZPkCK3Ttnt3nSqn+M/rkkaY6ZZXy/vBC8lvI3lp3Y8SRgERdIymgLYqiizs+JTT9FZk+IFwfCaZz+4gFqvmpw==
dependencies:
"@safe-global/safe-deployments" "^1.28.0"
"@safe-global/safe-deployments" "^1.32.0"
ethers "^6.7.1"
web3-core "^1.10.3"
web3-utils "^1.10.3"

"@safe-global/safe-[email protected]":
version "1.28.0"
resolved "https://registry.yarnpkg.com/@safe-global/safe-deployments/-/safe-deployments-1.28.0.tgz#9984b513999e5a1cd4449ed2c1ba9a66cb5b223c"
integrity sha512-zWn55unMucN3i3awjDA0XxH9BzGNHyC/qCbuISBh0GMZP/q+VCxERAOEO4OqwyGaxk6sSAzP4usGdmgz2y2svg==
"@safe-global/safe-core-sdk-types@^1.9.2":
version "1.10.1"
resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk-types/-/safe-core-sdk-types-1.10.1.tgz#94331b982671d2f2b8cc23114c58baf63d460c81"
integrity sha512-BKvuYTLOlY16Rq6qCXglmnL6KxInDuXMFqZMaCzwDKiEh+uoHu3xCumG5tVtWOkCgBF4XEZXMqwZUiLcon7IsA==
dependencies:
semver "^7.3.7"
"@ethersproject/bignumber" "^5.7.0"
"@ethersproject/contracts" "^5.7.0"
"@safe-global/safe-deployments" "^1.20.2"
web3-core "^1.8.1"
web3-utils "^1.8.1"

"@safe-global/safe-deployments@^1.28.0":
version "1.29.0"
resolved "https://registry.yarnpkg.com/@safe-global/safe-deployments/-/safe-deployments-1.29.0.tgz#72091773dccdea67d4a0066eeaaa816613b43cca"
integrity sha512-rXTktZblfklQyPe2JLK7GtXW/jH8htE6oP9MQHpVU5K/98OLkR4ApLAzlJscQEcyCaK+XOQunOk/gQYK1M2IpQ==
"@safe-global/safe-core-sdk-utils@^1.7.4":
version "1.7.4"
resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk-utils/-/safe-core-sdk-utils-1.7.4.tgz#810d36cf9629129a28eb1b9c6e690b163834b572"
integrity sha512-ITocwSWlFUA1K9VMP/eJiMfgbP/I9qDxAaFz7ukj5N5NZD3ihVQZkmqML6hjse5UhrfjCnfIEcLkNZhtB2XC2Q==
dependencies:
"@safe-global/safe-core-sdk-types" "^1.9.2"
semver "^7.3.8"
web3-utils "^1.8.1"

"@safe-global/safe-core-sdk@^3.3.5":
version "3.3.5"
resolved "https://registry.yarnpkg.com/@safe-global/safe-core-sdk/-/safe-core-sdk-3.3.5.tgz#30884639d368a9f50aa5fc96f78de87261ebdab3"
integrity sha512-ul+WmpxZOXgDIXrZ6MIHptThYbm0CVV3/rypMQEn4tZLkudh/yXK7EuWBFnx9prR3MePuku51Zcz9fu1vi7sfQ==
dependencies:
"@ethersproject/solidity" "^5.7.0"
"@safe-global/safe-core-sdk-types" "^1.9.2"
"@safe-global/safe-core-sdk-utils" "^1.7.4"
"@safe-global/safe-deployments" "^1.25.0"
ethereumjs-util "^7.1.5"
semver "^7.3.8"
web3-utils "^1.8.1"
zksync-web3 "^0.14.3"

"@safe-global/[email protected]", "@safe-global/safe-deployments@^1.20.2", "@safe-global/safe-deployments@^1.25.0", "@safe-global/safe-deployments@^1.32.0":
version "1.32.0"
resolved "https://registry.yarnpkg.com/@safe-global/safe-deployments/-/safe-deployments-1.32.0.tgz#3632194d883aa07bd446a6e530e825ba022c9b76"
integrity sha512-7RXmnBrUzJ9+Iat74yx3Gel0kygmsaWjJhqr+0Fy8mkP5ly/6dTZ/2ize1pv3j9Yal04NTOqXbaJG4JnbTANQw==
dependencies:
semver "^7.3.7"

"@safe-global/safe-ethers-lib@^1.9.4":
version "1.9.4"
resolved "https://registry.yarnpkg.com/@safe-global/safe-ethers-lib/-/safe-ethers-lib-1.9.4.tgz#049989a302c6f2010c574cf3a834b0cfb9cf67c5"
integrity sha512-WhzcmNun0s0VxeVQKRqaapV0vEpdm76zZBR2Du+S+58u1r57OjZkOSL2Gru0tdwkt3FIZZtE3OhDu09M70pVkA==
dependencies:
"@safe-global/safe-core-sdk-types" "^1.9.2"
"@safe-global/safe-core-sdk-utils" "^1.7.4"
ethers "5.7.2"

"@safe-global/safe-gateway-typescript-sdk@^3.14.0":
version "3.14.0"
resolved "https://registry.yarnpkg.com/@safe-global/safe-gateway-typescript-sdk/-/safe-gateway-typescript-sdk-3.14.0.tgz#9581c524c1ea4956555f40761eb6b4007392aa82"
Expand Down Expand Up @@ -15916,7 +15952,7 @@ [email protected]:
web3-core-requestmanager "1.10.2"
web3-utils "1.10.2"

[email protected], web3-core@^1.10.3:
[email protected], web3-core@^1.10.3, web3-core@^1.8.1:
version "1.10.3"
resolved "https://registry.yarnpkg.com/web3-core/-/web3-core-1.10.3.tgz#4aeb8f4b0cb5775d9fa4edf1127864743f1c3ae3"
integrity sha512-Vbk0/vUNZxJlz3RFjAhNNt7qTpX8yE3dn3uFxfX5OHbuon5u65YEOd3civ/aQNW745N0vGUlHFNxxmn+sG9DIw==
Expand Down Expand Up @@ -16986,3 +17022,8 @@ yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

zksync-web3@^0.14.3:
version "0.14.4"
resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.14.4.tgz#0b70a7e1a9d45cc57c0971736079185746d46b1f"
integrity sha512-kYehMD/S6Uhe1g434UnaMN+sBr9nQm23Ywn0EUP5BfQCsbjcr3ORuS68PosZw8xUTu3pac7G6YMSnNHk+fwzvg==

0 comments on commit 91f4418

Please sign in to comment.