pub struct PermitSingle {
pub token: [u8; 20],
pub amount: Uint160,
pub expiration: u64,
pub nonce: u64,
pub spender: [u8; 20],
pub sig_deadline: Uint256,
}Expand description
A single-token allowance permit.
Fields§
§token: [u8; 20]Token address to approve.
amount: Uint160Approval amount (uint160) encoded as 20-byte big-endian.
expiration: u64Approval expiration timestamp (uint48).
nonce: u64Per-token nonce for replay protection (uint48).
spender: [u8; 20]Address being granted the allowance.
sig_deadline: Uint256Signature deadline (uint256).
Implementations§
Source§impl PermitSingle
impl PermitSingle
Sourcepub fn struct_hash(&self) -> Result<[u8; 32], SignerError>
pub fn struct_hash(&self) -> Result<[u8; 32], SignerError>
Compute the EIP-712 struct hash for this permit.
Sourcepub fn signing_hash(
&self,
domain_separator: &[u8; 32],
) -> Result<[u8; 32], SignerError>
pub fn signing_hash( &self, domain_separator: &[u8; 32], ) -> Result<[u8; 32], SignerError>
Compute the full EIP-712 signing hash.
keccak256("\x19\x01" || domainSeparator || structHash)
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 PartialEq for PermitSingle
impl PartialEq for PermitSingle
impl Eq for PermitSingle
impl StructuralPartialEq 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