-
Notifications
You must be signed in to change notification settings - Fork 39
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
13 changed files
with
104 additions
and
30 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
# Rust | ||
/target | ||
|
||
# bundler wallets | ||
/src/res/bundler/0x* |
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
run-bundler: | ||
cargo run -- --mnemonic-file ./src/res/bundler/0xD00D3EEc454D05d3d9bB48532BabED0c89941f17 | ||
cargo run -- --mnemonic-file ./src/res/bundler/0xF78bB01dFd478608F5738fB0560642b2806D295E | ||
|
||
run-bundler-uopool: | ||
cargo run --bin bundler-uopool | ||
|
||
run-bundler-rpc: | ||
cargo run --bin bundler-rpc | ||
|
||
run-create-wallet: | ||
cargo run --bin create-wallet -- --output-folder ./src/res/bundler | ||
|
||
cargo-fmt: | ||
cargo fmt --all |
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,25 @@ | ||
use aa_bundler::models::wallet::Wallet; | ||
use anyhow::Result; | ||
use clap::Parser; | ||
use expanded_pathbuf::ExpandedPathBuf; | ||
|
||
#[derive(Parser)] | ||
#[clap( | ||
name = "aa-bundler-create-wallet", | ||
about = "Bundler's wallet creation for EIP-4337 Account Abstraction" | ||
)] | ||
pub struct Opt { | ||
#[clap(long, default_value = "./src/res/bundler")] | ||
pub output_folder: ExpandedPathBuf, | ||
} | ||
|
||
fn main() -> Result<()> { | ||
let opt: Opt = Opt::parse(); | ||
|
||
tracing_subscriber::fmt::init(); | ||
|
||
let wallet = Wallet::new(opt.output_folder); | ||
println!("{:?}", wallet.signer); | ||
|
||
Ok(()) | ||
} |
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,11 @@ | ||
use crate::models::wallet::Wallet; | ||
|
||
pub struct Bundler { | ||
pub wallet: Wallet, | ||
} | ||
|
||
impl Bundler { | ||
pub fn new(wallet: Wallet) -> Self { | ||
Self { wallet } | ||
} | ||
} |
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 @@ | ||
pub mod bundler; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod bundler; | ||
pub mod models; | ||
pub mod rpc; | ||
pub mod types; | ||
|
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
pub mod chainspec; | ||
pub mod wallet; |
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,31 @@ | ||
use ethers::{ | ||
prelude::{k256::ecdsa::SigningKey, rand}, | ||
signers::{coins_bip39::English, MnemonicBuilder}, | ||
}; | ||
use expanded_pathbuf::ExpandedPathBuf; | ||
|
||
pub struct Wallet { | ||
pub signer: ethers::signers::Wallet<SigningKey>, | ||
} | ||
|
||
impl Wallet { | ||
pub fn new(output_path: ExpandedPathBuf) -> Self { | ||
let mut rng = rand::thread_rng(); | ||
|
||
Self { | ||
signer: MnemonicBuilder::<English>::default() | ||
.write_to(output_path.to_path_buf()) | ||
.build_random(&mut rng) | ||
.unwrap(), | ||
} | ||
} | ||
|
||
pub fn from_file(input_path: ExpandedPathBuf) -> Self { | ||
Self { | ||
signer: MnemonicBuilder::<English>::default() | ||
.phrase(input_path.to_path_buf()) | ||
.build() | ||
.unwrap(), | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.