From 9a64f7c09eac7e112da2a4f7d8e3e19fdede66ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Va=C3=B1=C3=B3?= Date: Sat, 19 Aug 2023 12:18:23 +0200 Subject: [PATCH 1/2] SafeProxyFactoryWeb3Contract.ts updated --- packages/protocol-kit/package.json | 11 ++++++----- .../SafeProxyFactory/SafeProxyFactoryWeb3Contract.ts | 11 +++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/protocol-kit/package.json b/packages/protocol-kit/package.json index 9a118ed43..5d89a1aa3 100644 --- a/packages/protocol-kit/package.json +++ b/packages/protocol-kit/package.json @@ -1,6 +1,7 @@ { - "name": "@safe-global/protocol-kit", - "version": "1.2.0", + "name": "@safe-global/protocol-kit-fixed", + "version": "1.0.0", + "private": false, "description": "SDK to interact with Safe smart contracts", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -40,12 +41,12 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/safe-global/safe-core-sdk.git" + "url": "git+https://github.com/franvf/safe-core-sdk-fixed" }, - "author": "Safe (https://safe.global)", + "author": "Fran Vañó", "license": "MIT", "bugs": { - "url": "https://github.com/safe-global/safe-core-sdk/issues" + "url": "https://github.com/franvf" }, "files": [ "dist" diff --git a/packages/protocol-kit/src/adapters/web3/contracts/SafeProxyFactory/SafeProxyFactoryWeb3Contract.ts b/packages/protocol-kit/src/adapters/web3/contracts/SafeProxyFactory/SafeProxyFactoryWeb3Contract.ts index b8e93fc0a..2710225c3 100644 --- a/packages/protocol-kit/src/adapters/web3/contracts/SafeProxyFactory/SafeProxyFactoryWeb3Contract.ts +++ b/packages/protocol-kit/src/adapters/web3/contracts/SafeProxyFactory/SafeProxyFactoryWeb3Contract.ts @@ -63,12 +63,19 @@ class SafeProxyFactoryWeb3Contract implements SafeProxyFactoryContract { const txResult: TransactionReceipt = await new Promise((resolve, reject) => txResponse.once('receipt', (receipt: TransactionReceipt) => resolve(receipt)).catch(reject) ) - const proxyAddress = txResult.events?.ProxyCreation?.returnValues?.proxy - if (!proxyAddress) { + // const proxyAddress = txResult.events?.ProxyCreation?.returnValues?.proxy + + //FRAN CODE START + const events = await this.contract.getPastEvents('ProxyCreation') + const proxyAddress = events[0]['returnValues']['0'] + + // if (!proxyAddress) { + if (proxyAddress == '0x0000000000000000000000000000000000000000') { throw new Error('SafeProxy was not deployed correctly') } return proxyAddress } + //FRAN CODE FINISH encode(methodName: string, params: any[]): string { return (this.contract as any).methods[methodName](...params).encodeABI() From 94c72c8465d70632cc1af22d3430262dc8f55ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Va=C3=B1=C3=B3?= Date: Sat, 19 Aug 2023 12:48:19 +0200 Subject: [PATCH 2/2] Package.json updated --- packages/protocol-kit/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/protocol-kit/package.json b/packages/protocol-kit/package.json index 5d89a1aa3..e4cd4b16b 100644 --- a/packages/protocol-kit/package.json +++ b/packages/protocol-kit/package.json @@ -1,7 +1,6 @@ { - "name": "@safe-global/protocol-kit-fixed", + "name": "@franvf/protocol-kit", "version": "1.0.0", - "private": false, "description": "SDK to interact with Safe smart contracts", "main": "dist/src/index.js", "types": "dist/src/index.d.ts",