pub struct MsgToL2 {
pub from_address: EthAddress,
pub to_address: Felt,
pub selector: Felt,
pub payload: Vec<Felt>,
pub nonce: u64,
}Expand description
An L1-to-L2 message sent from Ethereum to Starknet.
Fields§
§from_address: EthAddressThe Ethereum address sending the message.
to_address: FeltThe Starknet contract address that handles the message.
selector: FeltThe entrypoint selector on the handler contract.
payload: Vec<Felt>The calldata to be used for the handler contract invocation.
nonce: u64The nonce on the message for duduplication.
Implementations§
Source§impl MsgToL2
impl MsgToL2
Sourcepub fn hash(&self) -> Hash256
pub fn hash(&self) -> Hash256
Calculates the message hash based on the algorithm documented here:
https://docs.starknet.io/architecture-and-concepts/network-architecture/messaging-mechanism/#hashing_l1-l2 https://github.com/starkware-libs/cairo-lang/blob/8276ac35830148a397e1143389f23253c8b80e93/src/starkware/starknet/solidity/StarknetMessaging.sol#L88
Trait Implementations§
Source§impl TryFrom<&L1HandlerTransaction> for MsgToL2
impl TryFrom<&L1HandlerTransaction> for MsgToL2
Source§type Error = ParseMsgToL2Error
type Error = ParseMsgToL2Error
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for MsgToL2
impl RefUnwindSafe for MsgToL2
impl Send for MsgToL2
impl Sync for MsgToL2
impl Unpin for MsgToL2
impl UnwindSafe for MsgToL2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more