pub struct AuthMessage {
pub invoker: [u8; 20],
pub commit: [u8; 32],
}Expand description
EIP-3074 AUTH message for authorizing an invoker contract.
The AUTH opcode verifies this signature to authorize the invoker to act on behalf of the signer.
Fields§
§invoker: [u8; 20]The invoker contract address.
commit: [u8; 32]Commit hash (application-specific commitment).
Implementations§
Source§impl AuthMessage
impl AuthMessage
Sourcepub fn signing_hash(&self, chain_id: u64, nonce: u64) -> [u8; 32]
pub fn signing_hash(&self, chain_id: u64, nonce: u64) -> [u8; 32]
Compute the AUTH signing hash.
keccak256(MAGIC || pad32(chainId) || pad32(nonce) || pad32(invoker) || commit)
Note: In production, chain_id and nonce come from the EVM context.
This method accepts them as parameters for flexibility.
Sourcepub fn sign(
&self,
signer: &EthereumSigner,
chain_id: u64,
nonce: u64,
) -> Result<EthereumSignature, SignerError>
pub fn sign( &self, signer: &EthereumSigner, chain_id: u64, nonce: u64, ) -> Result<EthereumSignature, SignerError>
Sign the AUTH message.
Trait Implementations§
Source§impl Clone for AuthMessage
impl Clone for AuthMessage
Source§fn clone(&self) -> AuthMessage
fn clone(&self) -> AuthMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthMessage
impl RefUnwindSafe for AuthMessage
impl Send for AuthMessage
impl Sync for AuthMessage
impl Unpin for AuthMessage
impl UnsafeUnpin for AuthMessage
impl UnwindSafe for AuthMessage
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