-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
423 additions
and
82 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use alloy_primitives::keccak256; | ||
use alloy_sol_types::SolValue; | ||
use semaphore::{hash_to_field, Field}; | ||
|
||
use crate::bindings::IEntryPoint::PackedUserOperation; | ||
|
||
pub fn hash_user_op(user_op: &PackedUserOperation) -> Field { | ||
let keccak_hash = keccak256(SolValue::abi_encode_packed(&( | ||
&user_op.sender, | ||
&user_op.nonce, | ||
&user_op.initCode, | ||
&user_op.callData, | ||
&user_op.accountGasLimits, | ||
&user_op.preVerificationGas, | ||
&user_op.gasFees, | ||
&user_op.paymasterAndData, | ||
))); | ||
|
||
hash_to_field(keccak_hash.as_slice()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use bon::builder; | ||
|
||
#[builder(on(String, into))] | ||
pub fn build_pbh_tx( | ||
#[builder(default = "test test test test test test test test test test test junk")] | ||
mnemonic: String, | ||
|
||
user_ops: Vec<String>, | ||
) { | ||
} | ||
|
||
#[builder(on(String, into))] | ||
pub fn build_user_op() {} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn whatever() { | ||
// build_pbh_tx().call(); | ||
} | ||
} |
Oops, something went wrong.