There's a problem with the owner addition process in the Gnosis Safe contract, you only have one owner (daoMember1.address
) and a threshold of 1. Just replace this part of your code
edit: lets try to get the Safe address from the transaction receipt
export async function createSafe() {
const safe{ daoMember1, daoMember2, daoMember3, daoMember4 } = await getAccounts()
const masterCopyFactory = await ethers.getContractAtgetContractFactory('GnosisSafe',)
const masterCopy = await masterCopyFactory.deploy()
const proxyFactoryFactory = await ethers.getContractFactory('GnosisSafeProxyFactory')
const proxyFactory = await proxyFactoryFactory.deploy()
const safeProxy = await proxyFactory.createProxy(masterCopy.address, '0x')
with
const safeAddress = safeProxy.events[0].args.proxy
const safe = await ethers.getContractAt('GnosisSafe', safeProxysafeAddress)
await safe.setup(
[daoMember1.address],
1,
ethers.constants.AddressZero,
'0x',
ethers.constants.AddressZero,
ethers.constants.AddressZero,
0,
ethers.constants.AddressZero
)
return safe
}