I'm building an app to manage a Safe using the Gnosis Safe SDK. The deploySafe
method works fine for creating one but if I try to add or remove an owner it returns this error:
Error: Invalid owner address provided
at OwnerManager.validateOwnerAddress (ownerManager.ts:17:1)
at OwnerManager.encodeRemoveOwnerData (ownerManager.ts:78:1)
at Safe.createRemoveOwnerTx (Safe.ts:700:1)
This is what my React.js code looks like
const addOwner = async (e) => {
e.preventDefault();
const newOwner = e.target[0].value;
setOwnerInput('');
setThresholdInput('');
try{
const isOwner = await safe.isOwner(newOwner)
await safe.createAddOwnerTx(newOwner);
const newOwners = [...owners]
newOwners.push(newOwner)
nickNames[newOwner] = ''
setOwners(newOwners)
} catch(error) {
console.log(error);
setErrorMessage(error)
}
}
newOwner
is an address that I've been using for testing purposes. I wanted to make sure that it was actually an owner before firing off the addOwner method. It returns true so why am I getting the invalid owner address error when using this method?
Here is a link to my repo: https://github.com/jackson-/muray-take-home