pub struct PermitSingle { /* private fields */ }Expand description
A single Permit2 authorization, covering one token for one spender.
Implementations§
Source§impl PermitSingle
impl PermitSingle
pub fn new( details: PermitDetails, spender: Bytes, sig_deadline: BigUint, ) -> Self
Sourcepub fn eip712_signing_hash(
&self,
chain_id: u64,
permit2_address: &Bytes,
) -> Result<[u8; 32], FyndError>
pub fn eip712_signing_hash( &self, chain_id: u64, permit2_address: &Bytes, ) -> Result<[u8; 32], FyndError>
Compute the Permit2 EIP-712 signing hash for this permit.
Pass the returned bytes to your signer’s sign_hash method, then supply the
65-byte result as the signature argument to EncodingOptions::with_permit2.
permit2_address must be the 20-byte address of the Permit2 contract
(canonical cross-chain deployment: 0x000000000022D473030F116dDEE9F6B43aC78BA3).
§Errors
Returns crate::FyndError::Protocol if any address field is not exactly 20 bytes,
or if amount / expiration / nonce exceed their respective Solidity types.
Trait Implementations§
Source§impl Clone for PermitSingle
impl Clone for PermitSingle
Source§fn clone(&self) -> PermitSingle
fn clone(&self) -> PermitSingle
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 moreSource§impl Debug for PermitSingle
impl Debug for PermitSingle
Source§impl TryFrom<PermitSingle> for PermitSingle
impl TryFrom<PermitSingle> for PermitSingle
Auto Trait Implementations§
impl !Freeze for PermitSingle
impl RefUnwindSafe for PermitSingle
impl Send for PermitSingle
impl Sync for PermitSingle
impl Unpin for PermitSingle
impl UnsafeUnpin for PermitSingle
impl UnwindSafe for PermitSingle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more