diff --git a/.github/workflows/create-integrity-file.yml b/.github/workflows/create-integrity-file.yml new file mode 100644 index 000000000..1de79e057 --- /dev/null +++ b/.github/workflows/create-integrity-file.yml @@ -0,0 +1,39 @@ +name: Create publish info file + +on: + release: + types: [created] + workflow_dispatch: + push: + branches: + - prepare-release + +permissions: + contents: read + +jobs: + generate-publish-info: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + - run: | + yarn install --frozen-lockfile + yarn build + + - name: Run integrity check script + run: | + yarn generate-publish-info + + - name: Upload YAML artifact + uses: actions/upload-artifact@v4 + with: + name: publish-info + path: ./publish-info + + - name: Show YAML output + run: cat ./publish-info/*.yml diff --git a/.gitignore b/.gitignore index 99cb3c5ef..a337ae248 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,5 @@ openapi/ yalc.lock # Local Netlify folder .netlify + +publish-info/ \ No newline at end of file diff --git a/package.json b/package.json index 61d69be71..fc4dbe69b 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "test": "FORCE_COLOR=1 lerna run test --stream", "play": "ts-node ./playground/config/run.ts", "format": "lerna run format && prettier --write \"playground/**/*.ts\"", - "prepare": "husky" + "prepare": "husky", + "generate-publish-info": "ts-node ./scripts/generate-publish-info.ts" }, "workspaces": { "packages": [ diff --git a/packages/api-kit/package.json b/packages/api-kit/package.json index eee171d6f..5f33193f2 100644 --- a/packages/api-kit/package.json +++ b/packages/api-kit/package.json @@ -40,7 +40,7 @@ "homepage": "https://github.com/safe-global/safe-core-sdk#readme", "devDependencies": { "@safe-global/relay-kit": "^3.4.6", - "@safe-global/testing-kit": "^0.1.2", + "@safe-global/testing-kit": "^0.1.3", "@types/chai": "^4.3.20", "@types/chai-as-promised": "^7.1.8", "@types/mocha": "^10.0.10", @@ -58,8 +58,8 @@ "web3": "^4.12.1" }, "dependencies": { - "@safe-global/protocol-kit": "^5.2.5", - "@safe-global/types-kit": "^1.0.4", + "@safe-global/protocol-kit": "^5.2.6", + "@safe-global/types-kit": "^1.0.5", "node-fetch": "^2.7.0", "viem": "^2.21.8" } diff --git a/packages/api-kit/tests/e2e/getMultisigTransactions.test.ts b/packages/api-kit/tests/e2e/getMultisigTransactions.test.ts index 630f4a803..d3022c20b 100644 --- a/packages/api-kit/tests/e2e/getMultisigTransactions.test.ts +++ b/packages/api-kit/tests/e2e/getMultisigTransactions.test.ts @@ -28,7 +28,7 @@ describe('getMultisigTransactions', () => { }) it('should return an empty list if there are no multisig transactions', async () => { - const safeAddress = '0x3e04a375aC5847C690A7f2fF54b45c59f7eeD6f0' // Safe without multisig transactions + const safeAddress = '0x513697456eDb113aDCAA1bbDA5bE59D9D7A2efd1' // Safe without multisig transactions const safeMultisigTransactionListResponse = await safeApiKit.getMultisigTransactions(safeAddress) chai.expect(safeMultisigTransactionListResponse.count).to.be.equal(0) diff --git a/packages/api-kit/tests/e2e/getPendingTransactions.test.ts b/packages/api-kit/tests/e2e/getPendingTransactions.test.ts index 2808f553c..8281bf829 100644 --- a/packages/api-kit/tests/e2e/getPendingTransactions.test.ts +++ b/packages/api-kit/tests/e2e/getPendingTransactions.test.ts @@ -35,14 +35,14 @@ describe('getPendingTransactions', () => { }) it('should return the the transaction list', async () => { - const safeAddress = '0xCa2f5A815b642c79FC530B60BC15Aee4eF6252b3' // Safe with pending transaction + const safeAddress = '0x95eF108E0dcC050c129fbBEB0456D1121c98A59c' // Safe with pending transaction const transactionList = await safeApiKit.getPendingTransactions(safeAddress) chai.expect(transactionList.count).to.be.equal(10) chai.expect(transactionList.results.length).to.be.equal(10) }) it('should return the the transaction list EIP-3770', async () => { - const safeAddress = '0xCa2f5A815b642c79FC530B60BC15Aee4eF6252b3' // Safe with pending transaction + const safeAddress = '0x95eF108E0dcC050c129fbBEB0456D1121c98A59c' // Safe with pending transaction const eip3770SafeAddress = `${config.EIP_3770_PREFIX}:${safeAddress}` const transactionList = await safeApiKit.getPendingTransactions(eip3770SafeAddress) chai.expect(transactionList.count).to.be.equal(10) @@ -50,7 +50,7 @@ describe('getPendingTransactions', () => { }) it('should return a maximum of 2 transactions with limit = 2', async () => { - const safeAddress = '0xCa2f5A815b642c79FC530B60BC15Aee4eF6252b3' // Safe with pending transaction + const safeAddress = '0x95eF108E0dcC050c129fbBEB0456D1121c98A59c' // Safe with pending transaction const transactionList = await safeApiKit.getPendingTransactions(safeAddress, { limit: 2 }) @@ -61,7 +61,7 @@ describe('getPendingTransactions', () => { }) it('should return all pending transactions excluding the first one with offset = 1', async () => { - const safeAddress = '0xCa2f5A815b642c79FC530B60BC15Aee4eF6252b3' // Safe with pending transaction + const safeAddress = '0x95eF108E0dcC050c129fbBEB0456D1121c98A59c' // Safe with pending transaction const transactionList = await safeApiKit.getPendingTransactions(safeAddress, { offset: 1 }) diff --git a/packages/api-kit/tests/e2e/getTransaction.test.ts b/packages/api-kit/tests/e2e/getTransaction.test.ts index 8a4309e5b..8e18393fc 100644 --- a/packages/api-kit/tests/e2e/getTransaction.test.ts +++ b/packages/api-kit/tests/e2e/getTransaction.test.ts @@ -26,7 +26,7 @@ describe('getTransaction', () => { }) it('should return the transaction with the given safeTxHash', async () => { - const safeTxHash = '0x317834aea988fd3cfa54fd8b2be2c96b4fd70a14d8c9470a7110576b01e6480a' + const safeTxHash = '0x71eb4e7daac8a5461c6b946c95895c5732281de9cb9dad6efa139fc42a063229' const transaction = await safeApiKit.getTransaction(safeTxHash) chai.expect(transaction.safeTxHash).to.be.equal(safeTxHash) chai.expect(transaction.safe).to.be.eq(API_TESTING_SAFE.address) diff --git a/packages/api-kit/tests/e2e/getTransactionConfirmations.test.ts b/packages/api-kit/tests/e2e/getTransactionConfirmations.test.ts index ecd877baa..f09ab7bd9 100644 --- a/packages/api-kit/tests/e2e/getTransactionConfirmations.test.ts +++ b/packages/api-kit/tests/e2e/getTransactionConfirmations.test.ts @@ -27,7 +27,7 @@ describe('getTransactionConfirmations', () => { }) it('should return the transaction with the given safeTxHash', async () => { - const safeTxHash = '0x317834aea988fd3cfa54fd8b2be2c96b4fd70a14d8c9470a7110576b01e6480a' + const safeTxHash = '0x71eb4e7daac8a5461c6b946c95895c5732281de9cb9dad6efa139fc42a063229' const transactionConfirmations = await safeApiKit.getTransactionConfirmations(safeTxHash) chai.expect(transactionConfirmations.count).to.be.equal(2) chai.expect(transactionConfirmations.results.length).to.be.equal(2) diff --git a/packages/api-kit/tests/helpers/safe.ts b/packages/api-kit/tests/helpers/safe.ts index facf1de40..4ad93a000 100644 --- a/packages/api-kit/tests/helpers/safe.ts +++ b/packages/api-kit/tests/helpers/safe.ts @@ -1,6 +1,6 @@ export const API_TESTING_SAFE = { address: '0xF8ef84392f7542576F6b9d1b140334144930Ac78', - nonce: '11', + nonce: '10', threshold: 2, owners: [ '0x56e2C102c664De6DfD7315d12c0178b61D16F171', diff --git a/packages/protocol-kit/package.json b/packages/protocol-kit/package.json index 2ae930712..cde497d21 100644 --- a/packages/protocol-kit/package.json +++ b/packages/protocol-kit/package.json @@ -1,6 +1,6 @@ { "name": "@safe-global/protocol-kit", - "version": "5.2.5", + "version": "5.2.6", "description": "SDK that facilitates the interaction with Safe Smart Accounts", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -52,7 +52,7 @@ ], "homepage": "https://github.com/safe-global/safe-core-sdk#readme", "devDependencies": { - "@safe-global/testing-kit": "^0.1.2", + "@safe-global/testing-kit": "^0.1.3", "@types/chai": "^4.3.20", "@types/chai-as-promised": "^7.1.8", "@types/mocha": "^10.0.10", @@ -70,7 +70,7 @@ "dependencies": { "@safe-global/safe-deployments": "^1.37.31", "@safe-global/safe-modules-deployments": "^2.2.7", - "@safe-global/types-kit": "^1.0.4", + "@safe-global/types-kit": "^1.0.5", "abitype": "^1.0.2", "semver": "^7.6.3", "viem": "^2.21.8" diff --git a/packages/protocol-kit/scripts/safe-deployments/updateLocalNetworks.ts b/packages/protocol-kit/scripts/safe-deployments/updateLocalNetworks.ts index 157d2f525..e22440e4d 100644 --- a/packages/protocol-kit/scripts/safe-deployments/updateLocalNetworks.ts +++ b/packages/protocol-kit/scripts/safe-deployments/updateLocalNetworks.ts @@ -26,7 +26,7 @@ function updateLocalNetworks(networks: NetworkShortName[]) { const startIndex = content.indexOf('export const networks: NetworkShortName[] = [') + 'export const networks: NetworkShortName[] = ['.length - const endIndex = content.indexOf(']\n\nif (process.env.TEST_NETWORK ===') + const endIndex = content.indexOf(']\n\ntry {') const sortedNetworks = networks .sort((a, b) => Number(a.chainId - b.chainId)) diff --git a/packages/protocol-kit/src/contracts/utils.ts b/packages/protocol-kit/src/contracts/utils.ts index f98d13a14..8ea25f389 100644 --- a/packages/protocol-kit/src/contracts/utils.ts +++ b/packages/protocol-kit/src/contracts/utils.ts @@ -49,6 +49,7 @@ export const PREDETERMINED_SALT_NONCE = const ZKSYNC_MAINNET = 324n const ZKSYNC_TESTNET = 300n +const ZKSYNC_LENS = 232n // For bundle size efficiency we store SafeProxy.sol/GnosisSafeProxy.sol zksync bytecode hash in hex. // To get the values below we need to: // 1. Compile Safe smart contracts for zksync @@ -62,6 +63,9 @@ const ZKSYNC_SAFE_PROXY_DEPLOYED_BYTECODE: { } = { '1.3.0': { deployedBytecodeHash: '0x0100004124426fb9ebb25e27d670c068e52f9ba631bd383279a188be47e3f86d' + }, + '1.4.1': { + deployedBytecodeHash: '0x0100003b6cfa15bd7d1cae1c9c022074524d7785d34859ad0576d8fab4305d4f' } } @@ -369,10 +373,10 @@ export async function predictSafeAddress({ const from = safeProxyFactoryContract.getAddress() - // On the zkSync Era chain, the counterfactual deployment address is calculated differently - const isZkSyncEraChain = [ZKSYNC_MAINNET, ZKSYNC_TESTNET].includes(chainId) - if (isZkSyncEraChain) { - const proxyAddress = zkSyncEraCreate2Address(from, safeVersion, salt, asHex(input)) + // On the zkSync chains, the counterfactual deployment address is calculated differently + const isZkSyncChain = [ZKSYNC_MAINNET, ZKSYNC_TESTNET, ZKSYNC_LENS].includes(chainId) + if (isZkSyncChain) { + const proxyAddress = zkSyncCreate2Address(from, safeVersion, salt, asHex(input)) return safeProvider.getChecksummedAddress(proxyAddress) } @@ -472,9 +476,9 @@ export function getSafeAddressFromDeploymentTx( * @param {`0x${string}`} salt - The salt used for address derivation. * @param {`0x${string}`} input - Additional input data for the derivation. * - * @returns {string} The derived zkSync Era address. + * @returns {string} The derived zkSync address. */ -export function zkSyncEraCreate2Address( +export function zkSyncCreate2Address( from: string, safeVersion: SafeVersion, salt: Hex, diff --git a/packages/protocol-kit/src/types/contracts.ts b/packages/protocol-kit/src/types/contracts.ts index f2f176089..28ea96992 100644 --- a/packages/protocol-kit/src/types/contracts.ts +++ b/packages/protocol-kit/src/types/contracts.ts @@ -87,43 +87,43 @@ export type GetContractProps = { export type ContractNetworkConfig = { /** safeSingletonAddress - Address of the Safe Singleton contract deployed on a specific network */ - safeSingletonAddress: string + safeSingletonAddress?: string /** safeSingletonAbi - Abi of the Safe Singleton contract deployed on a specific network */ safeSingletonAbi?: Abi /** safeProxyFactoryAddress - Address of the SafeProxyFactory contract deployed on a specific network */ - safeProxyFactoryAddress: string + safeProxyFactoryAddress?: string /** safeProxyFactoryAbi - Abi of the SafeProxyFactory contract deployed on a specific network */ safeProxyFactoryAbi?: Abi /** multiSendAddress - Address of the MultiSend contract deployed on a specific network */ - multiSendAddress: string + multiSendAddress?: string /** multiSendAbi - Abi of the MultiSend contract deployed on a specific network */ multiSendAbi?: Abi /** multiSendCallOnlyAddress - Address of the MultiSendCallOnly contract deployed on a specific network */ - multiSendCallOnlyAddress: string + multiSendCallOnlyAddress?: string /** multiSendCallOnlyAbi - Abi of the MultiSendCallOnly contract deployed on a specific network */ multiSendCallOnlyAbi?: Abi /** fallbackHandlerAddress - Address of the Fallback Handler contract deployed on a specific network */ - fallbackHandlerAddress: string + fallbackHandlerAddress?: string /** fallbackHandlerAbi - Abi of the Fallback Handler contract deployed on a specific network */ fallbackHandlerAbi?: Abi /** signMessageLibAddress - Address of the SignMessageLib contract deployed on a specific network */ - signMessageLibAddress: string + signMessageLibAddress?: string /** signMessageLibAbi - Abi of the SignMessageLib contract deployed on a specific network */ signMessageLibAbi?: Abi /** createCallAddress - Address of the CreateCall contract deployed on a specific network */ - createCallAddress: string + createCallAddress?: string /** createCallAbi - Abi of the CreateCall contract deployed on a specific network */ createCallAbi?: Abi /** simulateTxAccessorAddress - Address of the SimulateTxAccessor contract deployed on a specific network */ - simulateTxAccessorAddress: string + simulateTxAccessorAddress?: string /** simulateTxAccessorAbi - Abi of the SimulateTxAccessor contract deployed on a specific network */ simulateTxAccessorAbi?: Abi /** safeWebAuthnSignerFactoryAddress - Address of the SafeWebAuthnSignerFactory contract deployed on a specific network */ - safeWebAuthnSignerFactoryAddress: string + safeWebAuthnSignerFactoryAddress?: string /** safeWebAuthnSignerFactoryAbi - Abi of the SafeWebAuthnSignerFactory contract deployed on a specific network */ safeWebAuthnSignerFactoryAbi?: Abi /** safeWebAuthnSharedSignerAddress - Address of the SafeWebAuthnSharedSigner contract deployed on a specific network */ - safeWebAuthnSharedSignerAddress: string + safeWebAuthnSharedSignerAddress?: string /** safeWebAuthnSharedSignerAbi - Abi of the SafeWebAuthnSharedSigner contract deployed on a specific network */ safeWebAuthnSharedSignerAbi?: Abi } diff --git a/packages/protocol-kit/src/utils/eip-3770/config.ts b/packages/protocol-kit/src/utils/eip-3770/config.ts index 085eec2d0..176147afa 100644 --- a/packages/protocol-kit/src/utils/eip-3770/config.ts +++ b/packages/protocol-kit/src/utils/eip-3770/config.ts @@ -396,6 +396,10 @@ export const networks: NetworkShortName[] = [ { chainId: 920637907288165n, shortName: 'kkrt-starknet-sepolia' } ] -if (process.env.TEST_NETWORK === 'hardhat') { - networks.push({ shortName: 'local', chainId: 31337n }) +try { + if (process.env.TEST_NETWORK === 'hardhat') { + networks.push({ shortName: 'local', chainId: 31337n }) + } +} catch { + // When process is not available we run on a browser environment } diff --git a/packages/protocol-kit/src/utils/getProtocolKitVersion.ts b/packages/protocol-kit/src/utils/getProtocolKitVersion.ts index 60adc4e35..67ea9cfaa 100644 --- a/packages/protocol-kit/src/utils/getProtocolKitVersion.ts +++ b/packages/protocol-kit/src/utils/getProtocolKitVersion.ts @@ -1 +1 @@ -export const getProtocolKitVersion = () => '5.2.5' +export const getProtocolKitVersion = () => '5.2.6' diff --git a/packages/protocol-kit/tests/e2e/utils/setupProvider.ts b/packages/protocol-kit/tests/e2e/utils/setupProvider.ts index aa42df326..191c9b0c6 100644 --- a/packages/protocol-kit/tests/e2e/utils/setupProvider.ts +++ b/packages/protocol-kit/tests/e2e/utils/setupProvider.ts @@ -44,14 +44,11 @@ export function getSafeProviderFromNetwork(network: Network, account?: Account): case 'gnosis': rpcUrl = 'https://rpc.gnosischain.com' break - case 'goerli': - rpcUrl = 'https://rpc.ankr.com/eth_goerli' - break case 'sepolia': rpcUrl = 'https://sepolia.gateway.tenderly.co' break case 'mainnet': - rpcUrl = 'https://rpc.ankr.com/eth' + rpcUrl = 'https://ethereum-rpc.publicnode.com' break default: throw new Error('Chain not supported') diff --git a/packages/protocol-kit/tests/e2e/utilsContracts.test.ts b/packages/protocol-kit/tests/e2e/utilsContracts.test.ts index 422ba7e2c..74268344c 100644 --- a/packages/protocol-kit/tests/e2e/utilsContracts.test.ts +++ b/packages/protocol-kit/tests/e2e/utilsContracts.test.ts @@ -1,5 +1,5 @@ import chai from 'chai' -import { polygon, optimism, bsc, gnosis, base, avalanche } from 'viem/chains' +import { polygon, optimism, gnosis, base, avalanche } from 'viem/chains' import { getEip1193Provider, getSafeProviderFromNetwork } from './utils/setupProvider' import { getSafeAddressFromDeploymentTx, @@ -548,7 +548,7 @@ describe('Contract utils', () => { ) itif(safeVersionDeployed === '1.3.0')( - 'returns the predicted address for Safes deployed on zkSync Era', + 'returns the predicted address for Safes deployed on zkSync EVM', async () => { const { contractNetworks } = await setupTests() @@ -730,7 +730,7 @@ describe('Contract utils', () => { }) const protocolKitBNB = await Safe.init({ - provider: bsc.rpcUrls.default.http[0], + provider: 'https://bsc-rpc.publicnode.com', // bsc.rpcUrls.default.http[0], predictedSafe: { safeAccountConfig, safeDeploymentConfig diff --git a/packages/relay-kit/package.json b/packages/relay-kit/package.json index ff6b64495..a3080fddb 100644 --- a/packages/relay-kit/package.json +++ b/packages/relay-kit/package.json @@ -40,9 +40,9 @@ }, "dependencies": { "@gelatonetwork/relay-sdk": "^5.5.0", - "@safe-global/protocol-kit": "^5.2.5", + "@safe-global/protocol-kit": "^5.2.6", "@safe-global/safe-modules-deployments": "^2.2.7", - "@safe-global/types-kit": "^1.0.4", + "@safe-global/types-kit": "^1.0.5", "semver": "^7.6.3", "viem": "^2.21.8" } diff --git a/packages/sdk-starter-kit/package.json b/packages/sdk-starter-kit/package.json index 0f8f440bf..b0794a436 100644 --- a/packages/sdk-starter-kit/package.json +++ b/packages/sdk-starter-kit/package.json @@ -37,9 +37,9 @@ }, "dependencies": { "@safe-global/api-kit": "^2.5.11", - "@safe-global/protocol-kit": "^5.2.5", + "@safe-global/protocol-kit": "^5.2.6", "@safe-global/relay-kit": "^3.4.6", - "@safe-global/types-kit": "^1.0.4", + "@safe-global/types-kit": "^1.0.5", "viem": "^2.21.8" } } diff --git a/packages/testing-kit/package.json b/packages/testing-kit/package.json index 862135473..bac15bb9a 100644 --- a/packages/testing-kit/package.json +++ b/packages/testing-kit/package.json @@ -1,6 +1,6 @@ { "name": "@safe-global/testing-kit", - "version": "0.1.2", + "version": "0.1.3", "description": "Helper package providing testing utilities", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -39,8 +39,8 @@ "@nomicfoundation/hardhat-viem": "^2.0.6", "@openzeppelin/contracts": "^2.5.1", "@safe-global/safe-contracts-v1.4.1": "npm:@safe-global/safe-contracts@1.4.1", - "@safe-global/safe-passkey": "0.2.0-alpha.1", - "@safe-global/types-kit": "^1.0.4", + "@safe-global/safe-passkey": "0.2.0", + "@safe-global/types-kit": "^1.0.5", "@types/semver": "^7.5.8", "hardhat": "^2.19.3", "hardhat-deploy": "^0.12.4", diff --git a/packages/testing-kit/src/utils/setupContractNetworks.ts b/packages/testing-kit/src/utils/setupContractNetworks.ts index 454c0b429..2dfddbeff 100644 --- a/packages/testing-kit/src/utils/setupContractNetworks.ts +++ b/packages/testing-kit/src/utils/setupContractNetworks.ts @@ -14,43 +14,43 @@ import { export type ContractNetworkConfig = { /** safeSingletonAddress - Address of the Safe Singleton contract deployed on a specific network */ - safeSingletonAddress: string + safeSingletonAddress?: string /** safeSingletonAbi - Abi of the Safe Singleton contract deployed on a specific network */ safeSingletonAbi?: Abi /** safeProxyFactoryAddress - Address of the SafeProxyFactory contract deployed on a specific network */ - safeProxyFactoryAddress: string + safeProxyFactoryAddress?: string /** safeProxyFactoryAbi - Abi of the SafeProxyFactory contract deployed on a specific network */ safeProxyFactoryAbi?: Abi /** multiSendAddress - Address of the MultiSend contract deployed on a specific network */ - multiSendAddress: string + multiSendAddress?: string /** multiSendAbi - Abi of the MultiSend contract deployed on a specific network */ multiSendAbi?: Abi /** multiSendCallOnlyAddress - Address of the MultiSendCallOnly contract deployed on a specific network */ - multiSendCallOnlyAddress: string + multiSendCallOnlyAddress?: string /** multiSendCallOnlyAbi - Abi of the MultiSendCallOnly contract deployed on a specific network */ multiSendCallOnlyAbi?: Abi /** fallbackHandlerAddress - Address of the Fallback Handler contract deployed on a specific network */ - fallbackHandlerAddress: string + fallbackHandlerAddress?: string /** fallbackHandlerAbi - Abi of the Fallback Handler contract deployed on a specific network */ fallbackHandlerAbi?: Abi /** signMessageLibAddress - Address of the SignMessageLib contract deployed on a specific network */ - signMessageLibAddress: string + signMessageLibAddress?: string /** signMessageLibAbi - Abi of the SignMessageLib contract deployed on a specific network */ signMessageLibAbi?: Abi /** createCallAddress - Address of the CreateCall contract deployed on a specific network */ - createCallAddress: string + createCallAddress?: string /** createCallAbi - Abi of the CreateCall contract deployed on a specific network */ createCallAbi?: Abi /** simulateTxAccessorAddress - Address of the SimulateTxAccessor contract deployed on a specific network */ - simulateTxAccessorAddress: string + simulateTxAccessorAddress?: string /** simulateTxAccessorAbi - Abi of the SimulateTxAccessor contract deployed on a specific network */ simulateTxAccessorAbi?: Abi /** safeWebAuthnSignerFactoryAddress - Address of the SafeWebAuthnSignerFactory contract deployed on a specific network */ - safeWebAuthnSignerFactoryAddress: string + safeWebAuthnSignerFactoryAddress?: string /** safeWebAuthnSignerFactoryAbi - Abi of the SafeWebAuthnSignerFactory contract deployed on a specific network */ safeWebAuthnSignerFactoryAbi?: Abi /** safeWebAuthnSharedSignerAddress - Address of the SafeWebAuthnSharedSigner contract deployed on a specific network */ - safeWebAuthnSharedSignerAddress: string + safeWebAuthnSharedSignerAddress?: string /** safeWebAuthnSharedSignerAbi - Abi of the SafeWebAuthnSharedSigner contract deployed on a specific network */ safeWebAuthnSharedSignerAbi?: Abi } diff --git a/packages/types-kit/package.json b/packages/types-kit/package.json index 40b8e1a4f..4abec6628 100644 --- a/packages/types-kit/package.json +++ b/packages/types-kit/package.json @@ -1,6 +1,6 @@ { "name": "@safe-global/types-kit", - "version": "1.0.4", + "version": "1.0.5", "description": "Types for use with the Safe Core SDK packages", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", diff --git a/packages/types-kit/src/contracts/assets/SafeWebAuthnSignerFactory/v0.2.1/safe_webauthn_signer_factory.ts b/packages/types-kit/src/contracts/assets/SafeWebAuthnSignerFactory/v0.2.1/safe_webauthn_signer_factory.ts index 5179b383b..c51c90f94 100644 --- a/packages/types-kit/src/contracts/assets/SafeWebAuthnSignerFactory/v0.2.1/safe_webauthn_signer_factory.ts +++ b/packages/types-kit/src/contracts/assets/SafeWebAuthnSignerFactory/v0.2.1/safe_webauthn_signer_factory.ts @@ -16,7 +16,7 @@ export default { { internalType: 'P256.Verifiers', name: 'verifiers', - type: 'uint192' + type: 'uint176' } ], name: 'createSigner', @@ -45,7 +45,7 @@ export default { { internalType: 'P256.Verifiers', name: 'verifiers', - type: 'uint192' + type: 'uint176' } ], name: 'getSigner', @@ -84,7 +84,7 @@ export default { { internalType: 'P256.Verifiers', name: 'verifiers', - type: 'uint192' + type: 'uint176' } ], name: 'isValidSignatureForSigner', diff --git a/playground/tsconfig.json b/playground/tsconfig.json index 906bd7f65..be1e355ac 100644 --- a/playground/tsconfig.json +++ b/playground/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../tsconfig.settings.json", "compilerOptions": { - "composite": true, "noImplicitThis": false, "outDir": "dist" }, diff --git a/scripts/generate-publish-info.ts b/scripts/generate-publish-info.ts new file mode 100644 index 000000000..c70df1894 --- /dev/null +++ b/scripts/generate-publish-info.ts @@ -0,0 +1,118 @@ +import { execFile } from 'child_process' +import * as fs from 'fs' +import * as path from 'path' +import * as yaml from 'yaml' + +type PackagePublishInfo = { + id: string + name: string + version: string + size: number + unpackedSize: number + shasum: string + integrity: string + filename: string + entryCount: number +} + +type NpmPublishOutput = Record< + string, + PackagePublishInfo & { + files?: string[] + bundled?: unknown[] + } +> + +const executeCommand = (command: string, args: string[]): Promise => { + return new Promise((resolve, reject) => { + execFile(command, args, (error, stdout, stderr) => { + if (error) { + return reject(`Error executing command: ${error.message}`) + } + + if (stderr) { + console.warn(`Warning during execution: ${stderr}`) + } + + resolve(stdout) + }) + }) +} + +const writeToFile = (filePath: string, data: string): Promise => { + return new Promise((resolve, reject) => { + const safeDir = path.join(process.cwd(), 'publish-info') + + fs.mkdir(safeDir, { recursive: true, mode: 0o700 }, (err) => { + if (err) return reject(`Directory creation failed: ${err.message}`) + + const fullPath = path.join(safeDir, path.basename(filePath)) + + fs.writeFile(fullPath, data, { mode: 0o600 }, (writeErr) => { + if (writeErr) return reject(`File write failed: ${writeErr.message}`) + resolve() + }) + }) + }) +} + +const sanitizePublishOutput = (jsonData: NpmPublishOutput): Record => { + return Object.fromEntries( + Object.entries(jsonData).map(([pkgName, pkgData]) => { + const { files, bundled, ...cleanData } = pkgData + + return [pkgName, cleanData] + }) + ) +} + +const getReadableFilename = (): string => { + try { + const now = new Date() + const pad = (n: number) => n.toString().padStart(2, '0') + const datePart = [now.getFullYear(), pad(now.getMonth() + 1), pad(now.getDate())].join('-') + const timePart = [pad(now.getHours()), pad(now.getMinutes()), pad(now.getSeconds())].join('-') + const timestamp = `${datePart}_${timePart}` + + return `publish-info_${timestamp}.yml` + } catch { + return `publish-info_${Date.now()}.yml` + } +} + +const main = async () => { + try { + const projectRoot = path.join(__dirname, '../') + process.chdir(projectRoot) + + const stdout = await executeCommand('npm', [ + 'publish', + '--access', + 'public', + '--dry-run', + '--workspaces', + '--json', + '--ignore-scripts' + ]) + + let jsonOutput: NpmPublishOutput + try { + jsonOutput = JSON.parse(stdout) as NpmPublishOutput + } catch (parseError) { + throw new Error(`Error parsing JSON output: ${(parseError as Error).message}`) + } + + const cleanedOutput = sanitizePublishOutput(jsonOutput) + const yamlOutput = yaml.stringify(cleanedOutput) + + const outputFileName = getReadableFilename() + await writeToFile(outputFileName, yamlOutput) + + console.log(`Output stored in ${outputFileName}`) + } catch (error) { + console.error(`Error: ${error instanceof Error ? error.message : error}`) + process.exit(1) + } +} + +main() diff --git a/yarn.lock b/yarn.lock index 2d47e34c7..c127f3ac7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,14 @@ resolved "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== +"@account-abstraction/contracts@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@account-abstraction/contracts/-/contracts-0.7.0.tgz#f0f60d73e8d6ef57b794b07f8ab7b4779a3814c6" + integrity sha512-Bt/66ilu3u8I9+vFZ9fTd+cWs55fdb9J5YKfrhsrFafH1drkzwuCSL/xEot1GGyXXNJLQuXbMRztQPyelNbY1A== + dependencies: + "@openzeppelin/contracts" "^5.0.0" + "@uniswap/v3-periphery" "^1.4.3" + "@adraffy/ens-normalize@1.10.0": version "1.10.0" resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" @@ -1677,11 +1685,21 @@ dependencies: "@octokit/openapi-types" "^18.0.0" +"@openzeppelin/contracts@3.4.2-solc-0.7": + version "3.4.2-solc-0.7" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.2-solc-0.7.tgz#38f4dbab672631034076ccdf2f3201fab1726635" + integrity sha512-W6QmqgkADuFcTLzHL8vVoNBtkwjvQRpYIAom7KiUNoLKghyx3FgH0GBjt8NRvigV1ZmMOBllvE1By1C+bi8WpA== + "@openzeppelin/contracts@^2.5.1": version "2.5.1" resolved "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-2.5.1.tgz" integrity sha512-qIy6tLx8rtybEsIOAlrM4J/85s2q2nPkDqj/Rx46VakBZ0LwtFhXIVub96LXHczQX0vaqmAueDqNPXtbSXSaYQ== +"@openzeppelin/contracts@^5.0.0": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.2.0.tgz#bd020694218202b811b0ea3eec07277814c658da" + integrity sha512-bxjNie5z89W1Ea0NZLZluFh8PrFNn9DH8DQlujEok2yjsOlraUPKID5p1Wk3qdNbf6XkQ1Os2RvfiHrrXLHWKA== + "@peculiar/asn1-schema@^2.3.13": version "2.3.13" resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.3.13.tgz#ec8509cdcbc0da3abe73fd7e690556b57a61b8f4" @@ -1723,11 +1741,13 @@ resolved "https://registry.yarnpkg.com/@safe-global/safe-modules-deployments/-/safe-modules-deployments-2.2.7.tgz#8d9cabea778767776de2dc62258dcc458f2f2c14" integrity sha512-xlnAW7d0394EwlRgWJ+nuQNQmGkL0qBE54pN+1IBbUEFvWW8q0SbhDsTmlGgeDM+9F8q2KM06Ip1JMmddppA/Q== -"@safe-global/safe-passkey@0.2.0-alpha.1": - version "0.2.0-alpha.1" - resolved "https://registry.yarnpkg.com/@safe-global/safe-passkey/-/safe-passkey-0.2.0-alpha.1.tgz#a9e80e727ffe836f656808595dd4d59438948294" - integrity sha512-rmxZH79J0ynQf9WqyWHbHWbv1K7s6X1hFpp55f4euMO9taoU7Ymw5p+8iBgQNe4EWy4NjRbtfK9NKD7JaLoYjQ== +"@safe-global/safe-passkey@0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@safe-global/safe-passkey/-/safe-passkey-0.2.0.tgz#10ac37c9d36ce104247daf4b1cde41b92ddf2b97" + integrity sha512-B9IpVvwXLvK3m+BRhn9z8kCbEizFmua4YmaUBZ9yr0xM9YsX2PRTnxbFvC7pLph1OQ2u+9O2V3FEmPiS10YEIw== dependencies: + "@account-abstraction/contracts" "^0.7.0" + "@openzeppelin/contracts" "^5.0.0" "@safe-global/safe-contracts" "^1.4.1-build.0" cbor "^9.0.2" @@ -2279,6 +2299,32 @@ resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== +"@uniswap/lib@^4.0.1-alpha": + version "4.0.1-alpha" + resolved "https://registry.yarnpkg.com/@uniswap/lib/-/lib-4.0.1-alpha.tgz#2881008e55f075344675b3bca93f020b028fbd02" + integrity sha512-f6UIliwBbRsgVLxIaBANF6w09tYqc6Y/qXdsrbEmXHyFA7ILiKrIwRFXe1yOg8M3cksgVsO9N7yuL2DdCGQKBA== + +"@uniswap/v2-core@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@uniswap/v2-core/-/v2-core-1.0.1.tgz#af8f508bf183204779938969e2e54043e147d425" + integrity sha512-MtybtkUPSyysqLY2U210NBDeCHX+ltHt3oADGdjqoThZaFRDKwM6k1Nb3F0A3hk5hwuQvytFWhrWHOEq6nVJ8Q== + +"@uniswap/v3-core@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@uniswap/v3-core/-/v3-core-1.0.1.tgz#b6d2bdc6ba3c3fbd610bdc502395d86cd35264a0" + integrity sha512-7pVk4hEm00j9tc71Y9+ssYpO6ytkeI0y7WE9P6UcmNzhxPePwyAxImuhVsTqWK9YFvzgtvzJHi64pBl4jUzKMQ== + +"@uniswap/v3-periphery@^1.4.3": + version "1.4.4" + resolved "https://registry.yarnpkg.com/@uniswap/v3-periphery/-/v3-periphery-1.4.4.tgz#d2756c23b69718173c5874f37fd4ad57d2f021b7" + integrity sha512-S4+m+wh8HbWSO3DKk4LwUCPZJTpCugIsHrWR86m/OrUyvSqGDTXKFfc2sMuGXCZrD1ZqO3rhQsKgdWg3Hbb2Kw== + dependencies: + "@openzeppelin/contracts" "3.4.2-solc-0.7" + "@uniswap/lib" "^4.0.1-alpha" + "@uniswap/v2-core" "^1.0.1" + "@uniswap/v3-core" "^1.0.0" + base64-sol "1.0.1" + "@yarnpkg/lockfile@^1.1.0": version "1.1.0" resolved "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz" @@ -2656,6 +2702,11 @@ base64-js@^1.3.1: resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +base64-sol@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/base64-sol/-/base64-sol-1.0.1.tgz#91317aa341f0bc763811783c5729f1c2574600f6" + integrity sha512-ld3cCNMeXt4uJXmLZBHFGMvVpK9KsLVEhPpFRXnvSVAqABKbuNZg/+dsq3NuM+wxFLb/UrVkz7m1ciWmkMfTbg== + bech32@1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz"