Gnosis Safe – Error GS025: Hash Has Not Been Approved

gnosis-safegoerlisafe-core-sdk

I am getting the GS025 error from Tenderly.
The flow of my development is this: my own application using gnosis safe-core-sdk signs and proposes transactions to the gnosis safe on goerli or polygon.

I've listed my app's address as an owner on the safe and I see the signature 1 of 1 set on the gnosis ui. However the tenderly report is stating that the transaction won't execute because of GS025. I saw this previous post: GS025 error when executing Gnosis Safe multisig transaction

I am not specifying a nonce value in the transaction object, what could be the issue?
Proposing transactions from the gnosis safe ui itself manually doesn't trigger this.

Update sharing code:

 const options: SafeTransactionOptionalProps = {
                safeTxGas: maxFeePerGas.toNumber(), 
                baseGas: maxFeePerGas.toNumber(), 
                gasPrice: maxFeePerGas.toNumber(), 
                gasToken: "0x0000000000000000000000000000000000000000",
                refundReceiver: process.env.APP_ADDRESS, 
                // nonce: nonce 
            };

            const safeTransaction = await safeSdk.createTransaction(transactions, options);
            console.log("txn: ", safeTransaction);

      const safeTxHash = await safeSdk.getTransactionHash(safeTransaction);
        const signature = await safeSdk.signTransactionHash(safeTxHash);
        console.log("signature:", safeTxHash);

        const options : TransactionOptions= {
            gasPrice: maxFeePerGas.toNumber(), 
        }
        const approveTxResponse = await safeSdk.approveTransactionHash(safeTxHash, options);
        console.log("approve response, ", approveTxResponse);

        const proposedTxnBatch = await safeService.proposeTransaction({
            safeAddress:SAFE_ADDRESS,
            safeTransaction: safeTransaction,
            safeTxHash: safeTxHash,
            senderAddress: signer,
            origin: batchId //optional: provides more info about the app proposing the transaction
          });

Best Answer

You included a pre-validated signature for the owner 0x0db6854c93bf578f6fa2962decf92ed0d08474c1, but executed a transaction with the owner 0x47430d6f05f1a10484b1082ec27883002ea1ee1f and the hash wasn't previously approved by that owner.

You can check the condition yourself:

require(msg.sender == currentOwner || approvedHashes[currentOwner][dataHash] != 0, "GS025")

More about safe signatures: https://docs.gnosis-safe.io/contracts/signatures

Related Topic