pub struct Eip712Domain<'a> {
pub name: &'a str,
pub version: &'a str,
pub chain_id: u64,
pub verifying_contract: &'a [u8; 20],
}Expand description
EIP-712 domain separator parameters.
Use Eip712Domain::separator to compute the 32-byte domain separator hash.
use chains_sdk::ethereum::Eip712Domain;
let contract_addr = [0xCC_u8; 20];
let domain = Eip712Domain {
name: "MyDapp",
version: "1",
chain_id: 1,
verifying_contract: &contract_addr,
};
let sep = domain.separator();Fields§
§name: &'a strHuman-readable name of the signing domain (e.g., “Uniswap”).
version: &'a strCurrent major version of the signing domain (e.g., “1”).
chain_id: u64EIP-155 chain ID (1 = mainnet, 5 = goerli, etc.).
verifying_contract: &'a [u8; 20]Address of the contract that will verify the signature (20 bytes).
Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Eip712Domain<'a>
impl<'a> RefUnwindSafe for Eip712Domain<'a>
impl<'a> Send for Eip712Domain<'a>
impl<'a> Sync for Eip712Domain<'a>
impl<'a> Unpin for Eip712Domain<'a>
impl<'a> UnsafeUnpin for Eip712Domain<'a>
impl<'a> UnwindSafe for Eip712Domain<'a>
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