0

I'm trying to initiate/propose a transaction using Safe Contract SDK (gnosis-safe), but I can not find any example where the SC method and parameters are specified in the transaction object. The documentation is not very clear, I thing data and value should be filled with method signature and parameters.

If you have any example it will be great. Thanks!

-- Doc from gnosis-safe

import { SafeTransactionDataPartial } from '@gnosis.pm/safe-core-sdk-types'

const safeTransactionData: SafeTransactionDataPartial = { to, data, value, operation, // Optional safeTxGas, // Optional baseGas, // Optional gasPrice, // Optional gasToken, // Optional refundReceiver, // Optional nonce // Optional } const safeTransaction = await safeSdk.createTransaction({ safeTransactionData })

1 Answer 1

0

The transaction tutorial does imply that the data field is the contract call. As you surmised, value is the gas token value being submitted with the transaction.

Both of these fields mirror the way all transactions work on EVM-compatible networks.

Once you have generated the calldata for the contract you want to interact with, you can add it to the data field. This generation is outside the direct scope of Safe - the proposed transaction simply executes the provided calldata - hence why the docs do not walk through that aspect.

If you're not familiar with generating EVM calldata, you should find a library in the language you're most comfortable with and refer to their documentation.

Your Answer

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

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