Skip to main content
added 864 characters in body
Source Link
Saxtheowl
  • 698
  • 5
  • 12

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
}

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

const safe = await ethers.getContractAt('GnosisSafe', masterCopy.address)

with

const safe = await ethers.getContractAt('GnosisSafe', safeProxy)

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 { daoMember1, daoMember2, daoMember3, daoMember4 } = await getAccounts()

  const masterCopyFactory = await ethers.getContractFactory('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')

  const safeAddress = safeProxy.events[0].args.proxy
  const safe = await ethers.getContractAt('GnosisSafe', safeAddress)

  await safe.setup(
    [daoMember1.address],
    1,
    ethers.constants.AddressZero,
    '0x',
    ethers.constants.AddressZero,
    ethers.constants.AddressZero,
    0,
    ethers.constants.AddressZero
  )

  return safe
}
Source Link
Saxtheowl
  • 698
  • 5
  • 12

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

const safe = await ethers.getContractAt('GnosisSafe', masterCopy.address)

with

const safe = await ethers.getContractAt('GnosisSafe', safeProxy)