Open c-jain opened 2 years ago
Hi Gnosis team, kindly consider looking into this issue which is not resolved yet. @katspaugh @rudolfs @vorot93 @koeppelmann
same problem here
Hi Gnosis team, kindly consider looking into this issue which is not resolved yet. @katspaugh @rudolfs @vorot93 @koeppelmann
I was able to overcome this issue by using EtherAdapter instead of Web3Adapter
I was able to overcome this issue by using EtherAdapter instead of Web3Adapter
ok, so to use ether.js instead of web3.js? I will try and check, thanks. Hope, gnosis team look for web3.js as well as it should work with web3.js as well.
Hi @c-jain and @dntxos,
This should have been fixed with the merge of the linked PR into the development
branch.
Thank you for reporting this issue, web3 tests are working again now.
Hi @germartinez,
Can we open up this ticket? I am facing this exact issue on Polygon using an EthersAdapter, every time safeFactory.deplySafe()
is called I am getting Error: Safe Proxy contract is not deployed in the current network
.
I am having no problem when on Mumbai but this happens consistently on Polygon.
import Safe, { SafeAccountConfig, SafeFactory } from "@gnosis.pm/safe-core-sdk";
import EthersAdapter from "@gnosis.pm/safe-ethers-lib";
import { useSigner } from "wagmi";
import { ethers } from "ethers";
export test = () => {
const [{ data: signer }] = useSigner();
const createSafe = () => {
const ethAdapter = new EthersAdapter({
ethers,
signer,
});
const owners: string[] = ['address1 HERE','address2 HERE' , ''address3 HERE'];
try {
const safeFactory = await SafeFactory.create({ ethAdapter });
const safeAccountConfig: SafeAccountConfig = {
owners,
threshold: 2,
};
let gnosisDeployHash = "";
const safe: Safe = await safeFactory.deploySafe({
safeAccountConfig,
callback: (txHash) => {
gnosisDeployHash = txHash;
},
});
} catch (e) {
console.log(e);
}
}
return <button onClick={createSafe}>Create Safe</button>
}
The bug can be reproduced by running the above code with the Metamask extension installed in the browser and set on Polygon mainnet.
Hi @germartinez , im also experiencing the same issue as @zthh626 pointed out above
+1
the happens every so often on my end even though nothing changes within the code. I've resorted to creating multiple backup safes as a failsafe, but obviously that isn't ideal
@adteague @rish6ix is it only happening on Polygon for you?
@germartinez I created safes on Gnosis (xDai) and Polygon, and have received the error on both chains
@adteague @rish6ix is it only happening on Polygon for you?
@germartinez Tested on Goerli & Polygon. happening on polygon. Safe is getting created in the gnosis platform even though it throws an error. So i am currently fetching safes for given account though api before safe creation and after if it throws an error, I am comparing these two lists to get the newly created safe id. Not an ideal solution but just gets me keep going.
I have the same problem, i wander how long will it take to fix?
Is anyone still having this issue? I wonder if it has something to do with the signer
you are passing in when creating the EthAdapter.
Personally I'm using wagmi
to get the signer and it seems to be chain dependent (for some reason I've yet to figure out...). So when I was connected to the wrong chain and tried to call Safe methods it would say the contract hasn't been deployed error. But once I connect to the right chain, it works.
Still looking for a solution though.
Also getting Error: SafeProxy contract is not deployed on the current network
occasionally (maybe 1 out of 10 times) with the Web3Adapter on Goerli and Infura as an RPC provider. Could it be a sync issue? Any idea how to solve this?
This is how I'm using it:
const provider = new Web3.providers.HttpProvider(
process.env.WEB3_PROVIDER_GOERLI
);
const web3 = new Web3(provider);
const account = web3.eth.accounts.privateKeyToAccount(
"0x" + process.env.PK
);
web3.eth.accounts.wallet.add(account);
web3.eth.defaultAccount = account.address;
const ethAdapter = new Web3Adapter.default({
web3: web3,
signerAddress: process.env.SIGNER,
});
const safeFactory = await Safe.SafeFactory.create({ ethAdapter });
const safeAccountConfig = { owners: addresses, threshold: 2 };
const deploymentCallback = (txHash) => {
console.log(`Safe deployment txHash: ${txHash}`);
};
const safeSdkWallet = await safeFactory.deploySafe({
safeAccountConfig: safeAccountConfig,
callback: deploymentCallback,
});
const safeAddress = safeSdkWallet.getAddress();
console.log(`Safe address: ${safeAddress}`);
Im getting this error even when I use localhost and deploy all the contracts to ganache
Description
I am able to deploy a safe proxy contract on the Rinkeby testnet but I am facing an issue. After calling
safeFactory.deploySafe()
, the function waits for some time then give both error and Metamask notification at the same time. I wanted to understand, is it normal to get this error and then manually get the deployed safe proxy contract address from the Etherscan or not?My use case is whenever a user creates a safe then I should be able to store their deployed safe proxy contract address on my backend automatically and not manually by asking the user to go and check Etherscan and then save it on the backend via some frontend UI.
Environment
Steps to reproduce
The bug can be reproduced by running the above code with the Metamask extension installed in the browser and set on Rinkeby testnet.
Expected result
In some different file:
Additional context
I also asked the issue on the StackExchange.