MCPcopy Create free account
hub / github.com/5afe/safe-eip7702 / getMultiSendCallData

Function getMultiSendCallData

safe-eip7702-ui/src/utils/utils.ts:37–50  ·  view source on GitHub ↗
(transactions: MultiSendTransactions)

Source from the content-addressed store, hash-verified

35export type MultiSendTransactions = MultiSendTransaction[];
36
37export const getMultiSendCallData = (transactions: MultiSendTransactions): `0x${string}` => {
38
39 // Encode the transactions into the format required by MultiSend contract
40 let packedTransactions = '0x'; // Start with empty hex string
41 for (const tx of transactions) {
42 const encodedTx = encodePacked(
43 ['uint8', 'address', 'uint256', 'uint256', 'bytes'],
44 [tx.operation, tx.to, tx.value, BigInt(tx.data.length), tx.data]
45 );
46 packedTransactions += encodedTx.slice(2); // Append the packed transaction data
47 }
48 return packedTransactions as `0x${string}`;
49
50}
51
52
53// Function to check if the account is delegated

Callers

nothing calls this directly

Calls 1

BigIntInterface · 0.50

Tested by

no test coverage detected