0

Using the safe-core-sdk, I'm trying to make a custom transaction. Based on the doc, I need to make a dataPartial, sign it, then execute it. Question is.. how do I go about crafting the data field for this object?

            const safeTransactionData: SafeTransactionDataPartial = {
                to: '',
                value: '0',
                data: '0x'.  <--- this
            };
    
            const safeTransaction = await safeSdk.createTransaction({
                safeTransactionData
            });

Could anyone point me to the right resource?

1

1 Answer 1

0

I was able to make the data object using ethersjs library like below:

        const contractInterface = new utils.Interface(Abi);
        const data = contractInterface.encodeFunctionData('transfer', [
            address,
            utils.parseUnits('1')
        ]);

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.