Error: from address mismatch - Gnosis SDK integration in autotask

Hello there
I am trying to set up an autotask in which I used gnosis sdk to send metatransaction. I am getting the following error


This is the code i tried to execute

Please any help is greatly appreciated

Hey @Bhanu_Ratnakaram! That error means that you tried sending a transaction explicitly setting a from that is not the address of the relayer. Based on your logs, you're trying to send a tx from address 0x6fa0a8..., but apparently that is not the address of the relayer you have in Defender.

Hi @spalladino , thanks for your prompt response.


Above are screenshot show that address of Relayer is correctly configured in autotask.
Here are the logs

I tried populating safeAddress as from address in this line as i want transaction to be sent from multi sig safeaddress.
const myTx = await alchemix.populateTransaction.harvestDummy(0, {from: safeAddress})

After this error I tried removing the {from: safeAddress} but still its the same error.

If i call the same transaction from defender/admin from multisig, somehow defender admin is sending the transaction from multisig and i am able to approve the transaction from any multisig owner accounts.
Here is one such transaction - https://rinkeby.etherscan.io/tx/0x326870ea4c630670b3238e2683b3d2e052098d9112799bcd076ffe2c90448218
I am actually trying to do the same thing defender admin does but via autotask. Not sure what am I missing :frowning:

The code itself is quite simple -

const AlchemixLPStrategyAddress = "0x4EE3c6f9B30B1Cf62B644dC46AcCa2C2a9Cb52b8";
const safeAddress = "0xa228A6a3BC4Fa3bD7240133620960678706A9092";
const speed = "average";
const gasLimit = 100000;
exports.main = async function (relayer) {
  const provider = new DefenderRelayProvider(relayer);
  const signer = new DefenderRelaySigner(relayer, provider, { speed });
  const alchemix = new ethers.Contract(
    AlchemixLPStrategyAddress,
    JSON.parse(AlchemixLPStrategyABI),
    signer
  );
  const ethAdapter= new EthersAdapter({
    ethers,
    signer
  })
    const safeSdk = await Safe.create({ ethAdapter, safeAddress }) // create safe sdk with relayer and safe address
    const myTx = await alchemix.populateTransaction.harvestDummy(0)
    const txnWithOtherProps = {...myTx, gasLimit, value: 0}
    const safeTransaction = await safeSdk.createTransaction(txnWithOtherProps)
    const isOwner = await safeSdk.isOwner('0x6fa0a8563e7E21e9b1bc0CB93F3Ec059C5e23DE7') //this prints true
    await safeSdk.signTransaction(safeTransaction)
    const txRes = await safeSdk.executeTransaction(safeTransaction)
    console.log(txRes);
}

The case of address being added to gnosis is being changed from '0xcf2487870ed6f53d59984e70fd6ae76c50ba4c7f' to '0xcF2487870ed6f53d59984E70FD6ae76c50BA4c7F'
Case in Relayer is now different to case in Gnosis wallet.
This could be he potential issue which is causing issues with validation :thinking:

I have fixed the issue in defender relay client, signer class. Here is the fix. Please roll this out if you are happy

Thanks so much for identifying the issue, @Bhanu_Ratnakaram!! We've just released defender-relay-client@1.1.1 with this fix, and we'll be uploading to the Autotasks dependencies later today.

Hey @Bhanu_Ratnakaram, this is available on Autotaks now. If you create a new Autotask, it should have the latest defender-relay-client with the fix.

1 Like