Skip to content

Commit

Permalink
feat: create 6492 signature
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Smith committed Oct 18, 2024
1 parent e147eb3 commit ce534fc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/create.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use alloy::{
primitives::{b256, Address, Bytes, B256},
sol_types::SolValue,
};

pub const ERC6492_MAGIC_BYTES: B256 =
b256!("6492649264926492649264926492649264926492649264926492649264926492");

pub fn create_erc6492_signature(factory: Address, factory_data: Bytes, signature: Bytes) -> Bytes {
(
(factory, factory_data, signature).abi_encode_params(),
ERC6492_MAGIC_BYTES,
)
.abi_encode_packed()
.into()
}
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use alloy::{
transports::{Transport, TransportErrorKind},
};

pub mod create;

const SUCCESS_RESULT: u8 = 0x01;
sol! {
contract ValidateSigOffchain {
Expand Down

0 comments on commit ce534fc

Please sign in to comment.