0

I'm trying to execute a Safe transaction through the relay. The transaction has enough signatures, it just needs to be executed. After a few seconds, the transaction status changes to Cancelled and it says "lastCheckMessage":"Execution error: GelatoRelay.sponsoredCall:GS020" - Does anyone know what I'm missng or what GS020 means?

Simulation on tenderly also getting failed. this is the tenderly simulation link https://dashboard.tenderly.co/harsha/project/simulator/81d15adb-187c-41a5-a6ad-9f9b203db9be

        const safeTransactionData = {
            oldOwnerAddress,
            newOwnerAddress,
        };

        const safeSDK = await Safe.create({
            ethAdapter,
            safeAddress,
        });

        const options: MetaTransactionOptions = {
            gasLimit: "100000",
            isSponsored: true,
        };

        const safeTransaction = await safeSDK.createSwapOwnerTx(safeTransactionData);

        const relayPack = new GelatoRelayPack(GELATO_API_KEY);

        const response = await relayPack.executeRelayTransaction(
            safeTransaction,
            safeSDK,
            options,
        );

        const gelatoTaskId = response.taskId;
        const explorerUrl = gelatoTaskId && (await handleTransactionStatus(gelatoTaskId));

Code is as given above.

2 Answers 2

1

GS020 error means that there are not enough signatures sent to the contract:

Given your code, the threshold should be 1 and the EthAdapter you are using should be initialized with an owner of your Safe. The issue is happening because one of these conditions is not met.

1
  • Yes, signing part of the code was missing here. it's working fine on updating the code. Thanks German.
    – Harsha V
    Commented Nov 24, 2023 at 6:40
0

Signing part was missing here. here is the working code.

    const safeTransactionData = {
        oldOwnerAddress,
        newOwnerAddress,
    };

    const safeSDK = await Safe.create({
        ethAdapter,
        safeAddress,
    });

    const options: MetaTransactionOptions = {
        gasLimit: "100000",
        isSponsored: true,
    };

    const safeTransaction = await safeSDK.createSwapOwnerTx(safeTransactionData);

    const signedSafeTransaction = await safeSDK.signTransaction(safeTransaction);

    const relayPack = new GelatoRelayPack(GELATO_API_KEY);

    const response = await relayPack.executeRelayTransaction(
        safeTransaction,
        safeSDK,
        options,
    );

    const gelatoTaskId = response.taskId;
    const response = gelatoTaskId && (await 
    handleTransactionStatus(gelatoTaskId));

}

Thanks @German

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.