mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-09 04:08:01 -05:00
* postman test script * logString fixes * Revert "logString fixes" This reverts commit 66e15176d553abb741194be8446bf63e4defe114.
19 lines
434 B
TypeScript
19 lines
434 B
TypeScript
import { ethers } from "ethers";
|
|
|
|
export function encodeSendMessage(
|
|
sender: string,
|
|
receiver: string,
|
|
fee: bigint,
|
|
amount: bigint,
|
|
messageNonce: bigint,
|
|
calldata: string,
|
|
) {
|
|
const abiCoder = new ethers.AbiCoder();
|
|
const data = abiCoder.encode(
|
|
["address", "address", "uint256", "uint256", "uint256", "bytes"],
|
|
[sender, receiver, fee, amount, messageNonce, calldata],
|
|
);
|
|
|
|
return ethers.keccak256(data);
|
|
}
|